<!--hide this script from non-javascript-enabled browsers


/* Function that swaps images. */

function di20(id, newSrc) {
    var theImage = FWFindImage(document, id, 0);
    if (theImage) {
        theImage.src = newSrc;
    }
}

/* Functions that track and set toggle group button states. */

function FWFindImage(doc, name, j) {
    var theImage = false;
    if (doc.images) {
        theImage = doc.images[name];
    }
    if (theImage) {
        return theImage;
    }
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theImage = FWFindImage(doc.layers[j].document, name, 0);
            if (theImage) {
                return (theImage);
            }
        }
    }
    return (false);
}

var current = top.location;


window.saveInnerWidth = window.innerWidth;
window.saveInnerHeight = window.innerHeight;

/*
window.onresize = resize;

function resize() {
    if (saveInnerWidth < window.innerWidth || 
        saveInnerWidth > window.innerWidth || 
        saveInnerHeight > window.innerHeight || 
        saveInnerHeight < window.innerHeight ) 
    {
        window.location.replace(current);
    }
}
 window.onLoad=resize 
*/


/* Functions for PopUp Windows with Help/Login boxes etc. */

function popIt(url){
	popwin=window.open(url,"popwin","height=330,width=570,scrollbars=0,status=yes");
}

function MyPopUp(strDestination, nX, nY) {
	newwindow=open(strDestination,'PopUpMain','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+nX+',height='+nY+' bgcolor=#FFFFFF');
}


// Get Browser Type 
var ns, ns4, ns5, ie;
bname = navigator.appName;
ver = navigator.appVersion;
int_ver = parseInt(ver);
if (bname.indexOf("Netscape") >= 0 && int_ver >= 4) ns = 1;
if (bname.indexOf("Netscape") >= 0 && int_ver == 4) ns4 = 1;
else if (bname.indexOf("Netscape") >= 0 && int_ver == 5) ns5 = 1;
if (bname.indexOf("Microsoft Internet Explorer") >=0 && int_ver >= 4) ie = 1;
function openwin (url) {
// get window width and height
if (ns) {
	w = (window.innerWidth/2)-190;
	h = (window.innerHeight/2)-125;
}
else if (ie) {
	w = (document.body.offsetWidth/2)-210;
	h = (document.body.offsetHeight/2)-125;
} 
newwin = window.open(url,'newwin','width=386,height=300,toolbars=0,status=1,resizable=1,location=0,scrollbars=0,top='+h+',left='+w+',screenX='+w+',screenY='+h)
}

function openwinscroll (url) {
// get window width and height
if (ns) {
	w = (window.innerWidth/2)-190;
	h = (window.innerHeight/2)-125;
}
else if (ie) {
	w = (document.body.offsetWidth/2)-210;
	h = (document.body.offsetHeight/2)-125;
} 
newwin = window.open(url,'newwin','width=386,height=300,toolbars=0,status=1,resizable=1,location=0,scrollbars=1,top='+h+',left='+w+',screenX='+w+',screenY='+h)
}


// Function to check if FORM Values have CHANGED 

function isFormChanged(frm) {
   // Form NAME is passed
   // Each ELEMENT of form is checked to see if any CHANGES
   // Compares DEFAULT VALUE to CURRENT VALUE of EACH Form Element

   // Default value is FALSE, (no change)
   // But, will CHANGE to TRUE if any different values found!
   var rtnVal = false; 

   // Get all elements for FORM name passed
   var ele = frm.elements;

   for ( i=0; i < ele.length; i++ ) {
      if ( ele[i].type.length > 0 ) {
         if ( isElementChanged( ele, i ) ) {
            rtnVal = true;
            break;
         }
      }
   }
   return rtnVal;
}

function isElementChanged( ele, i ) {
   // This is called from isFormChaned Function
   // Depending upon EACH Form Element TYPE,
   // Compare original (Default) value to Current to determine IF changed
   // Default to NO Change, and OVERWRITE if CHANGE was found in Comparisons
   var isEleChanged = false; 

   // Depending upon Element TYPE,
   // SWITCH to appropriate code/logic
   switch ( ele[i].type ) { 

   case "text" : 
      if ( ele[i].value != ele[i].defaultValue ) return true;
         break;

   case "textarea" : 
      if ( ele[i].value != ele[i].defaultValue ) return true;
         break;

   case "radio" :
      val = "";
      if ( ele[i].checked != ele[i].defaultChecked ) return true;
         break;

   case "select-one" : 

      for ( var x =0 ; x <ele[i].length; x++ ) {
         if ( ele[i].options[ x ].selected != ele[i].options[ x ].defaultSelected ) return true;
         }
      break;

   case "select-multiple" :
      for ( var x =0 ; x <ele[i].length; x++ ) {
         if ( ele[i].options[ x ].selected != ele[i].options[ x ].defaultSelected ) return true;
         }
      break;

   case "checkbox" :
      if ( ele[i].checked != ele[i].defaultChecked ) return true;
   
   default:
      return false;
      break;
   }
}

function ClipBoard(data) {
   // Function to COPY data passed to Windows Clipboard
   // Ideal for ADDRESS LABEL or ENVELOPE Data
   // to be copied to other program such as MS Word.
   // Requires ELEMENT to Hold 'Clip Board' Text
   // Therefore, Page Setup of any calling page MUST include
   // non-displayed ELEMENT for this function to reference!
   // ONLY WORKS with I.E. (Netscape does NOT bomb, but simply does NOT work!)

   // Ensure there was DATA passed (i.e. ADDRESS)
   // Otherwise, INIT to something or element access will fail!
   if (data == "") {data="no copy data available"}
   
   ClipBoardCopyTextVarb.innerText=data;
   Copied=ClipBoardCopyTextVarb.createTextRange();
   Copied.execCommand('Copy');
   
   // Tell user how to PASTE
   alert("Address label data has been formatted and copied to the Windows Clip Board.\n\nYou may now PASTE this information into any Windows application.\n\nFrom Microsoft Word, use CTRL+V to PASTE.");
}


// stop hiding -->
