<!--

	/*######################################################################################################*/
        /* This function reads the value of a cookie given the cookie name, written by CoreBlox */
     function getCookie(c_name)
     {
     if (document.cookie.length>0)
     {
     c_start=document.cookie.indexOf(c_name + "=");
     if (c_start!=-1)
         {
         c_start=c_start + c_name.length+1;
         c_end=document.cookie.indexOf(";",c_start);
         if (c_end==-1) c_end=document.cookie.length;
         return unescape(document.cookie.substring(c_start,c_end));
         }
     }
     return false;
     }

        /* This function determines whether to display "Login" or "Logout" in the search header depending on whether the user has logged in via Siteminder, written by CoreBlox */
         function displayLoginOrLogout() {

             var smsession;
             smsession = getCookie("KeystoneToken");

              if ((smsession == "LOGGEDOFF") || (smsession == false)) {
                  //if user is at home page, set Login URL to special page that will redirect them
                  //back to where they came from, instead of landing page for their type of user
                  if ((location.pathname == "/index.html") || (location.pathname == "/")) {
                      document.getElementById("login_or_logout").innerHTML = "&nbsp;|&nbsp;<a href='/landingpage'>Login</a>";
                      document.getElementById('LoginButtonImage').style.display='block';
/*For login button*/
                  }
                  else {
                     document.getElementById("login_or_logout").innerHTML = "&nbsp;|&nbsp;<a href='/LoginApplication/RedirectToReferrerUrl.aspx'>Login</a>";
                  }
              }
              else {
                 document.getElementById("login_or_logout").innerHTML = "&nbsp;|&nbsp;<a href='/LoginApplication/logout.aspx'>Logout</a>";
                        if ((location.pathname == "/index.html") || (location.pathname == "/")) {
                                document.getElementById('LoginButtonImage').style.display='none';
/*For login button*/
                        }
              }
         } 	

	/* DaveS 4.13.09 - This is an expirement to see if we can display Login or Logout in the header without having to add onload() calls to all the web pages */
	if (window.addEventListener) //DOM method for binding an event
		window.addEventListener("load", displayLoginOrLogout, false);
	else if (window.attachEvent) //IE exclusive method for binding an event
		window.attachEvent("onload", displayLoginOrLogout);
	else if (document.getElementById) //support older modern browsers
		window.onload=displayLoginOrLogout;

	/* ###################################################################################################### */
	

	/* This function should be used for all image rollover effects */

	function changeImage(imageName,newImageSource) {
		if (document.images) {
			document.images[imageName].src = newImageSource;
		}
	}
	
	/* This function should be used for the quicklinks */
	
	function quickJump() {
		var jumpURL = document.qlinks.qsection.options[document.qlinks.qsection.selectedIndex].value;
		if (jumpURL != "") {
			top.document.location = document.qlinks.qsection.options[document.qlinks.qsection.selectedIndex].value;
		}
		return false;
	}	
	
	/* This function is used when you want to have browsers that do not 
	have flash player installed write an image file instead */
	
	function writeFlashOrImage(FlashName,ImageName,Width,Height,Alt,FlashVersion) {
		// first, write the opening object tag  
	
		strObjectTag = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		strObjectTag = strObjectTag + ' width="' + Width + '" height="' + Height + '" ';
		strObjectTag = strObjectTag + 'codebase="http://active.macromedia.com/flash5/cabs/swflash.cab#version=';
		strObjectTag = strObjectTag + FlashVersion + '">';
		strMovieParam = '<param name="movie" value="' + FlashName + '">';
		document.write(strObjectTag);
		document.write(strMovieParam);
		document.write('<param name=\"play\" value=\"true\">');
		document.write('<param name=\"loop\" value=\"true\">');
		document.write('<param name=\"quality\" value=\"high\">');
	
		// if the Flash Plug-in is installed and a browser than user plug-ins is the browser, write an embed tag
		plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
			strImageTag = '<image src="' + ImageName + '" width="' + Width + '" height="' + Height + '" ';
			strImageTag = strImageTag + ' border="0" alt="' + Alt + '">';
		if ( plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 4 )
			{
			strEmbedTag = '<embed src="' + FlashName + '" width="' + Width + '" height="' + Height + '" ';
			strEmbedTag = strEmbedTag + 'play="true" loop="true" quality="high" ';
			strEmbedTag = strEmbedTag + 'pluginspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
			document.write(strEmbedTag);
			document.write('</embed>');
			}
		// otherwise, then write an image tag.
		else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
			document.write(strImageTag);
			}
		
		//finally, write the closing object tag
		document.write('</object>');
	}
	
	/* Use this function to open new windows in a browser */
	
	function openNewWindow(URL,windowName,optionList) {
		/* Opens a new window based on following parameters
			URL: A full URL to the site or file you wish to open
			windowName: The name of the Window that JS assigns when creating
			optionList: (Optional)--list of options for the pop-up window
		*/
		optionListValue = optionList;
		// Assign a Default Set of Parameters if the optionList does not exist
		if ((optionListValue == '') || (optionList == null)) {
			optionListValue = 'scrollbars=yes,location=yes,menubar=yes,toolbar=yes,resizable=yes,status=yes,locationbar=yes';
		}
		winOpener = window.open(URL,windowName,optionListValue);
		winOpener.focus();
	}
	
	function loadTopFrame(URL) {
		top.document.location = URL
	}

	function popupWindow(URL,windowName,optionList) {
		/* Opens a new window based on following parameters
			URL: A full URL to the site or file you wish to open
			windowName: The name of the Window that JS assigns when creating
			optionList: (Optional)--list of options for the pop-up window
		*/
		optionListValue = optionList;
		// Assign a Default Set of Parameters if the optionList does not exist
		if ((optionListValue == '') || (optionList == null)) {
			optionListValue = 'height=300,width=270,scrollbars,location=no,menubar,toolbar=no,resizable=no,status=no,locationbar=no';
		}
		winOpener = window.open(URL,windowName,optionListValue);
		winOpener.focus();
	}
	
	function loadTopFrame(URL) {
		top.document.location = URL
	}
	
function AssignMinWidthEventHandler(layer, minWidth)
{ 
	 document.targetDiv=layer;
	 document.minHeight=minWidth;
	 document.minWidth=minWidth;
	 if(document.getElementById&&navigator.appVersion.indexOf("MSIE")>-1&&!window.opera)
	 {
	 	if(window.attachEvent)
		{
			window.attachEvent("onresize",SetMinWidth);
	 		window.attachEvent("onload",SetMinWidth);			
			
		} 
		else
		{
			onload=SetMinWidth;
	 		onresize=SetMinWidth;		
		}
 	}
 }
 
 
function SetMinWidth(){ 
	 var cw,w,pl,pr,ml,mr,br,bl,ad,theDiv=document.targetDiv;
	 var g=document.getElementById(theDiv);
	 w=parseInt(document.minWidth);
	 var iw = document.getElementById("inner_wrapper");
	 var mc = document.getElementById("maincontent");
	 if(g&&document.body&&document.body.clientWidth)
	 {
	 	gs=g.currentStyle;
	 	cw=parseInt(document.body.clientWidth);
		pl=parseInt(gs.paddingLeft);
	 	pr=parseInt(gs.paddingRight);
		ml=parseInt(gs.marginLeft);
		mr=parseInt(gs.marginRight);
	 	bl=parseInt(gs.borderLeftWidth);
		br=parseInt(gs.borderRightWidth);
		ml=ml?ml:0;
	 	mr=mr?mr:0;
		pl=pl?pl:0;
		pr=pr?pr:0;
		bl=bl?bl:0;
		br=br?br:0;
		ad=pl+pr+ml+mr+bl+br;
	 	if(cw<=w)
		{
			w-=ad;
			g.style.width=w+"px";
			iw.style.width=w+"px";
		}
		else
		{
		g.style.width="auto";
		iw.style.width="auto";
		}
	}
}

function lpn (obj)
{
	var names = ""
	for (var i in obj){
		names += i + " = " + obj[i] + "\t";
	}
	alert(names);
}


function closeWindow() 

{

window.open('','_parent','');

window.opener = window

window.close();

 

}

function MM_openBrWindow(theURL,winName,features) { 
 window.open(theURL,winName,features);
}



//-->




