var brName=navigator.appName.substring(0,2), timer=0, lastid=-1;

function mShow(id){
	if(!((document.all)?document.all['m'+id]:document.getElementById('m'+id))) return;
	clearTimeout(timer);
	if((id!=lastid)&&(lastid!=-1)) ((document.all)?document.all['m'+lastid]:document.getElementById('m'+lastid)).style.display='none';
	hideElement('SELECT',document.getElementById('m'+lastid));
	lastid=id;
	((document.all)?document.all['m'+lastid]:document.getElementById('m'+lastid)).style.display='block';
}
function mHide(id){
	if(!((document.all)?document.all['m'+id]:document.getElementById('m'+id))) return;
	showElement('SELECT');
	timer=setTimeout("if('"+id+"'=='"+lastid+"'){((document.all)?document.all['m"+lastid+"']:document.getElementById('m"+lastid+"')).style.display='none';}", 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(brName!='Mi') 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.display='none';
	}
}
function showElement(elName){
	if(brName!='Mi') 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.display=='none') obj.style.display='block';
	}
}
