var SITE_ROOT_PATH	= "/";
var IMAGE_PATH		= SITE_ROOT_PATH + "images/";
var SPACER_IMAGE	= IMAGE_PATH + "spacer.gif";
var flashArg = "none";
var n, ie, n6, ob;
if (document.all) {
  ie = true;
}
else if (document.layers) {
  n = true;
}
else if (document.getElementById) {
  n6 = true;
}
else {
  ob = true;
}
function divDisplay (state, layerDiv)
{
	if (state == "on")
	{
		ieState = "visible"
		nState = "show"
		document.all["headMenuDiv"].style.zIndex = 9
	}
	else
	{
		ieState = "hidden"
		 nState = "hide"
	}
	if (n) 
	{
		if (typeof(document.layers[layerDiv]) == "object")
		{		
			document.layers[layerDiv].visibility = nState
		}
	}
	else if (ie || ob) 
	{
		if (typeof(document.all[layerDiv]) == "object")
		{
			document.all[layerDiv].style.visibility = ieState

		}
	}
	else if (n6) 
	{
		if (typeof(document.getElementById(layerDiv)) == "object")
		{
			document.getElementById(layerDiv).style.visibility = ieState		
		}
	}
}
function hideNavs()
{
	document.all["headMenuDiv"].style.zIndex = 2
	divDisplay ("off","navBottomTriggerDiv");
	divDisplay ("off","menu01Div");
	divDisplay ("off","menu02Div");
	divDisplay ("off","menu03Div");
	divDisplay ("off","menu04Div");
	divDisplay ("off","menu05Div");	
	divDisplay ("off","menu06Div");	
	divDisplay ("off","menu07Div");	
	divDisplay ("off","menu08Div");				
}
function bg(item,menu,color) {		
	if (n) {						
		var lyr =  eval('document.menu'+menu+'.document.Content'+menu+'.document.item'+menu+item)
		lyr.document.bgColor = color
	}
	else if (ie || ob) {					
		 document.all['item' + menu + item].style.backgroundColor = color
	}
	else if (n6) {	
		document.getElementById('item' + menu + item).style.backgroundColor = color		
	}	
}
function statusText(text)
{
	window.status=text;
	if (n6)
	{
		stat = window.status;
		stat=text;
	}
	return true;
}
function openWindow(handle, URL, top, left, width, height) 
{
	window.open(URL,handle,'toolbar=no,menubar=no,location=no,resizable=yes,width='+width+',height='+height+',top='+top+',left='+left)
}
function swapImage(name,state) 
{
    if (n)
    {
		eval("document.images['"+name+"'].src='/images/"+name+"_"+state+".gif'");
	}
    if (ie)
    {
		eval("document.images['"+name+"'].src='/images/"+name+"_"+state+".gif'");
    }
    if (n6)
    {
		img = document.images[name];
		img.src="/images/"+name+"_"+state+".gif";
	}
	if (ob)
	{
		eval("document.images['"+name+"'].src='/images/"+name+"_"+state+".gif'");	
	}
}	
function writeDate(objMonth, objDay, objYear, objDateField)
{
	var strMonth = objMonth.options[objMonth.selectedIndex].value;
	var strDay   = objDay.options[objDay.selectedIndex].value;
	var strYear  = objYear.options[objYear.selectedIndex].value;
 	var daysInMonth = getDaysInMonth(strMonth,strYear)
	if (daysInMonth < strDay)
	{
		alert("There are only "+daysInMonth+" days in the month you've selected.\n\nThe last day for the month and year you have selected will be chosen.");
		objDay.options[daysInMonth-1].selected = true;
		var strDate  = strMonth + "/" + daysInMonth + "/" + strYear;
		objDateField.value = strDate;
	}
	else
	{
		var strDate  = strMonth + "/" + strDay + "/" + strYear;
		objDateField.value = strDate;
	}
}
function readDate(objMonth, objDay, objYear, objDateField)
{
	var strDate = objDateField.value
	strMonth = strDate.substring(0,strDate.indexOf("/"));
	var offset = strDate.length-4;
	var strYear  = strDate.substring(offset,strDate.length);
	var strDay   = strDate.substring((strDate.indexOf("/") + 1),strDate.indexOf("/"+strYear));
	objMonth.options[strMonth-1].selected = true;
	objDay.options[strDay-1].selected = true;
	for (var i = 0; i < objYear.length; i++)
	{
		if (objYear.options[i].value == strYear)
		{
			objYear.options[i].selected = true;
		}
	}
}
function getDaysInMonth(month,year)
{
	var days;
	if (month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12)
	{
		days=31;
	}
	else if (month==4 || month==6 || month==9 || month==11)
	{
		days=30;
	}
	else if (month==2)
	{
		if (isLeapYear(year))
		{
			days=29;
		}
			else
		{
			days=28;
		}
	}
	return (days);
}
function isLeapYear (Year)
{
	if (((Year % 4)==0) && ((Year % 100)!=0) || ((Year % 400)==0))
	{
		return (true);
	}
	else
	{
		return (false);
	}
}