 var brname=navigator.appName, BrVer='';
if(brname.substring(0,2)=="Mi")
	BrVer='E';
var timer = 0;
lastid = -1;

function onSiteButtonOver()
{
document.getElementById('sitebtn').style.background = 'url(/images/f7stpnlbtn_a.gif) #5D98BA';
}
function onSiteButtonOut()
{
document.getElementById('sitebtn').style.background = 'url(/images/f7stpnlbtn.gif) #5D98BA';
hideSitePanel();
}

function showSitePanel()
{
	clearTimeout(timer);
	hideElement("SELECT", document.getElementById('sitepanelddn'));
	document.getElementById('sitepanelddn').style.visibility = 'visible';
}
function hideSitePanel()
{
	showElement("SELECT");
	timer = setTimeout("document.getElementById('sitepanelddn').style.visibility = 'hidden'", 500);
}

function showDdnMenu(id)
{
	if(!((document.all)?document.all['ddnmenu'+id]:document.getElementById('ddnmenu'+id)))
		return;
	clearTimeout(timer);
	if((id != lastid) && (lastid!=-1))
		{((document.all)?document.all['ddnmenu'+lastid]:document.getElementById('ddnmenu'+lastid)).style.visibility = 'hidden';
		if(lastid != curid) {
		document.getElementById('menutabl'+lastid).className = 'tab_l'; 
		document.getElementById('menutabc'+lastid).className = 'topmenu'; 
		document.getElementById('menutabr'+lastid).className = 'tab_r'; 
		document.getElementById('bordertopl').className = 'brdtop'; 
		document.getElementById('bordertopc').className = 'brdtop'; 
		document.getElementById('bordertopr').className = 'brdtop';
		document.getElementById('bordersidel').className = 'brdside';
		document.getElementById('bordersider').className = 'brdside';}
		}
	hideElement("SELECT", document.getElementById('ddnmenu'+lastid));
	lastid = id;
	((document.all)?document.all['ddnmenu'+lastid]:document.getElementById('ddnmenu'+lastid)).style.visibility = 'visible';
	if(id != curid)
	{document.getElementById('menutabl'+lastid).className = 'tab_la';
	document.getElementById('menutabc'+lastid).className = 'topmenua';
	document.getElementById('menutabr'+lastid).className = 'tab_ra';}
	document.getElementById('bordertopl').className = 'brdtopa';
	document.getElementById('bordertopc').className = 'brdtopa';
	document.getElementById('bordertopr').className = 'brdtopa';
	document.getElementById('bordersidel').className = 'brdsidea';
	document.getElementById('bordersider').className = 'brdsidea';
}

function hideDdnMenu(id)
{
	if(!((document.all)?document.all['ddnmenu'+id]:document.getElementById('ddnmenu'+id)))
		return;
	showElement("SELECT");
	sHide = "if('"+id+"' == '"+lastid+"'){((document.all)?document.all['ddnmenu"+lastid+"']:document.getElementById('ddnmenu"+lastid+"')).style.visibility = 'hidden';"
	if(id != curid) {
		sHide = sHide + "document.getElementById('menutabl'+lastid).className = 'tab_l'; document.getElementById('menutabc'+lastid).className = 'topmenu'; document.getElementById('menutabr'+lastid).className = 'tab_r'; "
		if(curid == -1) sHide = sHide + "document.getElementById('bordertopl').className = 'brdtop'; document.getElementById('bordertopc').className = 'brdtop'; document.getElementById('bordertopr').className = 'brdtop'; document.getElementById('bordersidel').className = 'brdside'; document.getElementById('bordersider').className = 'brdside';";
		}
	sHide = sHide + "};";
	timer = setTimeout(sHide, 500)
}


function GetPos(el)
{
	if (!el || !el.offsetParent)return false;
	var res=Array()
	res["left"] = el.offsetLeft;
	res["top"] = el.offsetTop;
	var objParent = el.offsetParent;
	while (objParent.tagName.toUpperCase()!="BODY")
	{
		res["left"] += objParent.offsetLeft;
		res["top"] += objParent.offsetTop;
		objParent = objParent.offsetParent;
	}
	res["right"]=res["left"]+el.offsetWidth;
	res["bottom"]=res["top"]+el.offsetHeight;
	return res;
}

function hideElement(elName, Menu)
{
	if(BrVer!='E') return;
	for (i = 0; i < document.all.tags(elName).length; i++)
	{
		Obj = document.all.tags(elName)[i];
		if(!(pMenu=GetPos(Menu)))continue;
		if(!(pObj=GetPos(Obj)))continue;

		if(pObj["left"]<pMenu["right"] && pMenu["left"]<pObj["right"] && pObj["top"]<pMenu["bottom"] && pMenu["top"]<pObj["bottom"])
			Obj.style.visibility = "hidden";
	}
}

function showElement(elName)
{
	if(BrVer!='E') return;
	for (i = 0; i < document.all.tags(elName).length; i++)
	{
		obj = document.all.tags(elName)[i];
		if (!obj || !obj.offsetParent)continue;
		if(obj.style.visibility=="hidden")
			obj.style.visibility = "visible";
	}
}
