function openwindow(url,w,h)
{

  var winwidth = screen.availWidth;
  var winheight = screen.availHeight;
  var leftt=Math.floor((winwidth/2)-(w/2));
  var topt=Math.floor((winheight/2)-(h/2));
  var neww=window.open(url,'popup','left='+leftt+',top='+topt+',width='+w+', height='+h+', toolbar=0,  location=0, directories=0,status=0, titlebar=0, menubar=0, resizable=1, scrollbars=1')
	if(window.focus) {neww.focus();}
};


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 request(params)
	{
		
			var xmlHttp;
		  xmlHttp=GetXmlHttpObject();
		  xmlHttp.open("GET",params,false);
  		xmlHttp.send(null);
			return xmlHttp.responseText;

	}
var nav_timeOut="";
var nav_curObj="";
function nav_showSubs(cur_obj,arr_subs,arr_subs_url)
{
	nav_clearSetNavHover(0);
	nav_curObj=cur_obj;
	nav_clearTimeOut();
	var id_name="nav_subs";
	if (document.getElementById(id_name)==null)
	{
		var fm_frame=document.createElement('div');//frame
		document.body.appendChild(fm_frame);
		fm_frame.id=id_name;
		fm_frame.style.position="absolute";	
		fm_frame.style.textAlign="center";	
		fm_frame.style.backgroundColor="#FFFFFF";	
	}		
	else	var fm_frame=document.getElementById(id_name);	
	fm_frame.innerHTML="";
	fm_frame.style.top=(fm_getOffsetTop(cur_obj)+cur_obj.offsetHeight)+"px";	
	fm_frame.style.left=fm_getOffsetLeft(cur_obj)+"px";
	fm_frame.style.width=cur_obj.offsetWidth+"px";	
	var cnt=0;
	for (x in arr_subs)
	{
		fm_frame.innerHTML+="<a	style='padding-left:5px;width:95%' onmouseover='nav_clearTimeOut()' onmouseout='nav_setTimeOut()' href='"+arr_subs_url[x]+"'>"+arr_subs[x]+"</a>";	
		cnt++
	}
	if (!cnt)	fm_frame.style.display="none";
	else fm_frame.style.display="block";	
	nav_clearSetNavHover(1);
}
function nav_setTimeOut()
{
	nav_timeOut = setTimeout(nav_closeSubs, 100);	
}
function nav_closeSubs()
{
	document.getElementById("nav_subs").style.display="none";	
	document.getElementById("nav_subs").innerHTML="";		
	nav_clearSetNavHover(0);
	nav_clearTimeOut();
}
//mode 0 clear navhover 1 set navhover
function nav_clearSetNavHover(mode)
{
	if (nav_curObj)
	{
		if (mode)
		{
			if (nav_curObj.id=="last_topnav")
				nav_curObj.style.backgroundImage="url(/images/right_tab_yellow.jpg)";
			else
			{
				nav_curObj.style.backgroundColor="#ffe368";
				nav_curObj.style.backgroundImage="none";
			}
			nav_curObj.style.color="#1c3f93";			
		}
		else
		{
			if (nav_curObj.id=="last_topnav")
				nav_curObj.style.backgroundImage="url(/images/right_tab.jpg)";
			else
				nav_curObj.style.backgroundImage="url(/images/nav_bg.jpg)";
			nav_curObj.style.color="#FFFFFF";
		}
	}
}
function nav_clearTimeOut()
{
	clearTimeout(nav_timeOut);
}
	