function imageSwap(psImageName, psImagePath) {
var loImage;

	if (document.images) {

		loImage = eval("document.images['" + psImageName + "']");
		loImage.src = psImagePath;
	}	
}

function launchCaptivate(psURL, pWidth, pHeight)
{
  if (pWidth == null)
    pWidth = 815;
    
  if (pHeight == null)
    pHeight = 620;

  var windowProperties = 'height='+ pHeight +',width='+ pWidth +',menubar=no,location=no,status=no,resizable=yes,scrollbars=no,top=0,left=0,screenX=0,screenY=0'

  windowHandle = window.open(psURL,'Presentation',windowProperties);
	if (windowHandle.opener) {
    		windowHandle.focus();
	}
}

function launchSupport(psURL) {
	if (spawnNewWindow(psURL)) {
		windowHandle = window.open(psURL, null, "height=600,width=600,resizable=no,scrollbars=no,status=no,top=0,left=0,screenX=0,screenY=0");
		if (windowHandle.opener) {
    			windowHandle.focus();
		}
	}
}

function launchArticle(psURL) {
	if (spawnNewWindow(psURL)) {
		windowHandle = window.open(psURL, null, "height=600,width=620,resizable=yes,scrollbars=yes,status=no,top=0,left=0,screenX=0,screenY=0");
		if (windowHandle.opener) {
    			windowHandle.focus();
		}
	}
}

function spawnNewWindow(psFileName) {
	
	var lsFileName = psFileName;
	var lsFileExtension = lsFileName.substr(lsFileName.length - 3, 3);

	if (navigator.appName.indexOf('Netscape') != -1 && parseInt(navigator.appVersion) < 6) {   
		if (lsFileExtension == 'pps' || lsFileExtension == 'pdf') {
			location.href = lsFileName; 
			return false;
		}	
		else {
			return true;
		}
	}
	else {
		return true;
	}
}		

function defaultVisGeneric (psSectionName, pbVisible) {
var frm = document.frm;
var imgPlus = 'Img/ExpandSection.gif';
var imgMinus = 'Img/ContractSection.gif';
var imgToggleSection;
var lsAllTags;
var laSectionName = new Array();

  laSectionName = psSectionName.split('~');
  
	for (var llSectionNumber=0; llSectionNumber < laSectionName.length; llSectionNumber++) { 
		lsAllTags = document.getElementsByName(laSectionName[llSectionNumber]);
		imgToggleSection = eval("document.images['imgToggle" + laSectionName[llSectionNumber] + "']");
 	  
		if (lsAllTags.length > 0) {
			for (i=0; i < lsAllTags.length; i++) {
			  if (pbVisible) {
			  
			    if (browserIsIE())
				    lsAllTags[i].style.display = 'block';
  				else 
  				  lsAllTags[i].style.display = 'table-row';
  				  
				  if (imgToggleSection)
				    imgToggleSection.src = imgMinus;
				}
				else {
				   lsAllTags[i].style.display = 'none';
  				
				  if (imgToggleSection) {
				    imgToggleSection.src = imgPlus;
				  }
				}
			}
		}
	}
}

function toggleSectionVisGeneric(psSectionName) {
var lsAllTags = document.getElementsByName(psSectionName);
var imgPlus = 'Img/ExpandSection.gif';
var imgMinus = 'Img/ContractSection.gif';
var imgToggleSection = eval("document.images['imgToggle" + psSectionName + "']");
var frm = document.frmMG;
var bExplodeView;

	for (i=0; i < lsAllTags.length; i++) {
	
	  if (browserIsIE())
		  lsAllTags[i].style.display = lsAllTags[i].style.display == 'none' ? 'block' : 'none';
  	else 
  		lsAllTags[i].style.display = lsAllTags[i].style.display == 'none' ? 'table-row' : 'none';
	}
	if (imgToggleSection) {
	  bExplodeView = imgToggleSection.src.indexOf(imgPlus) >= 0;
	  imgToggleSection.src = bExplodeView ? imgMinus : imgPlus;
	}
}

function browserIsIE() {
var agt=navigator.userAgent.toLowerCase(); 
	
	 var is_ie = (agt.indexOf("msie") != -1);
	 return is_ie;
}

/*
Floating Menu script-  Roy Whittle (http://www.javascript-fx.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/

//Enter "frombottom" or "fromtop"
var verticalpos="frombottom"

function JSFX_FloatNavDiv()
{
	var startX = 3,
	startY = 110;
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	var d = document;
	function ml(id)
	{
		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x;this.style.top=y;};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function()
	{
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : document.body.scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml("divLeftNavFloat");
	stayTopLeft();
}

//
//   File Name :			jsLibOdometer.js
//   Author :					Jim Guild
//   Date :						01/06/00
//   Description :		odometer routine
//   Requires :				jsLibFormat.js
//   Revisions :
//


//does the rotating "Odometer" display in the field and with the format passed to it
function showOdometer (psControlName, pcEndDisplayValue, pfFormatFunction, plNbrDecimalPlaces) {
var llOdomoterSpeed = 100;
var loControl = eval (psControlName);
var lcBeginDisplayValue;
var llPlaceCounter;
var lcDisplayIncrement;

	lcBeginDisplayValue = stripNonDigits(loControl.value) - 0;

	if (lcBeginDisplayValue < pcEndDisplayValue) {
		for (llPlaceCounter = (pcEndDisplayValue.toString().length - 1); llPlaceCounter >= 0 ; llPlaceCounter--) {
			lcDisplayIncrement = Math.pow (10, llPlaceCounter);

			if ((lcBeginDisplayValue + lcDisplayIncrement) <= pcEndDisplayValue) {
				lcBeginDisplayValue += lcDisplayIncrement;
				if (pfFormatFunction == null) {
					loControl.value = lcBeginDisplayValue;
				}
				else {
					loControl.value = pfFormatFunction(lcBeginDisplayValue);
				}
				
				setTimeout ("showOdometer('" + psControlName + "'," + pcEndDisplayValue + "," + pfFormatFunction + "," + plNbrDecimalPlaces + ")", llOdomoterSpeed);

				break;
			}
		}
	}
	else {
		loControl.value = pcEndDisplayValue;
		pfFormatFunction (loControl, plNbrDecimalPlaces);
	}
}
