
var section;
var subsection;
var tertiary;

// Browser Sniffer
var sAgent = navigator.userAgent;
var mac = sAgent.indexOf("Mac") > -1;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var ns3 = (bName == "Netscape" && bVer == 3);
var ie3 = (bName == "Microsoft Internet Explorer" && bVer == 3);
var ns4 = (document.layers) ? true : false;
var ie4 = (document.all && !document.getElementById) ? true : false;
var ie5 = (document.all && document.getElementById) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;

// Size the Form field for the appropriate browser
if (ie3||ie4){ var formsize=12; } else { var formsize=10;}

function MM_findObj(n, d) { //v3.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); 
	return x;
}

/* Functions that swaps images. */
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_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 setCookie(name, value, expire) {   
	document.cookie = name + "=" + escape(value)   + ((expire == null) ? "" : ("; expires=" + expire.toGMTString())) + "; path=/"
}

function getCookie(Name) {   
	var search = Name + "="   
	if (document.cookie.length > 0) { // if there are any cookies      
		offset = document.cookie.indexOf(search)       
		if (offset != -1) { // if cookie exists          
			offset += search.length          // set index of beginning of value         
			end = document.cookie.indexOf(";", offset)          // set index of end of cookie value         
			if (end == -1)             
				end = document.cookie.length         
			return unescape(document.cookie.substring(offset, end))      
		}   
	}
	return "";
}


//URLs
var web_url = path + 'web/web.html';
var print_url = path + 'print/posters.html';
var guidance_url = path + 'guidance/guidance.html';
var contact_url = path + 'contact/contact.html';
var home_url = path + 'index.html';


if (section + "" == "undefined" || section == ""){ section = "" } 

section = section.toLowerCase();

// Determine section of site
var url = parent.location.href;
if (url.indexOf('') > -1) { 
	section  = 'home';	
}
if (url.indexOf('index.html') > -1) { 
	section  = 'home';	
}
if (url.indexOf('/'+'web'+'/') > -1) { 
	section   = 'web';
}
if (url.indexOf('/'+'print'+'/') > -1) { 
	section   = 'print';
}	
if (url.indexOf('/'+'guidance'+'/') > -1) { 
	section   = 'guidance';
}
if (url.indexOf('/'+'contact'+'/') > -1) { 
	section   = 'contact';
}	

// State for Sections
if (section == '') { state = 'nav'; } 
else { astate = 'nav' }

if (section == 'web') { dstate = 'navstate'; }
else { dstate = 'nav' }

if (section == 'print') { pstate = 'navstate'; }
else { pstate = 'nav' }

if (section == 'guidance') { estate = 'navstate'; }
else { estate = 'nav' }

if (section == 'contact') { gstate = 'navstate'; }
else { gstate = 'nav' }

if (section == 'home') { hstate = 'navstate'; }
else { hstate = 'nav' }

//preload Images
(new Image()).src = + path + 'images/nav/web-over.gif';
(new Image()).src = + path + 'images/nav/print-over.gif';
(new Image()).src = + path + 'images/nav/guidance-over.gif';
(new Image()).src = + path + 'images/nav/home.gif';

today=new Date();
thisyear=today.getFullYear();

// Navigation for All Pages
var navigation =
'<a href="' + home_url + '" class="'+ hstate +'" onmouseover="MM_swapImage(\'home\', 1, \'' + path + 'images/nav/home-over.jpg' + '\')" onmouseout= "MM_swapImgRestore();"><img src="' + path + 'images/nav/home' + (section=='home'?'-over':'') + '.jpg" width="48" height="24" alt="home" title="home" name="home" border="0"></a><a href="' + web_url + '" class="'+ dstate +'" onmouseover="MM_swapImage(\'web\', 1, \'' + path + 'images/nav/web-over.jpg' + '\')" onmouseout= "MM_swapImgRestore();"><img src="' + path + 'images/nav/web' + (section=='web'?'-over':'') + '.jpg" width="42" height="24" alt="web" title="web" name="web" border="0"></a><a href="' + print_url + '" class="'+ pstate +'" onmouseover="MM_swapImage(\'print\', 1, \'' + path + 'images/nav/print-over.jpg' + '\')" onmouseout= "MM_swapImgRestore();"><img src="' + path + 'images/nav/print' + (section=='print'?'-over':'') + '.jpg" width="48" height="24" alt="print" title="print" name="print" border="0"></a><a href="' + guidance_url + '" class="'+ estate +'" onmouseover="MM_swapImage(\'guidance\', 1, \'' + path + 'images/nav/guidance-over.jpg' + '\')" onmouseout= "MM_swapImgRestore();"><img src="' + path + 'images/nav/guidance' + (section=='guidance'?'-over':'') + '.jpg" width="78" height="24" alt="guidance" title="guidance" name="guidance" border="0"></a><a href="' + contact_url + '" class="'+ gstate +'" onmouseover="MM_swapImage(\'contact\', 1, \'' + path + 'images/nav/contact-over.jpg' + '\')" onmouseout= "MM_swapImgRestore();"><img src="' + path + 'images/nav/contact' + (section=='contact'?'-over':'') + '.jpg" width="68" height="24" alt="contact" title="contact" name="contact" border="0"></a>'
