var StrApplicationVersion = new String();
StrApplicationVersion = window.navigator.appVersion
var IE6 =(StrApplicationVersion.indexOf('MSIE 6.0')!=-1)?true:false;

var intTimer;
function fPopulateMenu(nMenuID, nSourceWidth){
	fHideMenu();
	var sContent = new String();		
	sContent = '<table  bgcolor="#000000" dir="'+lang_dir+'" cellpadding="5" cellspacing="0" width="' + nSourceWidth + '">';
	for(var a = 0; a < aMenu[nMenuID].length; a++){
		sContent += '<tr><td  align="left" class="MenuTitle" onmouseover="javascript:this.className=\'MenuTitleOn\';" onmouseout="javascript:this.className=\'MenuTitle\';"><a class="blue" href="./' + aMenu[nMenuID][a][0] + '">' + aMenu[nMenuID][a][1] + '</a></td></tr>\n';
	}
	sContent += '</table>';	
	return sContent;
}
		
function fShowMenu(oSource, nMenuID){
	g_bMenuOn = true;
	var oElement = eval('document.all.oMenu');
	oElement.style.visibility = 'hidden';
	oElement.innerHTML = fPopulateMenu(nMenuID, oSource.offsetWidth+1);
	
	if(lang_dir=='rtl'){	
		oElement.style.left = fGetLeft(oSource)+ oSource.offsetWidth - oElement.offsetWidth+s00;
	}else{
		oElement.style.left = fGetLeft(oSource);
	}
	
	oElement.style.top = fGetTop(oSource) + oSource.offsetHeight-5;

	if(aMenu[nMenuID].length > 0){
				if(IE6){
				oElement.filters[0].Apply();
				oElement.style.visibility = 'visible';
				oElement.filters[0].Play();
			}else{
				oElement.style.visibility = 'visible';
			}
	}
}
		
function fHideMenu(){
	if(!g_bMenuOn){
		var oElement = eval('document.all.oMenu');
		oElement.style.visibility = 'visible';
		if(IE6){
				oElement.filters[0].Apply();
				oElement.style.visibility = 'hidden';
				oElement.filters[0].Play();
			}else{
				oElement.style.visibility = 'hidden';
			}
		oElement.innerHtml = '';
	}
}
		
function fDelayedHide(){
	clearTimeout(intTimer);
	if(!g_bMenuOn){
		intTimer = setTimeout('fHideMenu()', 300);
	}
}
		
function fGetLeft(obj){
   return(obj.offsetParent==null ? obj.offsetLeft : obj.offsetLeft+fGetLeft(obj.offsetParent));
}

function fGetTop(obj){
   return(obj.offsetParent==null ? obj.offsetTop : obj.offsetTop+fGetTop(obj.offsetParent));
}

function fGetWidth(obj){
   return(obj.offsetWidth);

}
