﻿/* =Helper Functions
-----------------------------------------------*/
// Dreamweaver functions
function MM_swapImgRestore() { //v3.0
 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
 if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// Non-destructive way to add new functions to the window.onload event
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload !== 'function') {
    window.onload = func;
  } else {
    window.onload = function () {
      oldonload();
      func();
    };
  }
}

/* =Menu Functions
-----------------------------------------------*/
function P7_autoLayers() { //v1.5 by PVII
 var g,b,k,f,u,k,j,args=P7_autoLayers.arguments,a=parseInt(args[0]);if(isNaN(a))a=0;
 if(!document.p7setc){p7c=new Array();document.p7setc=true;for(u=0;u<10;u++){
 p7c[u]=new Array();}}for(k=0;k<p7c[a].length;k++){if((g=MM_findObj(p7c[a][k]))!=null){
 b=(document.layers)?g:g.style;b.visibility="hidden";}}for(k=1;k<args.length;k++){
 if((g=MM_findObj(args[k]))!=null){b=(document.layers)?g:g.style;b.visibility="visible";f=false;
 for(j=0;j<p7c[a].length;j++){if(args[k]==p7c[a][j]) {f=true;}}
 if(!f){p7c[a][p7c[a].length++]=args[k];}}}
}

var timeOut = null;

function navIn() {
	if (timeOut != null) {
		window.clearTimeout(timeOut);
	}
}

function navTimer() {
	if (timeOut != null) {
		window.clearTimeout(timeOut);
	}
	timeOut = window.setTimeout('hideMenuObjects()',250);
}

function hideMenuObjects(){
	menuObj = document.getElementById("navMain");
	menus = menuObj.getElementsByTagName("div");
	for ( n = 0; n < menus.length; n++) {
		menus[n].style.visibility = "hidden";
	}
}

function navTimerQuickLinks() {
	if (timeOut != null) {
		window.clearTimeout(timeOut);
	}
	timeOut = window.setTimeout('hideQuickLinksObjects()',250);
}

function hideQuickLinksObjects(){
	menuObj = document.getElementById("quickLinksButton");
	menus = menuObj.getElementsByTagName("div");
	for ( n = 0; n < menus.length; n++) {
		menus[n].style.visibility = "hidden";
	}
}

function navTimerTools() {
	if (timeOut != null) {
		window.clearTimeout(timeOut);
	}
	timeOut = window.setTimeout('hideToolsObjects()',250);
}

function hideToolsObjects(){
	menuObj = document.getElementById("toolsButton");
	menus = menuObj.getElementsByTagName("div");
	for ( n = 0; n < menus.length; n++) {
		menus[n].style.visibility = "hidden";
	}
}

function navTimerHowTo() {
	if (timeOut != null) {
		window.clearTimeout(timeOut);
	}
	timeOut = window.setTimeout('hideHowToObjects()',250);
}

function hideHowToObjects(){
	menuObj = document.getElementById("howToButton");
	menus = menuObj.getElementsByTagName("div");
	for ( n = 0; n < menus.length; n++) {
		menus[n].style.visibility = "hidden";
	}
}

//Product Matrix Show/Hide Code.
function clearMoreInfo(id) {
	for(n = startObject;n <=stopObject;n++) {
		if(n != id && eval("objectFlag" + n) == 1) {
			eval("objectFlag" + n + " = 0;");		
			document.getElementById("moreInfo" + n).className = "hideObject";
			document.getElementById("linkText" + n).innerHTML = "More&raquo;";
		}
	}
	return;
}

function toggleMoreInfo(id) {
	if (document.getElementById("moreInfo" + id).className == "hideObject") {
		eval("objectFlag" + id + " = 1;");
		clearMoreInfo(id);
		document.getElementById("moreInfo" + id).className = "showMoreInfo";
		document.getElementById("linkText" + id).innerHTML = "Hide&laquo;";
	}
	else {
		eval("objectFlag" + id + " = 0;");
		document.getElementById("moreInfo" + id).className = "hideObject";
		document.getElementById("linkText" + id).innerHTML = "More&raquo;";
	}
}

//Generic Show/Hide Code.
function showAll(status,startRow,stopRow) {
	//argument 4 is OPTIONAL - use this argument to specify different class names to be used
	//for each different class name add a 'case' statement to the switch statement below (be sure to end with break;)
	//THE DEFAULT IS ZERO (0)!
	var typeFlag = ((arguments.length>=4)?arguments[3]:0); //the array is zero-based
	for(n=startRow;n<=stopRow;n++) {
		if(eval("objectFlag" + n) != status) {
			eval("objectFlag" + n + " = status;");	
			if(status == 0) {
				switch(typeFlag) {
					case 0:
						document.getElementById("linkObject" + n).className = "bulletPlusListMtxTd";
						break;
					default:
						document.getElementById("linkObject" + n).className = "bulletPlusListMtxTd";
				}
				document.getElementById("displayObject" + n).className = "hideObject";
			} else {
				document.getElementById("linkObject" + n).className = "hideObject";
				document.getElementById("displayObject" + n).className = "bulletListMtxTdNone";
			}
		}
	}
	return;
}

function toggleShowAllVisibility(id) {
	//argument 2 is OPTIONAL - use this argument to specify different class names to be used
	//for each different class name add a 'case' statement to the switch statement below (be sure to end with break;)
	//THE DEFAULT IS ZERO (0)!
	var typeFlag = ((arguments.length>=2)?arguments[1]:0); //the array is zero-based
	if(eval("objectFlag" + id) == 1) {
		eval("objectFlag" + id + " = 0;");
		switch(typeFlag) {
			case 0:
				document.getElementById("linkObject" + id).className = "bulletPlusListMtxTd";
				break;
			default:
				document.getElementById("linkObject" + id).className = "bulletPlusListMtxTd";
		}
		document.getElementById("displayObject" + id).className = "hideObject";	
	}
	else {
		eval("objectFlag" + id + " = 1;");
		document.getElementById("linkObject" + id).className = "hideObject";
		document.getElementById("displayObject" + id).className = "bulletListMtxTdNone";
	}
	return;
}

function disclaimer(passedWebsite) {
	if(confirm(linkDisclaimer))
		window.open(passedWebsite,'NewWin','toolbar,status,resizable,location,scrollbars,menubar');
}

function mailConfirm(passedEmailAddress) {
	if(confirm(emailDisclaimer))
		window.location = passedEmailAddress;
}

//eval link function
function evalLink(linkURL,linkTarget,disclaimerFlag) {
  switch(linkTarget) {
		case 0: //Same window
			if(disclaimerFlag == 1) {
				if(confirm(linkDisclaimer)) window.location = linkURL;
			}
			else window.location = linkURL;
			break;

		case 1: // New Window
			if(disclaimerFlag == 1) {
				if(confirm(linkDisclaimer)) window.open(linkURL);
			}
			else window.open(linkURL);
			break;

		case 2: // Popup Window
			if(disclaimerFlag == 1) {
				if(confirm(linkDisclaimer)) window.open(linkURL,'popup','scrollbars=yes,resizable=yes,width=640,height=480');
			}
			else window.open(linkURL,'popup','scrollbars=yes,resizable=yes,width=500,height=450');
			break;
	}
}

/* =Print style helper
----------------------------------------------- */
// Hides page header graphics, displaying the alt text for the image instead
function getHeaderAlts() {
	// Check to see if we can interact with the DOM. Does #pageHeader exist?
	if (!document.getElementsByTagName || !document.getElementById("pageHeader")) { return false; }
	// Set all the variables for this function
	var headerContainer, headerContainer, headerImage, headerObject, n, headerText, headerSpan, css, cssText;
	// Get #pageHeader div tag
	headerContainer = document.getElementById("pageHeader");
	// Get the first image inside #pageHeader div tag (should be only image)
	headerImage = headerContainer.getElementsByTagName("img")[0];
	if(!headerImage) headerObject = headerContainer.getElementsByTagName("object")[0];
	// Get the first h1 tag inside #pageHeader div tag  (should be only h1 tag)
	headerTag = headerContainer.getElementsByTagName("h1")[0];
	// Get the alt attribute of the image and create a variable to contain it
	if(!headerImage) headerText = document.createTextNode(headerObject.title);
  else headerText = document.createTextNode(headerImage.alt);
	// Create a generic span tag
	headerSpan = document.createElement("span");
	// Append the span tag to the end of the h1 tag
	headerTag.appendChild(headerSpan);
	// Insert the alt attribute content into the span tag
	headerSpan.appendChild(headerText);
	// Create a generic style tag
	css = document.createElement('style');
	// The next 2 lines set up attributes for the style tag
	css.setAttribute('type', 'text/css');
	css.setAttribute('media', 'print');
	// Set the text to insert into the style tag
	cssText = "#pageHeader img {display: none;}";
	// Conditional code used to insert content into style tag (PS = IE sucks)
	if(css.styleSheet) {
		// IE does it this way
		css.styleSheet.cssText = cssText}
	else {
		// everyone else does it this way
		css.appendChild(document.createTextNode(cssText));
	}
	// Append the style tag to the end of the first head tag on the page (should be only 1 head tag per page)
	document.getElementsByTagName("head")[0].appendChild(css);
}
// Run the getHeaderAlts() function on page load
addLoadEvent(getHeaderAlts);

<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------
// -->
<!-- // Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 
// If called with no parameters this function returns a floating point value 
// which should be the version of the Flash Player or 0.0 
// ex: Flash Player 7r14 returns 7.14
// If called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
	return (reqVer ? false : 0.0);
}

function writeStaticImage(imgName, imgAlt){
	alert("writeStaticImage()");
	document.write("<img src=\"/" + imgName + "\" alt=\"" + imgAlt + "\" width=\"955\" height=\"408\">");
}

function writeFlash(contentId, pageId) {
	//all supporting functions are contained in flashFunctionsInclude.cfm
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {	
		var httpProtocol = (("https:" == document.location.protocol) ? "https://" : "http://");

		if(contentId == "hpMainImage") {
			var movie = "hpMainImage.swf";
			var width = "559";
			var height = "278";
		} else if(contentId == "hpSmallLeftAd") {
			var movie = "hpSmallLeftAd.swf";
			var width = "185";
			var height = "209";
		} else if(contentId == "hpSmallRightAd") {
			var movie = "hpSmallRightAd.swf";
			var width = "185";
			var height = "209";
		} else if(contentId == "interiorMainImage") {
			var movie = "interiorMainImage.swf";
			var width = "559";
			var height = "155";
		} else if(contentId == "interiorSmallTopAd") {
			var movie = "interiorSmallTopAd.swf";
			var width = "184";
			var height = "149";
		} else if(contentId == "interiorSmallBottomAd") {
			var movie = "interiorSmallBottomAd.swf";
			var width = "184";
			var height = "149";
		}

		document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"" + httpProtocol + "download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"" + width + "\" height=\"" + height + "\">");
		document.write("  <param name=\"movie\" value=\"/" + movie + "\" />");
		document.write("  <param name=\"quality\" value=\"high\" />");
		document.write("  <param name=\"wmode\" value=\"transparent\" />");
		document.write("  <param name=\"flashvars\" value=\"pageId=" + pageId + "\" />");
		document.write("  <param name=\"bgcolor\" value=\"#000000\" />");
		document.write("  <embed src=\"/" + movie + "\" quality=\"high\" bgcolor=\"#000000\" flashvars=\"pageId=" + pageId + "\" pluginspage=\"" + httpProtocol + "www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"" + width + "\" height=\"" + height + "\"></embed>");
		document.write("</object>");
	} else {
		writeStaticImage(staticImgName, staticImgAlt); // staticImgName & staticImgAlt variables are written in the view
	}
}
function myOpen(page,width,height) {
	 window.open(page,'windowName','width=' + width + ',height=' + height + ',toolbar=no,location=no,directories=no,resizable=yes,status=yes,menubar=yes,scrollbars=yes');
}


//Session Timeout Warning Module
/******************************************
* DHTML Ad Box (By Matt Gabbert at http://www.nolag.com)
* Visit http://www.dynamicdrive.com/ for full script
* This notice must stay intact for use
******************************************/

adTime=300;  // seconds ad reminder is shown
chanceAd=1; // ad will be shown 1 in X times (put 1 for everytime)

var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"
adCount=0;
function initAd(){
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sponsorAdDiv.style');
	else if(ns)	adDiv=eval('document.layers["sponsorAdDiv"]');
	else if(w3)	adDiv=eval('document.getElementById("sponsorAdDiv").style');
	randAd=Math.ceil(Math.random()*chanceAd);
        if (ie||w3)
        adDiv.display="block";
        else
        adDiv.display ="block";
	if(randAd==1) showAd();
}
function showAd(){
if(adCount<adTime*10){adCount+=1;
	if (ie){documentWidth  =truebody().offsetWidth/2+truebody().scrollLeft-20;
	documentHeight =truebody().offsetHeight/2+truebody().scrollTop-20;}	
	else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
	documentHeight=window.innerHeight/2+window.pageYOffset-20;} 
	else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
	documentHeight=self.innerHeight/2+window.pageYOffset-20;} 
	adDiv.left=documentWidth-200+calunit;adDiv.top =documentHeight-200+calunit;
	setTimeout("showAd()",100);}else closeAd();
}
function closeAd(){
if (ie||w3)
adDiv.display="none";
else
adDiv.visibility ="hide";
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function Minutes(data) {
	for (var i = 0; i < data.length; i++)
	if (data.substring(i, i + 1) == ":")
		break;
		return (data.substring(0, i));
}

function Seconds(data) {
	for (var i = 0; i < data.length; i++)
	if (data.substring(i, i + 1) == ":")
	break;
	return (data.substring(i + 1, data.length));
}

function Display(min, sec) {
	var disp;
	if (min <= 9) disp = " 0";
	else disp = " ";
	disp += min + ":";
	if (sec <= 9) disp += "0" + sec;
	else disp += sec; 
	return (disp);
}

function startTimer() { 
	sec--;	

	if (sec == -1) { sec = 59; min--; }

	window.status = "Session will time out in:" + Display(min, sec);

	if (min == 1 && sec == 0) {
		initAd();
		down = setTimeout("startTimer()", 1000);
	}
	else if (min!=0 || sec!=0) {
		down = setTimeout("startTimer()", 1000);
	}

	if (min == 0 && sec == 0) {
		document.getElementById("sponsorAdDiv").innerHTML = document.getElementById("sessionTimeoutMessageDiv").innerHTML;
	}

}

function startCountDown(timeLimit) {
	min = 1 * Minutes(timeLimit);
	sec = 0 + Seconds(timeLimit);
	startTimer();
}

function restartCountDown(timeLimit) {
	min=0;
	sec=1;

	min = 1 * Minutes(timeLimit);
	sec = 0 + Seconds(timeLimit);
}