var p_Menu_Dir = 'ltr';
var ArrowIcon = new Image();
var aMenu;
ArrowIcon.src = 'http://www.israeline.com/images-cms/icon-arrow_ltr.gif';

		function fPopulateMenu(nMenuID, nSourceWidth){
			fHideMenu();
			var sContent = new String();
			var len = aMenu[nMenuID].length
			sContent = '<table border="0" cellspacing="0" cellpadding="0" style="">';
			for(var a = 0; a < len; a++){
				//sContent +=	'<tr><td height=1px bgcolor="#526194"><img src="../media/images/nothing.gif" height=1 width=1></td></tr>'
				sContent +=	'<tr><td style="padding-right:20px;cursor:hand" class="mainNavMenu" onmouseout="this.className=\'mainNavMenu\'" onmouseover="this.className=\'mainNavMenuOver\'" onclick="window.location.href=\''+aMenu[nMenuID][a][0]+'\'">' + aMenu[nMenuID][a][1]+'</td></tr>'
				if( a != len-1)
					sContent +=	'<tr><td height=1px bgcolor="#526194"><img src="../media/images/nothing.gif" height=1 width=1></td></tr>'
			}
			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 +=' nowrap>' + 
						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');
			
			//alert(oSource.height)
			oElement.style.visibility = 'hidden';
			oElement.innerHTML = fPopulateMenu(nMenuID, oSource.offsetWidth);
			
			oElement.style.left = fGetLeft(oSource) + oSource.offsetWidth - oElement.offsetWidth;
			oElement.style.left = fGetLeft(oSource);
			oElement.style.top = fGetTop(oSource) + oSource.offsetHeight-2;

			if(aMenu[nMenuID].length > 0){
				if(document.all.tblSubNav){
					document.all.tblSubNav.style.display = 'none';
				}
				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');
				oElement.style.visibility = 'hidden';
				oElement.innerHtml = '';
				if(document.all.tblSubNav){
					document.all.tblSubNav.style.display = 'block';
				}
			}
			
		}
		
		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="z-index:100;VISIBILITY: hidden; POSITION: absolute;" onmouseover="g_bMenuOn = true; g_bSubMenuOn = true;" onmouseout="g_bMenuOn = false; g_bSubMenuOn = false; fDelayedHide();"></div>')