

// -------------------------------------------------------------------------------
// Called From: all of the pages that use the standard subnavigation
// Purpose: The page starts with two functions: PG_showSubNav and PG_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 PG_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 PG_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 PG_showSubNav(PG_subnav){
			
			var PG_nav;
			var PG_complete;
			
			PG_imgOn(PG_subnav);
			
			if(document.getElementById){
				PG_complete = "document.getElementById('" + PG_subnav + "Menu')";
			}
			else if(document.all){
				PG_complete = "document.all['" + PG_subnav + "Menu']";
			}
			
			PG_nav = eval(PG_complete);
				
			if (PG_nav){
				PG_nav.style.visibility = 'visible';	
			}
			
			PG_displaySelects( 'hidden' );
}

function PG_hideSubNav(PG_subnav){
		
			var PG_nav;
			var PG_complete;
			
			PG_imgOff(PG_subnav);
			
			if(document.getElementById){
				PG_complete = "document.getElementById('" + PG_subnav + "Menu')";
			}
			else if(document.all){
				PG_complete = "document.all['" + PG_subnav + "Menu']";
			}
			
			PG_nav = eval(PG_complete);
				
			if (PG_nav){
				PG_nav.style.visibility = 'hidden';	
			}
			
			PG_displaySelects( 'visible' );
}


if (document.images) {
			
			PG_pton = new Image();			 PG_pton.src="i/nav.pt_on.gif";
			PG_shopon = new Image();		 PG_shopon.src="i/nav.shop_on.gif";
			PG_recipon = new Image();			 PG_recipon.src="i/nav.recip_on.gif";
			PG_featon = new Image();			 PG_featon.src="i/nav.feat_on.gif";
			
			PG_ptoff = new Image();		 PG_ptoff.src="i/nav.pt_off.gif";
			PG_shopoff = new Image();		 PG_shopoff.src="i/nav.shop_off.gif";
			PG_recipoff = new Image();		 PG_recipoff.src="i/nav.recip_off.gif";
			PG_featoff = new Image();		 PG_featoff.src="i/nav.feat_off.gif";
		} 


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



var PG_arMenu = new Array();
		
		PG_arMenu[0] = new Array(
			"PG_pt",
			10,  // pixels from left
			115, // width of menu
			"In Israel","pg.tours.isr.html",
			"In USA","pg.tours.usa.html",
			"In Caribbean","pg.tours.crbb.html",
			"Worldwide","pg.tours.wrld.html"
			);

		PG_arMenu[1] = new Array(
			"PG_shop", 
			126, // pixels from left
			115, // width of menu
			"General","pg.shop.html",
			"Judaica","pg.shop.judaica.html",
			"Books","pg.shop.books.html",
			"Cosmetics","pg.shop.cosmetics.html",
			"Software","pg.shop.software.html"
			);

		PG_arMenu[2] = new Array(
			"PG_recip"
			);

		PG_arMenu[3] = new Array(
			"PG_feat"
			);
			

			

function PG_setUpMenus(PG_backcolor, PG_overcolor, PG_textcolor, PG_overtextcolor, PG_linecolor){
	if ((document.all) || (document.getElementById)){

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

	}
}


