

// -------------------------------------------------------------------------------
// Called From: all of the pages that use the standard subnavigation
// Purpose: The page starts with two functions: AV_showSubNav and AV_hideSubNav.  Each 
//			function takes in the object name of the menu. 
//			Depending on the function called and the browser being used, 
//			the visibility state of the dropdown menu is altered using the 
//			appropriate DOM.
//
//			The page then preloads all of the images that will be used in the  
//			horizontal navigation bar.
//
//          The page then loads all of the subnavigation text into each dropdown menu.  
//			Each array consists of the array name, the location of the dropdown menu 
//			(pixels from the left), and the width of the menu.  This is followed by 
//			a varying number of text links and the address (URL) of each link.
//
//			The function AV_setUpMenus then creates the dropdown menu using the information  
//			from the arrays.  This function takes 5 parameters: the background color of 
//          the menu, the rollover background color of the menu, the text color of 
//          the menu, the rollover text color, and the color of the line separating 
//          each link in the menu.   
// --------------------------------------------------------------------------------

function AV_displaySelects( selectVisibility ) {
	for ( var i = 0; i < document.forms.length; i++ ) {
		for ( var j = 0; j < document.forms[i].elements.length; j++ ) {
			if ( document.forms[i].elements[j].type.indexOf( "select" ) != -1 ) {
				document.forms[i].elements[j].style.visibility = selectVisibility;
			}
		}
	}
}

function AV_showSubNav(AV_subnav){
			
			var AV_nav;
			var AV_complete;
			
			AV_imgOn(AV_subnav);
			
			if(document.getElementById){
				AV_complete = "document.getElementById('" + AV_subnav + "Menu')";
			}
			else if(document.all){
				AV_complete = "document.all['" + AV_subnav + "Menu']";
			}
			
			AV_nav = eval(AV_complete);
				
			if (AV_nav){
				AV_nav.style.visibility = 'visible';	
			}
			
			AV_displaySelects( 'hidden' );
}

function AV_hideSubNav(AV_subnav){
		
			var AV_nav;
			var AV_complete;
			
			AV_imgOff(AV_subnav);
			
			if(document.getElementById){
				AV_complete = "document.getElementById('" + AV_subnav + "Menu')";
			}
			else if(document.all){
				AV_complete = "document.all['" + AV_subnav + "Menu']";
			}
			
			AV_nav = eval(AV_complete);
				
			if (AV_nav){
				AV_nav.style.visibility = 'hidden';	
			}
			
			AV_displaySelects( 'visible' );
}


if (document.images) {
			
			AV_allcaton = new Image();			 AV_allcaton.src="shared/i/nav/nav.list_on.gif";
			
			AV_allcatoff = new Image();		 AV_allcatoff.src="shared/i/nav/nav.list_off.gif";
		} 


		<!-- Adds a suffix onto the image name so that the program calls the on state of the image -->
		function AV_imgOn(iname) {
			if (document.images) {
				document[iname].src = eval(iname + "on.src");
			}
		}

		<!-- Adds a suffix onto the image name so that the program calls the off state of the image -->
		function AV_imgOff(iname) {
			if (document.images) {
				document[iname].src = eval(iname + "off.src");
			}
		}
		



var AV_arMenu = new Array();
		
		AV_arMenu[0] = new Array(
			"AV_allcat",
			541,  // pixels from left
			130, // width of menu
			"Aliya","aliyah.html",
			"Business","employment.html",
			"Emergency","emergency.html",
			"Health","health.html",
			"Leisure","entertainment.html",
			"Red Tape", "redtape.html",
			"FULL LISTINGS", "listings.html"
			);
			

			

function AV_setUpMenus(AV_backcolor, AV_overcolor, AV_textcolor, AV_overtextcolor, AV_linecolor){
	if ((document.all) || (document.getElementById)){

	var AV_subnav = "";
			
			for (j = 0; j < AV_arMenu.length; j++){
				AV_subnav += "<DIV ID=\"" + AV_arMenu[j][0] + "Menu\" style=\"z-index:999;position: absolute; left: " + AV_arMenu[j][1] + "; width: " + AV_arMenu[j][2] + ";  visibility: hidden\" onmouseover=\"AV_showSubNav('" + AV_arMenu[j][0] + "');\" onmouseout=\"AV_hideSubNav('" + AV_arMenu[j][0] + "');\">";
					AV_subnav += "<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\" WIDTH=\"" + AV_arMenu[j][2] + "\">";
						
						for (i=3; i < AV_arMenu[j].length-1; i=i+2){
							AV_subnav += "<TR>";
								AV_subnav += "<TD WIDTH=\"1\" BGCOLOR=\"#000000\"><IMG SRC=\"http://static.jpost.com/images/2002/site/pixel.gif\" WIDTH=\"1\" HEIGHT=\"22\"></TD>";
								AV_subnav += "<TD WIDTH=\"6\" BGCOLOR=\"#CC0033\" CLASS=\"avNavSide\"><IMG SRC=\"http://static.jpost.com/images/2002/site/pixel.gif\" WIDTH=\"6\" HEIGHT=\"22\"></TD>";
								if( document.isRemoteHosted == 'local' ) {
									AV_subnav += "<TD WIDTH=\"108\" BGCOLOR=\"" + AV_backcolor + "\" class=\"avNavMenu\" onClick=\"if (typeof P_popupoff != 'undefined') P_popupoff();document.location.href='" + AV_arMenu[j][i+1] + "'\" onmouseover=\"this.bgColor='" + AV_overcolor + "';this.style.color='" + AV_overtextcolor+ "';\" onmouseout=\"this.bgColor='" + AV_backcolor + "';this.style.color='" + AV_textcolor + "'\" style=\"color: " + AV_textcolor + "\"><DIV STYLE=\"padding-left:12px;\">" + AV_arMenu[j][i] + "</a></DIV></td>";
								} else if ( !(IsRelativeURL( AV_arMenu[j][i+1] )) ) {
									AV_subnav += "<TD WIDTH=\"108\" BGCOLOR=\"" + AV_backcolor + "\" class=\"avNavMenu\" onClick=\"if (typeof P_popupoff != 'undefined') P_popupoff();document.location.href='http://info.jpost.com/C004/Supplements/PASSOVER.GUIDE/" + AV_arMenu[j][i+1] + "'\" onmouseover=\"this.bgColor='" + AV_overcolor + "';this.style.color='" + AV_overtextcolor+ "';\" onmouseout=\"this.bgColor='" + AV_backcolor + "';this.style.color='" + AV_textcolor + "'\" style=\"color: " + AV_textcolor + "\"><DIV STYLE=\"padding-left:12px;\">" + AV_arMenu[j][i] + "</a></DIV></td>";
								} else {
									AV_subnav += "<TD WIDTH=\"108\" BGCOLOR=\"" + AV_backcolor + "\" class=\"avNavMenu\" onClick=\"if (typeof P_popupoff != 'undefined') P_popupoff();document.location.href='http://info.jpost.com/C004/Supplements/PASSOVER.GUIDE/" + AV_arMenu[j][i+1] + "'\" onmouseover=\"this.bgColor='" + AV_overcolor + "';this.style.color='" + AV_overtextcolor+ "';\" onmouseout=\"this.bgColor='" + AV_backcolor + "';this.style.color='" + AV_textcolor + "'\" style=\"color: " + AV_textcolor + "\"><DIV STYLE=\"padding-left:12px;\">" + AV_arMenu[j][i] + "</a></DIV></td>";
								}
								AV_subnav += "<TD WIDTH=\"1\" BGCOLOR=\"#000000\"><IMG SRC=\"http://static.jpost.com/images/2002/site/pixel.gif\" WIDTH=\"1\" HEIGHT=\"22\"></TD>";
							AV_subnav += "</TR>";
							AV_subnav += "<TR>";
								AV_subnav += "<TD COLSPAN=\"3\" BGCOLOR=\"" + AV_linecolor + "\" height=\"1\"><IMG SRC=\"http://static.jpost.com/images/2002/site/pixel.gif\" WIDTH=\"1\" HEIGHT=\"1\"></td>";
							AV_subnav += "</TR>";
						}
						
					AV_subnav += "</table>";
				AV_subnav += "</div>";
			}
			
	document.write(AV_subnav);

	}
}

