//preload nav prefix variables
var pfsn;
var pfmn;
var pfim;
var pfsnmid;
var pfimmid;
//Side nav Prefix sn="side nav", im="image map nav"
pfsn="SN";
pfim ="Peace"
pfsnid ="S"
pfsnmid="M"
pfimmid="IM"

//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'")
}
eval(pfim +"= new Image()")
eval(pfim +".src = 'images/Peace1.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;");
 }
}

//stop mouse over behavior 
	function stopimapmouseover()
	{
		if (y<5) y++;
		else
		{
		pI = eval(DocPre + pfimmid + prevarea + DocPost);
		pI.visibility = hide;
		//eval("swap('"+pfim+1+"','"+pfim+"','IM')");
		y=0;
		}
	Timer = setTimeout("stopimapmouseover()",300)
		
	}
	function startimapmouseover(Area)
	{
	y=0;
	I = eval(DocPre + pfimmid + Area + DocPost);
	//eval("swap('"+pfim+1+"','"+ pfim +"','IM')");
	 
	if (prevarea != Area && prevarea != 0)
	{
		pI = eval(DocPre +pfimmid+ prevarea + DocPost);
		//eval("swap('"+pfim+"','"+pfim+1+"','IM')");
	  pI.visibility = hide;
	}
	if (previmg != 0)
	{
	 	pNI = eval(DocPre +pfsnmid+ previmg + DocPost);
 		pNI.visibility = hide;
	}
	I.visibility = show;
	prevarea = Area;
	clearTimeout(Timer);
	return;
	}
	
	//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);
	}
