// JavaScript Document

function overmenuitem(obj)
{
	if(document.all)
	 obj.style.filter="alpha(opacity=80)";	
	else
	 obj.style.opacity="0.80";	
}

function outmenuitem(obj)
{
	if(document.all)
	 obj.style.filter="alpha(opacity=100)";	
	else
	 obj.style.opacity="1.0";	
}

////////////////////////////////////////////////////////////////////////

/////////////////// menu codes ////////////////
var mytimeout;
var lastdivshown="";
function showmenu(divname,e)
{
	
	var myEvent = window.event ? window.event : e;
	
	
	document.getElementById(divname).style.left=(myEvent.clientX-50)+"px";
	
	$("#"+divname).fadeIn("slow");
	
	if((lastdivshown!="")&&(lastdivshown!=divname))
	{
	 if(document.getElementById(lastdivshown).style.display!="none")
	 {$("#"+lastdivshown).fadeOut(100);}
	}
	lastdivshown=divname;
	clearTimeout(mytimeout);
}

function hidemenu()
{
//alert(lastdivshown);
$("#"+lastdivshown).fadeOut(100);
}

function overmenu(divname,obj)
{
obj.style.backgroundColor="#B40202";
obj.style.color="#ffffff";
clearTimeout(mytimeout);

}

function outmenu(divname,obj)
{
obj.style.backgroundColor="#ffffff";
obj.style.color="#000000";
mytimeout=setTimeout("hidemenu();",500);

}

function outmenu1(divname)
{
mytimeout=setTimeout("hidemenu();",500);
}

function overlink(obj)
{
obj.style.color="#C50102";
}

function outlink(obj)
{
obj.style.color="#666666";
}



////////////////////////////////////////////////////

// Flash showing script

function hideblocker()
{
	document.getElementById("map").style.display="none";
	document.getElementById("blocker").style.display="none";
}


function showflash(filename)
{
  //calculate page height - width  	   
  if(document.all)
	   {
	   document.getElementById("blocker").style.height=document.body.offsetHeight+"px";
	   document.getElementById("blocker").style.width=document.body.offsetWidth+"px";
	   }
	   else
	   {
	   document.getElementById("blocker").style.height=document.height+"px";
	   document.getElementById("blocker").style.width=document.width+"px";
	   }
	   document.getElementById("blocker").style.display="block";
	   

		// calculate mapbox position 
		if(document.all)
		{
		 var x=document.body.offsetWidth;
		 var y=screen.height;
		}
		else
		{
		 var x=document.width;
		 var y=screen.height;
		}
		var newx=(x-600)/2;
		var newy=(y-400)/2;
		//alert(newx+"x"+newy);
		
		document.getElementById("map").style.top=newy+"px";
		document.getElementById("map").style.left=newx+"px";
		document.getElementById("map").style.display="block";
		
		var ur="getfile.php?filename="+filename;
		fetchdata(ur,"map");
      

}


function GetXmlHttpObject()
{
  var xmlHttp=null;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  return xmlHttp;
}


function fetchdata(str,box)
{
 var obj=GetXmlHttpObject();
 obj.open("GET",str,true);
 obj.onreadystatechange=function f1()
  {
  if(obj.readyState==4)
   {
    var x=obj.responseText;
       //alert(x);
	   //document.getElementById(box).innerHTML=x;
	   //document.getElementById("map").style.display="none";
	   document.getElementById(box).innerHTML=x;
 	obj=null;
   }
   else
   {
    //document.getElementById("map").style.display="block";
	document.getElementById("map").innerHTML="loading...";
   }
  }
 obj.send(null);
}

