
d.write('			<table class = "navSubMastheadTable" height = "90" cellpadding="0" cellspacing="0">');
d.write('		<FORM name = "searchform" ACTION = "'+baseHrefURL+'/common/scripts/search.htm" METHOD = "POST" target = "_parent">');

d.write('				<tr>');
d.write('				<td class = "subMastHead">');
d.write('					&nbsp;<INPUT TYPE = "text" NAME = "recherche" SIZE = "10" value = "enter city" class = "searchbox" onClick = "CheckCity();" />&nbsp;');
d.write('					<INPUT type= "image" name = "submitCitySearch" src = "'+baseHrefURL+'/common/images/YellowArrowRight.gif" border = "0" /></a>');

d.write('				</td></tr>');
d.write('				<tr>');
d.write('				<td class = "subMastHead">');
d.write('					<IMG src = "'+baseHrefURL+'/images/spacer.gif" width = "110" height = "1" hspace = "0" vspace = "3">');
d.write('				</td>');
d.write('				</tr>');
d.write('				<tr>');
d.write('				<td class = "subMastHead" valign = "top">');

d.write('					&nbsp;<a href = "'+baseHrefURL+'/weather/cities/indexcan.htm" target = "_parent"><span class = "subMastheadLinkMenu">Canadian Cities</a>');
d.write('				</td>');
d.write('				</tr>');

d.write('				<tr>');
d.write('				<td class = "subMastHead">');
d.write('					<img src = "'+baseHrefURL+'/images/lightBlueMenuBorder.gif width = "110" height = "1" hspace = "0" vspace = "3">');
d.write('				</td>');
d.write('				</tr>');


d.write('				<tr>');
d.write('				<td class = "subMastHead" valign = "top">');
d.write('					&nbsp;<a href = "'+baseHrefURL+'/weather/cities/indexusa.htm" target = "_parent"><span class = "subMastheadLinkMenu">U.S. Cities</a>');
d.write('				</td>');
d.write('				</tr>');

d.write('				<tr>');
d.write('				<td class = "subMastHead">');
d.write('					<img src = "'+baseHrefURL+'/images/lightBlueMenuBorder.gif width = "110" height = "1" hspace = "0" vspace = "3">');
d.write('				</td>');
d.write('				</tr>');


d.write('				<tr>');
d.write('				<td class = "subMastHead" valign = "top" height = "20">');
d.write('					&nbsp;<a href = "'+baseHrefURL+'/weather/cities/indexintl.htm" target = "_parent"><span class = "subMastheadLinkMenu">International Cities</a>');
d.write('				</td>');
d.write('				</form>');
d.write('				</tr>');


d.write('		</table>');

// Switch that variable to "false" to bypass the call to the server-side perl script
var enableDynamicNavigation = true;


//	buildMenu = false;
	d.write('<scr'+'ipt type="text/javascript" src="http://www.theweathernetwork.com/common/ssidata/profiles/XXXXXXXX.js"></scr'+'ipt>');
	codePlace = "XXXXXXXX";
	//d.write(codePlace);

buildMenu=true;
// If no profile found, don't show the menu.
if (typeof featureAIR == "undefined") {
	buildMenu = false;
	featureAIR = 0;	featureALM = 0;	featureBUG = 0;	featureCLM = 0;
	featureFZN = 0;	featureGLF = 0;	featurePRK = 0;	featureOBS = 0;
	featurePOL = 0;	featureSKI = 0;	featureUVB = 0;
}

if (featureALM == 0 && featureCLM == 0 && featureOBS == 0 && featureGLF == 0 && featurePRK == 0 && 
    featurePOL == 0 && featureAIR == 0 && featureBUG == 0 && featureUVB == 0 && featureFZN == 0)




// Load the "switches" for what to display by "section (area)".
//d.write('<scr'+'ipt type="text/javascript" src="'+baseHrefURL+'/common/ssidata/profiles/switch'+area+'.js"></scr'+'ipt>');

var cookieValue="";
		function createCookie(name,value,days)
		{
			if (days)
			{
				var date = new Date();
				date.setTime(date.getTime()+(days*24*60*60*1000));
				var expires = "; expires="+date.toGMTString();
			}
			else var expires = "";
			document.cookie = name+"="+value+expires+"; path=/";
		}
		function readCookie(name)
		{
			var nameEQ = name + "=";
			var ca = document.cookie.split(';');
			for(var i=0;i < ca.length;i++)
			{
				var c = ca[i];
				while (c.charAt(0)==' ') c = c.substring(1,c.length);
				if (c.indexOf(nameEQ) == 0) cookieValue = c.substring(nameEQ.length,c.length);
			}
			
			
		}

		function eraseCookie(name)
		{
			createCookie(name,"",-1);
		}

		function test(name)
		{
			readCookie(name)
			if(cookieValue=="")
				{
					
					createCookie(name,codePlace,"2")
					readCookie(name)
					
				}
				
		}
if(codePlace != "XXXXXXXX") { test("codePlace"); }
var buildMenu = true;
// Ensure that important variable are defined, if not set a default value to it.
if (typeof codePlace == "undefined") { codePlace = "XXXX0000"; }
if (typeof enableDynamicNavigation == "undefined") { enableDynamicNavigation = true; }

var validCodePlace = false;
if (codePlace != "XXXX0000" && codePlace != "nil" && codePlace != "XXXXXXXX" && codePlace != "") { validCodePlace = true; }

// Extract country and province code, use the more appropriate as "sectorOfProfile".
var sectorOfProfile;
var areaOfProfile;
if (validCodePlace == true) {
	// Extract Country/Province informations from codePlace
	var countryCode  = codePlace.substring(0,2);
	var provinceCode = codePlace.substring(2,4);

	// Switch old prinvince code NF to the new NL.
	if (provinceCode == "NF") { provinceCode = "NL"; }

	// If it's Canada or USA, use provinceCode as sector, for intl use countryCode as sector.
	if (countryCode == "CA" || provinceCode == "US" ) { sectorOfProfile = provinceCode; }
	else { sectorOfProfile = countryCode; }
	// Define the name of the area, based on the country Code.
	switch (countryCode) {
		case "CA": areaOfProfile = "can"; break;
		case "US": areaOfProfile = "usa"; break;
		default  : areaOfProfile = "intl";
	}
}

/*
	addToMenu()
	featureProfile    = What has been profiled for the feature. If it starts with an "*" 
					    it means it while need the dynIndex script (Multiple choices profiled)
	menuLevel         = 0:Weather, 1:Travel, 2:Roads, 3:Home & Garden, 4:Activities, 5:Health & Environment
	menuItemName      = Name to show on the rightEnd menu.
	menuItemURLSingle = URL to use in case the feature has a single station.
	menuItemURLNone   = Generic URL to use if nothing has been profiled.
*/
function addToMenu(featureProfile, menuLevel, menuItemName, menuItemURLSingle, menuItemURLNone) {
	
	//alert(featureProfile+"***"+menuLevel+"***"+menuItemName+"***"+menuItemURLSingle+"***"+menuItemURLNone);
	CityMenu[menuLevel] = CityMenu[menuLevel].concat(menuItemName);
	// If feature is profiled (!= 0)
	if (featureProfile != 0 && enableDynamicNavigation == true) {
		// If feature has multiple stations for the profile
		if (featureProfile.substring(0,1) == "*") {
			CityMenuLink[menuLevel] = CityMenuLink[menuLevel].concat(featureProfile);
		// if feature has only on station for the profile
		} else {
			CityMenuLink[menuLevel] = CityMenuLink[menuLevel].concat(menuItemURLSingle);
		}
	// If nothing has been profiled, use the generic link.
	} else {
		// If there's a valide codePlace, add it the URL link to pass it to the next page.
		if (validCodePlace == true) { 
			if ((featureProfile!="map") || (featureProfile!="turin")) {
				menuItemURLNone = menuItemURLNone + "?" + codePlace;
			}
		}
		CityMenuLink[menuLevel] = CityMenuLink[menuLevel].concat(menuItemURLNone);
	}
}

CityTitle    = new Array("<a href='"+baseHrefURL+"/weather/index.htm' class = 'leftMenuTitle'>Weather</a>","<a href='"+baseHrefURL+"/travel/index.htm' class = 'leftMenuTitle'>Travel</a>","<a href='"+baseHrefURL+"/roads/index.htm' class = 'leftMenuTitle'>Roads</a>","<a href='"+baseHrefURL+"/homeandgarden/index.htm' class = 'leftMenuTitle'>Home & Garden</a>","<a href='"+baseHrefURL+"/activities/index.htm' class = 'leftMenuTitle'>Activities</a>","<a href='"+baseHrefURL+"/health/index.htm' class = 'leftMenuTitle'>Health & Environment</a>");
CityMenu     = new Array("Weather","Travel","Roads","Home & Garden","Activities","Health & Environment");
CityMenuLink = new Array("Weather","Travel","Roads","Home & Garden","Activities","Health & Environment");

///////////// Level 0 of Profiled Menu	(Weather)
CityMenu[0]     = new Array();
CityMenuLink[0] = new Array();

if (typeof counName != "undefined" && validCodePlace == true){
	if ((queryString != "") || (areaOfProfile == "can") || (areaOfProfile == "usa") || (areaOfProfile == "intl")) {
		if (counName == "Canada") { countryDirectory = "can"; }
		else if (counName == "United States") { countryDirectory = "usa"; }
		else { countryDirectory = "intl"; }
		addToMenu(0, 0, "Local weather", "", ""+baseHrefURL+"/weather/cities/"+countryDirectory+""+baseHrefURL+"/pages/"+codePlace+".htm");
	}
}

// 14 day FX
if (provinceCode == "NU" || provinceCode =="YT" || provinceCode == "NT") {
	weather14daytrend=0;
	areawx14daytrend="";
} else {
	weather14daytrend=featureALM;
	if (typeof sectorOfProfile != "undefined") {areawx14daytrend=sectorOfProfile;}
	else {areawx14daytrend=""};
}
if (areaOfProfile == "can") {
	if (0 != 0) { addToMenu(weather14daytrend, 0, "14 Day Trend", ""+baseHrefURL+"/weather/14day/pages/"+codePlace+".htm?"+codePlace, ""+baseHrefURL+"/weather/14day/index"+areawx14daytrend+".htm");}
}
// Avertissements (Warnings)
addToMenu(0, 0, "Watches and Warnings", "", ""+baseHrefURL+"/weather/alerts/index.htm");

// Cartes météo (Weather maps)
addToMenu("0", 0, "Weather Maps", ""+baseHrefURL+"/weather/maps/floods.htm", ""+baseHrefURL+"/weather/maps/floods.htm");

// Dernières 24 heurs (Last 24h)
if (areaOfProfile == "can") {
	if (0 != 0) { addToMenu(featureOBS, 0, "Last 24h", ""+baseHrefURL+"/weather/24h/pages/'+featureOBS+'.htm?"+codePlace, ""+baseHrefURL+"/weather/cities/index"+areaOfProfile+".htm"); }
}
// Éphémérides
if (0 != 0) { addToMenu(featureALM, 0, "Sun & Normals", ""+baseHrefURL+"/weather/alm/pages/'+featureALM+'.htm?"+codePlace, ""+baseHrefURL+"/weather/cities/index"+areaOfProfile+".htm"); }

// Foudre (Lightning)
//addToMenu(0, 0, "Foudre", "", ""+baseHrefURL+"/meteo/cartes/foudre.htm");

// Question de Savoir (WeatherWise(?))
//addToMenu(0, 0, "Question de savoir", "", ""+baseHrefURL+"/inter/savoir/index.htm");

// Satellites et radars
addToMenu(0, 0, "Satellite and Radar Maps", ""+baseHrefURL+"/weather/maps/satrad.htm", ""+baseHrefURL+"/weather/maps/satrad.htm");

// Neige au sol (Snow)
genericLink = ""+baseHrefURL+"/features/snow/index.htm";
if (typeof sectorOfProfile != "undefined" && areaOfProfile == "can") { genericLink = ""+baseHrefURL+"/features/snow/index"+sectorOfProfile+".htm"; } 
addToMenu(0, 0, "Snow Report", "", genericLink);

//addToMenu(0, 0, "Tropical Storm Centre", ""+baseHrefURL+"/weather/tropicalstorm.htm", ""+baseHrefURL+"/weather/tropicalstorm.htm");

// Climatologie (Statistics)
addToMenu(0, 0, "Statistics", ""+baseHrefURL+"/weather/stats/pages/'+featureCLM+'.htm?"+codePlace, ""+baseHrefURL+"/weather/stats/index.htm");

// Webcams
addToMenu(0, 0, "Weather Cameras", ""+baseHrefURL+"/features/camweather/displayCams.htm?'+featureWCM+'?"+codePlace, ""+baseHrefURL+"/features/camweather/index.htm");

// Conversions
addToMenu(0, 0, "Conversions", "", ""+baseHrefURL+"/inter/tools/conversion/index.htm");

// Sun Moon Seasons
addToMenu(0, 0, "Sun, Moon and Seasons", "", ""+baseHrefURL+"/inter/tools/moonsun/index.htm");

// Glossary
addToMenu(0, 0, "Glossary", "", ""+baseHrefURL+"/inter/help/glossary/index.htm");

///////////// Level 1 of Profiled Menu	(Travel)
CityMenu[1]     = new Array();
CityMenuLink[1] = new Array();

// Prévisions attractions (Attractions forecast)
if (typeof featureATT != "undefined") {
	addToMenu(0, 1, "Attractions Forecast", ""+baseHrefURL+"/features/attractions/pages/'+featureATT+'.htm?"+codePlace, ""+baseHrefURL+"/features/attractions/index.htm");
}

// Flight Tracker
addToMenu(0, 1, "Flight Tracker", "", ""+baseHrefURL+"/features/flighttracker/index.htm");

// Airport Fx
genericLink = ""+baseHrefURL+"/features/airport/index.htm";
availableInArea = "usa can intl";
availableInArea = availableInArea.indexOf(area);
if (availableInArea > -1) { genericLink = ""+baseHrefURL+"/features/airport/index"+area+".htm"; } 
addToMenu(0, 1, "Airport Forecast", ""+baseHrefURL+"/features/airport/index"+area+".htm?"+codePlace, genericLink);

//addToMenu(0, 1, "", "", ""+baseHrefURL+"/features/airport/index.htm");


// Informations voyage (Travel Informations)
addToMenu(0, 1, "Travel Information", "", ""+baseHrefURL+"/features/travellers/index.htm");



//===========================================================================
///////////// Level 2 of Profiled Menu (Roads)
CityMenu[2]     = new Array();
CityMenuLink[2] = new Array();

// Conditions routières (Hwy Conditions)

genericLink = ""+baseHrefURL+"/features/hwycond/index.htm";
availableInProvince = "BC SK MB ON QC NB NS PE NL YT NT";
availableInProvince = availableInProvince.indexOf(sectorOfProfile);
if (availableInProvince > -1) {
	genericPage = sectorOfProfile;
	switch (sectorOfProfile) {
		case "BC" : genericPage = "BC_S"; break;
		case "ON" : genericPage = "ON_S"; break;
		case "QC" : genericPage = "QC_W"; break;
		case "NB" : genericPage	= "NBNSPE"; break;
		case "NS" : genericPage	= "NBNSPE"; break;
		case "PE" : genericPage	= "NBNSPE"; break;
		case "NT" : genericPage	= "YTNT"; break;
		case "YT" : genericPage	= "YTNT"; break;
	}
	switch (codePlace) {
		case "CAQC0363" : genericPage = "QC_montreal"; break;
		case "CAON0696" : genericPage = "ON_toronto"; break;
		case "CABC0308" : genericPage = "BC_vancouver"; break;
	}
	genericLink = ""+baseHrefURL+"/features/hwycond/index"+genericPage+".htm";
}
addToMenu(0, 2, "Highway Conditions", "", genericLink);


// Prévisions routières (Highway forecast)
genericLink = ""+baseHrefURL+"/features/hwyfx/index.htm";
if (typeof sectorOfProfile != "undefined") {
	if ((sectorOfProfile == "BC") ||(sectorOfProfile == "ON") || (sectorOfProfile == "SK") || (sectorOfProfile == "MB") || (sectorOfProfile == "YT") || (sectorOfProfile == "AB") || (sectorOfProfile == "QC")) {
		switch (codePlace) {
			case "CABC0308" : genericPage = sectorOfProfile+"_vancouver"; break;
			case "CAON0696" : genericPage = sectorOfProfile+"_toronto"; break;
			case "CAQC0363" : genericPage = sectorOfProfile+"_montreal"; break;
			default:
			switch (sectorOfProfile)	{
				case "ON" : genericPage = sectorOfProfile+"_S"; break;
				case "BC" :	genericPage = sectorOfProfile+"_S";	break;
				case "QC" :	genericPage = sectorOfProfile+"_W";	break;
				default: genericPage = sectorOfProfile;
			}
		}
		genericLink = ""+baseHrefURL+"/features/hwyfx/index"+genericPage+".htm";
	}
}
highwayLink = genericLink;
addToMenu(0, 2, "Canadian Highway Forecast", "", genericLink);
//USA highway forecast
addToMenu(0, 2, "USA Highway Forecast", "", ""+baseHrefURL+"/features/hwyfx/usa/index.htm");

// Road Construction
addToMenu(0, 2, "Road Construction", "", "http://roads.theweathernetwork.com/search.asp");

// Circulation (Traffic cam)
genericLink = ""+baseHrefURL+"/features/camtraffic/index.htm";
availableInProvince = "BC ON QC NS NL";
availableInProvince = availableInProvince.indexOf(sectorOfProfile);
if (typeof sectorOfProfile != "undefined" && availableInProvince > -1) {
	switch (codePlace) {
		case "CABC0308" : genericPage = "vancouver"; break;
		case "CAON0696" : genericPage = "GTA/index.htm"; break;
		case "CAQC0363" : genericPage = "Montreal/index.htm"; break;
		case "CAQC0441" : genericPage = "Quebec/index.htm";	break;
		default: 
			availableInProvince = "BC NS NL";
			availableInProvince = availableInProvince.indexOf(sectorOfProfile);
			if (availableInProvince > -1) { genericPage = sectorOfProfile+""+baseHrefURL+"/index.htm"; }
			else { genericPage = "../index.htm"; }
	}
	genericLink = ""+baseHrefURL+"/features/camtraffic/pages/"+genericPage;
}
addToMenu(0, 2, "Traffic Cameras", "", genericLink);

// Informations voyage (Winter Driving Tips)
//addToMenu(0, 2, "Winter Driving Tips", "", ""+baseHrefURL+"/features/hwycond/info/drivingtips.htm");

// Traffic flow
addToMenu(0, 2, "<img src = http://www.theweathernetwork.com/common/images/newProductSm.gif align=right hspace=0 vspace=0 border=0>Traffic Flow", "", ""+baseHrefURL+"/features/trafficflow");


///////////// Level 3 of Profiled Menu (Home & Garden)
CityMenu[3]     = new Array();
CityMenuLink[3] = new Array();


//Weather & Your Home
genericLink = ""+baseHrefURL+"/features/wxhome/index.htm";
if (typeof sectorOfProfile != "undefined" && areaOfProfile == "can") {	genericLink = ""+baseHrefURL+"/features/wxhome/index"+sectorOfProfile+".htm";  } 
addToMenu(0, 3, "Weather and Your Home", ""+baseHrefURL+"/features/wxhome/pages/"+codePlace+".htm?", genericLink);


// Jardinage (Gardening)
genericLink = ""+baseHrefURL+"/features/gardening/index.htm";
if (typeof sectorOfProfile != "undefined" && areaOfProfile == "can") { genericLink = ""+baseHrefURL+"/features/gardening/index"+sectorOfProfile+".htm"; } 
addToMenu(0, 3, "Lawn and Garden Forecast", ""+baseHrefURL+"/features/gardening/pages/"+featureBUG+".htm?"+codePlace, genericLink);

//Power Consumption
genericLink = ""+baseHrefURL+"/homeandgarden/power.htm";
if (sectorOfProfile == "ON") { genericLink = ""+baseHrefURL+"//homeandgarden/powerOnt.htm";  }
addToMenu(0, 3, "<img src = "+baseHrefURL+"/common/images/newProductSm.gif align=right hspace=0 vspace=0 border=0>Power Consumption", "", genericLink);


///////////// Level 4 of Profiled Menu (Activities)
CityMenu[4]     = new Array();
CityMenuLink[4] = new Array();

// Valentine's day
//genericLink = ""+baseHrefURL+"/features/valentine/index.htm";
//if (typeof sectorOfProfile != "undefined" && areaOfProfile == "can") { genericLink = ""+baseHrefURL+"/features/valentine/pages/"+codePlace+".htm"; } 
//addToMenu(0, 4, "<img src = "+baseHrefURL+"/common/images/newProductSm.gif align=right hspace=0 vspace=0 border=0>Valentine's Day Forecast", ""+baseHrefURL+"/features/valentine/pages/'"+codePlace+"'.htm", genericLink);


/* newyears
genericLink = ""+baseHrefURL+"/features/newyears/index.htm";
if (typeof sectorOfProfile != "undefined" && areaOfProfile == "can") { genericLink = ""+baseHrefURL+"/features/newyears/pages/"+codePlace+".htm"; } 
addToMenu(0, 4, "<img src = "+baseHrefURL+"/common/images/newProductSm.gif align=right hspace=0 vspace=0 border=0>New Years Eve Forecast", ""+baseHrefURL+"/features/newyears/pages/'"+codePlace+"'.htm", genericLink);
*/

// Olympics
/*genericLink = ""+baseHrefURL+"/features/olympics/turin2006/index.htm";
addToMenu("turin", 4, "<img src = "+baseHrefURL+"/common/images/newProductSm.gif align=right hspace=0 vspace=0 border=0>Turin 2006", ""+baseHrefURL+"/features/olympics/turin2006/index.htm", ""+baseHrefURL+"/features/olympics/turin2006/index.htm");*/


//Spring break
genericLink = ""+baseHrefURL+"/features/travelindex/spring.htm"
addToMenu(0, 4, "<img src = "+baseHrefURL+"/common/images/newProductSm.gif align=right hspace=0 vspace=0 border=0>Spring Break", ""+baseHrefURL+"/features/travelindex/spring.htm", genericLink);

//Snowmobile
genericLink = ""+baseHrefURL+"/features/snowmobile/landing.htm"
addToMenu(0, 4, "Snowmobile Report", ""+baseHrefURL+"/features/snowmobile/landing.htm", genericLink);


// Farmzone
genericLink = "http://www.farmzone.com";
addToMenu(0, 4, "Farmzone", "", "http://www.farmzone.com");

// Fall Colour
//genericLink = ""+baseHrefURL+"/features/fallcolour/index.htm";
//addToMenu(0, 4, "<img src = "+baseHrefURL+"/common/images/newProductSm.gif align=right hspace=0 vspace=0 border=0>Fall Colour", "", ""+baseHrefURL+"/features/fallcolour/index.htm");


// Golf
genericLink = ""+baseHrefURL+"/features/golf/index.htm";
if (typeof sectorOfProfile != "undefined" && areaOfProfile == "can") { genericLink = ""+baseHrefURL+"/features/golf/index"+sectorOfProfile+".htm"; } 
addToMenu(0, 4, "Golf Report", ""+baseHrefURL+"/features/Golf/pages/"+featureGLF+".htm?"+codePlace, genericLink);
//document.write("<br><font color=white>sectorOfProfile="+sectorOfProfile+"</font>");

// Prévisions maritimes (Marine)
addToMenu(0, 4, "Marine Forecast", ""+baseHrefURL+"/features/marine/pages/'+featureMAR+'.htm?"+codePlace, ""+baseHrefURL+"/features/marine/index.htm");

// Prévisions Parcs
genericLink = ""+baseHrefURL+"/features/parks/index.htm";
availableInProvince = "AB BC MB NB NS ON QC PE SK NL YT";
availableInProvince = availableInProvince.indexOf(sectorOfProfile);
if (availableInProvince > -1) { genericLink = ""+baseHrefURL+"/features/parks/index"+sectorOfProfile+".htm"; } 
addToMenu(0, 4, "Park Report", ""+baseHrefURL+"/features/parks/pages/'+featurePRK+'.htm?"+codePlace, genericLink);

// Prévisions scolaires (Schoolday)
genericLink = ""+baseHrefURL+"/features/schoolday/index.htm";
if (typeof sectorOfProfile != "undefined" && areaOfProfile == "can") { genericLink = ""+baseHrefURL+"/features/schoolday/pages/"+codePlace+".htm"; } 
addToMenu(0, 4, "SchoolDay Forecast", ""+baseHrefURL+"/features/schoolday/pages/'+featureSCH+'.htm?"+codePlace, genericLink);

// stargazing
genericLink = ""+baseHrefURL+"/features/stargazing/index.htm";
if (typeof sectorOfProfile != "undefined" && areaOfProfile == "can") { genericLink = ""+baseHrefURL+"/features/stargazing/pages/"+codePlace+".htm"; } 
addToMenu(0, 4, "Stargazing", ""+baseHrefURL+"/features/stargazing/pages/'"+codePlace+"'.htm", genericLink);

// Ski
genericLink = ""+baseHrefURL+"/features/ski/index.htm";
if (typeof sectorOfProfile != "undefined" && (areaOfProfile == "can" || areaOfProfile == "usa" || areaOfProfile == "intl") ) { genericLink = ""+baseHrefURL+"/features/ski/index"+areaOfProfile+".htm"; }
addToMenu(0, 4, "Ski Report", ""+baseHrefURL+"/features/ski/pages/"+featureSKI+".htm?"+codePlace, genericLink);

// Ski Safety Tips
//genericLink = "http://www.farmzone.com";
addToMenu(0, 4, "Ski Safety Tips", "", ""+baseHrefURL+"/tv/skitips/index.htm");


///////////// Level 5 of Profiled Menu (Health & Environment)
CityMenu[5]     = new Array();
CityMenuLink[5] = new Array();

// Prévision Pollen
addToMenu(0, 5, "Pollen Report", ""+baseHrefURL+"/features/pollen/pages/"+featurePOL+".htm?"+codePlace, ""+baseHrefURL+"/features/pollen/index.htm");


// Flu
addToMenu(0, 5, "Flu Report", "", ""+baseHrefURL+"/features/flu/index.htm");

// Qualité de l'air (Air Quality)
genericLink = ""+baseHrefURL+"/features/airq/index.htm";
availableInProvince = "AB BC MB NB NS ON QC";
availableInProvince = availableInProvince.indexOf(sectorOfProfile);
if (availableInProvince > -1) { genericLink = ""+baseHrefURL+"/features/airq/pages/index"+sectorOfProfile+".htm"; } 
addToMenu(0, 5, "Air Quality", ""+baseHrefURL+"/features/airq/pages/index"+sectorOfProfile+".htm?"+codePlace, genericLink);


// Indice grippal
// addToMenu(0, 3, "Indice grippal", "", ""+baseHrefURL+"/features/grippe/index.htm");




// Bulletin moustiques (Bug)
genericLink = ""+baseHrefURL+"/features/bugs/index.htm";
if (typeof sectorOfProfile != "undefined" && areaOfProfile == "can") { genericLink = ""+baseHrefURL+"/features/bugs/index"+sectorOfProfile+".htm"; } 
addToMenu(0, 5, "Bug Report", ""+baseHrefURL+"/features/bugs/pages/"+featureBUG+".htm?"+codePlace, genericLink);

// Feux de fôret (Forest fire)
addToMenu(0, 5, "Forest Fire Watch", "", ""+baseHrefURL+"/features/firewatch/index.htm");

// Une Tonne (One Tonne Challenge)
//addToMenu(0, 5, "One Tonne Challenge", "", ""+baseHrefURL+"/weather/climatechange/index.htm");

// Bulletin UV (UVB)
genericLink = ""+baseHrefURL+"/features/uv/index.htm";
availableInProvince = "AB BC MB NL NS NT NU ON PE QC SK YK YU";
availableInProvince = availableInProvince.indexOf(sectorOfProfile);
if (availableInProvince > -1) { genericLink = ""+baseHrefURL+"/features/uv/index.htm#"+sectorOfProfile; } 
addToMenu(0, 5, "UV Report", ""+baseHrefURL+"/features/uv/pages/'+featureUVB+'.htm?"+codePlace, genericLink);


// Sentiers motoneige (Snowmobile)
//addToMenu(0, 2, "Sentiers motoneige", ""+baseHrefURL+"/features/motoneige/index.htm?"+codePlace, ""+baseHrefURL+"/features/motoneige/index.htm");

// Zone Verte
//genericLink = "/features/zoneverte/index.htm";
//if (typeof sectorOfProfile != "undefined" && areaOfProfile == "can") { genericLink = ""+baseHrefURL+"/features/zoneverte/index"+sectorOfProfile+".htm"; } 
//addToMenu(0, 2, "ZoneVerte", ""+baseHrefURL+"/features/zoneverte/pages/"+featureFZN+".htm?"+codePlace, genericLink);


function dynLink(product, placeCode) {
	document.dynIndex.product.value = product;
	document.dynIndex.place.value = placeCode;
	document.dynIndex.action = ''+baseHrefURL+'/common/scripts/dynIndex/'+product+'Index.htm';
	document.dynIndex.submit();
}


var NN4X;
var userAgent = navigator.userAgent;

var NNIndex = navigator.userAgent.indexOf("Mozilla");

if (navigator.appName == "Netscape") {
	if (userAgent.substring((NNIndex + 8),(NNIndex + 9)) == "4") {
		NN4X = "1";
	} else { NN4X = "0";}
} else {
	NN4X = "0";
}

	//var CN = cityNameLink.toUpperCase();



		center1 = "no";
		d=document;

		d.write('<table class = "navSubMastheadTable" cellpadding = "0" cellspacing = "0">');
		d.write('<FORM NAME = "dynIndex" METHOD = "POST" ACTION = "'+baseHrefURL+'/common/scripts/dynIndex/index.htm" target = "_parent">');
		d.write('<INPUT TYPE = "hidden" NAME = "product" VALUE = "0">');
		d.write('<INPUT TYPE = "hidden" NAME = "place" VALUE = "'+codePlace+'">');
		d.write('<tr>');
		d.write('<td><table cellpadding = "0" cellspacing = "0" class = "navSubMastheadTable">');
		if (center1 == "no") {
			for (i = 0; i < CityMenu.length; i++) {


					d.write('<tr><td>');
					d.write('<table class = "navSubMastheadTable" cellpadding = "0" cellspacing = "0">');

						d.write('<tr><td class = "cssCityTitle">'+CityTitle[i]+'</td></tr>\n');
						for (j = 0; j < CityMenu[i].length; j++) {
							d.write('<tr><td height=18>\n');
							d.write('<table class = "navLinkTitle" onmouseover=\'javascript:this.style.backgroundColor="#1b4d80"; javascript:this.style.color="#000000";\'; onmouseout=this.style.backgroundColor="transparent";><tr><td style="width:110px;">');
							if (CityMenuLink[i][j].substr(0,1) == "*") {
								d.write('<a href = "javascript:dynLink(\''+CityMenuLink[i][j].substr(1,CityMenuLink[i][j].length)+'\',\''+codePlace+'\');">');
							}

							else {
								d.write('<a href = "'+CityMenuLink[i][j]+'" target = "_parent">');
							}
							d.write('<span class = "navLinkMenu"><b>'+CityMenu[i][j]+'</b></span></a></td></tr></table>');

							d.write('</td></tr><tr><td height = "1"><IMG SRC = "'+baseHrefURL+'/common/images/lightBlueMenuBorder.gif" width = "110" height = "1" hspace = "0" vspace = "0" align = "bottom" /></td></tr>\n');
						}

							d.write('<IMG SRC = "'+baseHrefURL+'/common/images/lightBlueMenuBorder.gif" width = "110" height = "3" hspace = "0" vspace = "0" /></td></tr></table></tr>');


					}

					}




		d.write('</td>');

					d.write('</tr></table>\n');
					d.write('</td></tr></table>\n');


		// building the menu



function BodyOnLoad()
{
		if (document.searchform.recherche) {
		document.searchform.recherche.focus();
	}
}


function CheckCity()
{
	if (document.searchform.recherche.value == "enter city")
	{
		document.searchform.recherche.value = "";
	}
}


d.write('</form>');

