var browserType = null
if( document.layers )   browserType="Netscape";
else if( document.all )	browserType="IE";
else if( document.getElementById ) browserType = "NS6";


///////////////////////////////////


function showMenu( strMenu ) {

        cancelWait(switchTimeout);

	if( browserType == "Netscape" ) {
		setMenuVisibility("document.layers[\"" + strMenu + "\"]","show")
	}
	else if( browserType == "IE" ) {
		setMenuVisibility("document.all[\"" + strMenu + "\"]","visible")
	}
	else if( browserType == "NS6" ) {
		setMenuVisibility(strMenu,'visible')
	}
}

function hideMenu( strMenu ) {

	if( browserType == "Netscape" ) {
		setMenuVisibility("document.layers[\"" + strMenu + "\"]","hide")
	}
	else if( browserType == "IE" ) {
		setMenuVisibility(document.all[strMenu],"hidden")
	}
	else if( browserType == "NS6" ) {
		setMenuVisibility(strMenu,'hidden')
	}	
}

/////////////////////////////////////

function setMenuVisibility( strMenuDiv, strNewMenuState ){
	var objMenuDiv;
	if( browserType == "Netscape")
	{
		objMenuDiv = eval(strMenuDiv);
  		if( objMenuDiv ) objMenuDiv.visibility = strNewMenuState;
	}
	else if( browserType == "IE" )
	{
		objMenuDiv=eval(strMenuDiv);
		if( objMenuDiv ) objMenuDiv.style.visibility = strNewMenuState;
	}
	else if( browserType == "NS6" )
	{
		objMenuDiv=eval("document.getElementById(\"" + strMenuDiv + "\")");
		if( objMenuDiv ){
		objMenuDiv.style.visibility = strNewMenuState;
		}
	}	
	else
	{
		return
	}
}

/////////////////////////////////////

var switchTimeout;
//wait then execute
function wait(_msecs, _menu) {
  if (switchTimeout != null) clearTimeout(switchTimeout);
  switchTimeout = setTimeout("hideMenu('" + _menu + "')",_msecs);
}

//cancel wait for a timeout
function cancelWait(_timeout) {
  if (_timeout != null || _timeout != ''){
    clearTimeout(_timeout);
    }
}

/////////////////////////////////////


 function imgOver(img, nav2){ 

   document[img].src= "images/nav/"+img+"_on.gif";
   var navimg = img+"_nav2";
   if(nav2)
     showMenu(nav2);

 }
 
 function imgOut(img, nav2){ 
   var imgsrc = document[img].src;
   if(section!=img)
     document[img].src= "images/nav/"+img+".gif";
  if(nav2)
     hideMenu(nav2);   
 }



 function getObj(){
   var oDiv = document.all
   if (document.all)
     oDiv = document.all.tags("div");
   else if (document.layers)
     oDiv = document.layers();
   else if (document.getElementById)
     oDiv = document.getElementsByTagName("div");
     
   return oDiv;
 }
 
function changeMenu (obj, newsection){
  var sec = obj.parent.section;
  obj.parent.document[sec].src= "images/nav/"+sec+".gif";
  obj.parent.section = newsection;
  obj.parent.document[newsection].src= "images/nav/"+newsection+"_on.gif";
}

function overSubMenu(obj, idx){
  if( browserType == "Netscape" ) {
    objMenuDiv = eval(obj);
    if( objMenuDiv ) objMenuDiv.backgroundColor = "#EBECEC";  
  }else if( browserType == "IE" ) {
    objMenuDiv=eval(obj);
    if( objMenuDiv ) objMenuDiv.style.backgroundColor = "#EBECEC";  
  }
  document["arr"+idx].src = "images/menu_arr.gif";
 }
 
 
function outSubMenu(obj, idx){
  if( browserType == "Netscape" ) {
    objMenuDiv = eval(obj);
    if( objMenuDiv ) objMenuDiv.backgroundColor = "#FFFFFF";  
  }else if( browserType == "IE" ) {
    objMenuDiv=eval(obj);
    if( objMenuDiv ) objMenuDiv.style.backgroundColor = "#FFFFFF";  
  }
  document["arr"+idx].src = "images/spacer.gif";
 }

var section = "home";
var onsecnav = false;

//////////MM EMAIL VALIDATION (off the old site)
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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}


DaysofWeek = new Array()

DaysofWeek[0]="Sunday"

DaysofWeek[1]="Monday"

DaysofWeek[2]="Tuesday"

DaysofWeek[3]="Wednesday"

DaysofWeek[4]="Thursday"

DaysofWeek[5]="Friday"

DaysofWeek[6]="Saturday"



Months = new Array()

Months[0]="January"

Months[1]="February"

Months[2]="March"

Months[3]="April"

Months[4]="May"

Months[5]="June"

Months[6]="July"

Months[7]="August"

Months[8]="September"

Months[9]="October"

Months[10]="November"

Months[11]="December"



function CurrDate()

{

    var d, s, hr, min;

    d = new Date();

    s = DaysofWeek[d.getDay()] + ", ";

    s += Months[d.getMonth()] + " ";

    s += d.getDate() + ", ";

    s += d.getFullYear() + "&nbsp;<span class='reg_pk'>&nbsp;</span>&nbsp;";

	

    hr = d.getHours();

    if (hr > 12)

        s += (hr - 12);

    else if (hr == 0)

        s += "12";

    else

        s += hr;

    min = d.getMinutes();

    s += ":" + (min < 10 ? "0" : "") + min;

    s += (hr > 11 ? " PM" : " AM");



    document.write(s);

}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized

  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}

MM_reloadPage(true);
