var p_Menu_Dir = 'ltr';
var ArrowIcon = new Image();
ArrowIcon.src = 'http://www.israeline.com/images-cms/icon-arrow_ltr.gif';

var StrApplicationVersion = new String();
StrApplicationVersion = window.navigator.appVersion
var IE6 =(StrApplicationVersion.indexOf('MSIE 6.0')!=-1)?true:false;

		function fPopulateMenu(nMenuID, nSourceWidth){
			fHideMenu();
			var sContent = new String();
			sContent = '<table border=0 cellspacing=0 cellpadding=0 dir="'+p_Menu_Dir+'">';
			for(var a = 0; a < aMenu[nMenuID].length; a++){
				sContent += '<tr class="oMenuTd" onmouseout="this.className=\'oMenuTd\'" onmouseover="this.className=\'oMenuTdOnMouseOver\'" > ' +
				'<td class="oMenuItem" style="padding-right:8px;padding-left:8px;" '
				if(aMenu[nMenuID][a][0].length!=0){
					sContent += ' onClick="location.href=\'' + aMenu[nMenuID][a][0] + '\'" '
				}
				if(aMenu[nMenuID][a][2]){
					sContent += 'onmouseover="g_bSubMenuOn = true; fShowSubMenu(this, ' + nMenuID + ', ' + a + ')" ' +
						' >' + 
						aMenu[nMenuID][a][1] + '</td><td style="padding-left:4px;padding-right:4px;"><img SRC="'+ArrowIcon.src+'"></td></tr>\n';
				}else{
					sContent += '>' + 
						aMenu[nMenuID][a][1] + '</td><td></td></tr>\n';
				}
			}
			sContent += '</table>';
			return sContent;
		}
		
		function fPopulateSubMenu(oSource, nMenuID, nOptionID){
			fHideMenu();
			var sContent = new String();
			sContent = '<table width="100" dir="'+p_Menu_Dir+'" cellpadding=2 cellspacing=0>';
			if(aMenu[nMenuID][nOptionID][2]){
				for(var a = 0; a < aMenu[nMenuID][nOptionID][2].length; a++){
					sContent += '<tr><td  style="padding-right:8px;padding-left:8px;" class="oMenuTd" '
						if(aMenu[nMenuID][nOptionID][2][a][1].length!=0){
							sContent += ' onClick="location.href=\'' + aMenu[nMenuID][nOptionID][2][a][1] + '\'" ' +
										' onmouseover="this.className=\'oMenuTdOnMouseOver\'" ' +
										' onmouseout="this.className=\'oMenuTd\'"'							
						}
						sContent +='>' + 
						aMenu[nMenuID][nOptionID][2][a][0] + '</td></tr>\n';
				}
			}
			sContent += '</table>';
			return sContent;
		}
		
	function fShowMenu(oSource, nMenuID){
		g_bMenuOn = true;
		g_bSubMenuOn = false;

		var oElement = eval('document.all.oMenu');
		oElement.style.visibility = 'hidden';
		oElement.innerHTML = fPopulateMenu(nMenuID, oSource.offsetWidth);
		if(p_Menu_Dir=='rtl'){
			oElement.style.left = fGetLeft(oSource) + oSource.offsetWidth - oElement.offsetWidth;
		}else{
			oElement.style.left = fGetLeft(oSource)-9;
		}
		oElement.style.top = fGetTop(oSource) + oSource.offsetHeight+13;
		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 fShowSubMenu(oSource, nMenuID, nOptionID){
			g_bMenuOn = true;
			var oElement = eval('document.all.oSubMenu');
			oElement.style.visibility = 'hidden';
			oElement.innerHTML = fPopulateSubMenu(oSource, nMenuID, nOptionID);

			oElement.style.left = fGetLeft(oSource)+oSource.offsetWidth;
			//oElement.style.left = fGetLeft(oSource)+1;
			oElement.style.top = fGetTop(oSource)+1;
			if(aMenu[nMenuID].length > 0){
				oElement.style.visibility = 'visible';
			}
		}
		
		function fHideMenu(){
			if(!g_bMenuOn){
				var oElement = eval('document.all.oMenu');
				if(IE6){
					oElement.filters[0].Apply();
					oElement.style.visibility = 'hidden';
					oElement.filters[0].Play();
				}else{
					oElement.style.visibility = 'hidden';
				}
				oElement.innerHtml = '';
			}
			
			if(!g_bSubMenuOn){
				var oElement = eval('document.all.oSubMenu');
				oElement.style.visibility = 'hidden';
				oElement.innerHtml = '';
			}
		}
		
		function fDelayedHide(){
			setTimeout('fHideMenu()', 1000);
		}
		
		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));
		}


	document.write('<div id="oMenu" class="oMenuStyle" style="filter:progid:DXImageTransform.Microsoft.Fade(duration=0.4);progid:DXImageTransform.Microsoft.Alpha(opacity=85);z-index:100;VISIBILITY: hidden; POSITION: absolute;" onmouseover="g_bMenuOn = true;" onmouseout="g_bMenuOn = false; g_bSubMenuOn = false; fDelayedHide();"></div>')
	document.write('<div id="oSubMenu" class="oMenuStyle" style="z-index:100;VISIBILITY: hidden; POSITION: absolute;" onmouseover="g_bMenuOn = true; g_bSubMenuOn = true;" onmouseout="g_bMenuOn = false; g_bSubMenuOn = false; fDelayedHide();"></div>')