//browser detection

if (document.all) {n=0;ie=1;ns6=0;fShow="visible";fHide="hidden";}//ie
else if (document.getElementById){n=0;ie=0;ns6=1;fShow="";fHide="hidden";}//ns6
else if (document.layers) {n=1;ie=0;ns6=0;fShow="show";fHide="hide";}//ns4

//set absolute application path
appPath  = "http://www.rebelcreek.ca/";
//Initialize variables used in displaySubMenu function
rightX = 0;
leftY = 0;
leftX = 0;

//menu contents
function showToolbar(){
//addItem(id, text, hint, location, alternativeLocation);
	menu = new Menu();
	menu.addItem("rebelcreekgolfid", "Rebel Creek Golf", "Rebel Creek Golf",  null, null);
	menu.addItem("clubhouseandservicesid", "Clubhouse and Services", "Clubhouse and Services",  null, null);
	menu.addItem("golfacademyid", "Golf Academy", "Golf Academy",  null, null);	
	menu.addItem("feemembershipsleaguesid", "Fees, Memberships & Leagues", "Fees, Memberships & Leagues",  null, null);
	menu.addItem("corporategolfid", "Corporate Golf", "Corporate Golf",  null, null);
// addSubItem(idParent, text, hint, location);
if(navigator.platform =="MacPPC"){
	if (ie){	
		menu.addSubItem("rebelcreekgolfid", "Welcome", "Welcome", appPath + "RebelCreekGolf/Welcome.html",150,22);
		menu.addSubItem("rebelcreekgolfid", "Course Description", "Course Description",  appPath + "RebelCreekGolf/CourseDescription.html",150,22);
		menu.addSubItem("rebelcreekgolfid", "Events & Promotions", "Events & Promotions",  appPath + "RebelCreekGolf/Promotions.html",150,22);
		menu.addSubItem("rebelcreekgolfid", "Scorecard", "Scorecard",  appPath + "RebelCreekGolf/Scorecard.html",150,22);
		menu.addSubItem("rebelcreekgolfid", "Tournaments", "Tournaments",  appPath + "RebelCreekGolf/Tournaments.html",150,22);
		menu.addSubItem("rebelcreekgolfid", "About the Architect", "About the Architect",  appPath + "RebelCreekGolf/Architect.html",150,22);
		menu.addSubItem("rebelcreekgolfid", "Rebel Creek Policies", "Rebel Creek Policies",  appPath + "RebelCreekGolf/Policies.html",150,22);
	
		menu.addSubItem("clubhouseandservicesid", "Rebel Creek Clubhouse", "Rebel Creek Clubhouse",  appPath + "ClubhouseServices/Clubhouse.html",236,83);
		menu.addSubItem("clubhouseandservicesid", "Restaurant and Food Services", "Restaurant and Food Services",  appPath + "ClubhouseServices/RestaurantServices.html",236,83);
		menu.addSubItem("clubhouseandservicesid", "Banquet Facilities and Special Events", "Banquet Facilities and Special Events",  appPath + "ClubhouseServices/BanquetFacilities.html",236,83);
		
		menu.addSubItem("golfacademyid", "About Rebel Creek Golf Academy ", "About Rebel Creek Golf Academy ",  appPath +"GolfAcademy/AboutTheAcademy.html",221,109);
		menu.addSubItem("golfacademyid", "The Academy Facilities", "The Academy Facilities",  appPath +"GolfAcademy/Facilities.html",221,109);
		menu.addSubItem("golfacademyid", "Private and Group Instruction", "Private and Group Instruction",  appPath +"GolfAcademy/PrivateGroup.html",221,109);
		menu.addSubItem("golfacademyid", "Junior and Family Programs", "Junior and Family Programs",  appPath +"GolfAcademy/JuniorFamily.html",221,109);
		menu.addSubItem("golfacademyid", "Corporate and Group Programs", "Corporate and Group Programs",  appPath +"GolfAcademy/CorporateGroup.html",221,109);
		
		menu.addSubItem("feemembershipsleaguesid", "Green Fee Rates", "Green Fee Rates",  appPath +"Rates/Fees.html",207,0);
		menu.addSubItem("feemembershipsleaguesid", "Privileged Package Information", "Privileged Package Information",  appPath +"Rates/Packages.html",207,0);
		menu.addSubItem("feemembershipsleaguesid", "League Play", "League Play", appPath +"Rates/Leagues.html",207,0);
		
		menu.addSubItem("corporategolfid", "A Fresh View on Golf", "A Fresh View on Golf",  appPath +"CorporateGolf/AboutCorporateGolf.html",103,195);
		menu.addSubItem("corporategolfid", "Meeting Facilities", "Meeting Facilities",  appPath +"CorporateGolf/MeetingFacilities.html",103,195);
		menu.addSubItem("corporategolfid", "Rebel Creek Golf Academy", "Rebel Creek Golf Academy", appPath +"CorporateGolf/GolfAcademy.html",103,195);
		menu.addSubItem("corporategolfid", "Tournament Packages", "Tournament Packages",  appPath +"CorporateGolf/TournamentPackages.html",103,195);
		menu.addSubItem("corporategolfid", "Restaurant and Food Services", "Restaurant and Food Services",  appPath +"CorporateGolf/RestaurantServices.html",103,195);
	} else if (ns6){
		menu.addSubItem("rebelcreekgolfid", "Welcome", "Welcome", appPath + "RebelCreekGolf/Welcome.html",149,21);
		menu.addSubItem("rebelcreekgolfid", "Course Description", "Course Description",  appPath + "RebelCreekGolf/CourseDescription.html",149,21);
		menu.addSubItem("rebelcreekgolfid", "Events & Promotions", "Events & Promotions",  appPath + "RebelCreekGolf/Promotions.html",149,21);
		menu.addSubItem("rebelcreekgolfid", "Scorecard", "Scorecard",  appPath + "RebelCreekGolf/Scorecard.html",149,21);
		menu.addSubItem("rebelcreekgolfid", "Tournaments", "Tournaments",  appPath + "RebelCreekGolf/Tournaments.html",149,21);
		menu.addSubItem("rebelcreekgolfid", "About the Architect", "About the Architect",  appPath + "RebelCreekGolf/Architect.html",149,21);
		menu.addSubItem("rebelcreekgolfid", "Rebel Creek Policies", "Rebel Creek Policies",  appPath + "RebelCreekGolf/Policies.html",149,21);
	
		menu.addSubItem("clubhouseandservicesid", "Rebel Creek Clubhouse", "Rebel Creek Clubhouse",  appPath + "ClubhouseServices/Clubhouse.html",235,82);
		menu.addSubItem("clubhouseandservicesid", "Restaurant and Food Services", "Restaurant and Food Services",  appPath + "ClubhouseServices/RestaurantServices.html",235,82);
		menu.addSubItem("clubhouseandservicesid", "Banquet Facilities and Special Events", "Banquet Facilities and Special Events",  appPath + "ClubhouseServices/BanquetFacilities.html",235,82);
		
		menu.addSubItem("golfacademyid", "About Rebel Creek Golf Academy ", "About Rebel Creek Golf Academy ",  appPath +"GolfAcademy/AboutTheAcademy.html",220,108);
		menu.addSubItem("golfacademyid", "The Academy Facilities", "The Academy Facilities",  appPath +"GolfAcademy/Facilities.html",220,108);
		menu.addSubItem("golfacademyid", "Private and Group Instruction", "Private and Group Instruction",  appPath +"GolfAcademy/PrivateGroup.html",220,108);
		menu.addSubItem("golfacademyid", "Junior and Family Programs", "Junior and Family Programs",  appPath +"GolfAcademy/JuniorFamily.html",220,108);
		menu.addSubItem("golfacademyid", "Corporate and Group Programs", "Corporate and Group Programs",  appPath +"GolfAcademy/CorporateGroup.html",220,108);
		
		menu.addSubItem("feemembershipsleaguesid", "Green Fee Rates", "Green Fee Rates",  appPath +"Rates/Fees.html",204,0);
		menu.addSubItem("feemembershipsleaguesid", "Privileged Package Information", "Privileged Package Information",  appPath +"Rates/Packages.html",204,0);
		menu.addSubItem("feemembershipsleaguesid", "League Play", "League Play", appPath +"Rates/Leagues.html",204,0);
		
		menu.addSubItem("corporategolfid", "A Fresh View on Golf", "A Fresh View on Golf",  appPath +"CorporateGolf/AboutCorporateGolf.html",103,195);
		menu.addSubItem("corporategolfid", "Meeting Facilities", "Meeting Facilities",  appPath +"CorporateGolf/MeetingFacilities.html",103,195);
		menu.addSubItem("corporategolfid", "Rebel Creek Golf Academy", "Rebel Creek Golf Academy", appPath +"CorporateGolf/GolfAcademy.html",103,195);
		menu.addSubItem("corporategolfid", "Tournament Packages", "Tournament Packages",  appPath +"CorporateGolf/TournamentPackages.html",103,195);
		menu.addSubItem("corporategolfid", "Restaurant and Food Services", "Restaurant and Food Services",  appPath +"CorporateGolf/RestaurantServices.html",103,195);
	} else {
		menu.addSubItem("rebelcreekgolfid", "Welcome", "Welcome", appPath + "RebelCreekGolf/Welcome.html",150,22);
		menu.addSubItem("rebelcreekgolfid", "Course Description", "Course Description",  appPath + "RebelCreekGolf/CourseDescription.html",150,22);
		menu.addSubItem("rebelcreekgolfid", "Events & Promotions", "Events & Promotions",  appPath + "RebelCreekGolf/Promotions.html",150,22);
		menu.addSubItem("rebelcreekgolfid", "Scorecard", "Scorecard",  appPath + "RebelCreekGolf/Scorecard.html",150,22);
		menu.addSubItem("rebelcreekgolfid", "Tournaments", "Tournaments",  appPath + "RebelCreekGolf/Tournaments.html",150,22);
		menu.addSubItem("rebelcreekgolfid", "About the Architect", "About the Architect",  appPath + "RebelCreekGolf/Architect.html",150,22);
		menu.addSubItem("rebelcreekgolfid", "Rebel Creek Policies", "Rebel Creek Policies",  appPath + "RebelCreekGolf/Policies.html",150,22);
	
		menu.addSubItem("clubhouseandservicesid", "Rebel Creek Clubhouse", "Rebel Creek Clubhouse",  appPath + "ClubhouseServices/Clubhouse.html",236,83);
		menu.addSubItem("clubhouseandservicesid", "Restaurant and Food Services", "Restaurant and Food Services",  appPath + "ClubhouseServices/RestaurantServices.html",236,83);
		menu.addSubItem("clubhouseandservicesid", "Banquet Facilities and Special Events", "Banquet Facilities and Special Events",  appPath + "ClubhouseServices/BanquetFacilities.html",236,83);
		
		menu.addSubItem("golfacademyid", "About Rebel Creek Golf Academy ", "About Rebel Creek Golf Academy ",  appPath +"GolfAcademy/AboutTheAcademy.html",221,109);
		menu.addSubItem("golfacademyid", "The Academy Facilities", "The Academy Facilities",  appPath +"GolfAcademy/Facilities.html",221,109);
		menu.addSubItem("golfacademyid", "Private and Group Instruction", "Private and Group Instruction",  appPath +"GolfAcademy/PrivateGroup.html",221,109);
		menu.addSubItem("golfacademyid", "Junior and Family Programs", "Junior and Family Programs",  appPath +"GolfAcademy/JuniorFamily.html",221,109);
		menu.addSubItem("golfacademyid", "Corporate and Group Programs", "Corporate and Group Programs",  appPath +"GolfAcademy/CorporateGroup.html",221,109);
		
		menu.addSubItem("feemembershipsleaguesid", "Green Fee Rates", "Green Fee Rates",  appPath +"Rates/Fees.html",207,0);
		menu.addSubItem("feemembershipsleaguesid", "Privileged Package Information", "Privileged Package Information",  appPath +"Rates/Packages.html",207,0);
		menu.addSubItem("feemembershipsleaguesid", "League Play", "League Play", appPath +"Rates/Leagues.html",207,0);
		
		menu.addSubItem("corporategolfid", "A Fresh View on Golf", "A Fresh View on Golf",  appPath +"CorporateGolf/AboutCorporateGolf.html",103,195);
		menu.addSubItem("corporategolfid", "Meeting Facilities", "Meeting Facilities",  appPath +"CorporateGolf/MeetingFacilities.html",103,195);
		menu.addSubItem("corporategolfid", "Rebel Creek Golf Academy", "Rebel Creek Golf Academy", appPath +"CorporateGolf/GolfAcademy.html",103,195);
		menu.addSubItem("corporategolfid", "Tournament Packages", "Tournament Packages",  appPath +"CorporateGolf/TournamentPackages.html",103,195);
		menu.addSubItem("corporategolfid", "Restaurant and Food Services", "Restaurant and Food Services",  appPath +"CorporateGolf/RestaurantServices.html",103,195);
	}	
} else {
	if (ie){	
		menu.addSubItem("rebelcreekgolfid", "Welcome", "Welcome", appPath + "RebelCreekGolf/Welcome.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Course Description", "Course Description",  appPath + "RebelCreekGolf/CourseDescription.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Events & Promotions", "Events & Promotions",  appPath + "RebelCreekGolf/Promotions.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Scorecard", "Scorecard",  appPath + "RebelCreekGolf/Scorecard.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Tournaments", "Tournaments",  appPath + "RebelCreekGolf/Tournaments.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "About the Architect", "About the Architect",  appPath + "RebelCreekGolf/Architect.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Rebel Creek Policies", "Rebel Creek Policies",  appPath + "RebelCreekGolf/Policies.html",161,34);
	
		menu.addSubItem("clubhouseandservicesid", "Rebel Creek Clubhouse", "Rebel Creek Clubhouse",  appPath + "ClubhouseServices/Clubhouse.html",252,100);
		menu.addSubItem("clubhouseandservicesid", "Restaurant and Food Services", "Restaurant and Food Services",  appPath + "ClubhouseServices/RestaurantServices.html",252,100);
		menu.addSubItem("clubhouseandservicesid", "Banquet Facilities and Special Events", "Banquet Facilities and Special Events",  appPath + "ClubhouseServices/BanquetFacilities.html",252,100);
		
		menu.addSubItem("golfacademyid", "About Rebel Creek Golf Academy ", "About Rebel Creek Golf Academy ",  appPath +"GolfAcademy/AboutTheAcademy.html",232,121);
		menu.addSubItem("golfacademyid", "The Academy Facilities", "The Academy Facilities",  appPath +"GolfAcademy/Facilities.html",232,121);
		menu.addSubItem("golfacademyid", "Private and Group Instruction", "Private and Group Instruction",  appPath +"GolfAcademy/PrivateGroup.html",232,121);
		menu.addSubItem("golfacademyid", "Junior and Family Programs", "Junior and Family Programs",  appPath +"GolfAcademy/JuniorFamily.html",232,121);
		menu.addSubItem("golfacademyid", "Corporate and Group Programs", "Corporate and Group Programs",  appPath +"GolfAcademy/CorporateGroup.html",232,121);
		
		menu.addSubItem("feemembershipsleaguesid", "Green Fee Rates", "Green Fee Rates",  appPath +"Rates/Fees.html",222,0);
		menu.addSubItem("feemembershipsleaguesid", "Privileged Package Information", "Privileged Package Information",  appPath +"Rates/Packages.html",222,0);
		menu.addSubItem("feemembershipsleaguesid", "League Play", "League Play", appPath +"Rates/Leagues.html",222,0);
		
		menu.addSubItem("corporategolfid", "A Fresh View on Golf", "A Fresh View on Golf",  appPath +"CorporateGolf/AboutCorporateGolf.html",213,198);
		menu.addSubItem("corporategolfid", "Meeting Facilities", "Meeting Facilities",  appPath +"CorporateGolf/MeetingFacilities.html",213,198);
		menu.addSubItem("corporategolfid", "Rebel Creek Golf Academy", "Rebel Creek Golf Academy", appPath +"CorporateGolf/GolfAcademy.html",213,198);
		menu.addSubItem("corporategolfid", "Tournament Packages", "Tournament Packages",  appPath +"CorporateGolf/TournamentPackages.html",213,198);
		menu.addSubItem("corporategolfid", "Restaurant and Food Services", "Restaurant and Food Services",  appPath +"CorporateGolf/RestaurantServices.html",213,198);
	} else if (ns6){
		menu.addSubItem("rebelcreekgolfid", "Welcome", "Welcome", appPath + "RebelCreekGolf/Welcome.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Course Description", "Course Description",  appPath + "RebelCreekGolf/CourseDescription.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Events & Promotions", "Events & Promotions",  appPath + "RebelCreekGolf/Promotions.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Scorecard", "Scorecard",  appPath + "RebelCreekGolf/Scorecard.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Tournaments", "Tournaments",  appPath + "RebelCreekGolf/Tournaments.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "About the Architect", "About the Architect",  appPath + "RebelCreekGolf/Architect.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Rebel Creek Policies", "Rebel Creek Policies",  appPath + "RebelCreekGolf/Policies.html",161,34);
	
		menu.addSubItem("clubhouseandservicesid", "Rebel Creek Clubhouse", "Rebel Creek Clubhouse",  appPath + "ClubhouseServices/Clubhouse.html",252,100);
		menu.addSubItem("clubhouseandservicesid", "Restaurant and Food Services", "Restaurant and Food Services",  appPath + "ClubhouseServices/RestaurantServices.html",252,100);
		menu.addSubItem("clubhouseandservicesid", "Banquet Facilities and Special Events", "Banquet Facilities and Special Events",  appPath + "ClubhouseServices/BanquetFacilities.html",252,100);
		
		menu.addSubItem("golfacademyid", "About Rebel Creek Golf Academy ", "About Rebel Creek Golf Academy ",  appPath +"GolfAcademy/AboutTheAcademy.html",236,126);
		menu.addSubItem("golfacademyid", "The Academy Facilities", "The Academy Facilities",  appPath +"GolfAcademy/Facilities.html",236,126);
		menu.addSubItem("golfacademyid", "Private and Group Instruction", "Private and Group Instruction",  appPath +"GolfAcademy/PrivateGroup.html",236,126);
		menu.addSubItem("golfacademyid", "Junior and Family Programs", "Junior and Family Programs",  appPath +"GolfAcademy/JuniorFamily.html",236,126);
		menu.addSubItem("golfacademyid", "Corporate and Group Programs", "Corporate and Group Programs",  appPath +"GolfAcademy/CorporateGroup.html",236,126);
		
		menu.addSubItem("feemembershipsleaguesid", "Green Fee Rates", "Green Fee Rates",  appPath +"Rates/Fees.html",222,0);
		menu.addSubItem("feemembershipsleaguesid", "Privileged Package Information", "Privileged Package Information",  appPath +"Rates/Packages.html",222,0);
		menu.addSubItem("feemembershipsleaguesid", "League Play", "League Play", appPath +"Rates/Leagues.html",222,0);
		
		menu.addSubItem("corporategolfid", "A Fresh View on Golf", "A Fresh View on Golf",  appPath +"CorporateGolf/AboutCorporateGolf.html",213,198);
		menu.addSubItem("corporategolfid", "Meeting Facilities", "Meeting Facilities",  appPath +"CorporateGolf/MeetingFacilities.html",213,198);
		menu.addSubItem("corporategolfid", "Rebel Creek Golf Academy", "Rebel Creek Golf Academy", appPath +"CorporateGolf/GolfAcademy.html",213,198);
		menu.addSubItem("corporategolfid", "Tournament Packages", "Tournament Packages",  appPath +"CorporateGolf/TournamentPackages.html",213,198);
		menu.addSubItem("corporategolfid", "Restaurant and Food Services", "Restaurant and Food Services",  appPath +"CorporateGolf/RestaurantServices.html",213,198);
	} else {
		menu.addSubItem("rebelcreekgolfid", "Welcome", "Welcome", appPath + "RebelCreekGolf/Welcome.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Course Description", "Course Description",  appPath + "RebelCreekGolf/CourseDescription.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Events & Promotions", "Events & Promotions",  appPath + "RebelCreekGolf/Promotions.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Scorecard", "Scorecard",  appPath + "RebelCreekGolf/Scorecard.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Tournaments", "Tournaments",  appPath + "RebelCreekGolf/Tournaments.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "About the Architect", "About the Architect",  appPath + "RebelCreekGolf/Architect.html",161,34);
		menu.addSubItem("rebelcreekgolfid", "Rebel Creek Policies", "Rebel Creek Policies",  appPath + "RebelCreekGolf/Policies.html",161,34);
	
		menu.addSubItem("clubhouseandservicesid", "Rebel Creek Clubhouse", "Rebel Creek Clubhouse",  appPath + "ClubhouseServices/Clubhouse.html",252,100);
		menu.addSubItem("clubhouseandservicesid", "Restaurant and Food Services", "Restaurant and Food Services",  appPath + "ClubhouseServices/RestaurantServices.html",252,100);
		menu.addSubItem("clubhouseandservicesid", "Banquet Facilities and Special Events", "Banquet Facilities and Special Events",  appPath + "ClubhouseServices/BanquetFacilities.html",252,100);
		
		menu.addSubItem("golfacademyid", "About Rebel Creek Golf Academy ", "About Rebel Creek Golf Academy ",  appPath +"GolfAcademy/AboutTheAcademy.html",236,126);
		menu.addSubItem("golfacademyid", "The Academy Facilities", "The Academy Facilities",  appPath +"GolfAcademy/Facilities.html",236,126);
		menu.addSubItem("golfacademyid", "Private and Group Instruction", "Private and Group Instruction",  appPath +"GolfAcademy/PrivateGroup.html",236,126);
		menu.addSubItem("golfacademyid", "Junior and Family Programs", "Junior and Family Programs",  appPath +"GolfAcademy/JuniorFamily.html",236,126);
		menu.addSubItem("golfacademyid", "Corporate and Group Programs", "Corporate and Group Programs",  appPath +"GolfAcademy/CorporateGroup.html",236,126);
		
		menu.addSubItem("feemembershipsleaguesid", "Green Fee Rates", "Green Fee Rates",  appPath +"Rates/Fees.html",222,0);
		menu.addSubItem("feemembershipsleaguesid", "Privileged Package Information", "Privileged Package Information",  appPath +"Rates/Packages.html",222,0);
		menu.addSubItem("feemembershipsleaguesid", "League Play", "League Play", appPath +"Rates/Leagues.html",222,0);
		
		menu.addSubItem("corporategolfid", "A Fresh View on Golf", "A Fresh View on Golf",  appPath +"CorporateGolf/AboutCorporateGolf.html",213,198);
		menu.addSubItem("corporategolfid", "Meeting Facilities", "Meeting Facilities",  appPath +"CorporateGolf/MeetingFacilities.html",213,198);
		menu.addSubItem("corporategolfid", "Rebel Creek Golf Academy", "Rebel Creek Golf Academy", appPath +"CorporateGolf/GolfAcademy.html",213,198);
		menu.addSubItem("corporategolfid", "Tournament Packages", "Tournament Packages",  appPath +"CorporateGolf/TournamentPackages.html",213,198);
		menu.addSubItem("corporategolfid", "Restaurant and Food Services", "Restaurant and Food Services",  appPath +"CorporateGolf/RestaurantServices.html",213,198);
	}	
}	
	menu.showMenu();
}

//create the menu
function Menu(){
	this.addItem    = addItem;
	this.addSubItem = addSubItem;
	this.showMenu   = showMenu;
	this.bgColor     = "#62748A";	
	this.mainPaneBorder = 0;
	this.subMenuPaneBorder = 0;
	this.subMenuPaneWidth = 0;
	lastMenu = null;
	
	HTMLstr = "";
	HTMLstr += "<!-- MENU PANE DECLARATION BEGINS -->\n";
	HTMLstr += "\n";
	HTMLstr += "<div id='MainTable' z-index:1; style='position:absolute'>\n";
	HTMLstr += "<table width=0 height=0 cellpadding='0' onMouseOut='hideAll();' cellspacing='0' bgcolor='"+this.bgColor+"' border='"+this.mainPaneBorder+"'>\n";
	HTMLstr += "<tr>";
	if (n) HTMLstr += "<td> ";
	HTMLstr += "<!-- MAIN MENU STARTS -->\n";
	HTMLstr += "<!-- MAIN_MENU -->\n";
	HTMLstr += "<!-- MAIN MENU ENDS -->\n";
	if (n) HTMLstr += "</td>";
	HTMLstr += "</tr>\n";
	HTMLstr += "</table>\n";
	HTMLstr += "\n";
	HTMLstr += "<!-- SUB MENU STARTS -->\n";
	HTMLstr += "<!-- SUB_MENU -->\n";
	HTMLstr += "<!-- SUB MENU ENDS -->\n";
	HTMLstr += "\n";
 	HTMLstr+= "</div>\n";
	HTMLstr += "<!-- MENU PANE DECALARATION ENDS -->\n";
}

//add drop-down container
function addItem(idItem, text, hint, location, altLocation){
	var Lookup = "<!-- ITEM "+idItem+" -->";
	if (HTMLstr.indexOf(Lookup) != -1){
		alert(idParent + " already exist");
		return;
	}
	var MENUitem = "";
	MENUitem += "\n<!-- ITEM "+idItem+" -->\n";
	if (n){
		MENUitem += "<ilayer name="+idItem+">";
		MENUitem += "<a href='../prototype_nav.html' class=clsMenuItemNS onmouseover=\"displaySubMenu('"+idItem+"')\" onclick=\"return false;\">";
		MENUitem += "| ";
		MENUitem += text;
		MENUitem += "</a>";
		MENUitem += "</ilayer>";
	}
	else{//IE or NS6
		if(ie)
			MENUitem += "<td style='text-decoration: none; width:0; height:0; font-family: Verdana, Arial, Helvetica, sans-serif; color: white; cursor: hand;'>\n";
		if(ns6){
			MENUitem += "<td style='text-decoration: none; width:0; height:0; font-family: Verdana, Arial, Helvetica, sans-serif; color: white; cursor: hand;'>\n";
			}
		MENUitem += "<div id='"+idItem+"' z-index:2; style='position:relative; font: "+this.menuFont+";'>\n";
		MENUitem += "<a ";
		
		if(ie)
			MENUitem += "style='text-decoration: none; width:0; height:0; font-family: Verdana, Arial, Helvetica, sans-serif; color: white; cursor: hand;' ";
		if(ns6){
			MENUitem += "style='text-decoration: none; width:0; height:0; font-family: Verdana, Arial, Helvetica, sans-serif; color: white; cursor: hand;' ";
			}
		if (hint != null)
			MENUitem += "title='"+hint+"' ";
		if (location != null){
			MENUitem += "href='"+location+"' ";
			MENUitem += "onmouseover=\"hideAll()\" ";
		}
		else{
			if (altLocation != null)
				MENUitem += "href='"+altLocation+"' ";
			else
				MENUitem += "href='.' ";
			//MENUitem += "onmouseover=\"displaySubMenu('"+idItem+"')\" ";
			//MENUitem += "onclick=\"return false;\" "
		}
		MENUitem += ">";
		//MENUitem += text;
		MENUitem += "</a>\n";
		MENUitem += "</div>\n";
		MENUitem += "</td>\n";
	}
	MENUitem += "<!-- END OF ITEM "+idItem+" -->\n\n";
	MENUitem += "<!-- MAIN_MENU -->\n";

	HTMLstr = HTMLstr.replace("<!-- MAIN_MENU -->\n", MENUitem);
}


//add sub-menu items to applicable drop-down containor
function addSubItem(idParent, text, hint, location, iSizeSubMenu, iSize){
	var MENUitem = "";
	Lookup = "<!-- ITEM "+idParent+" -->";
	if (HTMLstr.indexOf(Lookup) == -1){
		alert(idParent + " not found");
		return;
	}
	Lookup = "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->";
	if (HTMLstr.indexOf(Lookup) == -1){
		if (n){
			MENUitem += "\n";
			MENUitem += "<layer id='"+idParent+"submenu' visibility=hide bgcolor='"+this.bgColor+"'>\n";
			MENUitem += "<table border='"+this.subMenuPaneBorder+"' bgcolor='"+this.bgColor+"' width="+this.subMenuPaneWidth+">\n";
			MENUitem += "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
			MENUitem += "</table>\n";
			MENUitem += "</layer>\n";
			MENUitem += "\n";
		}
		else{//IE or NS6
			MENUitem += "\n";
			MENUitem += "<div id='"+idParent+"submenu' z-index:3; style='position:absolute; background-color: "+this.bgColor+"; visibility: hidden; width: "+this.subMenuPaneWidth+"; top: -300;'>\n";
			MENUitem += "<table width='" + iSizeSubMenu + "' height='1' border='0' cellpadding='0' cellspacing='0'>"
  			if (idParent =='corporategolfid'){
				MENUitem += "<tr><td height='1' align='left' class='DropLayerBorderRight'><table height='1' width='" + iSize + "' border='0' cellpadding='0' cellspacing='0'>"
    	    	MENUitem += "<tr><td class='DropLayerBorderTopLeft'><img src='" + appPath +"images/spacer.gif' height='3'></td><td class='DropLayerBorderRight' width='100'></td></tr></table></td></tr></table>"
			}else{
	  			MENUitem += "<tr><td height='1' align='right' class='DropLayerBorderLeft'><table height='1' width='" + iSize + "' border='0' cellpadding='0' cellspacing='0'>"
    	    	MENUitem += "<tr><td class='DropLayerBorderTopRight'><img src='" + appPath +"images/spacer.gif' height='3'></td></tr></table></td></tr></table>"
			}	
			
			//MENUitem += "<table border='0' bgcolor='"+this.bgColor+"' width='250'>\n";
			//MENUitem += "<tr><td align='left' class='DropLayerBorderLeft'>&nbsp;</td><td align='right' class='DropLayerBorderTopRight' colspan='2'>&nbsp;</td></tr></table>";
			MENUitem += "<table class='CELLdropdownSHADOW' cellspacing='4' border='"+this.subMenuPaneBorder+"' bgcolor='"+this.bgColor+"' width="+iSize+">\n";
			//MENUitem += "<tr><td colspan='3' height='0'><img src='" + appPath +"images/spacer.gif' height='0'></td>";			
			MENUitem += "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
			
    		MENUitem += "<tr><td colspan='3' height='1'><img src='" + appPath +"images/spacer.gif' height='1'></td>";		
			MENUitem += "</table>\n";
			MENUitem += "</div>\n";
			MENUitem += "\n";
		}
		MENUitem += "<!-- SUB_MENU -->\n";
		HTMLstr = HTMLstr.replace("<!-- SUB_MENU -->\n", MENUitem);
	}

	Lookup = "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
	if (n)  MENUitem = "<tr><td><a class=clsMenuSubItemNS title='"+hint+"' href='../%22%2Blocation%2B%22'>"+text+"</a><br></td></tr>\n";
	else //IE or NS6
		if(ie){
			//MENUitem = "<tr><td><a class=MainNavDropLinks_IE title='"+hint+"' href='../%22%2Blocation%2B%22'>"+text+"</a><br></td></tr>\n";
			MENUitem = "<tr><td align='right' nowrap class='edgeLeftOnly'><img src='" + appPath + "images/spacer.gif' height='6'><img src='../images/dropBullet.gif' width='10' height='11'></td>";
			MENUitem += "<td nowrap height='11' valign='top' class=MainNavDropLinks_IE class='edgeTopOnly'><a class=MainNavDropLinks_IE title='"+hint+"' href='" + location + "'>"+text+"</a></td>";
      		MENUitem += "<td width =10 class='edgeTopRight'><img src='" + appPath + "images/spacer.gif' height='6'></td></tr>";
   	 		  }				
		if(ns6){
			//MENUitem = "<tr><td><a class=clsMenuSubItemNS6 title='"+hint+"' href='../%22%2Blocation%2B%22'>"+text+"</a><br></td></tr>\n";
			MENUitem = "<tr><td align='right' bgcolor='#62748A' nowrap class='edgeLeftOnly'><img src='" + appPath + "images/spacer.gif' height='6'><img src='../images/dropBullet.gif' width='10' height='11'></td>";
			MENUitem += "<td nowrap height='11' valign='top' class='MainNavDropLinks_NS6' class='edgeTopOnly'><a class='MainNavDropLinks_NS6' title='"+hint+"' href='" + location + "'>"+text+"</a></td>";
      		MENUitem += "<td width =10 bgcolor='#62748A' class='edgeTopRight'><img src='" + appPath + "images/spacer.gif' height='6'></td></tr>";
			   }
	MENUitem += Lookup;
	HTMLstr = HTMLstr.replace(Lookup, MENUitem);

}

//write out main menu bar
function showMenu(){
	document.writeln(HTMLstr);
}

//show submenu, and then calculate its x and y coordinates
//submenu.left = the left start point of the menu
//submenu.top = the Y distance between the menu and submenu
//leftY = the Y length of the submenu drop down
function displaySubMenu(idMainMenu){
	var menu;
	var submenu;
	if (n){
		submenu = document.layers[idMainMenu+"submenu"];
		if (lastMenu != null && lastMenu != submenu) hideAll();
		if (idMainMenu == 'rebelcreekgolfid'){
			submenu.left = 37;
			leftY = 285;
		} else if (idMainMenu =='clubhouseandservicesid'){
			submenu.left = 153;
			leftY = 232;
		} else if (idMainMenu =='golfacademyid'){
			submenu.left = 294;
			leftY = 265;
		} else if (idMainMenu =='feemembershipsleaguesid'){
			submenu.left = 393;
			leftY = 230;
		} else if (idMainMenu =='corporategolfid'){
			submenu.left = 500;
			leftY = 265;
		}
		submenu.top = 20;
		//submenu.left = document.layers[idMainMenu].pageX;
		//submenu.top  = document.layers[idMainMenu].pageY + document.layers[idMainMenu].clip.height;
		submenu.visibility = fShow;
		submenu.zIndex=10
		//leftX  = document.layers[idMainMenu+"submenu"].left;
		//rightX = leftX + document.layers[idMainMenu+"submenu"].clip.width;
		//leftY  = document.layers[idMainMenu+"submenu"].top+document.layers[idMainMenu+"submenu"].clip.height;
		leftX = submenu.style.left;
		rightX = leftX + 200;
		
//		alert ("n, leftX = " + leftX + ", rightX = " + rightX + ", leftY = " + leftY); 
	} else if (ns6) {
	
		menu = document.getElementById(idMainMenu);		
		submenu = document.getElementById(idMainMenu+"submenu");
		if (lastMenu != null && lastMenu != submenu) hideAll();
		if (idMainMenu == 'rebelcreekgolfid'){
			submenu.style.left = 37;
			leftY = 285;
		} else if (idMainMenu =='clubhouseandservicesid'){
			submenu.style.left = 153;
			leftY = 232;
		} else if (idMainMenu =='golfacademyid'){
			submenu.style.left = 294;
			leftY = 265;
		} else if (idMainMenu =='feemembershipsleaguesid'){
			submenu.style.left = 393;
			leftY = 230;
		} else if (idMainMenu =='corporategolfid'){
			submenu.style.left = 500;
			leftY = 265;
		}
		
		//submenu.style.left = calculateSumOffset(menu, 'offsetLeft');
		//submenu.style.top  = document.getElementById(idMainMenu).offsetHeight + 4;
		submenu.style.top = -8;
		submenu.style.visibility = fShow;
		//leftX  = calculateSumOffset(menu, 'offsetLeft');
		//rightX =leftX + document.getElementById(idMainMenu+"submenu").offsetWidth;
		//leftY  = document.getElementById(idMainMenu+"submenu").offsetHeight + window.pageYOffset + 4;
		leftX = submenu.style.left;
		rightX = leftX + 200;
		
		//alert ("ns6, leftX = " + leftX + ", rightX = " + rightX + ", leftY = " + leftY); 
	} else if (ie) { 
		menu = eval(idMainMenu);
		submenu = eval(idMainMenu+"submenu.style");
		if (lastMenu != null && lastMenu != submenu) hideAll();			
		if (idMainMenu == 'rebelcreekgolfid'){
			submenu.left = 37;
			leftY = 285;
		} else if (idMainMenu =='clubhouseandservicesid'){
			submenu.left = 153;
			leftY = 232;
		} else if (idMainMenu =='golfacademyid'){
			submenu.left = 294;
			leftY = 265;
		} else if (idMainMenu =='feemembershipsleaguesid'){
			submenu.left = 393;
			leftY = 230;
		} else if (idMainMenu =='corporategolfid'){
			submenu.left = 500;
			leftY = 265;
		}
		
		submenu.top = -8;
		//submenu.left = calculateSumOffset(menu, 'offsetLeft');
		//submenu.top  = document.getElementById(idMainMenu).offsetHeight + 4;
		submenu.visibility = fShow;
		leftX = submenu.left;
		rightX = leftX + 200;
		//leftY = 32;
		//leftX  = document.all[idMainMenu+"submenu"].style.posLeft;
		//rightX = leftX + document.all[idMainMenu+"submenu"].offsetWidth;
		//leftY  = document.all[idMainMenu+"submenu"].style.posTop+document.all[idMainMenu+"submenu"].offsetHeight + 4;
		
		//alert ('ie, leftX = ' + leftX + ', rightX = ' + rightX + ', leftY = ' + leftY + ', submenu.left=' + submenu.left + ',submenu.top=' + submenu.top + ',document.body.clientWidth=' + document.body.clientWidth);
		
	}
	lastMenu = submenu;
}

//hide the submenu
function hideAll(){
	if (ns6){
		if (lastMenu != null) 
			{lastMenu.style.visibility = fHide;}
			MM_swapImgRestore();
	}else{
		if (lastMenu != null) 
			{lastMenu.visibility = fHide;}
			MM_swapImgRestore();
	
	}		
}

//used to calculate position of a submenu
function calculateSumOffset(idItem, offsetName){
	var totalOffset = 0;
	var item = eval('idItem');
	do{
		totalOffset += eval('item.'+offsetName);
		item = eval('item.offsetParent');
	} while (item != null);
	return totalOffset;
}

//close menu on mouse out of menu containor
function updateIt(e){
	if (ns6){
		var x = e.pageX;
		var y = e.pageY;
		if (x > rightX || x < leftX) hideAll();
		else if (y > leftY) hideAll();
	}
	 else if (ie){
		var x = window.event.clientX;
		var y = window.event.clientY;
		if (x > rightX || x < leftX) hideAll();
		else if (y > leftY) hideAll();
	}
	else if (n){
		var x = e.pageX;
		var y = e.pageY;
		if (x > rightX || x < leftX) hideAll();
		else if (y > leftY) hideAll();
	}
}

//set page to hide menus on a mouse click or on mouseout of menu containor
if (ns6)
{
	document.body.onclick=hideAll;
	MM_swapImgRestore();
	document.body.onmousemove=updateIt;
}
else if (ie)
{
	//document.body.onclick=hideAll;
	//document.body.onscroll=hideAll;
	MM_swapImgRestore();
	//document.body.onmousemove=updateIt;
}
else if (n)
{
	document.onmousedown=hideAll;
	MM_swapImgRestore();
	window.captureEvents(Event.MOUSEMOVE);
	window.onmousemove=updateIt;
}

//change the background color of menu items
function changeMenuColor(ID){
	if (ID == 1){
		document.all('rebelcreekgolf').style.background="";
	} else if (ID==2){
		document.all('clubhouseandservices').style.background="";
	} else if (ID==3){
		document.all('golfacademy').style.background="";
	} else if (ID==4){
		document.all('feemembershipsleagues').style.background="";
	} else if (ID==5){

		document.all('corporategolf').style.background="";
	} 
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function changeiFramePhoto(txtPath,txtDescription){
		frames['iframePhoto'].location.href = txtPath;
		document.getElementById('photoText').innerHTML = txtDescription; 
}

function openPopup(strPath,iWidth,iHeight){
var w = 800, h = 600;

if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
}

var popW = iWidth, popH = iHeight;

var leftPos = (w-popW)/2, topPos = (h-popH)/2;
window.open(strPath,'test','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',scrollbars=yes, resizable=yes, location = no');
}

function openPopupVideo(strPath,iWidth,iHeight){
var w = 800, h = 600;

if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
}

var popW = iWidth, popH = iHeight;

var leftPos = (w-popW)/2, topPos = (h-popH)/2;
window.open(strPath,'test','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',scrollbars=no, resizable=yes, location = no');
}


function openPopupVideo(strPath,iWidth,iHeight){
var w = 800, h = 600;

if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
}

var popW = iWidth, popH = iHeight;

var leftPos = (w-popW)/2, topPos = (h-popH)/2;
window.open(strPath,'test','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',scrollbars=yes, status=yes, resizable=yes, location = yes');
}

function openPopupVideo(strPath,iWidth,iHeight){
var w = 728, h = 589;

if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
}

var popW = iWidth, popH = iHeight;

var leftPos = (w-popW)/2, topPos = (h-popH)/2;
window.open(strPath,'test','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',scrollbars=yes, status=yes, resizable=yes, toolbar=yes, location = yes');
}


function openPopupInnerVideo(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}