//----- DROPDOWN NAV SCRIPT FOR IE -----//

navHover = function() {
	var lis = document.getElementById("navigation").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", navHover);



//----- ROTATING MASTHEAD IMAGE SCRIPT -----//

topImages=["marathon_florida_detox","detox","7_mile_bridge_marathon","fl_crisis_stabilization","florida_keys_mangrove","keys_crisis_stabilization"];

// GENERIC COOKIE SCRIPT (Next 3 functions)
function getCookieVal(offset) {
 var endstr=document.cookie.indexOf(";",offset);
 if (endstr==-1)
 endstr=document.cookie.length;
 return unescape(document.cookie.substring(offset,endstr));
}
function GetCookie(cname) {
 var arg=cname+"="; var alen=arg.length;
 var clen=document.cookie.length; var i=0;
 while (i<clen) {
	var j=i+alen;
	if (document.cookie.substring(i,j)==arg) return getCookieVal (j);		i=document.cookie.indexOf(" ",i)+ 1;
	if (i==0) break;
 } return null;
}
function SaveCookie(cname,cvalue,cdays,cpath) {
 ex=new Date; ex.setTime(ex.getTime()+(cdays*86400000));
 if (cpath == null) { cpath = "" } else { cpath= "; path="+cpath }
 document.cookie=cname+'='+cvalue+'; expires='+ex.toGMTString()+cpath;
}

function getImage() {
	seen=Number(GetCookie("seenImages")); 
	if (!seen || (seen>=topImages.length) ) { seen=0 }
	document.write("<img src='images/"+topImages[seen]+".jpg' width='225' height='155' border='0' align='right' class='rotatingImg'>");
	SaveCookie("seenImages",seen+1,365);
}


//----- DATE -----//
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000)
year = year + 1900;
//document.write("<center>" + lmonth + " ");
//document.write(date + ", " + year + "</center>");