var debugthis=1;
var portalkey='login'
var posX = 100;
var posY = 100;

onerror=errorHandler;
var error="";

function errorHandler(errMessage,url,line){
  error="There is an error at this page.\n";
  error+="Error: " + errMessage+ "\n";
  error+="URL: " + url + "\n";
  error+="Line: " + line + "\n\n";
  window.status = error;
//  alert (error)
  return true;
 }
var IE = document.all?true:false;
function getMouseXY(e) {
if (IE) { // grab the x-y pos.s if browser is IE
   // alert (isObj(document.body))
      posX = event.clientX + document.documentElement.scrollLeft;
      posY = event.clientY + document.documentElement.scrollTop;
    }
   //}
   else {  // grab the x-y pos.s if browser is NS
      posX = e.pageX;
      posY = e.pageY;
   }  
}

var firsttime='1';
// move these to wmcc.js so it is globalj
// and remove from portal.js
var logoutcountdown=60; // half hour  should hit the timer ever minute set also  in setlogouttime

 function isNum(id){
 var n=document.getElementById(id).value;
 var ret = !isNaN(parseFloat(n)) && isFinite(n);
  if (!ret){
   document.getElementById(id).value = "";
   document.getElementById(id).style.backgroundColor="yellow";
   document.getElementById(id).focus();
   alert ("Please enter a number!");
   } else{
   document.getElementById(id).style.backgroundColor="white";
  }
}

function displayAppl(){   // this function will display testappl id if in the page on mouseover of a span...
        
   //     alert(document.location.href);
        if (document.location.href.indexOf('test') > 0){
           document.getElementById('testappl').style.display ='inline'
           document.getElementById('liveappl').style.display ='none'

     //      alert ("test account")
         }
}

function startTime()
{
document.getElementById('lgout').innerHTML= logoutcountdown;
if (logoutcountdown < 6) {
  document.getElementById('lgout').innerHTML ="<span style = 'background-color:red;color:white;font-weight:bold'>"+logoutcountdown+"</span>"
}
if (logoutcountdown < 1){
   //alert("You have been logged out! "+logoutcountdown)
   logout()
}
logoutcountdown-=1;
t=setTimeout('startTime()',60000);  // update every minute
}

function setLogoutTime(){
// run on load or refresh
logoutcountdown = 60
document.getElementById('lgout').innerHTML= logoutcountdown;
}



function handleErr(){
// put this in because n7 seems to error out on getMouseXY
}


function getquerystring() {
    qstr = 'programs=' + escape(location);
    return qstr;
}

function updateHtmlPage(title, removehref, w, l, t, h, data, divtag) {
    var st = data.indexOf('<!-- bodystart -->');
    var en = data.indexOf('<!-- bodyend -->');
    if ((st > '0') && (en > '0')) {
        data = data.substring(0, en);
        data = data.substring(st);
    }
    if (!removehref) { // this fouls up if i use a href="#"
        // remove a href
        while (data.indexOf('href') != -1) {
            st = data.indexOf('href');
            if (st) {
                data = data.substr(0, st - 1) + "nothing" + data.substr(st + 4);
            }
        }
    }
    //data.replace("href", "nothing")
    //data.replace( new RegExp( "href", "gi" ), "[X]" );  //neither of these worked!
    //  <!-- bodystart -->
    //  <!-- bodyend -->
    //alert (document.getElementById('mypopup').style.z-index)
    if (divtag) {
        document.getElementById(divtag).innerHTML = data; // these are the titles
    } else {
        if (winList['mypopup']) {
            document.getElementById('mypopuptitle').innerHTML = title;
            if (w) {
                document.getElementById('mypopup').style.width = w;
            }
            if (w) {
                document.getElementById('mypopupclientarea').style.width = w;
            }
            var neww = document.getElementById('mypopupclientarea').style.width;
            neww = w.replace("px", "");
            neww = neww - 15;
            neww = neww + "px";
            document.getElementById('mypopupclientarea').style.width = neww;
            if (l) {
                document.getElementById('mypopup').style.left = l;
            }
            if (t) {
                document.getElementById('mypopup').style.top = posY;
            }
            if (h) {
                document.getElementById('mypopupclientarea').style.height = h;
            }
            if (data) {
                document.getElementById('mypopupclientarea').innerHTML = data;
            }
            document.getElementById('mypopupclientarea').scrollTop = 0;
            winList['mypopup'].open();
        } else {
            alert("Error getting the data!  Sorry!");
        }
    }
} //if divtag

// this function requires
//<link href="/wwizfiles/files/popup.css" rel="stylesheet" type="text/css" />
//<script type="text/javascript" src = "/wwizfiles/files/popupwin.js"></scrip

//*****************************************************************************
// Do not remove this notice.
//
// Copyright 2001 by Mike Hall.
// See http://www.brainjar.com for terms of use.
//*****************************************************************************

// Determine browser and version.

function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();

//=============================================================================
// Window Object
//=============================================================================

function Window(el) {

  var i, mapList, mapName;

  // Get window components.

  this.frame           = el;
  this.titleBar        = winFindByClassName(el, "titleBar");
  this.titleBarText    = winFindByClassName(el, "titleBarText");
  this.titleBarButtons = winFindByClassName(el, "titleBarButtons");
  this.clientArea      = winFindByClassName(el, "clientArea");

  // Find matching button image map.

  mapName = this.titleBarButtons.useMap.substr(1);
  mapList = document.getElementsByTagName("MAP");
  for (i = 0; i < mapList.length; i++)
    if (mapList[i].name == mapName)
      this.titleBarMap = mapList[i];

  // Save colors.

  this.activeFrameBackgroundColor  = this.frame.style.backgroundColor;
  this.activeFrameBorderColor      = this.frame.style.borderColor;
  this.activeTitleBarColor         = this.titleBar.style.backgroundColor;
  this.activeTitleTextColor        = this.titleBar.style.color;
  this.activeClientAreaBorderColor = this.clientArea.style.borderColor;
  if (browser.isIE)
    this.activeClientAreaScrollbarColor = this.clientArea.style.scrollbarBaseColor;

  // Save images.

  this.activeButtonsImage   = this.titleBarButtons.src;
  this.inactiveButtonsImage = this.titleBarButtons.longDesc;

  // Set flags.

  this.isOpen      = false;
  this.isMinimized = false;

  // Set methods.

  this.open       = winOpen;
  this.close      = winClose;
  this.minimize   = winMinimize;
  this.restore    = winRestore;
  this.makeActive = winMakeActive;

  // Set up event handling.

  this.frame.parentWindow = this;
  this.frame.onmousemove  = winResizeCursorSet;
  this.frame.onmouseout   = winResizeCursorRestore;
  this.frame.onmousedown  = winResizeDragStart;

  this.titleBar.parentWindow = this;
  this.titleBar.onmousedown  = winMoveDragStart;

  this.clientArea.parentWindow = this;
  this.clientArea.onclick      = winClientAreaClick;

  for (i = 0; i < this.titleBarMap.childNodes.length; i++)
    if (this.titleBarMap.childNodes[i].tagName == "AREA")
      this.titleBarMap.childNodes[i].parentWindow = this;

  // Calculate the minimum width and height values for resizing
  // and fix any initial display problems.

  var initLt, initWd, w, dw;

  // Save the inital frame width and position, then reposition
  // the window.

  initLt = this.frame.style.left;
  initWd = parseInt(this.frame.style.width);
  if (!browser.isIE) { this.frame.style.left = -this.titleBarText.offsetWidth + "px";}
  // alert( this.frame.id+" line 126")
  //var test =  document.getElementById('titleBarText')
  //alert (test.id)
  // For IE, start calculating the value to use when setting
  // the client area width based on the frame width.

  if (browser.isIE) {
    this.titleBarText.style.display = "none";
    w = this.clientArea.offsetWidth;
    this.widthDiff = this.frame.offsetWidth - w;
    this.clientArea.style.width = w + "px";
    dw = this.clientArea.offsetWidth - w;
    w -= dw;     
    this.widthDiff += dw;
    this.titleBarText.style.display = "";
  }

  // Find the difference between the frame's style and offset
  // widths. For IE, adjust the client area/frame width
  // difference accordingly.

  w = this.frame.offsetWidth;
  this.frame.style.width = w + "px";
  dw = this.frame.offsetWidth - w;
  w -= dw;     
  this.frame.style.width = w + "px";
  if (browser.isIE)
    this.widthDiff -= dw;

  // Find the minimum width for resize.

  this.isOpen = true;  // Flag as open so minimize call will work.
  this.minimize();
  // Get the minimum width.
  if (browser.isNS && browser.version >= 1.2)
    // For later versions of Gecko.
    this.minimumWidth = this.frame.offsetWidth;
  else
    // For all others.
    this.minimumWidth = this.frame.offsetWidth - dw;

  // Find the frame width at which or below the title bar text will
  // need to be clipped.

  this.titleBarText.style.width = "";
  this.clipTextMinimumWidth = this.frame.offsetWidth - dw;

  // Set the minimum height.

  this.minimumHeight = 1;

  // Restore window. For IE, set client area width.

  this.restore();
  this.isOpen = false;  // Reset flag.
  initWd = Math.max(initWd, this.minimumWidth);
  this.frame.style.width = initWd + "px";
  if (browser.isIE)
    this.clientArea.style.width = (initWd - this.widthDiff) + "px";
  // Clip the title bar text if needed.

  if (this.clipTextMinimumWidth >= this.minimumWidth)
    this.titleBarText.style.width = (winCtrl.minimizedTextWidth + initWd - this.minimumWidth) + "px";

  // Restore the window to its original position.

  this.frame.style.left = initLt;
}

//=============================================================================
// Window Methods
//=============================================================================

function winOpen() {

  if (this.isOpen)
    return;

  // Restore the window and make it visible.

  this.makeActive();
  this.isOpen = true;
  if (this.isMinimized)
    this.restore();
  this.frame.style.visibility = "visible";
}

function winClose() {

  // Hide the window.

  this.frame.style.visibility = "hidden";
  this.isOpen = false;
}

function winMinimize() {

  if (!this.isOpen || this.isMinimized)
    return;

  this.makeActive();

  // Save current frame and title bar text widths.

  this.restoreFrameWidth = this.frame.style.width;
  this.restoreTextWidth = this.titleBarText.style.width;

  // Disable client area display.

  this.clientArea.style.display = "none";

  // Minimize frame and title bar text widths.

  if (this.minimumWidth)
    this.frame.style.width = this.minimumWidth + "px";
  else
    this.frame.style.width = "";
  this.titleBarText.style.width = winCtrl.minimizedTextWidth + "px";

  this.isMinimized = true;
}

function winRestore() {

  if (!this.isOpen || !this.isMinimized)
    return;

  this.makeActive();

  // Enable client area display.

  this.clientArea.style.display = "";

  // Restore frame and title bar text widths.

  this.frame.style.width = this.restoreFrameWidth;
  this.titleBarText.style.width = this.restoreTextWidth;

  this.isMinimized = false;
}

function winMakeActive() {

  if (winCtrl.active == this)
    return;

  // Inactivate the currently active window.

  if (winCtrl.active) {
    winCtrl.active.frame.style.backgroundColor    = winCtrl.inactiveFrameBackgroundColor;
    winCtrl.active.frame.style.borderColor        = winCtrl.inactiveFrameBorderColor;
    winCtrl.active.titleBar.style.backgroundColor = winCtrl.inactiveTitleBarColor;
    winCtrl.active.titleBar.style.color           = winCtrl.inactiveTitleTextColor;
    winCtrl.active.clientArea.style.borderColor   = winCtrl.inactiveClientAreaBorderColor;
    if (browser.isIE)
      winCtrl.active.clientArea.style.scrollbarBaseColor = winCtrl.inactiveClientAreaScrollbarColor;
    if (browser.isNS && browser.version < 6.1)
      winCtrl.active.clientArea.style.overflow = "hidden";
    if (winCtrl.active.inactiveButtonsImage)
      winCtrl.active.titleBarButtons.src = winCtrl.active.inactiveButtonsImage;
  }

  // Activate this window.

  this.frame.style.backgroundColor    = this.activeFrameBackgroundColor;
  this.frame.style.borderColor        = this.activeFrameBorderColor;
  this.titleBar.style.backgroundColor = this.activeTitleBarColor;
  this.titleBar.style.color           = this.activeTitleTextColor;
  this.clientArea.style.borderColor   = this.activeClientAreaBorderColor;
  if (browser.isIE)
    this.clientArea.style.scrollbarBaseColor = this.activeClientAreaScrollbarColor;
  if (browser.isNS && browser.version < 6.1)
    this.clientArea.style.overflow = "auto";
  if (this.inactiveButtonsImage)
    this.titleBarButtons.src = this.activeButtonsImage;
  this.frame.style.zIndex = ++winCtrl.maxzIndex;
  winCtrl.active = this;
}

//=============================================================================
// Event handlers.
//=============================================================================

function winClientAreaClick(event) {

  // Make this window the active one.

  this.parentWindow.makeActive();
}

//-----------------------------------------------------------------------------
// Window dragging.
//-----------------------------------------------------------------------------

function winMoveDragStart(event) {

  var target;
  var x, y;

  if (browser.isIE)
    target = window.event.srcElement.tagName;
  if (browser.isNS)
    target = event.target.tagName;

  if (target == "AREA")
    return;

  this.parentWindow.makeActive();

  // Get cursor offset from window frame.

  if (browser.isIE) {
    x = window.event.x;
    y = window.event.y;
  }
  if (browser.isNS) {
    x = event.pageX;
    y = event.pageY;
  }
  winCtrl.xOffset = winCtrl.active.frame.offsetLeft - x;
  winCtrl.yOffset = winCtrl.active.frame.offsetTop  - y;

  // Set document to capture mousemove and mouseup events.

  if (browser.isIE) {
    document.onmousemove = winMoveDragGo;
    document.onmouseup   = winMoveDragStop;
  }
  if (browser.isNS) {
    document.addEventListener("mousemove", winMoveDragGo,   true);
    document.addEventListener("mouseup",   winMoveDragStop, true);
    event.preventDefault();
  }

  winCtrl.inMoveDrag = true;
}

function winMoveDragGo(event) {

  var x, y;

  if (!winCtrl.inMoveDrag)
    return;

  // Get cursor position.

  if (browser.isIE) {
    x = window.event.x;
    y = window.event.y;
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS) {
    x = event.pageX;
    y = event.pageY;
    event.preventDefault();
  }

  // Move window frame based on offset from cursor.

  winCtrl.active.frame.style.left = (x + winCtrl.xOffset) + "px";
  winCtrl.active.frame.style.top  = (y + winCtrl.yOffset) + "px";
}

function winMoveDragStop(event) {

  winCtrl.inMoveDrag = false;

  // Remove mousemove and mouseup event captures on document.

  if (browser.isIE) {
    document.onmousemove = null;
    document.onmouseup   = null;
  }
  if (browser.isNS) {
    document.removeEventListener("mousemove", winMoveDragGo,   true);
    document.removeEventListener("mouseup",   winMoveDragStop, true);
  }
}

//-----------------------------------------------------------------------------
// Window resizing.
//-----------------------------------------------------------------------------

function winResizeCursorSet(event) {

  var target;
  var xOff, yOff;

  if (this.parentWindow.isMinimized || winCtrl.inResizeDrag)
    return;

  // If not on window frame, restore cursor and exit.

  if (browser.isIE)
    target = window.event.srcElement;
  if (browser.isNS)
    target = event.target;
  if (target != this.parentWindow.frame)
    return;

  // Find resize direction.

  if (browser.isIE) {
    xOff = window.event.offsetX;
    yOff = window.event.offsetY;
  }
  if (browser.isNS) {
    xOff = event.layerX;
    yOff = event.layerY;
  }
  winCtrl.resizeDirection = ""
  if (yOff <= winCtrl.resizeCornerSize)
    winCtrl.resizeDirection += "n";
  else if (yOff >= this.parentWindow.frame.offsetHeight - winCtrl.resizeCornerSize)
    winCtrl.resizeDirection += "s";
  if (xOff <= winCtrl.resizeCornerSize)
    winCtrl.resizeDirection += "w";
  else if (xOff >= this.parentWindow.frame.offsetWidth - winCtrl.resizeCornerSize)
    winCtrl.resizeDirection += "e";

  // If not on window edge, restore cursor and exit.

  if (winCtrl.resizeDirection == "") {
    this.onmouseout(event);
    return;
  }

  // Change cursor.

  if (browser.isIE)
    document.body.style.cursor = winCtrl.resizeDirection + "-resize";
  if (browser.isNS)
    this.parentWindow.frame.style.cursor = winCtrl.resizeDirection + "-resize";
}

function winResizeCursorRestore(event) {
  if (winCtrl.inResizeDrag)
    return;
  // Restore cursor.
  if (browser.isIE)
    document.body.style.cursor = "";
  if (browser.isNS)
    this.parentWindow.frame.style.cursor = "";
}

function winResizeDragStart(event) {

  var target;

  // Make sure the event is on the window frame.

  if (browser.isIE)
    target = window.event.srcElement;
  if (browser.isNS)
    target = event.target;
  if (target != this.parentWindow.frame)
    return;

  this.parentWindow.makeActive();

  if (this.parentWindow.isMinimized)
    return;

  // Save cursor position.

  if (browser.isIE) {
    winCtrl.xPosition = window.event.x;
    winCtrl.yPosition = window.event.y;
  }
  if (browser.isNS) {
    winCtrl.xPosition = event.pageX;
    winCtrl.yPosition = event.pageY;
  }

  // Save window frame position and current window size.

  winCtrl.oldLeft   = parseInt(this.parentWindow.frame.style.left,  10);
  winCtrl.oldTop    = parseInt(this.parentWindow.frame.style.top,   10);
  winCtrl.oldWidth  = parseInt(this.parentWindow.frame.style.width, 10);
  winCtrl.oldHeight = parseInt(this.parentWindow.clientArea.style.height, 10);

  // Set document to capture mousemove and mouseup events.

  if (browser.isIE) {
    document.onmousemove = winResizeDragGo;
    document.onmouseup   = winResizeDragStop;
  }
  if (browser.isNS) {
    document.addEventListener("mousemove", winResizeDragGo,   true);
    document.addEventListener("mouseup"  , winResizeDragStop, true);
    event.preventDefault();
  }

  winCtrl.inResizeDrag = true;
}

function winResizeDragGo(event) {

 var north, south, east, west;
 var dx, dy;
 var w, h;

  if (!winCtrl.inResizeDrag)
    return;

  // Set direction flags based on original resize direction.

  north = false;
  south = false;
  east  = false;
  west  = false;
  if (winCtrl.resizeDirection.charAt(0) == "n")
    north = true;
  if (winCtrl.resizeDirection.charAt(0) == "s")
    south = true;
  if (winCtrl.resizeDirection.charAt(0) == "e" || winCtrl.resizeDirection.charAt(1) == "e")
    east = true;
  if (winCtrl.resizeDirection.charAt(0) == "w" || winCtrl.resizeDirection.charAt(1) == "w")
    west = true;

  // Find change in cursor position.

  if (browser.isIE) {
    dx = window.event.x - winCtrl.xPosition;
    dy = window.event.y - winCtrl.yPosition;
  }
  if (browser.isNS) {
    dx = event.pageX - winCtrl.xPosition;
    dy = event.pageY - winCtrl.yPosition;
  }

  // If resizing north or west, reverse corresponding amount.

  if (west)
    dx = -dx;
  if (north)
    dy = -dy;

  // Check new size.

  w = winCtrl.oldWidth  + dx;
  h = winCtrl.oldHeight + dy;
  if (w <= winCtrl.active.minimumWidth) {
    w = winCtrl.active.minimumWidth;
    dx = w - winCtrl.oldWidth;
  }
  if (h <= winCtrl.active.minimumHeight) {
    h = winCtrl.active.minimumHeight;
    dy = h - winCtrl.oldHeight;
  }

  // Resize the window. For IE, keep client area and frame widths in synch.

  if (east || west) {
    winCtrl.active.frame.style.width = w + "px";
    if (browser.isIE)
      winCtrl.active.clientArea.style.width = (w - winCtrl.active.widthDiff) + "px";
  }
  if (north || south)
    winCtrl.active.clientArea.style.height = h + "px";

  // Clip the title bar text, if necessary.

  if (east || west) {
    if (w < winCtrl.active.clipTextMinimumWidth)
      winCtrl.active.titleBarText.style.width = (winCtrl.minimizedTextWidth + w - winCtrl.active.minimumWidth) + "px";
    else
      winCtrl.active.titleBarText.style.width = "";
  }

  // For a north or west resize, move the window.

  if (west)
    winCtrl.active.frame.style.left = (winCtrl.oldLeft - dx) + "px";
  if (north)
    winCtrl.active.frame.style.top  = (winCtrl.oldTop  - dy) + "px";

  if (browser.isIE) {
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS)
    event.preventDefault();
}

function winResizeDragStop(event) {

  winCtrl.inResizeDrag = false;

  // Remove mousemove and mouseup event captures on document.

  if (browser.isIE) {
    document.onmousemove = null;
    document.onmouseup   = null;
  }
  if (browser.isNS) {
    document.removeEventListener("mousemove", winResizeDragGo,   true);
    document.removeEventListener("mouseup"  , winResizeDragStop, true);
  }
}

//=============================================================================
// Utility functions.
//=============================================================================

function winFindByClassName(el, className) {

  var i, tmp;

  if (el.className == className)
    return el;

  // Search for a descendant element assigned the given class.

  for (i = 0; i < el.childNodes.length; i++) {
    tmp = winFindByClassName(el.childNodes[i], className);
    if (tmp != null)
      return tmp;
  }

  return null;
}

//=============================================================================
// Initialization code.
//=============================================================================

var winList = new Array();
var winCtrl = new Object();

function winInit() {
  var elList;
  // Initialize window control object.
  winCtrl.maxzIndex                        =  999;// 0;
  winCtrl.resizeCornerSize                 =  16;
  winCtrl.minimizedTextWidth               = 100;
  winCtrl.inactiveFrameBackgroundColor     = "#c0c0c0";
  winCtrl.inactiveFrameBorderColor         = "#f0f0f0 #505050 #404040 #e0e0e0";
  winCtrl.inactiveTitleBarColor            = "#808080";
  winCtrl.inactiveTitleTextColor           = "#c0c0c0";
  winCtrl.inactiveClientAreaBorderColor    = "#404040 #e0e0e0 #f0f0f0 #505050";
  winCtrl.inactiveClientAreaScrollbarColor = "";
  winCtrl.inMoveDrag                       = false;
  winCtrl.inResizeDrag                     = false;
  // Initialize windows and build list.
//  alert ("winINit")
  elList = document.getElementsByTagName("DIV");
  //alert("here")
  for (var i = 0; i < elList.length; i++)
    if (elList[i].className == "window")
     winList[elList[i].id] = new Window(elList[i]);
     //alert (winList[elList[i].id])
   }
window.onload = winInit;  // run initialization code after page loads.

//http://10.1.42.1/wwizfiles/files/slideshow.js

/***********************************************
* Ultimate Fade-In Slideshow (v1.5): ? Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
 
 
var fadebgcolor="white"
 
////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px"  >'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=obj.degree/100
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}
//http://10.1.42.1/wwizfiles/files/breadcrumbs.js
  function breadcrumbs(sClass, sDelimiter)
  {
    if(!sDelimiter) sDelimiter = '>';
    var sURL = (location.pathname.indexOf('?') != -1) ? location.pathname.substring(0, location.pathname.indexOf('?')) : location.pathname;
        sURL = (location.pathname.charAt(0) == '/') ? location.pathname.substring(1) : location.pathname;
    var aURL = sURL.split('/');
    if(aURL)
    {
      var sOutput = '<a href="/">wncc home</a> ' + sDelimiter + ' ';
      var sPath = '/';
      for(var i = 0; i < aURL.length -2; i++)
      {
        sPath += aURL[i] + '/';
        sOutput += '<a href="' + sPath + '"';
        if(sClass) sOutput += ' class="' + sClass +'"';
        sOutput += '>' + aURL[i] + '</a>';
        sOutput += ' ' + sDelimiter + ' ';
      }
      //sOutput += document.title;
      sOutput +=aURL[i]
      document.write(sOutput);
    }
  }


function fontSize(what, tag) {
    var min = 7;
    var max = 18;
    var s = document.getElementById(tag).style.fontSize;
    if (s < min) {
        s = min;
    }
    s = s.replace("pt", "");
    if (what == 'l') {
        s++;
        if (s > max) {
            s = max;
        }
    }
    if (what == 's') {
        s--;
        if (s < min) {
            s = min;
        }
    }
    s = s + "pt";
    document.getElementById(tag).style.fontSize = s;
}

function showPic(picture) {
    var state = document.getElementById(picture).style.display;
    if (state == 'none') {
        document.getElementById(picture).style.display = 'inline';
    } else {
        document.getElementById(picture).style.display = 'none';
    }
}
function openWin(what) {
    //  portalkey is stored as a global var in the portal.  
    //  WNCC.LOGIN reads the cookie created here to get the portalkey, WNCC.LOGIN then clears the cookie
    //  and processes the program
    
    //alert ('mousexy'+posX)
    var entrywhat = what
    var currentTime = new Date()
    var mill = currentTime.getUTCMilliseconds()
    var newwin =mill;// somewhat unique
    if (what.indexOf("/students/registration/schedules/") > -1) { 
        var name  ='portalid'
        var value = portalkey
        var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";  // this cookie will need to be read and deleted in the index of schedules
        //alert (portalkey+" going to schedules");
        if (logoutcountdown < 1) {
            alert ("This session of the portal has been disabled.  Please log in again!")
            logout();
        } 
        setLogoutTime();  // only if in portal!
    }

    if (what.indexOf("null") > -1) {  
         return;
    }
    if (what.indexOf("NULL") > -1) {  
         return;
    }
    if (what.indexOf("WEB.") > -1) {  // && portalkey
        what = '/cgi-bin/wwiz/wwiz.asp?wwizmstr=' + what;
        var name  ='portalid'
        var value = portalkey
        var expires = "";
        var nologin=1
        var temp = what.indexOf("nologin")
       // alert (temp+" "+what)
        if  (temp == -1 ){nologin='';}
        //if (nologin){alert (nologin+" "+what +"  "+what.indexOf("nologin"))}
        if  (nologin == '') {
          // alert (what.indexOf("nologin"))
          // alert (nologin)
           document.cookie = name+"="+value+expires+"; path=/";  // this cookie is deleted in WNCC.LOGIN
           //alert (portalkey);
           if (logoutcountdown < 1) {
            alert ("This session of the portal has been disabled.  Please log in again!")
            logout();
           } 
           setLogoutTime();  // only if in portal! and we havent used nologin as argument
         
     }else{ 
        if (!nologin){      
         if ((what.indexOf("http") <0 )&&(what.indexOf(".") >-1))  {
             what = "http://"+what
         } 
       
         }
     }
} 
//alert (what+" "+newwin)
//ADD AJAX HERE TO UPDATE MYFAVORITES
//if (nologin) {alert("this far "+what)}
if (!nologin){updateFavorites(entrywhat)}
   myWindow = window.open(what, newwin, "menubar=1,resizable=1,location=1,width=800,height=550,left=50,top=50,status=1,toolbar=1,scrollbars=1");
    myWindow.focus();
}

function hideShow(what) {
    if (document.getElementById(what).style.display == 'none') {
        document.getElementById(what).style.display = 'inline';
    } else {
        document.getElementById(what).style.display = 'none';
    }
}

function insertHtmlPage(what, wherefrom, whereto) {
   document.getElementById(whereto).style.display = 'none'
   
    AjaxRequest.get({
        'onLoading': function() {
            document.getElementById(whereto).innerHTML = "<div style='background-color:yellow;color:black;font-size:14pt;font-weight:bold'>Processing your request</div>";
   document.getElementById(whereto).style.display = 'inline'

        },
        'onLoaded': function() {
            document.getElementById(whereto).innerHTML += "......";
        },
        'onInteractive': function() {
            document.getElementById(whereto).innerHTML += "......";
         
 
        },
        'onComplete': function() {
            document.getElementById(whereto).innerHTML += "<br>Done!";

        },
        'url': wherefrom + what,
        'onSuccess': function(req) {
            
            document.getElementById(whereto).innerHTML = req.responseText;
        },
        'onError': function(req) {
            document.getElementById(whereto).innerHTML = 'Error!<br>' + req.statusText + '<br>' + req.responseText;
        }

    })
}

function showDiv(what) { 
    var state = document.getElementById(what).style.display;
   
    switch (state){
    case '':
     document.getElementById(what).style.display = 'inline';
      break;
    case 'none':
      document.getElementById(what).style.display = 'inline';
      break;
    case 'inline':
   

      document.getElementById(what).style.display = 'none';
   

      break;
    }
}

function showHideTermlets(what) {
    //designed to toggle the on off display on schedules
    var w1= what+'_closed'
    var w2= what+'_open'
    var state = document.getElementById(w1).style.display;
    
    switch (state){
    
    case 'none':
      document.getElementById(w2).style.display = 'none'
      document.getElementById(w1).style.display = 'inline'
    break;

    case '':
     document.getElementById(w2).style.display = 'inline';
     document.getElementById(w1).style.display = 'none';
     break;
    case 'inline':
      document.getElementById(w2).style.display = 'inline';
      document.getElementById(w1).style.display = 'none';
      break;
    }
}


function xxxshowHideTermlets(what) {
    //designed to toggle the on off display on schedules
    var w1= what+'_closed'
    var w2= what+'_open'
    var state = document.getElementById(w1).style.display;
    alert (w1+" "+w2+' '+state)
    switch (state){
    case '':
     document.getElementById(w1).style.display = 'none';
     document.getElementById(w2).style.display = 'inline';
     break;
    case 'none':
      document.getElementById(w1).style.display = 'none';
      document.getElementById(w2).style.display = 'inline';
    break;
    case 'inline':
       document.getElementById(w1).style.display = 'none';
       document.getElementById(w2).style.display = 'inline';

      break;
    }
}

function showHideEmplist(what) {
    //designed to toggle the on off display on schedules
    var w1= what+'_closed'
    var w2= what+'_open'
    var state = document.getElementById(w1).style.display;
    

    switch (state){
    case '':
     document.getElementById(w1).style.display = 'none';
     document.getElementById(w2).style.display = 'inline';
     showHideClass(what,'show')

      break;
    case 'none':
      document.getElementById(w2).style.display = 'none';
     document.getElementById(w1).style.display = 'inline';

     showHideClass(what,'hide')


      break;
    case 'inline':
       document.getElementById(w1).style.display = 'none';
       document.getElementById(w2).style.display = 'inline';
       showHideClass(what,'show')

      break;
    }
}




/// used for new student orientation..perhaps better installed locally//
function submitForm() {
var ok=1;
var   theform=document.forms['WebWiz'] 
 //alert (document.getElementById('location').value)
 if (document.getElementById('lastname').value == '') {
    alert ("Please supply both your first and last name!")
    ok=''
    return 
  }
 if (document.getElementById('firstname').value == '') {
    alert ("Please supply both your first and last name!")
    ok=''
    return
  }
 if (document.getElementById('ssn').value == '') {
    alert ("Please supply your Social Security Number or some unique identifier (drivers license # or birthdate for example)")
    ok=''
    return
  }
// if (document.getElementById('location').value == '') {
 //   alert ("Please select a time and location!")
//    ok=''
//    return
//  }
checkvalue=""
for (x=0;x < theform.location.length;x++){
    //alert(x+" "+theform.location[x].checked) 
    if (theform.location[x].checked) {checkvalue='yes'}
}
if (!checkvalue){
    alert ("Please select a location and date!")
    ok=''
    return
}
 if (ok) {
  var status = AjaxRequest.submit(
  theform
    ,{
      'onSuccess':function(req){ document.getElementById('results').innerHTML= req.responseText; 
       document.getElementById('results').style.display ='inline'
      }
     }
   );
 return status;
}
}
 function logout(){
  
  AjaxRequest.get(
       {
         'url':'/cgi-bin/wwiz/wwiz.asp?wwizmstr=WEB.CHECKLOGIN.AJX'
          ,'parameters':{'logout':'1'}
          ,'onSuccess':function(req){
  var expires = "";
  var name = 'portallogin';
  var value = 'NOT OK'  
  document.cookie = name+"="+value+expires+"; path=/";
  var name = 'portalkey';
  var value = 'login'  
  document.cookie = name+"="+value+expires+"; path=/";
  var name = 'portalid';
  var value = 'login'  
  document.cookie = name+"="+value+expires+"; path=/";
  portalkey="";
  window.close()
  location.href='/mywncc/index.html'   
//  alert(portalkey+" this is the portalkey now")
  portalkey="";  // the global variable

       }// end of onsuccess
       }// end of request.get curlies
       ) //get argument list
}


//********************below are for schedule only
function readLoginCookie(cookiename){
        if (portalkey != 'login'){return}
        var nameEQ = cookiename + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) {
                    // DELETE THE COOKIE!
                    var value ='';
                    var days = -1
	            var date = new Date();
		    date.setTime(date.getTime()+(days*24*60*60*1000));
		    var expires = "; expires="+date.toGMTString();
		    //document.cookie = cookiename+"="+value+expires+"; path=/";
	           // alert ("cookie "+nameEQ.length,c.length+ " in get cookie")
	            
      		    return c.substring(nameEQ.length,c.length)};
      		    
	}
	return "";
}
function scheduleWhoAmi(){
   var logininfo = "You are not logged in "+portalkey;
   document.getElementById('logininfo').innerHTML=logininfo 
   document.getElementById('logininfo').style.display="inline"; 
  // alert ("Whoami "+portalkey)
   AjaxRequest.get(
       {
         'url':'/cgi-bin/wwiz/wwiz.asp?wwizmstr=WEB.CHECKLOGIN.AJX'
          ,'parameters':{'whoami':portalkey,'loginonly':'1'}
          ,'onSuccess':function(req){ 
        
         var name = parseXml(req.responseText,"<name>")
         var nameok = (name.length > 1 ) 
         if (nameok){
         logininfo = "You are currently logged in as "+name
         logininfo+="<br>If this is not you, please logout and re-enter through your Portal."
         logininfo+="<br><input type = 'button' value = 'logout' onClick='logout()'>"
         var moreinfo = parseXml(req.responseText,"<moreinfo>")         
         document.getElementById('logininfo').innerHTML=logininfo
         if (moreinfo){
           getSelectionInfo()
         } 
        } // end of nameok
       }// end of onsuccess
       }// end of request.get curlies
       ) //get argument list
       
}
function getElementsByClass(node,searchClass,tag) {
var classElements = new Array();
var els = node.getElementsByTagName(tag); // use "*" for all elements
var elsLen = els.length;
var pattern = new RegExp("\\b"+searchClass+"\\b");
for (i = 0, j = 0; i < elsLen; i++) {
 if ( pattern.test(els[i].className) ) {
 classElements[j] = els[i];
 j++;
 }
}
return classElements;
}

function showHideMenulets(){
// toggle display
  
var el = getElementsByClass(document,'showhidemenulets','*');
what= el[0].style.display; 
switch (what) {
   case 'none':
     what = 'show';
     break;
   case '':
     what = 'hide';
     break;
   case 'inline':
     what = 'hide';
     break;
   }
showHideClass('showhidemenulets',what)
return false;
}

function showHideClass(cls,what) {
var el = getElementsByClass(document,cls,'*');
  for (x=0;x<el.length;x++){
    if (what == 'hide'){
         el[x].style.display='none'; 
         } 
 

    else {
        el[x].style.display='inline'
    }  // end of if what == hide 
    } // end of for
   } // end of function

function showHideClass2(cls,what) {
var el = getElementsByClass(document,cls,'*');
  for (x=0;x<el.length;x++){
    if (what == 'hide'){
         el[x].style.display='none'; 
         } 
   else {
        el[x].style.display=''
        alert (el[x].id+" "+el[x].style.display);
        
    }  // end of if what == hide 
    } // end of for
   } // end of function

function showHideClassTableRow(cls,what) {
var el = getElementsByClass(document,cls,'*');
//        alert(navigator.appName)

  for (x=0;x<el.length;x++){
    if (what == 'hide'){
        el[x].style.display='none'; 
         } 
    else {
        if (navigator.appName!='Netscape'){ 
//          alert(navigator.appName)

            el[x].style.display='inline' ;
        } else {
            el[x].style.display='table-row';
        }

    }  // end of if what == hide 
    } // end of for
   } // end of function



function showThisDiv(what) {
        document.getElementById(what).style.display = 'inline';
}
function hideThisDiv(what) {
        document.getElementById(what).style.display = 'none';
}


function openWizard(what,querystring) { 
    //  no login required
    //  query string is passed as &id=0000071&name=froglips etc
// what i relly want to do is get the data from the wizard and poke it ito the popup window
    alert(querystring)
   return
    if (what.indexOf("WEB.") > -1) {  // && portalkey
        what = '/cgi-bin/wwiz/wwiz.asp?wwizmstr=' + what;
           
   myWindow = window.open(what, newwin, "menubar=1,resizable=1,location=1,width=800,height=550,left=50,top=50,status=1,toolbar=1,scrollbars=1");
    myWindow.focus();
}

}

function quickPopup(title,data){
// alert ("quickpopup")
// alert (portalkey)
if (winList['mypopup']) {
  
   var w = "700px";
   var l = "350px";
   var t = "100px";
   var h = "400px";

   //var t = '100px';
   if (posY< 300) {
      posY = 400;
    }
    var t = posY-300+"px"   // FORCE IT TO BE CLOSER TO MOUSECLICK
    document.getElementById('mypopup').style.height= h;
    document.getElementById('mypopup').style.width= w;
    document.getElementById('mypopupclientarea').style.height = h;
    document.getElementById('mypopupclientarea').style.width = 'auto';
    document.getElementById('mypopuptitle').innerHTML = title;
    document.getElementById('mypopuptitle').style.textAlign= 'center';
    //document.getElementById('titleBar').style.backgroundColor='#000447';
    //if (w){ document.getElementById('mypopup').style.width = w;} 
    //if (w){document.getElementById('mypopupclientarea').style.width = w;} 
    //var neww=document.getElementById('mypopupclientarea').style.width
   // var neww = w.replace("px","");
   // neww = neww - 15
   // neww = neww+"px"
   // document.getElementById('mypopupclientarea').style.width =neww;
    if (l){ document.getElementById('mypopup').style.left= l;}
    document.getElementById('mypopup').style.top = t;
    if (data){document.getElementById('mypopupclientarea').innerHTML = data;}
    document.getElementById('mypopupclientarea').scrollTop=0; 
    winList['mypopup'].open()
   
 } else{
    alert ("Error getting the data!  Sorry!")
  }
} 
	
function processPs(){
// get all the checkboxes in the page & send to web.ps.new.ajx
 //   alert (document.getElementById('loginid').value  )  
if (document.getElementById('loginid').value=='0012391XXX'){
      newProcessPs();
} else{
    winList['mypopup'].close()
     var   theform=document.forms['WebWiz'] 
     showHideClass('processing','hide')
     showHideClass('notprocessing','show')
var status = AjaxRequest.submit(
  theform
    ,{
       'onSuccess':function(req){quickPopup("Selections",req.responseText);
        showHideClass('processing','show')
        showHideClass('notprocessing','hide')
        unCheckAll(document.WebWiz.selectsection)
        winList['mypopup'].open()

      }
     }
   );
}
}
function manageSelections(what){
    winList['mypopup'].close()
    var  theform=document.forms['WebWiz'] ;
    document.getElementById('mode').value = what
     showHideClass('processing','hide')
     showHideClass('notprocessing','show')
  var status = AjaxRequest.submit	(
  theform
    ,{    
       
       'onSuccess':function(req){quickPopup("Selections",req.responseText);
        showHideClass('processing','show')
        showHideClass('notprocessing','hide')
        //document.getElementById('mode').value = ''; this caused an error, not sure why it doesnt in the lines above!
        winList['mypopup'].open()
   
      }
     }
   );
}

function getRadio(obj){
     for (x=0;x<obj.length;x++){
      if(obj[x].checked){ return obj[x].value;  }    
     }
}

function getCheckbox(obj){
   var ret=""
   var div=""
   for (x=0;x<obj.length;x++){
          if (obj[x].checked) {
          if (obj[x].value){ret+=div+obj[x].value; div="|"}
          }
    }
    return ret;
}
function checkAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = true ;
}


function unCheckAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = false ;
}

function  updateFavorites(what){
//var value = portalkey;
AjaxRequest.get(
       {
         'url':'/cgi-bin/wwiz/wwiz.asp?wwizmstr=WEB.CHECKLOGIN.AJX'
          ,'parameters':{'favorite':what,'portalkey':portalkey}
          ,'onSuccess':function(req){
       //v=favorites is returned, innerhtml onto that view...
       response=req.responseText;
         st = response.indexOf("<myfavorites>")
         end = response.indexOf("</myfavorites>")
         st=st+13
         end = end-st
         var myfavorites=response.substr(st,end)       
          // if (document.getElementById('MY_Favorites')) != undefined{ document.getElementById('MY_Favorites').innerHTML =myfavorites;}
       }// end of onsuccess
       }// end of request.get curlies
       ) //get argument list
}
function printThis(section){
/// execute the screen
   what = '/cgi-bin/wwiz/wwiz.asp?wwizmstr=WEB.PRINT&what='+section
   newwin = 'Roster'
   myWindow = window.open(what, newwin, "menubar=1,resizable=1,location=1,width=800,height=550,left=50,top=50,status=1,toolbar=1,scrollbars=1");
    myWindow.focus();
}
function printDiv(divid){   // allows you to print the div flling the entire screen first
  // use printtemp id
  var temp ='printtemp'
var button = '<br><span style = "font-size:8pt;background-color:lightgrey;color:black;cursor:pointer" onclick="showDiv('
button+="'printtemp'"
button+=')">Close this window</span><br>'
  //showHideClass("hideforprint","hide")
  document.getElementById(temp).style.position = 'absolute'; 
  document.getElementById(temp).style.backgroundColor = 'lightblue'; 
  document.getElementById(temp).style.opacity = '1';
  document.getElementById(temp).style.filter = '-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"';
  document.getElementById(temp).style.filter = 'alpha(opacity="100")';
  document.getElementById(temp).style.width = '100%'; 
  document.getElementById(temp).style.height = '100%';
  document.getElementById(temp).style.left = '1px';
  document.getElementById(temp).style.top = '1px'; 
  document.getElementById(temp).innerHTML = document.getElementById(divid).innerHTML+button
  document.getElementById(temp).style.display = 'inline'
  //HIDE ALL THE HIDEFORPRINT CSS CLASSES
  showHideClass2("hideforprint","hide")
 //  window.print(); 
 showHideClass("hideforprint","show")
 // document.getElementById(temp).style.display = 'none'; 

}
function printDiv2(divid){
divid = 'printtemp2'
alert (divid)
if (winList['mypopup']) {
    var data=document.getElementById(divid).innerHTML;
    w='100%';
    l='1px'
    t='1px'
    h='100%'
    var title = 'PrintPage';
    document.getElementById('mypopup').style.height= 'auto';
    document.getElementById('mypopuptitle').innerHTML = title  // 'WNCC News and Events';
    document.getElementById('mypopuptitle').style.textAlign= 'center';
    //document.getElementById('titleBar').style.backgroundColor='#000447';
    if (w){ document.getElementById('mypopup').style.width = w;} 
    if (w){document.getElementById('mypopupclientarea').style.width = w;} 
    var neww=document.getElementById('mypopupclientarea').style.width
    //var neww = w.replace("px","");
    //neww = neww - 15
    //neww = neww+"px"
    //document.getElementById('mypopupclientarea').style.width =neww;
    if (l){ document.getElementById('mypopup').style.left= l;}
    if (t){ document.getElementById('mypopup').style.top = posY;}
    if (h){document.getElementById('mypopupclientarea').style.height  = h;}
    if (data){document.getElementById('mypopupclientarea').innerHTML = data;}
    document.getElementById('mypopupclientarea').scrollTop=0; 
  document.getElementById('mypopup').style.width = '100%'; 
  document.getElementById('mypopup').style.height = 'auto'; 
  document.getElementById('mypopup').style.left = '1px';
  document.getElementById('mypopup').style.top = '1px'; 
  document.getElementById('mypopupclientarea').style.width = '100%';
  document.getElementById('mypopupclientarea').style.height = '100%';
  document.getElementById('mypopupclientarea').style.left = '1px';
  document.getElementById('mypopupclientarea').style.top = '1px';
  document.getElementById('mypopup').style.height= '100%';
  
  document.getElementById('mypopup').style.width = '100%'; 
  document.getElementById('mypopup').style.height = 'auto'; 
  document.getElementById('mypopup').style.left = '1px';
  document.getElementById('mypopup').style.top = '1px'; 
  document.getElementById('mypopupclientarea').style.width = '100%';
  document.getElementById('mypopupclientarea').style.height = '100%';
  document.getElementById('mypopupclientarea').style.left = '1px';
  document.getElementById('mypopupclientarea').style.top = '1px';
  document.getElementById('mypopup').style.height= '100%';
  alert ("window about to open")
  winList['mypopup'].open()
//    window.print(); 

 } else{
    alert ("Error getting the data!  Sorry!")
  }
}

function newProcessPs(){
     // new function to fill static div
     // document.getElementById('schedselect').style.display = 'inline'
     alert ("newprocess")
     var  theform=document.forms['WebWiz'] 
     showHideClass('processing','hide')
     showHideClass('notprocessing','show')
var status = AjaxRequest.submit(
  theform
    ,{
       'onSuccess':function(req){
        document.getElementById('scheduleselect').style.display = 'inline';
        document.getElementById('scheduleselect').innerHTML=req.responseText;
        
        showHideClass('processing','show')
        showHideClass('notprocessing','hide')
        unCheckAll(document.WebWiz.selectsection)
      }
     }
 );
}
        
function GetMySections(){
var loginidfromjs=document.getElementById('loginid').value
AjaxRequest.get(
       {
         'url':'/cgi-bin/wwiz/wwiz.asp?wwizmstr=WEB.CHECKLOGIN.AJX'
          ,'parameters':{'programs':'1','loginidfromjs':loginidfromjs}
          ,'onSuccess':function(req){
        response=req.responseText;
         st = response.indexOf("<programs>")
         end = response.indexOf("</programs>")
         st=st+10
         end = end-st
         var myprograms=response.substr(st,end )     
        // alert (myprograms)
        document.getElementById('sections').innerHTML=myprograms;
         // if (document.getElementById('MY_Favorites')) != undefined{ document.getElementById('MY_Favorites').innerHTML =myfavorites;}
       }// end of onsuccess
       }// end of request.get curlies
       ) //get argument list
   }
function notIE(){
  var browser=navigator.appName;
   var b_version=navigator.appVersion;
   var version=parseFloat(b_version);
   //alert (navigator.appName)
   if (navigator.appName !='Netscape'){
           alert ("This program will NOT sort ( and may crash ) in Internet Explorer..Please use Firefox")
   }
}

//keep this at the bottom or a object expected error is generated!
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

