	// Common variable setup
var topcol1='#D72700'; topcol2='#cccccc'
var midcol1='#FF9933'; midcol2='#cccccc'; midcol3='#ffffff'
var midnav1=''; topnav1=''; myrowname='';
cookie_name="mhtextsize"; 
font1="0.69pc"; font2="0.75pc";

//	setnav highlights the bars underneath/next to menu items.  Depending on what is passed in
//	it will highlight the given section by finding the id that is passed in.
function setnav(topnav, midnav, bodnav, sidnav, dropper) { 
	if (topnav!='') {topnav1="ln_"+topnav; topnav2="td_"+topnav;}
	if (midnav!='') {midnav1="ln_"+midnav; midnav2="td_"+midnav;}

	if (topnav!='') {document.getElementById(topnav1).style.background=topcol1}
	if (midnav!='') {document.getElementById(midnav1).style.background=midcol1}
	if (bodnav!='') {document.getElementById(bodnav).className = 'highlight'}
	if (sidnav!='') {	
			namer=sidnav.substring(1,sidnav.length);
			if (dropper=='') {myarr=eval("arr_"+namer); myarr.src="images/shim.gif";}

			myblk=eval("blk_"+namer); myblk.src="images/icon_block.gif"; 
			myrowname="row_"+namer; myrow=eval(myrowname); colorhi1='#dddddd'; colorhi2='#cccccc';
			mynum=sidnav.substring(0,1); myrow.style.backgroundColor=eval("colorhi"+mynum);
	}
	if (dropper!='') {
			myprompt=dropper.lastIndexOf('_')
			mydrop=eval(dropper.substring(0,myprompt))
			myindex=dropper.substring(myprompt+1,dropper.length); 
			mydrop.selectedIndex=myindex;
	}
}

// navover and navoff are called to change the colors of the bars when the mouse hovers over a link in a nav bar	
function navover(which,col) {document.getElementById("ln_"+which).style.background=col}
function navoff(which,col,nav) {
	if ( ("ln_"+which)!=nav )
	{
		if(document.getElementById("ln_"+which) != null)
		{
			document.getElementById("ln_"+which).style.background=col
		}
	}
	
}

//putCookie adds the cookie that is used to store the text size settings
function putCookie() {
	if(document.cookie != document.cookie) {index = document.cookie.indexOf(cookie_name);} else { index = -1;}
	if (index == -1){
		document.cookie=cookie_name+"="+mysize+"; expires=Monday, 04-Apr-2010 05:00:00 GMT; path=/";
	} 
}

//	setRule is called to change the size of the font when the user clicks on the link in 
//	the site tools bar in the banner.
function setRule(stylesheet,rule,attribute,value){
	if (!document.styleSheets) return false;
	var lRules = new Array();

	if (document.styleSheets[stylesheet].cssRules) 
		lRules = document.styleSheets[stylesheet].cssRules
	else if (document.styleSheets[stylesheet].rules)
		lRules = document.styleSheets[stylesheet].rules
	else return false;

	//alert(lRules[0].style.fontSize)
 	if (value=="") {if (lRules[0].style.fontSize==font1) {value=font2} else {value=font1}	}

	mysize=value; //alert('value is '+value)
	lSuccess = eval("lRules[" + rule + "].style." + attribute + " = value")
	putCookie();
	return lSuccess;
}

//	getCookie reads the cookie from the user and sets the font size accordingly.
function getCookie() {
	if(document.cookie) {
		index = document.cookie.indexOf(cookie_name);
		if (index != -1) {
			namestart = (document.cookie.indexOf("=", index) + 1);
			nameend = document.cookie.indexOf(";", index);
			if (nameend == -1) {nameend = document.cookie.length;}
			mysize = document.cookie.substring(namestart, nameend);
			setRule(0,0,'fontSize',mysize);
		}
	} //else {alert('no cookie')}
}

//	showOnly is used to show specified expandable section on a page in the site.
function showOnly(namer,id_all,id_show) {
	for (i=1; i<id_all+1; i++) {
		if (i<10) {spacer="0"} else {spacer=""}
		the_id=namer+spacer+i
		var obj = (dom)? document.getElementById(the_id): document.all[the_id];
	
	if (i!=id_show) {
			obj.style.visibility = "hidden";
			obj.style.display = "none";
		} else {
			obj.style.visibility = "visible";
			obj.style.display = "block";
		} 
	}		
}

//	show_hide is used to show/hide expandable sections in the site.  It also
//	will change the image of the + to a - or vice versa.
var dom = (document.getElementById && !document.all)? 1: 0;
function show_hide(the_id,icon) {
	var obj = (dom)? document.getElementById(the_id): document.all[the_id];
	//if (icon!='') {arr=eval(the_id+"_"+icon)}
	if (icon!='') {arr=document.getElementById(the_id+"_"+icon)}
	
	if(obj.style.visibility == "hidden"){ // show
		obj.style.visibility = "visible";
		obj.style.display = "block"; // If this looks wrong, try 'inline'
		if (icon!='') {arr.src = "images/nav_minus.gif";}
	} else { // hide
		obj.style.visibility = "hidden";
		obj.style.display = "none";
		if (icon!='') {arr.src = "images/nav_plus.gif"; }
	}
}

//	showH_hideall is used to show/hide all expandable sections on a page in the site.  It also
//	will change the image of the + to a - or vice versa.
function show_hideall(id_start,id_end,icon,the_act) {
for (i=id_start; i<id_end+1; i++) {
	if (i<10) {spacer="0"} else {spacer=""}
	the_id="q"+spacer+i
	var obj = (dom)? document.getElementById(the_id): document.all[the_id];
	if (icon!='') {arr=eval("q"+spacer+i+"_"+icon)}
	
	if(the_act=="show"){ // show
		obj.style.visibility = "visible";
		obj.style.display = "block"; // If this looks wrong, try 'inline'
		if (icon!='') {arr.src = "images/nav_minus.gif";}
	} else { // hide
		obj.style.visibility = "hidden";
		obj.style.display = "none";
		if (icon!='') {arr.src = "images/nav_plus.gif"; }
	}
}
}

//-- may replace popup and popupgeneric below
function openWin(url, winName) { //v2.0
 	width=screen.width-170; height=screen.height-230
	sizer='yes'; scrollstat='yes'
  
  	newWin=window.open(url, winName,'width=' + width + ',height=' + height + ',resizable=' + sizer + ',scrollbars=' + scrollstat + ',menubar=yes,status=yes,toolbar=yes,location=yes,top=30,left=85' );
	newWin.focus()
	}


//	popup will create a popup showing the given URL with the specified width and height.  The user can also
//	choose to show the scrollbar and whether or not to allow the user to resize the popup.
function popup(url, width, height, scrollstat, sizer) {
  window.open(url,'','width=' + width + ',height=' + height + ',resizable=' + sizer + ',scrollbars=' + scrollstat + ',menubar=no,status=no,toolbar=yes,location=yes,top=30,left=85' );
}

//	popupgeneric opens an url in a popup window with a width of 835
function popupgeneric(theurl) {
 	width=835; height=screen.height-250
	sizer='yes'; scrollstat='yes'
	popup(theurl, width, height, scrollstat, sizer)
}

function selecturl(theurl) { //v2.0
  starturl=theurl.substring(0,7)
  if ((starturl=="http://")||(starturl=="https:/")) {openWin(theurl,'')} else {MM_goToURL('parent',theurl)}
}

/* printit is called when the user clicks the print button in site tools */
function printit(){  
	if (window.print) {window.print();}
}

/* bookit is called when the user clicks the bookmark button in site tools */
function bookit(linkUrl,linkTitle){
   if (!document.all) {
      alert('Please hit ctrl-d to bookmark this page');
   }
   else external.AddFavorite(linkUrl,linkTitle);
   return false;
}

/* forwards a user to the url */
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

/* used to find an object in the DOM */
function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

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_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_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];}
}


// The following code is used to detect whether or not the user has the Flash Plugin
// initialize global variables for checking
var detectableWithVB = false;
var pluginFound = false;

// Searches for flash by calling detectPlugin or detectActiveXControl
function detectFlash() {
    pluginFound = detectPlugin('Shockwave','Flash'); 
    // if not found, try to detect with VisualBasic (needed for IE on windows)
    if(!pluginFound && detectableWithVB) {
		pluginFound = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.6');
    }
    // return pluginFound to caller.  True if flash was detected, otherwise false.
    return pluginFound;
}

// Detect Plugin is used for Netscape/Mozilla plugin checking
function detectPlugin() {
    // allow for multiple checks in a single pass
    var thePlugins = detectPlugin.arguments;
    // consider pluginFound to be false until proven true
    var pluginFound = false;
    // if plugins array is there and not fake (IE has a placeholder that is always empty)
    if (navigator.plugins && navigator.plugins.length > 0) {
		var pluginsArrayLength = navigator.plugins.length;
		// for each plugin...
		for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) {
		    // loop through all desired names and check each against the current plugin name
		    var numFound = 0;
		    for(namesCounter=0; namesCounter < thePlugins.length; namesCounter++) {
				// if desired plugin name is found in either plugin name or description
				if( (navigator.plugins[pluginsArrayCounter].name.indexOf(thePlugins[namesCounter]) >= 0) || 
					(navigator.plugins[pluginsArrayCounter].description.indexOf(thePlugins[namesCounter]) >= 0) ) {
					// this name was found
				    numFound++;
				}   
		    }
		    // if the number we found matches the total number provided then we were successful
			if(numFound == thePlugins.length) {
				pluginFound = true;
				break;
			}
		}
    }
    return pluginFound;
} // detectPlugin

// Here we write out the VBScript block for MSIE for Windows
// this is the only way to detect Flash in IE for windows. DetectPlugin won't work
if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {
    document.writeln('<script language="VBscript">');

    document.writeln('\'do a one-time test for a version of VBScript that can handle this code');
    document.writeln('detectableWithVB = False');
    document.writeln('If ScriptEngineMajorVersion >= 2 then');
    document.writeln('  detectableWithVB = True');
    document.writeln('End If');

    document.writeln('\'this next function will detect most plugins');
    document.writeln('Function detectActiveXControl(activeXControlName)');
    document.writeln('  on error resume next');
    document.writeln('  detectActiveXControl = False');
    document.writeln('  If detectableWithVB Then');
    document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
    document.writeln('  End If');
    document.writeln('End Function');
    document.writeln('</script >');
}

getCookie();