//preload nav prefix variables
var pfsn;
var pfmn;
var pfsnmid;
//Side nav Prefix sn="side nav", im="image map nav"
pfsn="SN";

pfsnid ="S"
pfsnmid="M"

//Preload nav images and ImageMap image
for(c=0;c<9;c++)
{
eval(pfsn+c+" = new Image()")
eval(pfsn+c+".src = '../images/nav"+c+".jpg'")
}

//layer call
var IE;
var NS;
var NS6;
var DM;
var DocPre;
var DocPost;
var show;
var hide;
var TimeOut;

	if (document.all){
		 IE= true;
		 DocPre="document.all.";
		 DocPost=".style";
		 show="visible";
		 hide="hidden";
			}
	if (document.layers){
		 NS = true;
		 DocPre="document.layers.";
		 DocPost="";
		 show="show";
		 hide="hide";
		 }
	if (document.getElementById &&!IE) {
		 DM=true;
		 DocPre = "document.getElementById('";
		 DocPost = "').style";
		 show ="visible";
		 hide = "hidden";
		 }
	if (DM == true && navigator.appName =="Netscape"){ 
		 NS6 = true;
		 }
	
//Image Variables
var prevarea =0;
var previmg = 0;
var Timer;

var x=0
var y=0
	function startnavmouseover(img)
	{
	x=0;
	I = eval(DocPre + pfsnmid+ img + DocPost);
	eval("swap('"+pfsnid +img+"','"+pfsn+img+"','SN')");
	
	if (previmg != img && previmg != 0)
	{
		pI = eval(DocPre +pfsnmid+ previmg + DocPost);
		eval("swap('"+pfsnid +previmg+"','"+pfsn+previmg+"','SN')");
		pI.visibility = hide;
	}
	if (prevarea != 0)
	{
	 pIM = eval(DocPre +pfimmid+ prevarea + DocPost);
	 pIM.visibility = hide;
	}
	I.visibility = show;
	previmg = img;
	clearTimeout(Timer);
	return;
	}
	//stop mouse over behavior 
	function stopnavmouseover()
	{
		if (x<5) x++;
		else
		{
		pI = eval(DocPre + pfsnmid + previmg + DocPost);
		pI.visibility = hide;
		eval("swap('"+pfsnid+previmg+"','"+pfsn+previmg+"','SN')");
		x=0;
		}
	Timer = setTimeout("stopnavmouseover()",300)
		
	}
	function swap(previmage,newimage, layer)
{
if (layer=="") eval("document.images['"+ previmage + "'].src =" + newimage + ".src;");
else 
 {
  if (document.all) eval("document.images['" +previmage+ "'].src =" + newimage + ".src;");
  if (document.layers)  eval("document.layers."+layer+".document.images['" + previmage + "'].src = " + newimage + ".src;");
  if (!document.all && document.getElementById) eval("document.getElementById('" + previmage + "').src = " + newimage + ".src;");
 }
}

	//change background color
	function changebgcolor(item, color)
{
	if (document.getElementById)
	{
	temp = eval("document.getElementById('"+item+"')")
	temp.style.background = color
	}	
}

//Reset Timer
	function ResetTimer()
	{
	x=0
	y=0
	clearTimeout(Timer);
	}
