// Swap image function 
  function ChangeImage (ImageName, FileName) {
    if (document.images) {
      document[ImageName].src = eval(FileName + ".src");
    }
  }

// Swap two images function
  function ChangeImages (ImageName,FileName,SecImageName,SecFileName) {
    if (document.images) {
      document[ImageName].src = eval(FileName + ".src");
      document[SecImageName].src = eval(SecFileName + ".src");
    }
  }

// Popup external section function - added on 2/2/07
  function popExternalWin(url, name) {
    var str = "left=0,screenX=0,top=0,screenY=0,resizable,status=yes,scrollbars=yes,location=no,menubar=no,toolbar=no";
    if (window.screen) {
      var ah = screen.availHeight - 30;
      var aw = screen.availWidth - 10;
      str += ",height=" + ah;
      str += ",innerHeight=" + ah;
      str += ",width=" + aw;
      str += ",innerWidth=" + aw;
    }
    win=window.open(url, name, str);
    win.focus;
  }

// Popup window function
// On 8/15/05, modified 'resize=no' to 'resizable=1' to match admin popups
  function openWindow(url, name, size, scroll) {
    popupWin=window.open(url, name, '"toolbar=no,' + size +',left=15,top=15,status=no,' + scroll +',resizable=1,menubar=no"');
  }
  
// Popup window function
  function openWindowAllowResize(url, name, size, scroll) {
    popupWin=window.open(url, name, '"toolbar=no,' + size +',left=15,top=15,status=yes,' + scroll +',resizable=yes,menubar=no"');
  }

// Array function
  function makeArray(len) {
    for (var i = 0 ; i < len; i++) this[i] = null;
    this.length = len;
  }

// Array of day names
  var dayNames=new makeArray(7);
  dayNames[0] = "Sunday";
  dayNames[1] = "Monday";
  dayNames[2] = "Tuesday";
  dayNames[3] = "Wednesday";
  dayNames[4] = "Thursday";
  dayNames[5] = "Friday";
  dayNames[6] = "Saturday";

// Array of month names
  var monthNames = new makeArray(12);
  monthNames[0] = "January";
  monthNames[1] = "February";
  monthNames[2] = "March";
  monthNames[3] = "April";
  monthNames[4] = "May";
  monthNames[5] = "June";
  monthNames[6] = "July";
  monthNames[7] = "August";
  monthNames[8] = "September";
  monthNames[9] = "October";
  monthNames[10] = "November";
  monthNames[11] = "December";

// Elements of Date object assigned to variables
  var now = new Date();
  var day = now.getDay();
  var month = now.getMonth();
  var year = now.getYear();
  if (year == 99)
    year = 1999;
  else if (year > 99 && year < 2000)
    year = 1900 + year;
  var date = now.getDate();

// Close window function
function closeWin () {
  cWindow = window.close();
}

// Swap html function
function swap (id, txt) {
  document.getElementById(id).innerHTML = txt;
}
  
function openAWindow( pageToLoad, winName, width, height, center) {
/* Opens a new window on the users desktop.
   Arguments:
    pageToLoad - The URL of a page to load in the browser window.
                 This can be a relative URL or fully qualified.
    winName - 	 Name of the new window.
    width - 	 The horizontal size of the new window.
    height - 	 The vertical size of the new window.
    center -     toggle centering on 4.0 browsers.
                  1=centered window 0=no centering

    Values in the "args" section below can all be toggled in the
    same fashion as the center toggle.  Just modify the appropriate
    value in the args section to be either 0 or 1.

    A call to this function might look like this:
    <a href="javascript:openAWindow('ice.html','ice',375,250,1)">Ice</a>

   Created by Glenn Davis of Project Cool, Inc. for general use.  If
   you use this routine please leave all comments in place so that
   others may benefit as well.
*/
				 
    xposition=0; yposition=0;
    if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    args = "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=1,"
    + "scrollbars=1,"
    + "status=0," 
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only

    window.open( pageToLoad,winName,args );
}

function openAFullWindow( pageToLoad, winName, width, height, center) {
/* Opens a new window on the users desktop.
   Arguments:
    pageToLoad - The URL of a page to load in the browser window.
                 This can be a relative URL or fully qualified.
    winName - 	 Name of the new window.
    width - 	 The horizontal size of the new window.
    height - 	 The vertical size of the new window.
    center -     toggle centering on 4.0 browsers.
                  1=centered window 0=no centering

    Values in the "args" section below can all be toggled in the
    same fashion as the center toggle.  Just modify the appropriate
    value in the args section to be either 0 or 1.

    A call to this function might look like this:
    <a href="javascript:openAFullWindow('ice.html','ice',375,250,1)">Ice</a>

   Created by Glenn Davis of Project Cool, Inc. for general use.  If
   you use this routine please leave all comments in place so that
   others may benefit as well.
*/

	var larg = screen.availWidth - 10;
    var alt = screen.availHeight - 30;
				 
    xposition=0; yposition=0;
    //if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
    //   xposition = (screen.width - width) / 2;
    //    yposition = (screen.height - height) / 2;
    //}
    args = "width=" + larg + "," 
    + "height=" + alt + "," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=1,"
    + "scrollbars=1,"
    + "status=0," 
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition + ","     //IE Only
    + "fullscreen=1";             //IE Only
    
    window.open( pageToLoad,winName,args );
}

//if (document.layers) {
//    window.captureEvents(Event.MOUSEMOVE);
    //window.onmousemove=move;
//}
//else if (document.all)
//   document.onmousemove=move;

function openAPositionedWindow( pageToLoad, winName, width, height, center, e) {
				 
    var xposition=yposition=0;
    if (e != '') {
        xposition = e.screenX + 10;
        yposition = e.screenY + 10;
    }

    //if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
    //  xposition = (screen.width - width) / 2;
    //  yposition = (screen.height - height) / 2;
    //}
    args = "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=1,"
    + "scrollbars=1,"
    + "status=0," 
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only

    newwindow = window.open( pageToLoad,winName,args );
}
