if (document.images)
{
	checkit= new Image(); 
	checkit.src="../images/maps/checkit.gif"; 
}
/**************************************  CALGARY HV MAPS  *********************************/
// Each map is sectioned off, containing its own variables, functions and data.  There is a section at the end that contains common functions
// among all three maps.

//These variables position the title layer and the side panel layer
var mapCalgRES_titleposx = 70;
var mapCalgRES_titleposy = -27;
var mapCalgRES_sidelayerposx = 20;
var mapCalgRES_sidelayerposy = 120;

// Multidimensional Arrays are created to store all the information for the different Calgary regions to 
//	display titles, side panels and selecting different areas.

var mapCalgRES_titleOfArea = new Array();
var mapCalgRES_nameOfRegion = new Array();
var mapCalgRES_idOfRegion = new Array();
var mapCalgRES_valueOfRegion = new Array();

//Data for the Titles and the Regions.
mapCalgRES_titleOfArea[0] = "Calgary North East";
mapCalgRES_nameOfRegion[0] = new Array();
mapCalgRES_idOfRegion[0] = new Array();
mapCalgRES_valueOfRegion[0] = new Array();

mapCalgRES_idOfRegion[0][0]="664"; mapCalgRES_nameOfRegion[0][0]="(NE) Abbeydale"; mapCalgRES_valueOfRegion[0][0]="Abbeydale";
mapCalgRES_idOfRegion[0][1]="730"; mapCalgRES_nameOfRegion[0][1]="(NE) Albert Park"; mapCalgRES_valueOfRegion[0][1]="Albert Park";
mapCalgRES_idOfRegion[0][2]="768"; mapCalgRES_nameOfRegion[0][2]="(NE) Applewood"; mapCalgRES_valueOfRegion[0][2]="Applewood";
mapCalgRES_idOfRegion[0][3]="624"; mapCalgRES_nameOfRegion[0][3]="(NE) Calgary International Airport/Pegasus Industrial Park"; mapCalgRES_valueOfRegion[0][3]="Calgary Int Airport";//combined Pegasus ind airport, may need to change
mapCalgRES_idOfRegion[0][4]="676"; mapCalgRES_nameOfRegion[0][4]="(NE) Castleridge"; mapCalgRES_valueOfRegion[0][4]="Castleridge";
mapCalgRES_idOfRegion[0][5]="678"; mapCalgRES_nameOfRegion[0][5]="(NE) Castleridge Estates"; mapCalgRES_valueOfRegion[0][5]="Castleridge Estates";
mapCalgRES_idOfRegion[0][6]="688"; mapCalgRES_nameOfRegion[0][6]="(NE) Coral Springs"; mapCalgRES_valueOfRegion[0][6]="Coral Springs";
mapCalgRES_idOfRegion[0][7]="615"; mapCalgRES_nameOfRegion[0][7]="(NE) Deerfoot/Skyline Ind Park"; mapCalgRES_valueOfRegion[0][7]="Skylne_Deerft Ind Pk";
mapCalgRES_idOfRegion[0][8]="738"; mapCalgRES_nameOfRegion[0][8]="(NE) Dover"; mapCalgRES_valueOfRegion[0][8]="Dover";
mapCalgRES_idOfRegion[0][9]="736"; mapCalgRES_nameOfRegion[0][9]="(NE) Dover Glen"; mapCalgRES_valueOfRegion[0][9]="Dover Glen";
mapCalgRES_idOfRegion[0][10]="748"; mapCalgRES_nameOfRegion[0][10]="(NE) Eastfield"; mapCalgRES_valueOfRegion[0][10]="Eastfield";
mapCalgRES_idOfRegion[0][11]="740"; mapCalgRES_nameOfRegion[0][11]="(NE) Erin Woods"; mapCalgRES_valueOfRegion[0][11]="Erinwoods";
mapCalgRES_idOfRegion[0][12]="680"; mapCalgRES_nameOfRegion[0][12]="(NE) Falconridge"; mapCalgRES_valueOfRegion[0][12]="Falconridge";
mapCalgRES_idOfRegion[0][13]="726"; mapCalgRES_nameOfRegion[0][13]="(NE) Fonda"; mapCalgRES_valueOfRegion[0][13]="Fonda";
mapCalgRES_idOfRegion[0][14]="762"; mapCalgRES_nameOfRegion[0][14]="(NE) Forest Heights"; mapCalgRES_valueOfRegion[0][14]="Forest Heights";
mapCalgRES_idOfRegion[0][15]="764"; mapCalgRES_nameOfRegion[0][15]="(NE) Forest Lawn"; mapCalgRES_valueOfRegion[0][15]="Forest Lawn";
mapCalgRES_idOfRegion[0][16]="630"; mapCalgRES_nameOfRegion[0][16]="(NE) Franklin/Meridian Ind Park"; mapCalgRES_valueOfRegion[0][16]="Franklin_Meridian Ind Pk";
mapCalgRES_idOfRegion[0][17]="640"; mapCalgRES_nameOfRegion[0][17]="(NE) Horizon Industrial Park"; mapCalgRES_valueOfRegion[0][17]="Horizon Ind Pk";
mapCalgRES_idOfRegion[0][18]="660"; mapCalgRES_nameOfRegion[0][18]="(NE) Marlborough"; mapCalgRES_valueOfRegion[0][18]="Marlborough";
mapCalgRES_idOfRegion[0][19]="662"; mapCalgRES_nameOfRegion[0][19]="(NE) Marlborough Park"; mapCalgRES_valueOfRegion[0][19]="Marlborough Park";
mapCalgRES_idOfRegion[0][20]="682"; mapCalgRES_nameOfRegion[0][20]="(NE) Martindale"; mapCalgRES_valueOfRegion[0][20]="Martindale";
mapCalgRES_idOfRegion[0][21]="600"; mapCalgRES_nameOfRegion[0][21]="(NE) Mayland Heights"; mapCalgRES_valueOfRegion[0][21]="Mayland Heights";
mapCalgRES_idOfRegion[0][22]="604"; mapCalgRES_nameOfRegion[0][22]="(NE) East Mayland Heights"; mapCalgRES_valueOfRegion[0][22]="East Mayland Heights";//may need to change to Mayland Heights East
mapCalgRES_idOfRegion[0][23]="610"; mapCalgRES_nameOfRegion[0][23]="(NE) McCall/Airways Ind Park"; mapCalgRES_valueOfRegion[0][23]="McCall_Airwys Ind Pk";
mapCalgRES_idOfRegion[0][24]="670"; mapCalgRES_nameOfRegion[0][24]="(NE) Monterey Park"; mapCalgRES_valueOfRegion[0][24]="Monterey Park";
mapCalgRES_idOfRegion[0][25]="671"; mapCalgRES_nameOfRegion[0][25]="(NE) Parkridge Estates"; mapCalgRES_valueOfRegion[0][25]="Parkridge Estates";
mapCalgRES_idOfRegion[0][26]="766"; mapCalgRES_nameOfRegion[0][26]="(NE) Penbrooke"; mapCalgRES_valueOfRegion[0][26]="Penbrooke";
mapCalgRES_idOfRegion[0][27]="668"; mapCalgRES_nameOfRegion[0][27]="(NE) Pineridge"; mapCalgRES_valueOfRegion[0][27]="Pineridge";
mapCalgRES_idOfRegion[0][28]="728"; mapCalgRES_nameOfRegion[0][28]="(NE) Radisson Heights"; mapCalgRES_valueOfRegion[0][28]="Radisson Heights";
mapCalgRES_idOfRegion[0][29]="770"; mapCalgRES_nameOfRegion[0][29]="(NE) Red Carpet/Mountview Mobile Park"; mapCalgRES_valueOfRegion[0][29]="Redcarpet_Mountview";
mapCalgRES_idOfRegion[0][30]="666"; mapCalgRES_nameOfRegion[0][30]="(NE) Rundle"; mapCalgRES_valueOfRegion[0][30]="Rundle";
mapCalgRES_idOfRegion[0][31]="645"; mapCalgRES_nameOfRegion[0][31]="(NE) Saddle Ridge"; mapCalgRES_valueOfRegion[0][31]="Saddleridge";
mapCalgRES_idOfRegion[0][32]="732"; mapCalgRES_nameOfRegion[0][32]="(NE) Southview"; mapCalgRES_valueOfRegion[0][32]="Southview";
mapCalgRES_idOfRegion[0][33]="625"; mapCalgRES_nameOfRegion[0][33]="(NE) Saddle Ridge Ind/Stoney Industrial/Westwinds"; mapCalgRES_valueOfRegion[0][33]="Saddle Ridge_Stoney Ind";  //may have to include westwinds later
mapCalgRES_idOfRegion[0][34]="635"; mapCalgRES_nameOfRegion[0][34]="(NE) Sunridge Industrial Park"; mapCalgRES_valueOfRegion[0][34]="Sunridge Ind Pk";
mapCalgRES_idOfRegion[0][35]="684"; mapCalgRES_nameOfRegion[0][35]="(NE) Taradale"; mapCalgRES_valueOfRegion[0][35]="Taradale";
mapCalgRES_idOfRegion[0][36]="674"; mapCalgRES_nameOfRegion[0][36]="(NE) Temple"; mapCalgRES_valueOfRegion[0][36]="Temple";
mapCalgRES_idOfRegion[0][37]="744"; mapCalgRES_nameOfRegion[0][37]="(NE) Valleyfield"; mapCalgRES_valueOfRegion[0][37]="Valleyfield Park";
mapCalgRES_idOfRegion[0][38]="605"; mapCalgRES_nameOfRegion[0][38]="(NE) Vista Heights"; mapCalgRES_valueOfRegion[0][38]="Vista Heights";
mapCalgRES_idOfRegion[0][39]="734"; mapCalgRES_nameOfRegion[0][39]="(NE) West Dover"; mapCalgRES_valueOfRegion[0][39]="West Dover";
mapCalgRES_idOfRegion[0][40]="672"; mapCalgRES_nameOfRegion[0][40]="(NE) Whitehorn"; mapCalgRES_valueOfRegion[0][40]="Whitehorn";

mapCalgRES_titleOfArea[1] = "Calgary North West";
mapCalgRES_nameOfRegion[1] = new Array();
mapCalgRES_idOfRegion[1] = new Array();
mapCalgRES_valueOfRegion[1] = new Array();

mapCalgRES_idOfRegion[1][0]="443";  mapCalgRES_nameOfRegion[1][0]="(NW) Arbour Lake"; mapCalgRES_valueOfRegion[1][0]="Arbour Lake";
mapCalgRES_idOfRegion[1][1]="415";  mapCalgRES_nameOfRegion[1][1]="(NW) Banff Trail"; mapCalgRES_valueOfRegion[1][1]="Banff Trail";
mapCalgRES_idOfRegion[1][2]="508";  mapCalgRES_nameOfRegion[1][2]="(NW) Beddington"; mapCalgRES_valueOfRegion[1][2]="Beddington";
mapCalgRES_idOfRegion[1][3]="478";  mapCalgRES_nameOfRegion[1][3]="(NW) Bowness"; mapCalgRES_valueOfRegion[1][3]="Bowness";
mapCalgRES_idOfRegion[1][4]="420";  mapCalgRES_nameOfRegion[1][4]="(NW) Brentwood"; mapCalgRES_valueOfRegion[1][4]="Brentwood_Calg";
mapCalgRES_idOfRegion[1][5]="408";  mapCalgRES_nameOfRegion[1][5]="(NW) Briar Hill"; mapCalgRES_valueOfRegion[1][5]="Briar Hill";
mapCalgRES_idOfRegion[1][6]="400";  mapCalgRES_nameOfRegion[1][6]="(NW) Bridgeland"; mapCalgRES_valueOfRegion[1][6]="Bridgeland";
mapCalgRES_idOfRegion[1][7]="496";  mapCalgRES_nameOfRegion[1][7]="(NW) Cambrian Heights"; mapCalgRES_valueOfRegion[1][7]="Cambrian Heights";
mapCalgRES_idOfRegion[1][8]="414";  mapCalgRES_nameOfRegion[1][8]="(NW) Capitol Hill"; mapCalgRES_valueOfRegion[1][8]="Capitol Hill";
mapCalgRES_idOfRegion[1][9]="419";  mapCalgRES_nameOfRegion[1][9]="(NW) Charleswood"; mapCalgRES_valueOfRegion[1][9]="Charleswood";
mapCalgRES_idOfRegion[1][10]="475";  mapCalgRES_nameOfRegion[1][10]="(NW) Citadel"; mapCalgRES_valueOfRegion[1][10]="Citadel";
mapCalgRES_idOfRegion[1][11]="418";  mapCalgRES_nameOfRegion[1][11]="(NW) Collingwood"; mapCalgRES_valueOfRegion[1][11]="Collingwood";
mapCalgRES_idOfRegion[1][12]="516";  mapCalgRES_nameOfRegion[1][12]="(NW) Country Hills"; mapCalgRES_valueOfRegion[1][12]="Country Hills";
mapCalgRES_idOfRegion[1][13]="521";  mapCalgRES_nameOfRegion[1][13]="(NW) Country Hills Village"; mapCalgRES_valueOfRegion[1][13]="Country Hills Village";
mapCalgRES_idOfRegion[1][14]="520";  mapCalgRES_nameOfRegion[1][14]="(NW) Coventry Hills"; mapCalgRES_valueOfRegion[1][14]="Coventry Hills";
mapCalgRES_idOfRegion[1][15]="404";  mapCalgRES_nameOfRegion[1][15]="(NW) Crescent Heights"; mapCalgRES_valueOfRegion[1][15]="Crescent Heights";
mapCalgRES_idOfRegion[1][16]="422";  mapCalgRES_nameOfRegion[1][16]="(NW) Dalhousie"; mapCalgRES_valueOfRegion[1][16]="Dalhousie";
mapCalgRES_idOfRegion[1][17]="461";  mapCalgRES_nameOfRegion[1][17]="(NW) Edgemont"; mapCalgRES_valueOfRegion[1][17]="Edgemont";
mapCalgRES_idOfRegion[1][18]="519";  mapCalgRES_nameOfRegion[1][18]="(NW) Evanston"; mapCalgRES_valueOfRegion[1][18]="Evanston";
mapCalgRES_idOfRegion[1][19]="503";  mapCalgRES_nameOfRegion[1][19]="(NW) Greenview"; mapCalgRES_valueOfRegion[1][19]="Greenview";
mapCalgRES_idOfRegion[1][20]="479";  mapCalgRES_nameOfRegion[1][20]="(NW) Greenwood/Greenbriar"; mapCalgRES_valueOfRegion[1][20]="Greenwood Village";
mapCalgRES_idOfRegion[1][21]="471";  mapCalgRES_nameOfRegion[1][21]="(NW) Hamptons"; mapCalgRES_valueOfRegion[1][21]="Hamptons";
mapCalgRES_idOfRegion[1][22]="514";  mapCalgRES_nameOfRegion[1][22]="(NW) Harvest Hills"; mapCalgRES_valueOfRegion[1][22]="Harvest Hills";
mapCalgRES_idOfRegion[1][23]="451";  mapCalgRES_nameOfRegion[1][23]="(NW) Hawkwood"; mapCalgRES_valueOfRegion[1][23]="Hawkwood";
mapCalgRES_idOfRegion[1][24]="518";  mapCalgRES_nameOfRegion[1][24]="(NW) Hidden Valley"; mapCalgRES_valueOfRegion[1][24]="Hidden Valley";
mapCalgRES_idOfRegion[1][25]="498";  mapCalgRES_nameOfRegion[1][25]="(NW) Highland Park"; mapCalgRES_valueOfRegion[1][25]="Highland Park";
mapCalgRES_idOfRegion[1][26]="499";  mapCalgRES_nameOfRegion[1][26]="(NW) Highwood"; mapCalgRES_valueOfRegion[1][26]="Highwood";
mapCalgRES_idOfRegion[1][27]="407";  mapCalgRES_nameOfRegion[1][27]="(NW) Hillhurst"; mapCalgRES_valueOfRegion[1][27]="Hillhurst";
mapCalgRES_idOfRegion[1][28]="505";  mapCalgRES_nameOfRegion[1][28]="(NW) Huntington Hills"; mapCalgRES_valueOfRegion[1][28]="Huntington Hills";
mapCalgRES_idOfRegion[1][29]="512";  mapCalgRES_nameOfRegion[1][29]="(NW) Macewan Glen"; mapCalgRES_valueOfRegion[1][29]="MacEwan Glen";
mapCalgRES_idOfRegion[1][30]="476";  mapCalgRES_nameOfRegion[1][30]="(NW) Montgomery"; mapCalgRES_valueOfRegion[1][30]="Montgomery";
mapCalgRES_idOfRegion[1][31]="494";  mapCalgRES_nameOfRegion[1][31]="(NW) Mount Pleasant"; mapCalgRES_valueOfRegion[1][31]="Mount Pleasant";
mapCalgRES_idOfRegion[1][32]="490";  mapCalgRES_nameOfRegion[1][32]="(NW) Mountview/Winston Heights"; mapCalgRES_valueOfRegion[1][32]="Winston Heights_Mountview";
mapCalgRES_idOfRegion[1][33]="500";  mapCalgRES_nameOfRegion[1][33]="(NW) North Haven"; mapCalgRES_valueOfRegion[1][33]="North Haven";
mapCalgRES_idOfRegion[1][34]="515";  mapCalgRES_nameOfRegion[1][34]="(NW) Panorama Hills"; mapCalgRES_valueOfRegion[1][34]="Panorama Hills";
mapCalgRES_idOfRegion[1][35]="411";  mapCalgRES_nameOfRegion[1][35]="(NW) Parkdale"; mapCalgRES_valueOfRegion[1][35]="Parkdale";
mapCalgRES_idOfRegion[1][36]="412";  mapCalgRES_nameOfRegion[1][36]="(NW) Point Mckay"; mapCalgRES_valueOfRegion[1][36]="Point Mckay";
mapCalgRES_idOfRegion[1][37]="441";  mapCalgRES_nameOfRegion[1][37]="(NW) Ranchlands"; mapCalgRES_valueOfRegion[1][37]="Ranchlands";
mapCalgRES_idOfRegion[1][38]="442";  mapCalgRES_nameOfRegion[1][38]="(NW) Ranchlands Estates"; mapCalgRES_valueOfRegion[1][38]="Ranchlands Estates";
mapCalgRES_idOfRegion[1][39]="402";  mapCalgRES_nameOfRegion[1][39]="(NW) Regal Terrace/Renfrew"; mapCalgRES_valueOfRegion[1][39]="Renfrew_Regal Terrace";
mapCalgRES_idOfRegion[1][40]="484";  mapCalgRES_nameOfRegion[1][40]="(NW) Rocky Ridge"; mapCalgRES_valueOfRegion[1][40]="Rocky Ridge Ranch";
mapCalgRES_idOfRegion[1][41]="406";  mapCalgRES_nameOfRegion[1][41]="(NW) Rosedale"; mapCalgRES_valueOfRegion[1][41]="Rosedale";
mapCalgRES_idOfRegion[1][42]="495";  mapCalgRES_nameOfRegion[1][42]="(NW) Rosemont"; mapCalgRES_valueOfRegion[1][42]="Rosemont";
mapCalgRES_idOfRegion[1][43]="486";  mapCalgRES_nameOfRegion[1][43]="(NW) Royal Oak"; mapCalgRES_valueOfRegion[1][43]="Royal Oak";
mapCalgRES_idOfRegion[1][44]="510";  mapCalgRES_nameOfRegion[1][44]="(NW) Sandstone"; mapCalgRES_valueOfRegion[1][44]="Sandstone";
mapCalgRES_idOfRegion[1][45]="432";  mapCalgRES_nameOfRegion[1][45]="(NW) Scenic Acres"; mapCalgRES_valueOfRegion[1][45]="Scenic Acres";
mapCalgRES_idOfRegion[1][46]="430";  mapCalgRES_nameOfRegion[1][46]="(NW) Silver Springs"; mapCalgRES_valueOfRegion[1][46]="Silver Springs";
mapCalgRES_idOfRegion[1][47]="413";  mapCalgRES_nameOfRegion[1][47]="(NW) St. Andrews Heights"; mapCalgRES_valueOfRegion[1][47]="St Andrews Heights";
mapCalgRES_idOfRegion[1][48]="405";  mapCalgRES_nameOfRegion[1][48]="(NW) Sunnyside"; mapCalgRES_valueOfRegion[1][48]="Sunnyside";

mapCalgRES_idOfRegion[1][49]="477";  mapCalgRES_nameOfRegion[1][49]="(NW) Sherwood"; mapCalgRES_valueOfRegion[1][49]="Sherwood Calgary";

mapCalgRES_idOfRegion[1][50]="502";  mapCalgRES_nameOfRegion[1][50]="(NW) Thorncliffe"; mapCalgRES_valueOfRegion[1][50]="Thorncliffe";
mapCalgRES_idOfRegion[1][51]="482";  mapCalgRES_nameOfRegion[1][51]="(NW) Tuscany"; mapCalgRES_valueOfRegion[1][51]="Tuscany";
mapCalgRES_idOfRegion[1][52]="492";  mapCalgRES_nameOfRegion[1][52]="(NW) Tuxedo"; mapCalgRES_valueOfRegion[1][52]="Tuxedo";
mapCalgRES_idOfRegion[1][53]="416";  mapCalgRES_nameOfRegion[1][53]="(NW) University Heights"; mapCalgRES_valueOfRegion[1][53]="University Heights";
mapCalgRES_idOfRegion[1][54]="501";  mapCalgRES_nameOfRegion[1][54]="(NW) Upper North Haven"; mapCalgRES_valueOfRegion[1][54]="North Haven Upper";
mapCalgRES_idOfRegion[1][55]="480";  mapCalgRES_nameOfRegion[1][55]="(NW) Valley Ridge"; mapCalgRES_valueOfRegion[1][55]="Valley Ridge";
mapCalgRES_idOfRegion[1][56]="426";  mapCalgRES_nameOfRegion[1][56]="(NW) Varsity Acres"; mapCalgRES_valueOfRegion[1][56]="Varsity Acres";
mapCalgRES_idOfRegion[1][57]="428";  mapCalgRES_nameOfRegion[1][57]="(NW) Varsity Estates"; mapCalgRES_valueOfRegion[1][57]="Varsity Estates";
mapCalgRES_idOfRegion[1][58]="424";  mapCalgRES_nameOfRegion[1][58]="(NW) Varsity Village"; mapCalgRES_valueOfRegion[1][58]="Varsity Village";
mapCalgRES_idOfRegion[1][59]="410";  mapCalgRES_nameOfRegion[1][59]="(NW) West Hillhurst"; mapCalgRES_valueOfRegion[1][59]="West Hillhurst";
mapCalgRES_idOfRegion[1][60]="488";  mapCalgRES_nameOfRegion[1][60]="(NW) Lynx Ridge"; mapCalgRES_valueOfRegion[1][60]="Lynx Ridge Calgary";
mapCalgRES_idOfRegion[1][61]="524";  mapCalgRES_nameOfRegion[1][61]="(NW) Kincora"; mapCalgRES_valueOfRegion[1][61]="Kincora";

mapCalgRES_idOfRegion[1][62]="526";  mapCalgRES_nameOfRegion[1][62]="(NW) Sage Hill"; mapCalgRES_valueOfRegion[1][62]="Sage Hill";


mapCalgRES_titleOfArea[2] = "Calgary South East";
mapCalgRES_nameOfRegion[2] = new Array();
mapCalgRES_idOfRegion[2] = new Array();
mapCalgRES_valueOfRegion[2] = new Array();

mapCalgRES_idOfRegion[2][0]="215";  mapCalgRES_nameOfRegion[2][0]="(SE) Acadia"; mapCalgRES_valueOfRegion[2][0]="Acadia";
mapCalgRES_idOfRegion[2][1]="217";  mapCalgRES_nameOfRegion[2][1]="(SE) Blackfoot Mobile Park"; mapCalgRES_valueOfRegion[2][1]="Blackfoot Mobile Prk";
mapCalgRES_idOfRegion[2][2]="280";  mapCalgRES_nameOfRegion[2][2]="(SE) Chaparral"; mapCalgRES_valueOfRegion[2][2]="Chaparral";
mapCalgRES_idOfRegion[2][3]="355";  mapCalgRES_nameOfRegion[2][3]="(SE) Copperfield"; mapCalgRES_valueOfRegion[2][3]="Copperfield";
mapCalgRES_idOfRegion[2][4]="360";  mapCalgRES_nameOfRegion[2][4]="(SE) Cranston"; mapCalgRES_valueOfRegion[2][4]="Cranston";
mapCalgRES_idOfRegion[2][5]="265";  mapCalgRES_nameOfRegion[2][5]="(SE) Deer Ridge"; mapCalgRES_valueOfRegion[2][5]="Deer Ridge";
mapCalgRES_idOfRegion[2][6]="270";  mapCalgRES_nameOfRegion[2][6]="(SE) Deer Run"; mapCalgRES_valueOfRegion[2][6]="Deer Run";
mapCalgRES_idOfRegion[2][7]="252";  mapCalgRES_nameOfRegion[2][7]="(SE) Diamond Cove"; mapCalgRES_valueOfRegion[2][7]="Diamond Cove";
mapCalgRES_idOfRegion[2][8]="320";  mapCalgRES_nameOfRegion[2][8]="(SE) Douglas Glen"; mapCalgRES_valueOfRegion[2][8]="Douglasglen";
mapCalgRES_idOfRegion[2][9]="330";  mapCalgRES_nameOfRegion[2][9]="(SE) Douglas Ridge"; mapCalgRES_valueOfRegion[2][9]="Douglas Rdg_Dglsdale";
mapCalgRES_idOfRegion[2][10]="325";  mapCalgRES_nameOfRegion[2][10]="(SE) Douglasdale Estates"; mapCalgRES_valueOfRegion[2][10]="Douglasdale Estates";
mapCalgRES_idOfRegion[2][11]="210";  mapCalgRES_nameOfRegion[2][11]="(SE) Fairview"; mapCalgRES_valueOfRegion[2][11]="Fairview";
mapCalgRES_idOfRegion[2][12]="340";  mapCalgRES_nameOfRegion[2][12]="(SE) Foothills Industrial Park"; mapCalgRES_valueOfRegion[2][12]="Foothills Ind Pk S";
mapCalgRES_idOfRegion[2][13]="205";  mapCalgRES_nameOfRegion[2][13]="(SE) Highfield"; mapCalgRES_valueOfRegion[2][13]="Highfield";
mapCalgRES_idOfRegion[2][14]="200";  mapCalgRES_nameOfRegion[2][14]="(SE) Inglewood"; mapCalgRES_valueOfRegion[2][14]="Inglewood";
mapCalgRES_idOfRegion[2][15]="235";  mapCalgRES_nameOfRegion[2][15]="(SE) Lake Bonavista"; mapCalgRES_valueOfRegion[2][15]="Lake Bonavista";
mapCalgRES_idOfRegion[2][16]="245";  mapCalgRES_nameOfRegion[2][16]="(SE) Lake Bonavista Downs"; mapCalgRES_valueOfRegion[2][16]="Lk Bonavista Downs";
mapCalgRES_idOfRegion[2][17]="240";  mapCalgRES_nameOfRegion[2][17]="(SE) Lake Bonavista Estates"; mapCalgRES_valueOfRegion[2][17]="Lk Bonavista Estates";
mapCalgRES_idOfRegion[2][18]="300";  mapCalgRES_nameOfRegion[2][18]="(SE) Lynnwood Ridge"; mapCalgRES_valueOfRegion[2][18]="Lynnwood_Riverglen"; //this may be incorrect
mapCalgRES_idOfRegion[2][19]="207";  mapCalgRES_nameOfRegion[2][19]="(SE) Manchester"; mapCalgRES_valueOfRegion[2][19]="Manchester";
mapCalgRES_idOfRegion[2][20]="230";  mapCalgRES_nameOfRegion[2][20]="(SE) Maple Ridge"; mapCalgRES_valueOfRegion[2][20]="Maple Ridge";
mapCalgRES_idOfRegion[2][21]="335";  mapCalgRES_nameOfRegion[2][21]="(SE) Mckenzie Lake"; mapCalgRES_valueOfRegion[2][21]="McKenzie Lake";
mapCalgRES_idOfRegion[2][22]="345";  mapCalgRES_nameOfRegion[2][22]="(SE) Mckenzie Towne"; mapCalgRES_valueOfRegion[2][22]="McKenzie Towne";
mapCalgRES_idOfRegion[2][23]="255";  mapCalgRES_nameOfRegion[2][23]="(SE) Midnapore"; mapCalgRES_valueOfRegion[2][23]="Midnapore";
mapCalgRES_idOfRegion[2][24]="350";  mapCalgRES_nameOfRegion[2][24]="(SE) New Brighton"; mapCalgRES_valueOfRegion[2][24]="New Brighton";
mapCalgRES_idOfRegion[2][25]="305";  mapCalgRES_nameOfRegion[2][25]="(SE) Ogden/Lynnwood"; mapCalgRES_valueOfRegion[2][25]="Ogden_Lynnwd_Millcan"; //this may be incorrect
mapCalgRES_idOfRegion[2][26]="260";  mapCalgRES_nameOfRegion[2][26]="(SE) Parkland"; mapCalgRES_valueOfRegion[2][26]="Parkland";
mapCalgRES_idOfRegion[2][27]="250";  mapCalgRES_nameOfRegion[2][27]="(SE) Queensland"; mapCalgRES_valueOfRegion[2][27]="Queensland";
mapCalgRES_idOfRegion[2][28]="202";  mapCalgRES_nameOfRegion[2][28]="(SE) Ramsay"; mapCalgRES_valueOfRegion[2][28]="Ramsay";
mapCalgRES_idOfRegion[2][29]="310";  mapCalgRES_nameOfRegion[2][29]="(SE) Riverbend"; mapCalgRES_valueOfRegion[2][29]="Riverbend";
mapCalgRES_idOfRegion[2][30]="306";  mapCalgRES_nameOfRegion[2][30]="(SE) South Hill"; mapCalgRES_valueOfRegion[2][30]="South Hill";
mapCalgRES_idOfRegion[2][31]="275";  mapCalgRES_nameOfRegion[2][31]="(SE) Sundance"; mapCalgRES_valueOfRegion[2][31]="Sundance";
mapCalgRES_idOfRegion[2][32]="220";  mapCalgRES_nameOfRegion[2][32]="(SE) Willow Park"; mapCalgRES_valueOfRegion[2][32]="Willow Park";
mapCalgRES_idOfRegion[2][33]="225";  mapCalgRES_nameOfRegion[2][33]="(SE) Willow Park Estates"; mapCalgRES_valueOfRegion[2][33]="Willow Park Estates";
mapCalgRES_idOfRegion[2][34]="365";  mapCalgRES_nameOfRegion[2][34]="(SE) Auburn Bay"; mapCalgRES_valueOfRegion[2][34]="Auburn Bay";
mapCalgRES_idOfRegion[2][35]="370";  mapCalgRES_nameOfRegion[2][35]="(SE) Seton"; mapCalgRES_valueOfRegion[2][35]="Seton";

mapCalgRES_idOfRegion[2][36]="375";  mapCalgRES_nameOfRegion[2][36]="(SE) Mahogany"; mapCalgRES_valueOfRegion[2][36]="Mahogany";
mapCalgRES_idOfRegion[2][37]="315";  mapCalgRES_nameOfRegion[2][37]="(SE) Quarry Park"; mapCalgRES_valueOfRegion[2][37]="Quarry Park";

mapCalgRES_titleOfArea[3] = "Calgary South West";
mapCalgRES_nameOfRegion[3] = new Array();
mapCalgRES_idOfRegion[3] = new Array();
mapCalgRES_valueOfRegion[3] = new Array();

mapCalgRES_idOfRegion[3][0]="019"; mapCalgRES_nameOfRegion[3][0]="(SW) Altadore/River Park"; mapCalgRES_valueOfRegion[3][0]="Altadore_River Park";
mapCalgRES_idOfRegion[3][1]="073"; mapCalgRES_nameOfRegion[3][1]="(SW) Aspen Woods"; mapCalgRES_valueOfRegion[3][1]="Aspen Woods";
mapCalgRES_idOfRegion[3][2]="015"; mapCalgRES_nameOfRegion[3][2]="(SW) Bankview"; mapCalgRES_valueOfRegion[3][2]="Bankview";
mapCalgRES_idOfRegion[3][3]="129"; mapCalgRES_nameOfRegion[3][3]="(SW) Bayview"; mapCalgRES_valueOfRegion[3][3]="Bayview";
mapCalgRES_idOfRegion[3][4]="110"; mapCalgRES_nameOfRegion[3][4]="(SW) Bel Aire"; mapCalgRES_valueOfRegion[3][4]="Bel Aire";
mapCalgRES_idOfRegion[3][5]="135"; mapCalgRES_nameOfRegion[3][5]="(SW) Braeside"; mapCalgRES_valueOfRegion[3][5]="Braeside_Braesde Est";
mapCalgRES_idOfRegion[3][6]="161"; mapCalgRES_nameOfRegion[3][6]="(SW) Bridlewood"; mapCalgRES_valueOfRegion[3][6]="Bridlewood";
mapCalgRES_idOfRegion[3][7]="105"; mapCalgRES_nameOfRegion[3][7]="(SW) Britannia"; mapCalgRES_valueOfRegion[3][7]="Britannia";
mapCalgRES_idOfRegion[3][8]="125"; mapCalgRES_nameOfRegion[3][8]="(SW) Canyon Meadows"; mapCalgRES_valueOfRegion[3][8]="Canyon Meadows";
mapCalgRES_idOfRegion[3][9]="127"; mapCalgRES_nameOfRegion[3][9]="(SW) Canyon Meadows Estates"; mapCalgRES_valueOfRegion[3][9]="Canyon Mdws Estates";
mapCalgRES_idOfRegion[3][10]="145"; mapCalgRES_nameOfRegion[3][10]="(SW) Cedarbrae"; mapCalgRES_valueOfRegion[3][10]="Cedarbrae";
mapCalgRES_idOfRegion[3][11]="020"; mapCalgRES_nameOfRegion[3][11]="(SW) CFB Currie"; mapCalgRES_valueOfRegion[3][11]="CFB Currie";
mapCalgRES_idOfRegion[3][12]="024"; mapCalgRES_nameOfRegion[3][12]="(SW) CFB Lincoln Park"; mapCalgRES_valueOfRegion[3][12]="CFB Lincoln Park";
mapCalgRES_idOfRegion[3][13]="117"; mapCalgRES_nameOfRegion[3][13]="(SW) Chinook Park"; mapCalgRES_valueOfRegion[3][13]="Chinook Park";
mapCalgRES_idOfRegion[3][14]="052"; mapCalgRES_nameOfRegion[3][14]="(SW) Christie Park"; mapCalgRES_valueOfRegion[3][14]="Christie Park Estate";
mapCalgRES_idOfRegion[3][15]="004"; mapCalgRES_nameOfRegion[3][15]="(SW) Cliff Bungalow"; mapCalgRES_valueOfRegion[3][15]="Cliff Bungalow";
mapCalgRES_idOfRegion[3][16]="049"; mapCalgRES_nameOfRegion[3][16]="(SW) Coach Hill"; mapCalgRES_valueOfRegion[3][16]="Coach Hill";
mapCalgRES_idOfRegion[3][17]="003"; mapCalgRES_nameOfRegion[3][17]="(SW) Connaught"; mapCalgRES_valueOfRegion[3][17]="Connaught";
mapCalgRES_idOfRegion[3][18]="071"; mapCalgRES_nameOfRegion[3][18]="(SW) Cougar Ridge"; mapCalgRES_valueOfRegion[3][18]="Cougar Ridge";
mapCalgRES_idOfRegion[3][19]="081"; mapCalgRES_nameOfRegion[3][19]="(SW) Crestmont"; mapCalgRES_valueOfRegion[3][19]="Crestmont";
mapCalgRES_idOfRegion[3][20]="070"; mapCalgRES_nameOfRegion[3][20]="(SW) Discovery Ridge"; mapCalgRES_valueOfRegion[3][20]="Discovery Ridge";
mapCalgRES_idOfRegion[3][21]="001"; mapCalgRES_nameOfRegion[3][21]="(SW) Downtown"; mapCalgRES_valueOfRegion[3][21]="Downtown";
mapCalgRES_idOfRegion[3][22]="006"; mapCalgRES_nameOfRegion[3][22]="(SW) Downtown East Village"; mapCalgRES_valueOfRegion[3][22]="Downtown East Village";
mapCalgRES_idOfRegion[3][23]="012"; mapCalgRES_nameOfRegion[3][23]="(SW) Downtown West End"; mapCalgRES_valueOfRegion[3][23]="Downtown West End";
mapCalgRES_idOfRegion[3][24]="119"; mapCalgRES_nameOfRegion[3][24]="(SW) Eagle Ridge"; mapCalgRES_valueOfRegion[3][24]="Eagle Ridge";
mapCalgRES_idOfRegion[3][25]="002"; mapCalgRES_nameOfRegion[3][25]="(SW) Eau Claire"; mapCalgRES_valueOfRegion[3][25]="Eau Claire";
mapCalgRES_idOfRegion[3][26]="005"; mapCalgRES_nameOfRegion[3][26]="(SW) Elbow Park/Glencoe"; mapCalgRES_valueOfRegion[3][26]="Elbow Park_Glencoe";
mapCalgRES_idOfRegion[3][27]="103"; mapCalgRES_nameOfRegion[3][27]="(SW) Elboya"; mapCalgRES_valueOfRegion[3][27]="Elboya";
mapCalgRES_idOfRegion[3][28]="101"; mapCalgRES_nameOfRegion[3][28]="(SW) Erlton"; mapCalgRES_valueOfRegion[3][28]="Erlton";
mapCalgRES_idOfRegion[3][29]="157"; mapCalgRES_nameOfRegion[3][29]="(SW) Evergreen"; mapCalgRES_valueOfRegion[3][29]="Evergreen";
mapCalgRES_idOfRegion[3][30]="045"; mapCalgRES_nameOfRegion[3][30]="(SW) Glamorgan"; mapCalgRES_valueOfRegion[3][30]="Glamorgan";
mapCalgRES_idOfRegion[3][31]="043"; mapCalgRES_nameOfRegion[3][31]="(SW) Glenbrook"; mapCalgRES_valueOfRegion[3][31]="Glenbrook";
mapCalgRES_idOfRegion[3][32]="041"; mapCalgRES_nameOfRegion[3][32]="(SW) Glendale/Glendale Meadows"; mapCalgRES_valueOfRegion[3][32]="Glendle_Glendle Mdws";
mapCalgRES_idOfRegion[3][33]="121"; mapCalgRES_nameOfRegion[3][33]="(SW) Haysboro"; mapCalgRES_valueOfRegion[3][33]="Haysboro";
mapCalgRES_idOfRegion[3][34]="115"; mapCalgRES_nameOfRegion[3][34]="(SW) Kelvin Grove"; mapCalgRES_valueOfRegion[3][34]="Kelvin Grove";
mapCalgRES_idOfRegion[3][35]="027"; mapCalgRES_nameOfRegion[3][35]="(SW) Killarney/Glengarry"; mapCalgRES_valueOfRegion[3][35]="Killarney_Glengarry";
mapCalgRES_idOfRegion[3][36]="113"; mapCalgRES_nameOfRegion[3][36]="(SW) Kingsland"; mapCalgRES_valueOfRegion[3][36]="Kingsland";
mapCalgRES_idOfRegion[3][37]="031"; mapCalgRES_nameOfRegion[3][37]="(SW) Lakeview"; mapCalgRES_valueOfRegion[3][37]="Lakeview";
mapCalgRES_idOfRegion[3][38]="033"; mapCalgRES_nameOfRegion[3][38]="(SW) Lakeview Village"; mapCalgRES_valueOfRegion[3][38]="Lakeview Village";
mapCalgRES_idOfRegion[3][39]="021"; mapCalgRES_nameOfRegion[3][39]="(SW) Lincoln Park"; mapCalgRES_valueOfRegion[3][39]="Lincoln Park";
mapCalgRES_idOfRegion[3][40]="010"; mapCalgRES_nameOfRegion[3][40]="(SW) Lower Mount Royal"; mapCalgRES_valueOfRegion[3][40]="Lower Mount Royal";
mapCalgRES_idOfRegion[3][41]="111"; mapCalgRES_nameOfRegion[3][41]="(SW) Mayfair"; mapCalgRES_valueOfRegion[3][41]="Mayfair";
mapCalgRES_idOfRegion[3][42]="109"; mapCalgRES_nameOfRegion[3][42]="(SW) Meadowlark Park"; mapCalgRES_valueOfRegion[3][42]="Meadowlark Park";
mapCalgRES_idOfRegion[3][43]="153"; mapCalgRES_nameOfRegion[3][43]="(SW) Millrise"; mapCalgRES_valueOfRegion[3][43]="Millrise";
mapCalgRES_idOfRegion[3][44]="014"; mapCalgRES_nameOfRegion[3][44]="(SW) Mission"; mapCalgRES_valueOfRegion[3][44]="Mission";
mapCalgRES_idOfRegion[3][45]="007"; mapCalgRES_nameOfRegion[3][45]="(SW) Mount Royal"; mapCalgRES_valueOfRegion[3][45]="Mount Royal";
mapCalgRES_idOfRegion[3][46]="022"; mapCalgRES_nameOfRegion[3][46]="(SW) North Glenmore Park"; mapCalgRES_valueOfRegion[3][46]="North Glenmore";
mapCalgRES_idOfRegion[3][47]="143"; mapCalgRES_nameOfRegion[3][47]="(SW) Oakridge"; mapCalgRES_valueOfRegion[3][47]="Oakridge";
mapCalgRES_idOfRegion[3][48]="141"; mapCalgRES_nameOfRegion[3][48]="(SW) Oakridge Estates"; mapCalgRES_valueOfRegion[3][48]="Oakridge Estates";
mapCalgRES_idOfRegion[3][49]="133"; mapCalgRES_nameOfRegion[3][49]="(SW) Palliser"; mapCalgRES_valueOfRegion[3][49]="Palliser";
mapCalgRES_idOfRegion[3][50]="104"; mapCalgRES_nameOfRegion[3][50]="(SW) Park Hill/Stanley Park"; mapCalgRES_valueOfRegion[3][50]="Parkhill_Stanley Prk";
mapCalgRES_idOfRegion[3][51]="047"; mapCalgRES_nameOfRegion[3][51]="(SW) Prominence Patterson"; mapCalgRES_valueOfRegion[3][51]="Prominence_Patterson";  
mapCalgRES_idOfRegion[3][52]="131"; mapCalgRES_nameOfRegion[3][52]="(SW) Pumphill"; mapCalgRES_valueOfRegion[3][52]="Pump Hill";
mapCalgRES_idOfRegion[3][53]="029"; mapCalgRES_nameOfRegion[3][53]="(SW) Richmond"; mapCalgRES_valueOfRegion[3][53]="Richmond Park_Knobhl"; //this may be incorrect
mapCalgRES_idOfRegion[3][54]="057"; mapCalgRES_nameOfRegion[3][54]="(SW) Richmond Hill"; mapCalgRES_valueOfRegion[3][54]="Richmond Hill";
mapCalgRES_idOfRegion[3][55]="102"; mapCalgRES_nameOfRegion[3][55]="(SW) Rideau Park"; mapCalgRES_valueOfRegion[3][55]="Rideau Park";
mapCalgRES_idOfRegion[3][56]="037"; mapCalgRES_nameOfRegion[3][56]="(SW) Rosscarrock"; mapCalgRES_valueOfRegion[3][56]="Rosscarrock";
mapCalgRES_idOfRegion[3][57]="100"; mapCalgRES_nameOfRegion[3][57]="(SW) Roxboro"; mapCalgRES_valueOfRegion[3][57]="Roxboro";
mapCalgRES_idOfRegion[3][58]="028"; mapCalgRES_nameOfRegion[3][58]="(SW) Rutland Park"; mapCalgRES_valueOfRegion[3][58]="Rutland Park";
mapCalgRES_idOfRegion[3][59]="011"; mapCalgRES_nameOfRegion[3][59]="(SW) Scarboro"; mapCalgRES_valueOfRegion[3][59]="Scarboro";
mapCalgRES_idOfRegion[3][60]="025"; mapCalgRES_nameOfRegion[3][60]="(SW) Shaganappi"; mapCalgRES_valueOfRegion[3][60]="Shaganappi";
mapCalgRES_idOfRegion[3][61]="151"; mapCalgRES_nameOfRegion[3][61]="(SW) Shawnee Slopes"; mapCalgRES_valueOfRegion[3][61]="Shawnee Slps_Evergreen Est";
mapCalgRES_idOfRegion[3][62]="155"; mapCalgRES_nameOfRegion[3][62]="(SW) Shawnessy"; mapCalgRES_valueOfRegion[3][62]="Shawnessy";
mapCalgRES_idOfRegion[3][63]="053"; mapCalgRES_nameOfRegion[3][63]="(SW) Signal Hill"; mapCalgRES_valueOfRegion[3][63]="Signl Hll_Sienna Hll";
mapCalgRES_idOfRegion[3][64]="055"; mapCalgRES_nameOfRegion[3][64]="(SW) Signature Parke"; mapCalgRES_valueOfRegion[3][64]="Signature Parke";
mapCalgRES_idOfRegion[3][65]="159"; mapCalgRES_nameOfRegion[3][65]="(SW) Somerset"; mapCalgRES_valueOfRegion[3][65]="Somerset";
mapCalgRES_idOfRegion[3][66]="017"; mapCalgRES_nameOfRegion[3][66]="(SW) South Calgary"; mapCalgRES_valueOfRegion[3][66]="South Calgary";
mapCalgRES_idOfRegion[3][67]="123"; mapCalgRES_nameOfRegion[3][67]="(SW) Southwood"; mapCalgRES_valueOfRegion[3][67]="Southwood";
mapCalgRES_idOfRegion[3][68]="065"; mapCalgRES_nameOfRegion[3][68]="(SW) Springbank Hill"; mapCalgRES_valueOfRegion[3][68]="Springbank Hill";
mapCalgRES_idOfRegion[3][69]="023"; mapCalgRES_nameOfRegion[3][69]="(SW) Spruce Cliff"; mapCalgRES_valueOfRegion[3][69]="Spruce Cliff";
mapCalgRES_idOfRegion[3][70]="051"; mapCalgRES_nameOfRegion[3][70]="(SW) Strathcona Park"; mapCalgRES_valueOfRegion[3][70]="Strathcona Park";
mapCalgRES_idOfRegion[3][71]="009"; mapCalgRES_nameOfRegion[3][71]="(SW) Sunalta"; mapCalgRES_valueOfRegion[3][71]="Sunalta";
mapCalgRES_idOfRegion[3][72]="067"; mapCalgRES_nameOfRegion[3][72]="(SW) The Slopes"; mapCalgRES_valueOfRegion[3][72]="The Slopes";
mapCalgRES_idOfRegion[3][73]="013"; mapCalgRES_nameOfRegion[3][73]="(SW) Upper Scarboro"; mapCalgRES_valueOfRegion[3][73]="Upper Scarboro";
mapCalgRES_idOfRegion[3][74]="008"; mapCalgRES_nameOfRegion[3][74]="(SW) Victoria Park"; mapCalgRES_valueOfRegion[3][74]="Victoria Park";
mapCalgRES_idOfRegion[3][75]="075"; mapCalgRES_nameOfRegion[3][75]="(SW) West Springs"; mapCalgRES_valueOfRegion[3][75]="West Springs";
mapCalgRES_idOfRegion[3][76]="039"; mapCalgRES_nameOfRegion[3][76]="(SW) Westgate"; mapCalgRES_valueOfRegion[3][76]="Westgate";
mapCalgRES_idOfRegion[3][77]="035"; mapCalgRES_nameOfRegion[3][77]="(SW) Wildwood"; mapCalgRES_valueOfRegion[3][77]="Wildwood";
mapCalgRES_idOfRegion[3][78]="107"; mapCalgRES_nameOfRegion[3][78]="(SW) Windsor Park"; mapCalgRES_valueOfRegion[3][78]="Windsor Park";
mapCalgRES_idOfRegion[3][79]="147"; mapCalgRES_nameOfRegion[3][79]="(SW) Woodbine"; mapCalgRES_valueOfRegion[3][79]="Woodbine";
mapCalgRES_idOfRegion[3][80]="139"; mapCalgRES_nameOfRegion[3][80]="(SW) Woodlands"; mapCalgRES_valueOfRegion[3][80]="Woodlands";
mapCalgRES_idOfRegion[3][81]="165"; mapCalgRES_nameOfRegion[3][81]="(SW) Silverado"; mapCalgRES_valueOfRegion[3][81]="Silverado";

mapCalgRES_titleOfArea[4] = "Calgary Area Cities";
mapCalgRES_nameOfRegion[4] = new Array();
mapCalgRES_idOfRegion[4] = new Array();
mapCalgRES_valueOfRegion[4] = new Array();

mapCalgRES_idOfRegion[4][0]="8888"; mapCalgRES_nameOfRegion[4][0]="Acme"; mapCalgRES_valueOfRegion[4][0]="Acme";
mapCalgRES_idOfRegion[4][1]="AST"; mapCalgRES_nameOfRegion[4][1]="Airdrie"; mapCalgRES_valueOfRegion[4][1]="Airdrie";
mapCalgRES_idOfRegion[4][2]="8888"; mapCalgRES_nameOfRegion[4][2]="Banff"; mapCalgRES_valueOfRegion[4][2]="Banff"; 
mapCalgRES_idOfRegion[4][3]="8888"; mapCalgRES_nameOfRegion[4][3]="Black Diamond"; mapCalgRES_valueOfRegion[4][3]="Black Diamond";
mapCalgRES_idOfRegion[4][4]="8888"; mapCalgRES_nameOfRegion[4][4]="Bragg Creek"; mapCalgRES_valueOfRegion[4][4]="Bragg Creek";
mapCalgRES_idOfRegion[4][5]="8888"; mapCalgRES_nameOfRegion[4][5]="Canmore"; mapCalgRES_valueOfRegion[4][5]="Canmore"; 
mapCalgRES_idOfRegion[4][6]="8888"; mapCalgRES_nameOfRegion[4][6]="Carseland"; mapCalgRES_valueOfRegion[4][6]="Carseland"; 
mapCalgRES_idOfRegion[4][7]="0056"; mapCalgRES_nameOfRegion[4][7]="Carstairs"; mapCalgRES_valueOfRegion[4][7]="Carstairs"; 
mapCalgRES_idOfRegion[4][8]="8888"; mapCalgRES_nameOfRegion[4][8]="Chestermere"; mapCalgRES_valueOfRegion[4][8]="Chestermere";
mapCalgRES_idOfRegion[4][9]="8888"; mapCalgRES_nameOfRegion[4][9]="Cochrane"; mapCalgRES_valueOfRegion[4][9]="Cochrane";
mapCalgRES_idOfRegion[4][10]="0078"; mapCalgRES_nameOfRegion[4][10]="Cremona"; mapCalgRES_valueOfRegion[4][10]="Cremona"; 
mapCalgRES_idOfRegion[4][11]="8888"; mapCalgRES_nameOfRegion[4][11]="Crossfield"; mapCalgRES_valueOfRegion[4][11]="Crossfield";
mapCalgRES_idOfRegion[4][12]="8888"; mapCalgRES_nameOfRegion[4][12]="Didsbury"; mapCalgRES_valueOfRegion[4][12]="Didsbury";
mapCalgRES_idOfRegion[4][13]="8888"; mapCalgRES_nameOfRegion[4][13]="Foothills"; mapCalgRES_valueOfRegion[4][13]="Foothills";
mapCalgRES_idOfRegion[4][14]="8888"; mapCalgRES_nameOfRegion[4][14]="High River"; mapCalgRES_valueOfRegion[4][14]="High River";
mapCalgRES_idOfRegion[4][15]="0180"; mapCalgRES_nameOfRegion[4][15]="Innisfail"; mapCalgRES_valueOfRegion[4][15]="Innisfail"; 
mapCalgRES_idOfRegion[4][16]="8888"; mapCalgRES_nameOfRegion[4][16]="Langdon"; mapCalgRES_valueOfRegion[4][16]="Langdon";
mapCalgRES_idOfRegion[4][17]="8888"; mapCalgRES_nameOfRegion[4][17]="Okotoks"; mapCalgRES_valueOfRegion[4][17]="Okotoks";
mapCalgRES_idOfRegion[4][18]="8888"; mapCalgRES_nameOfRegion[4][18]="Olds"; mapCalgRES_valueOfRegion[4][18]="Olds";
mapCalgRES_idOfRegion[4][19]="0248"; mapCalgRES_nameOfRegion[4][19]="Penhold"; mapCalgRES_valueOfRegion[4][19]="Penhold"; 
mapCalgRES_idOfRegion[4][20]="0248"; mapCalgRES_nameOfRegion[4][20]="Rocky View"; mapCalgRES_valueOfRegion[4][20]="Rocky View"; 
mapCalgRES_idOfRegion[4][21]="8888"; mapCalgRES_nameOfRegion[4][21]="Strathmore"; mapCalgRES_valueOfRegion[4][21]="Strathmore";
mapCalgRES_idOfRegion[4][22]="0307"; mapCalgRES_nameOfRegion[4][22]="Sundre"; mapCalgRES_valueOfRegion[4][22]="Sundre"; 
mapCalgRES_idOfRegion[4][23]="0319"; mapCalgRES_nameOfRegion[4][23]="Torrington"; mapCalgRES_valueOfRegion[4][23]="Torrington"; 
mapCalgRES_idOfRegion[4][24]="8888"; mapCalgRES_nameOfRegion[4][24]="Turner Valley"; mapCalgRES_valueOfRegion[4][24]="Turner Valley";
mapCalgRES_idOfRegion[4][25]="0873"; mapCalgRES_nameOfRegion[4][25]="Water Valley"; mapCalgRES_valueOfRegion[4][25]="Water Valley"; 

//Data for the Titles and the Regions.
mapCalgRES_titleOfArea[5] = "Airdrie";
mapCalgRES_nameOfRegion[5] = new Array();
mapCalgRES_idOfRegion[5] = new Array();
mapCalgRES_valueOfRegion[5] = new Array();

mapCalgRES_idOfRegion[5][0]="ADM"; mapCalgRES_nameOfRegion[5][0]="(Airdrie) Airdrie Meadows"; mapCalgRES_valueOfRegion[5][0]="Airdrie Meadows";
mapCalgRES_idOfRegion[5][1]="BAY"; mapCalgRES_nameOfRegion[5][1]="(Airdrie) Bayside"; mapCalgRES_valueOfRegion[5][1]="Bayside";
mapCalgRES_idOfRegion[5][2]="8888"; mapCalgRES_nameOfRegion[5][2]="(Airdrie) Big Hill Springs Est"; mapCalgRES_valueOfRegion[5][2]="Big Hill Springs Est";
mapCalgRES_idOfRegion[5][3]="BGS"; mapCalgRES_nameOfRegion[5][3]="(Airdrie) Big Springs"; mapCalgRES_valueOfRegion[5][3]="Big Springs";
mapCalgRES_idOfRegion[5][4]="CAN"; mapCalgRES_nameOfRegion[5][4]="(Airdrie) Canals"; mapCalgRES_valueOfRegion[5][4]="Canals";
mapCalgRES_idOfRegion[5][5]="COO"; mapCalgRES_nameOfRegion[5][5]="(Airdrie) Coopers Crossing"; mapCalgRES_valueOfRegion[5][5]="Coopers Crossing";
mapCalgRES_idOfRegion[5][6]="DOW"; mapCalgRES_nameOfRegion[5][6]="(Airdrie) Downtown"; mapCalgRES_valueOfRegion[5][6]="Downtown_1";
mapCalgRES_idOfRegion[5][7]="8888"; mapCalgRES_nameOfRegion[5][7]="(Airdrie) East Lake Industrial Park"; mapCalgRES_valueOfRegion[5][7]="East Lake Industrial Park";
mapCalgRES_idOfRegion[5][8]="EDG"; mapCalgRES_nameOfRegion[5][8]="(Airdrie) Edgewater"; mapCalgRES_valueOfRegion[5][8]="Edgewater";
mapCalgRES_idOfRegion[5][9]="FAI"; mapCalgRES_nameOfRegion[5][9]="(Airdrie) Fairways"; mapCalgRES_valueOfRegion[5][9]="Fairways";

mapCalgRES_idOfRegion[5][10]="JEN"; mapCalgRES_nameOfRegion[5][10]="(Airdrie) Jensen"; mapCalgRES_valueOfRegion[5][10]="Jensen";
mapCalgRES_idOfRegion[5][11]="LUX"; mapCalgRES_nameOfRegion[5][11]="(Airdrie) Luxstone"; mapCalgRES_valueOfRegion[5][11]="Luxstone";
mapCalgRES_idOfRegion[5][12]="MDB"; mapCalgRES_nameOfRegion[5][12]="(Airdrie) Meadowbrook"; mapCalgRES_valueOfRegion[5][12]="Meadowbrook";
mapCalgRES_idOfRegion[5][13]="8888"; mapCalgRES_nameOfRegion[5][13]="(Airdrie) None"; mapCalgRES_valueOfRegion[5][13]="None";
mapCalgRES_idOfRegion[5][14]="OTO"; mapCalgRES_nameOfRegion[5][14]="(Airdrie) Old Town"; mapCalgRES_valueOfRegion[5][14]="Old Town";
mapCalgRES_idOfRegion[5][15]="8888"; mapCalgRES_nameOfRegion[5][15]="(Airdrie) Ridgegate"; mapCalgRES_valueOfRegion[5][15]="Ridgegate";
mapCalgRES_idOfRegion[5][16]="SAG"; mapCalgRES_nameOfRegion[5][16]="(Airdrie) Sagewood"; mapCalgRES_valueOfRegion[5][16]="Sagewood";
mapCalgRES_idOfRegion[5][17]="SIL"; mapCalgRES_nameOfRegion[5][17]="(Airdrie) Silver Creek"; mapCalgRES_valueOfRegion[5][17]="Silver Creek";
mapCalgRES_idOfRegion[5][18]="STO"; mapCalgRES_nameOfRegion[5][18]="(Airdrie) Stonegate"; mapCalgRES_valueOfRegion[5][18]="Stonegate";
mapCalgRES_idOfRegion[5][19]="SUM"; mapCalgRES_nameOfRegion[5][19]="(Airdrie) Summerhill"; mapCalgRES_valueOfRegion[5][19]="Summerhill";

mapCalgRES_idOfRegion[5][20]="SUN"; mapCalgRES_nameOfRegion[5][20]="(Airdrie) Sunridge"; mapCalgRES_valueOfRegion[5][20]="Sunridge";
mapCalgRES_idOfRegion[5][21]="THO"; mapCalgRES_nameOfRegion[5][21]="(Airdrie) Thorburn"; mapCalgRES_valueOfRegion[5][21]="Thorburn";
mapCalgRES_idOfRegion[5][22]="WAT"; mapCalgRES_nameOfRegion[5][22]="(Airdrie) Waterstone"; mapCalgRES_valueOfRegion[5][22]="Waterstone";
mapCalgRES_idOfRegion[5][23]="WLB"; mapCalgRES_nameOfRegion[5][23]="(Airdrie) Willow Brook"; mapCalgRES_valueOfRegion[5][23]="Willow Brook";
mapCalgRES_idOfRegion[5][24]="WOO"; mapCalgRES_nameOfRegion[5][24]="(Airdrie) Woodside"; mapCalgRES_valueOfRegion[5][24]="Woodside";
mapCalgRES_idOfRegion[5][25]="YAN"; mapCalgRES_nameOfRegion[5][25]="(Airdrie) Fletcher Village"; mapCalgRES_valueOfRegion[5][25]="Fletcher Village";
mapCalgRES_idOfRegion[5][26]="FLE"; mapCalgRES_nameOfRegion[5][26]="(Airdrie) Yankee Valley Crossing"; mapCalgRES_valueOfRegion[5][26]="Yankee Valley Crossing";

// 27 -> 25
// 28 -> 26

mapCalgRES_titleOfArea[6] = "Other";
mapCalgRES_nameOfRegion[6] = new Array();
mapCalgRES_idOfRegion[6] = new Array();
mapCalgRES_valueOfRegion[6] = new Array();

mapCalgRES_idOfRegion[6][0]="Cochrane"; mapCalgRES_nameOfRegion[6][0]="Cochrane"; mapCalgRES_valueOfRegion[6][0]="Cochrane";
mapCalgRES_idOfRegion[6][1]="Strathmore"; mapCalgRES_nameOfRegion[6][1]="Strathmore"; mapCalgRES_valueOfRegion[6][1]="Strathmore";
mapCalgRES_idOfRegion[6][2]="8888"; mapCalgRES_nameOfRegion[6][2]="Chestermere"; mapCalgRES_valueOfRegion[6][2]="Chestermere";
mapCalgRES_idOfRegion[6][3]="8888"; mapCalgRES_nameOfRegion[6][3]="Okotoks"; mapCalgRES_valueOfRegion[6][3]="Okotoks";
mapCalgRES_idOfRegion[6][4]="Canmore"; mapCalgRES_nameOfRegion[6][4]="Canmore"; mapCalgRES_valueOfRegion[6][4]="Canmore";

// MAIN 5  -> 6

// 25 -> 0
// 26 -> 1
// 29 -> 2
// 30 -> 3
// 31 -> 4


var mapCalgRES_strList= new Array(7);
var mapCalgRES_strOptions = new Array(7);

//Populates strings with the entire list to be used for larger areas, such as all of the north east.  It will add all the regions in the northeast into
//the string to be submitted.
for (var n=0; n < mapCalgRES_titleOfArea.length; n++){
	mapCalgRES_strList[n] = new Array();
	mapCalgRES_strOptions[n] = new Array();
	for (var i=0; i < mapCalgRES_nameOfRegion[n].length; i++){
		//alert (mapCalgRES_titleOfArea[i]);
		if (mapCalgRES_nameOfRegion[n][i]){
			mapCalgRES_strList[n] = mapCalgRES_strList[n] + '"' + mapCalgRES_valueOfRegion[n][i] + '",';
			mapCalgRES_strOptions[n] = mapCalgRES_strOptions[n] + '<option value=\'\"'+mapCalgRES_valueOfRegion[n][i]+'\"\'>'+mapCalgRES_nameOfRegion[n][i]+'</option>';
		}
	}
	mapCalgRES_strList[n] = mapCalgRES_strList[n].substring(0,mapCalgRES_strList[n].length-1);
	//alert(mapCalgRES_strList);
}
//Function : to show the title and the side panel
function mapCalgRES_showAt(id,mapCalgRES_titleLayer,mapCalgRES_sideLayer,region,strPosition) {
    var x=y=0;
	var sidebarhtml="";
	var titlexinsert = 0;
	
	if (strPosition == "center")
		titlexinsert = 0;
	else if (strPosition == "right")
		titlexinsert = 50;
	else if (strPosition == "rightfarther")
		titlexinsert = 67;

	var blnValueSelected = false;
	var strSelectBox = getSelectBox();
	for (var i = 0; i < strSelectBox.options.length; i++) {
			if(strSelectBox.options[i].value==('"'+mapCalgRES_valueOfRegion[id][region]+'"')){
				//alert(strSelectBox.options[i].value);
				if (strSelectBox.options[i].selected)
					blnValueSelected = true;
			}
	}

	//if ((region)||(region==0))
	if (region>=0){
		if (blnValueSelected)
			mapCalgRES_changeContent (mapCalgRES_titleLayer, '<img name="checkit" src="../images/maps/checkit.gif" border="0" align="bottom"> ' + mapCalgRES_nameOfRegion[id][region]);
		else
			mapCalgRES_changeContent (mapCalgRES_titleLayer, mapCalgRES_nameOfRegion[id][region]);

	}else {
		mapCalgRES_changeContent (mapCalgRES_titleLayer, mapCalgRES_titleOfArea[id]);
	}
	
	if (document.getElementById) {//netscape 6 and above
		document.getElementById(mapCalgRES_titleLayer).style.left = mapCalgRES_titleposx+titlexinsert;
		document.getElementById(mapCalgRES_titleLayer).style.top = mapCalgRES_titleposy-5;
		document.getElementById(mapCalgRES_titleLayer).style.visibility = 'visible';
	}
    else if (document.layers && document.layers[mapCalgRES_titleLayer] != null) {//netscape 4
        document.layers[mapCalgRES_titleLayer].left = mapCalgRES_titleposx+titlexinsert;
        document.layers[mapCalgRES_titleLayer].top = mapCalgRES_titleposy;
        document.layers[mapCalgRES_titleLayer].visibility = 'visible';
    }
    else if (document.all) { //internet explorer
        document.all[mapCalgRES_titleLayer].style.posLeft = mapCalgRES_titleposx+titlexinsert;
        document.all[mapCalgRES_titleLayer].style.posTop = mapCalgRES_titleposy;
        document.all[mapCalgRES_titleLayer].style.visibility = 'visible';
    }
   return
}
//Function to change the content in the layer
function mapCalgRES_changeContent(layerid,shtml) {
	var newshtml = shtml;
	//newshtml =  addanewline(shtml, " ", "<BR>",15);
   if (document.getElementById || document.all) {
      var el = document.getElementById? document.getElementById(layerid): document.all[layerid];
      if (el && typeof el.innerHTML != "undefined") el.innerHTML = newshtml;
   }
   return
}
//function hides the layer
function mapCalgRES_hide(mapCalgRES_titleLayer,mapCalgRES_sideLayer) {
	//mapCalgRES_hide title layer
	if (document.getElementById)	
		document.getElementById(mapCalgRES_titleLayer).style.visibility = 'hidden';
    else if (document.layers && document.layers[mapCalgRES_titleLayer] != null)
        document.layers[mapCalgRES_titleLayer].visibility = 'hidden';
    else if (document.all)
        document.all[mapCalgRES_titleLayer].style.visibility = 'hidden';

	//mapCalgRES_hide side layer
	if (mapCalgRES_sideLayer) {
		if (document.getElementById)	
			document.getElementById(mapCalgRES_sideLayer).style.visibility = 'hidden';
		else if (document.layers && document.layers[mapCalgRES_sideLayer] != null)
			document.layers[mapCalgRES_sideLayer].visibility = 'hidden';
		else if (document.all)
			document.all[mapCalgRES_sideLayer].style.visibility = 'hidden';
	}
   return
}
//This function is used for selecting areas from a map.  It populates a select box based on what region is selected.
function mapCalgRES_selectRegion(id,region,area,strPosition) {
	//alert('region:'+region);
	var strSelectBox = getSelectBox();
	for (var i = 0; i < strSelectBox.options.length; i++) {
		if (area){
			if(strSelectBox.options[i].value==mapCalgRES_strList[id]){
				//alert(strSelectBox.options[i].value);
				if (strSelectBox.options[i].selected)
					strSelectBox.options[i].selected = false;
				else
					strSelectBox.options[i].selected = true;
			}
		} else {
			
			if(strSelectBox.options[i].value==('"'+mapCalgRES_valueOfRegion[id][region]+'"')){
				//alert(strSelectBox.options[i].value);
				if (strSelectBox.options[i].selected)
					strSelectBox.options[i].selected = false;
				else
					strSelectBox.options[i].selected = true;

				mapCalgRES_hide('mapCalgRES_titleLayer',false);	
				mapCalgRES_showAt(id,'mapCalgRES_titleLayer',false,region,strPosition);
			}
		}
	}
	chgAction();
}

//This function is used when the form is submitted.  IT does nothing else but display in an alert box the values of the select box.
// NOTE: This function can be omitted.  It is for debug purposes only.
function mapCalgRES_submitFrm () {
	var strSelectBox = getSelectBox();
	var mapCalgRES_strList = "";
	for (var i = 0; i < strSelectBox.options.length; i++) {
		if(strSelectBox.options[i].selected){
			mapCalgRES_strList = mapCalgRES_strList + strSelectBox.options[i].value +',';
		}
	}
	mapCalgRES_strList = mapCalgRES_strList.substring(0,mapCalgRES_strList.length-1);
	//alert ('Zones : '+mapCalgRES_strList);
//	
	return false
	//return true
}
// This function displays an additoinal layer with the quadrant title.
function mapCalgRES_changeMapLayer(mapLayer,quadranttitle) {
//alert (" "+document.all[mapLayer].style.visibility);	
		if(quadranttitle){
			//alert(quadranttitle);
			mapCalgRES_changeContent('mapCalgRES_quadranttitle',quadranttitle)
		}
		else {
			mapCalgRES_changeContent('mapCalgRES_quadranttitle','')
			
		}

		if(mapLayer!="CalgaryMapLayer"){
			if (document.getElementById)
				document.getElementById('mapCalgRES_quadranttitle').style.visibility = 'visible';
			else if (document.layers && document.layers[mapLayer] != null)
				document.layers[mapCalgRES_quadranttitle].style.visibility = 'visible';
			else if (document.all)
				document.all[mapCalgRES_quadranttitle].style.visibility = 'visible';
		}
		if (document.getElementById) {//netscape 6 and above
			document.getElementById('CalgaryMapLayer').style.visibility = 'hidden';
			document.getElementById('nwLayer').style.visibility = 'hidden';
			document.getElementById('neLayer').style.visibility = 'hidden';
			document.getElementById('seLayer').style.visibility = 'hidden';
			document.getElementById('swLayer').style.visibility = 'hidden';
			document.getElementById('airLayer').style.visibility = 'hidden';			
			
			document.getElementById(mapLayer).style.visibility = 'visible';
		}
		else if (document.layers && document.layers[mapLayer] != null) {
			document.layers['CalgaryMapLayer'].style.visibility = 'hidden';
			document.layers['nwLayer'].style.visibility = 'hidden';
			document.layers['neLayer'].style.visibility = 'hidden';
			document.layers['seLayer'].style.visibility = 'hidden';
			document.layers['swLayer'].style.visibility = 'hidden';
			document.layers['airLayer'].style.visibility = 'hidden';			

			document.layers[mapLayer].style.visibility = 'visible';
		}
		else if (document.all) {
			document.all['CalgaryMapLayer'].style.visibility = 'hidden';
			document.all['nwLayer'].style.visibility = 'hidden';
			document.all['neLayer'].style.visibility = 'hidden';
			document.all['seLayer'].style.visibility = 'hidden';
			document.all['swLayer'].style.visibility = 'hidden';
			document.all['airLayer'].style.visibility = 'hidden';			

			document.all[mapLayer].style.visibility = 'visible';
		}
}

/**************************************  RURAL MAPS  *********************************/
// These maps differ from the residential maps in that they show a side panel with a listing of all the regions.  So when you select an area on the
// map, it selects all the regions within that area.

//positions the title and the side panel.
var mapSA_RURAL_titleposx = 125;
var mapSA_RURAL_titleposy = -553;
var mapSA_RURAL_sidelayerposx = 20;
var mapSA_RURAL_sidelayerposy = -330;

var mapSA_RURAL_titleOfArea = new Array();
var mapSA_RURAL_nameOfRegion = new Array();
var mapSA_RURAL_idOfRegion = new Array();

//Data for the Titles and the Regions.
mapSA_RURAL_titleOfArea[0] = "Banff";
mapSA_RURAL_nameOfRegion[0] = new Array();
mapSA_RURAL_idOfRegion[0] = new Array();
mapSA_RURAL_idOfRegion[0][0] = "9164";
mapSA_RURAL_nameOfRegion[0][0] = "Rural Banff I.D.";
mapSA_RURAL_idOfRegion[0][1] = "0387";
mapSA_RURAL_nameOfRegion[0][1] = "BANFF";
mapSA_RURAL_idOfRegion[0][2] = "9164";
mapSA_RURAL_nameOfRegion[0][2] = "Castle Mountain";
mapSA_RURAL_idOfRegion[0][3] = "0757";
mapSA_RURAL_nameOfRegion[0][3] = "Lake Louise";
mapSA_RURAL_idOfRegion[0][4] = "9164";
mapSA_RURAL_nameOfRegion[0][4] = "Saskatchewan River Crossing";

mapSA_RURAL_titleOfArea[1] = "Bighorn";
mapSA_RURAL_nameOfRegion[1] = new Array();
mapSA_RURAL_idOfRegion[1] = new Array();
mapSA_RURAL_idOfRegion[1][0] = "9382";
mapSA_RURAL_nameOfRegion[1][0] = "Rural Bighorn M.D.";
mapSA_RURAL_idOfRegion[1][1] = "0623";
mapSA_RURAL_nameOfRegion[1][1] = "Benchlands";
mapSA_RURAL_idOfRegion[1][2] = "0050";
mapSA_RURAL_nameOfRegion[1][2] = "CANMORE";
mapSA_RURAL_idOfRegion[1][3] = "0698";
mapSA_RURAL_nameOfRegion[1][3] = "Exshaw";
mapSA_RURAL_idOfRegion[1][4] = "0123";
mapSA_RURAL_nameOfRegion[1][4] = "GHOST LAKE";
mapSA_RURAL_idOfRegion[1][5] = "0724";
mapSA_RURAL_nameOfRegion[1][5] = "Harvie Heights";
mapSA_RURAL_idOfRegion[1][6] = "0755";
mapSA_RURAL_nameOfRegion[1][6] = "Lac des Arcs";
mapSA_RURAL_idOfRegion[1][7] = "0834";
mapSA_RURAL_nameOfRegion[1][7] = "Seebe";
mapSA_RURAL_idOfRegion[1][8] = "0380";
mapSA_RURAL_nameOfRegion[1][8] = "WAIPAROUS";

mapSA_RURAL_titleOfArea[2] = "Kananskis";
mapSA_RURAL_nameOfRegion[2] = new Array();
mapSA_RURAL_idOfRegion[2] = new Array();
mapSA_RURAL_idOfRegion[2][0] = "9373";
mapSA_RURAL_nameOfRegion[2][0] = "Rural Kananskis I.D.";
mapSA_RURAL_idOfRegion[2][1] = "9373";
mapSA_RURAL_nameOfRegion[2][1] = "Kananskis Village";

mapSA_RURAL_titleOfArea[3] = "Mountain View";
mapSA_RURAL_nameOfRegion[3] = new Array();
mapSA_RURAL_idOfRegion[3] = new Array();
mapSA_RURAL_idOfRegion[3][0] = "9226";
mapSA_RURAL_nameOfRegion[3][0] = "Rural Mountain View County";
mapSA_RURAL_idOfRegion[3][2] = "BEB";
mapSA_RURAL_nameOfRegion[3][2] = "Bearberry";
mapSA_RURAL_idOfRegion[3][3] = "9226";
mapSA_RURAL_nameOfRegion[3][3] = "Bergen";
mapSA_RURAL_idOfRegion[3][4] = "0056";
mapSA_RURAL_nameOfRegion[3][4] = "CARSTAIRS";
mapSA_RURAL_idOfRegion[3][5] = "0078";
mapSA_RURAL_nameOfRegion[3][5] = "CREMONA";
mapSA_RURAL_idOfRegion[3][6] = "0088";
mapSA_RURAL_nameOfRegion[3][6] = "DIDSBURY";
mapSA_RURAL_idOfRegion[3][7] = "0689";
mapSA_RURAL_nameOfRegion[3][7] = "Eagle Hill";
mapSA_RURAL_idOfRegion[3][8] = "9226";
mapSA_RURAL_nameOfRegion[3][8] = "Elkton";
mapSA_RURAL_idOfRegion[3][9] = "0239";
mapSA_RURAL_nameOfRegion[3][9] = "OLDS";
mapSA_RURAL_idOfRegion[3][10] = "0307";
mapSA_RURAL_nameOfRegion[3][10] = "SUNDRE";
mapSA_RURAL_idOfRegion[3][11] = "0873";
mapSA_RURAL_nameOfRegion[3][11] = "Water Valley";
mapSA_RURAL_idOfRegion[3][12] = "0879";
mapSA_RURAL_nameOfRegion[3][12] = "Westward Ho";

mapSA_RURAL_titleOfArea[4] = "Kneehill";
mapSA_RURAL_nameOfRegion[4] = new Array();
mapSA_RURAL_idOfRegion[4] = new Array();
mapSA_RURAL_idOfRegion[4][0] = "9191";
mapSA_RURAL_nameOfRegion[4][0] = "Rural Kneehill County";
mapSA_RURAL_idOfRegion[4][1] = "0002";
mapSA_RURAL_nameOfRegion[4][1] = "ACME";
mapSA_RURAL_idOfRegion[4][2] = "0051";
mapSA_RURAL_nameOfRegion[4][2] = "CARBON";
mapSA_RURAL_idOfRegion[4][3] = "0731";
mapSA_RURAL_nameOfRegion[4][3] = "Huxley";
mapSA_RURAL_idOfRegion[4][4] = "0205";
mapSA_RURAL_nameOfRegion[4][4] = "LINDEN";
mapSA_RURAL_idOfRegion[4][5] = "0855";
mapSA_RURAL_nameOfRegion[4][5] = "Swalwell";
mapSA_RURAL_idOfRegion[4][6] = "0316";
mapSA_RURAL_nameOfRegion[4][6] = "THREE HILLS";
mapSA_RURAL_idOfRegion[4][7] = "0319";
mapSA_RURAL_nameOfRegion[4][7] = "Torrington";
mapSA_RURAL_idOfRegion[4][8] = "0320";
mapSA_RURAL_nameOfRegion[4][8] = "TROCHO";
mapSA_RURAL_idOfRegion[4][9] = "0881";
mapSA_RURAL_nameOfRegion[4][9] = "Wimborne";

mapSA_RURAL_titleOfArea[5] = "Rocky View";
mapSA_RURAL_nameOfRegion[5] = new Array();
mapSA_RURAL_idOfRegion[5] = new Array();
mapSA_RURAL_idOfRegion[5][0] = "9269";
mapSA_RURAL_nameOfRegion[5][0] = "Rural Rocky View County";
mapSA_RURAL_idOfRegion[5][2] = "0987";
mapSA_RURAL_nameOfRegion[5][2] = "Balzac";
mapSA_RURAL_idOfRegion[5][3] = "0022";
mapSA_RURAL_nameOfRegion[5][3] = "BEISEKER";
mapSA_RURAL_idOfRegion[5][4] = "0988";
mapSA_RURAL_nameOfRegion[5][4] = "Bottrel";
mapSA_RURAL_idOfRegion[5][5] = "0631";
mapSA_RURAL_nameOfRegion[5][5] = "Bragg Creek";
mapSA_RURAL_idOfRegion[5][6] = "0356";
mapSA_RURAL_nameOfRegion[5][6] = "CHESTERMERE";
mapSA_RURAL_idOfRegion[5][7] = "0070";
mapSA_RURAL_nameOfRegion[5][7] = "COCHRANE";
mapSA_RURAL_idOfRegion[5][8] = "0665";
mapSA_RURAL_nameOfRegion[5][8] = "Cochrane Lake";
mapSA_RURAL_idOfRegion[5][9] = "0672";
mapSA_RURAL_nameOfRegion[5][9] = "Conrich";
mapSA_RURAL_idOfRegion[5][10] = "0079";
mapSA_RURAL_nameOfRegion[5][10] = "CROSSFIELD";
mapSA_RURAL_idOfRegion[5][11] = "0675";
mapSA_RURAL_nameOfRegion[5][11] = "Dalemead";
mapSA_RURAL_idOfRegion[5][12] = "0676";
mapSA_RURAL_nameOfRegion[5][12] = "Dalroy";
mapSA_RURAL_idOfRegion[5][13] = "0989";
mapSA_RURAL_nameOfRegion[5][13] = "Delacour";
mapSA_RURAL_idOfRegion[5][14] = "EBV";
mapSA_RURAL_nameOfRegion[5][14] = "Elbow Valley";
mapSA_RURAL_idOfRegion[5][15] = "0734";
mapSA_RURAL_nameOfRegion[5][15] = "Indus";
mapSA_RURAL_idOfRegion[5][16] = "0183";
mapSA_RURAL_nameOfRegion[5][16] = "IRRICANA";
mapSA_RURAL_idOfRegion[5][17] = "0990";
mapSA_RURAL_nameOfRegion[5][17] = "Janet";
mapSA_RURAL_idOfRegion[5][18] = "0743";
mapSA_RURAL_nameOfRegion[5][18] = "Kathyrn";
mapSA_RURAL_idOfRegion[5][19] = "0747";
mapSA_RURAL_nameOfRegion[5][19] = "Keoma";
mapSA_RURAL_idOfRegion[5][20] = "0758";
mapSA_RURAL_nameOfRegion[5][20] = "Langdon";
mapSA_RURAL_idOfRegion[5][21] = "0773";
mapSA_RURAL_nameOfRegion[5][21] = "Madden";
mapSA_RURAL_idOfRegion[5][22] = "0631";
mapSA_RURAL_nameOfRegion[5][22] = "Redwood Meadows";
mapSA_RURAL_idOfRegion[5][23] = "0837";
mapSA_RURAL_nameOfRegion[5][23] = "Shepard";

mapSA_RURAL_titleOfArea[6] = "Wheatland";
mapSA_RURAL_nameOfRegion[6] = new Array();
mapSA_RURAL_idOfRegion[6] = new Array();
mapSA_RURAL_idOfRegion[6][0] = "9349";
mapSA_RURAL_nameOfRegion[6][0] = "Rural Wheatland County";
mapSA_RURAL_idOfRegion[6][2] = "9349";
mapSA_RURAL_nameOfRegion[6][2] = "Ardenode";
mapSA_RURAL_idOfRegion[6][3] = "0651";
mapSA_RURAL_nameOfRegion[6][3] = "Carseland";
mapSA_RURAL_idOfRegion[6][4] = "0655";
mapSA_RURAL_nameOfRegion[6][4] = "Chancellor";
mapSA_RURAL_idOfRegion[6][5] = "0656";
mapSA_RURAL_nameOfRegion[6][5] = "Cheadle";
mapSA_RURAL_idOfRegion[6][6] = "0067";
mapSA_RURAL_nameOfRegion[6][6] = "Cluny";
mapSA_RURAL_idOfRegion[6][7] = "9349";
mapSA_RURAL_nameOfRegion[6][7] = "Dalum";
mapSA_RURAL_idOfRegion[6][8] = "0126";
mapSA_RURAL_nameOfRegion[6][8] = "Gleichen";
mapSA_RURAL_idOfRegion[6][9] = "0154";
mapSA_RURAL_nameOfRegion[6][9] = "HUSSAR";
mapSA_RURAL_idOfRegion[6][10] = "0771";
mapSA_RURAL_nameOfRegion[6][10] = "Lyalta";
mapSA_RURAL_idOfRegion[6][11] = "0795";
mapSA_RURAL_nameOfRegion[6][11] = "Namaka";
mapSA_RURAL_idOfRegion[6][12] = "0270";
mapSA_RURAL_nameOfRegion[6][12] = "ROCKYFORD";
mapSA_RURAL_idOfRegion[6][13] = "0827";
mapSA_RURAL_nameOfRegion[6][13] = "Rosebud";
mapSA_RURAL_idOfRegion[6][14] = "0295";
mapSA_RURAL_nameOfRegion[6][14] = "STANDARD";
mapSA_RURAL_idOfRegion[6][15] = "0303";
mapSA_RURAL_nameOfRegion[6][15] = "STRATHMORE";

mapSA_RURAL_titleOfArea[7] = "Foothills";
mapSA_RURAL_nameOfRegion[7] = new Array();
mapSA_RURAL_idOfRegion[7] = new Array();
mapSA_RURAL_idOfRegion[7][0] = "9111";
mapSA_RURAL_nameOfRegion[7][0] = "Rural Foothills M.D.";
mapSA_RURAL_idOfRegion[7][1] = "0606";
mapSA_RURAL_nameOfRegion[7][1] = "Aldersyde";
mapSA_RURAL_idOfRegion[7][2] = "0030";
mapSA_RURAL_nameOfRegion[7][2] = "BLACK DIAMOND";
mapSA_RURAL_idOfRegion[7][3] = "0032";
mapSA_RURAL_nameOfRegion[7][3] = "Blackie";
mapSA_RURAL_idOfRegion[7][4] = "0059";
mapSA_RURAL_nameOfRegion[7][4] = "Cayley";
mapSA_RURAL_idOfRegion[7][5] = "0678";
mapSA_RURAL_nameOfRegion[7][5] = "De Winton";
mapSA_RURAL_idOfRegion[7][6] = "0971";
mapSA_RURAL_nameOfRegion[7][6] = "Heritage Pointe";
mapSA_RURAL_idOfRegion[7][7] = "0148";
mapSA_RURAL_nameOfRegion[7][7] = "HIGH RIVER";
mapSA_RURAL_idOfRegion[7][8] = "0208";
mapSA_RURAL_nameOfRegion[7][8] = "LONGVIEW";
mapSA_RURAL_idOfRegion[7][9] = "0786";
mapSA_RURAL_nameOfRegion[7][9] = "Millarville";
mapSA_RURAL_idOfRegion[7][10] = "0238";
mapSA_RURAL_nameOfRegion[7][10] = "OKOTOKS";
mapSA_RURAL_idOfRegion[7][11] = "0972";
mapSA_RURAL_nameOfRegion[7][11] = "Priddis";
mapSA_RURAL_idOfRegion[7][12] = "0973";
mapSA_RURAL_nameOfRegion[7][12] = "Priddis Greens";
mapSA_RURAL_idOfRegion[7][13] = "0321";
mapSA_RURAL_nameOfRegion[7][13] = "TURNER VALLEY";

mapSA_RURAL_titleOfArea[8] = "Vulcan";
mapSA_RURAL_nameOfRegion[8] = new Array();
mapSA_RURAL_idOfRegion[8] = new Array();
mapSA_RURAL_idOfRegion[8][0] = "9334";
mapSA_RURAL_nameOfRegion[8][0] = "Rural Vulcan County.";
mapSA_RURAL_idOfRegion[8][1] = "0010";
mapSA_RURAL_nameOfRegion[8][1] = "ARROWWOOD";
mapSA_RURAL_idOfRegion[8][2] = "0632";
mapSA_RURAL_nameOfRegion[8][2] = "Brant";
mapSA_RURAL_idOfRegion[8][3] = "0054";
mapSA_RURAL_nameOfRegion[8][3] = "CARMANGAY";
mapSA_RURAL_idOfRegion[8][4] = "0061";
mapSA_RURAL_nameOfRegion[8][4] = "CHAMPION";
mapSA_RURAL_idOfRegion[8][5] = "0695";
mapSA_RURAL_nameOfRegion[8][5] = "Ensign";
mapSA_RURAL_idOfRegion[8][6] = "1051";
mapSA_RURAL_nameOfRegion[8][6] = "Herronton";
mapSA_RURAL_idOfRegion[8][7] = "1052";
mapSA_RURAL_nameOfRegion[8][7] = "Kirkcaldy";
mapSA_RURAL_idOfRegion[8][8] = "0207";
mapSA_RURAL_nameOfRegion[8][8] = "LOMOND";
mapSA_RURAL_idOfRegion[8][9] = "0220";
mapSA_RURAL_nameOfRegion[8][9] = "MILO";
mapSA_RURAL_idOfRegion[8][10] = "0790";
mapSA_RURAL_nameOfRegion[8][10] = "Mossleigh";
mapSA_RURAL_idOfRegion[8][11] = "0808";
mapSA_RURAL_nameOfRegion[8][11] = "Queenstown";
mapSA_RURAL_idOfRegion[8][12] = "1053";
mapSA_RURAL_nameOfRegion[8][12] = "Shouldice";
mapSA_RURAL_idOfRegion[8][13] = "1054";
mapSA_RURAL_nameOfRegion[8][13] = "Travers";
mapSA_RURAL_idOfRegion[8][14] = "0333";
mapSA_RURAL_nameOfRegion[8][14] = "VULCAN";

mapSA_RURAL_titleOfArea[9] = "Ranchlands";
mapSA_RURAL_nameOfRegion[9] = new Array();
mapSA_RURAL_idOfRegion[9] = new Array();
mapSA_RURAL_idOfRegion[9][0] = "0361";
mapSA_RURAL_nameOfRegion[9][0] = "Rural Ranchlands County";

mapSA_RURAL_titleOfArea[10] = "Willow Creek";
mapSA_RURAL_nameOfRegion[10] = new Array();
mapSA_RURAL_idOfRegion[10] = new Array();
mapSA_RURAL_idOfRegion[10][0] = "9353";
mapSA_RURAL_nameOfRegion[10][0] = "Rural Willow Creek County";
mapSA_RURAL_idOfRegion[10][2] = "0065";
mapSA_RURAL_nameOfRegion[10][2] = "CLARESHOLM";
mapSA_RURAL_idOfRegion[10][3] = "0115";
mapSA_RURAL_nameOfRegion[10][3] = "FORT MACLEOD";
mapSA_RURAL_idOfRegion[10][4] = "0135";
mapSA_RURAL_nameOfRegion[10][4] = "GRANUM";
mapSA_RURAL_idOfRegion[10][5] = "0232";
mapSA_RURAL_nameOfRegion[10][5] = "NANTON";
mapSA_RURAL_idOfRegion[10][6] = "9353";
mapSA_RURAL_nameOfRegion[10][6] = "Parkland";
mapSA_RURAL_idOfRegion[10][7] = "0297";
mapSA_RURAL_nameOfRegion[10][7] = "STAVLEY";

mapSA_RURAL_titleOfArea[11] = "Lethbridge";
mapSA_RURAL_nameOfRegion[11] = new Array();
mapSA_RURAL_idOfRegion[11] = new Array();
mapSA_RURAL_idOfRegion[11][0] = "9204";
mapSA_RURAL_nameOfRegion[11][0] = "Rural Lethbridge County";
mapSA_RURAL_idOfRegion[11][2] = "0013";
mapSA_RURAL_nameOfRegion[11][2] = "Barons";
mapSA_RURAL_idOfRegion[11][3] = "0069";
mapSA_RURAL_nameOfRegion[11][3] = "COALDALE";
mapSA_RURAL_idOfRegion[11][4] = "0360";
mapSA_RURAL_nameOfRegion[11][4] = "Coalhurst";
mapSA_RURAL_idOfRegion[11][5] = "0682";
mapSA_RURAL_nameOfRegion[11][5] = "Diamond City";
mapSA_RURAL_idOfRegion[11][6] = "0735";
mapSA_RURAL_nameOfRegion[11][6] = "Iron Springs";
mapSA_RURAL_idOfRegion[11][7] = "0203";
mapSA_RURAL_nameOfRegion[11][7] = "Lethbridge";
mapSA_RURAL_idOfRegion[11][8] = "0787";
mapSA_RURAL_nameOfRegion[11][8] = "Monarch";
mapSA_RURAL_idOfRegion[11][9] = "0236";
mapSA_RURAL_nameOfRegion[11][9] = "Nobleford";
mapSA_RURAL_idOfRegion[11][10] = "0249";
mapSA_RURAL_nameOfRegion[11][10] = "PICTURE BUTTE";
mapSA_RURAL_idOfRegion[11][11] = "0836";
mapSA_RURAL_nameOfRegion[11][11] = "Shaughnessy";
mapSA_RURAL_idOfRegion[11][12] = "0864";
mapSA_RURAL_nameOfRegion[11][12] = "Turin";

mapSA_RURAL_titleOfArea[12] = "Crowsnest Pass";
mapSA_RURAL_nameOfRegion[12] = new Array();
mapSA_RURAL_idOfRegion[12] = new Array();
mapSA_RURAL_idOfRegion[12][0] = "0361";
mapSA_RURAL_nameOfRegion[12][0] = "Rural Municipality of Crowsnest Pass";
mapSA_RURAL_idOfRegion[12][1] = "BV";
mapSA_RURAL_nameOfRegion[12][1] = "Bellevue";
mapSA_RURAL_idOfRegion[12][2] = "BL";
mapSA_RURAL_nameOfRegion[12][2] = "Blairmore";
mapSA_RURAL_idOfRegion[12][3] = "CO";
mapSA_RURAL_nameOfRegion[12][3] = "Coleman";
mapSA_RURAL_idOfRegion[12][4] = "FR";
mapSA_RURAL_nameOfRegion[12][4] = "Frank";
mapSA_RURAL_idOfRegion[12][5] = "HC";
mapSA_RURAL_nameOfRegion[12][5] = "Hillcrest Mines";

mapSA_RURAL_titleOfArea[13] = "Airdrie";
mapSA_RURAL_nameOfRegion[13] = new Array();
mapSA_RURAL_idOfRegion[13] = new Array();
mapSA_RURAL_idOfRegion[13][0] = "0003";
mapSA_RURAL_nameOfRegion[13][0] = "Airdrie";

mapSA_RURAL_titleOfArea[14] = "Drumheller";
mapSA_RURAL_nameOfRegion[14] = new Array();
mapSA_RURAL_idOfRegion[14] = new Array();
mapSA_RURAL_idOfRegion[14][0] = "0532";
mapSA_RURAL_nameOfRegion[14][0] = "Drumheller";

mapSA_RURAL_titleOfArea[15] = "Lethbridge";
mapSA_RURAL_nameOfRegion[15] = new Array();
mapSA_RURAL_idOfRegion[15] = new Array();
mapSA_RURAL_idOfRegion[15][0] = "0203";
mapSA_RURAL_nameOfRegion[15][0] = "Lethbridge";

//this function shows the title and side panel
function mapSA_RURAL_showAt(id,mapSA_RURAL_titleLayer,mapSA_RURAL_sideLayer) {
    var x=y=0;
	var sidebarhtml="";

	var blnValueSelected = false;
	var strSelectBox = getSelectBox();
	if(strSelectBox.options[id].selected){
			blnValueSelected = true;
	}

	if (blnValueSelected)
		mapSA_RURAL_changeContent (mapSA_RURAL_titleLayer, '<img name="checkit" src="../images/maps/checkit.gif" border="0" align="bottom"> ' + mapSA_RURAL_titleOfArea[id]);
	else
		mapSA_RURAL_changeContent (mapSA_RURAL_titleLayer, mapSA_RURAL_titleOfArea[id]);

	if (document.getElementById) {//netscape 6 and above
		document.getElementById(mapSA_RURAL_titleLayer).style.left = mapSA_RURAL_titleposx;
		document.getElementById(mapSA_RURAL_titleLayer).style.top = mapSA_RURAL_titleposy-5;
		document.getElementById(mapSA_RURAL_titleLayer).style.visibility = 'visible';
	
	}
    else if (document.layers && document.layers[mapSA_RURAL_titleLayer] != null) {//netscape 4
        document.layers[mapSA_RURAL_titleLayer].left = mapSA_RURAL_titleposx;
        document.layers[mapSA_RURAL_titleLayer].top = mapSA_RURAL_titleposy;
        document.layers[mapSA_RURAL_titleLayer].visibility = 'visible';

    }
    else if (document.all) { //internet explorer
        document.all[mapSA_RURAL_titleLayer].style.posTop = mapSA_RURAL_titleposy;
        document.all[mapSA_RURAL_titleLayer].style.posLeft = mapSA_RURAL_titleposx;
        document.all[mapSA_RURAL_titleLayer].style.visibility = 'visible';
    }

	for(var i=0; i<mapSA_RURAL_nameOfRegion[id].length; i++){
		if (mapSA_RURAL_nameOfRegion[id][i]){
			if (mapSA_RURAL_nameOfRegion[id][i].length>=20){
				var lastSpace = mapSA_RURAL_nameOfRegion[id][i].lastIndexOf(" ",28);
				var newName = mapSA_RURAL_nameOfRegion[id][i].substring(0,lastSpace)  + "<BR>&nbsp;&nbsp;" + mapSA_RURAL_nameOfRegion[id][i].substring(lastSpace);
				pad_total = 18 - (mapSA_RURAL_nameOfRegion[id][i].length - lastSpace);
				if (pad_total > 0) {
					for (var counter = 1; counter < pad_total; counter++){ 
						newName += ".";
					}
				}
			}else{
				pad_total = 20 - mapSA_RURAL_nameOfRegion[id][i].length;
				var newName = mapSA_RURAL_nameOfRegion[id][i];
				if (pad_total > 0) {
					for (var counter = 1; counter < pad_total; counter++){ 
						newName += ".";
					}
				}
			}
			newName =  newName + mapSA_RURAL_idOfRegion[id][i] + '';
			sidebarhtml = sidebarhtml + newName + "<BR>";
		}
	}

	mapSA_RURAL_changeContent (mapSA_RURAL_sideLayer, sidebarhtml);

	if (document.getElementById) {//netscape 6 and above
		document.getElementById(mapSA_RURAL_sideLayer).style.left = mapSA_RURAL_sidelayerposx;
		document.getElementById(mapSA_RURAL_sideLayer).style.top = mapSA_RURAL_sidelayerposy-5;
		document.getElementById(mapSA_RURAL_sideLayer).style.visibility = 'visible';
	
	}
    else if (document.layers && document.layers[mapSA_RURAL_sideLayer] != null) {
        document.layers[mapSA_RURAL_sideLayer].left = mapSA_RURAL_sidelayerposx;
        document.layers[mapSA_RURAL_sideLayer].top = mapSA_RURAL_sidelayerposy;
        document.layers[mapSA_RURAL_sideLayer].visibility = 'visible';
    }
    else if (document.all) {
        document.all[mapSA_RURAL_sideLayer].style.posTop = mapSA_RURAL_sidelayerposy;
        document.all[mapSA_RURAL_sideLayer].style.posLeft = mapSA_RURAL_sidelayerposx;
        document.all[mapSA_RURAL_sideLayer].style.visibility = 'visible';
    }

   return

}

//this function changes the content of the html in the layer (it changes the title).
function mapSA_RURAL_changeContent(layerid,shtml) {
	
   if (document.getElementById || document.all) {
      var el = document.getElementById? document.getElementById(layerid): document.all[layerid];
      if (el && typeof el.innerHTML != "undefined") el.innerHTML = shtml;
   }
   return
}

//this function is for the mouseout action.  It hides the titles and side info when the mouse is taken off the image.
function mapSA_RURAL_hide(mapSA_RURAL_titleLayer,mapSA_RURAL_sideLayer) {
	
	//mapSA_RURAL_hide title layer
	if (document.getElementById)	
		document.getElementById(mapSA_RURAL_titleLayer).style.visibility = 'hidden';
    else if (document.layers && document.layers[mapSA_RURAL_titleLayer] != null)
        document.layers[mapSA_RURAL_titleLayer].visibility = 'hidden';
    else if (document.all)
        document.all[mapSA_RURAL_titleLayer].style.visibility = 'hidden';

	//mapSA_RURAL_hide side layer
	if (document.getElementById)	
		document.getElementById(mapSA_RURAL_sideLayer).style.visibility = 'hidden';
    else if (document.layers && document.layers[mapSA_RURAL_sideLayer] != null)
        document.layers[mapSA_RURAL_sideLayer].visibility = 'hidden';
    else if (document.all)
        document.all[mapSA_RURAL_sideLayer].style.visibility = 'hidden';

   return

}
//this function selects an image map, and populates the correct select box with the values.
function mapSA_RURAL_selectRegion(id) {
	var strSelectBox = getSelectBox();
	var frmField = strSelectBox.options[id];
	
	if (frmField.selected)
	frmField.selected = false;
	else
	frmField.selected = true;

	mapSA_RURAL_hide('mapSA_RURAL_titleLayer','mapSA_RURAL_sideLayer')
	mapSA_RURAL_showAt(id,'mapSA_RURAL_titleLayer','mapSA_RURAL_sideLayer');

}



//this function is used when the form is submitted.  it does nothing but display an alert box with the submitted values from the maps.  
//NOTE: this function is not needed for implementation.
function mapSA_RURAL_fillValues() {
	var strSelectBox = getSelectBox();
	var rural_strList = "";

	for (var i = 0; i < strSelectBox.options.length; i++) {
		if(strSelectBox.options[i].selected){
			rural_strList = rural_strList + strSelectBox.options[i].value +',';
			//alert ('Zones:'+strSelectBox.options[i].value);
		}
	}
	rural_strList = rural_strList.substring(0,rural_strList.length-1);
	alert ('Zones : '+rural_strList);
	
	return false

}

var mapSA_MobilePark_titleposx = 40;
var mapSA_MobilePark_titleposy = -160;
var mapSA_MobilePark_sidelayerposx = 20;
var mapSA_MobilePark_sidelayerposy = -320;

var mapSA_MobilePark_titleOfArea = new Array();
var mapSA_MobilePark_nameOfRegion = new Array();
var mapSA_MobilePark_idOfRegion = new Array();

//Data for the Titles and the Regions.
mapSA_MobilePark_titleOfArea[0] = "Abbeydale";
mapSA_MobilePark_nameOfRegion[0] = "Abbeydale";
mapSA_MobilePark_idOfRegion[0] = "664";

mapSA_MobilePark_titleOfArea[1] = "Acadia";
mapSA_MobilePark_nameOfRegion[1] = "Acadia";
mapSA_MobilePark_idOfRegion[1] = "215";

mapSA_MobilePark_titleOfArea[2] = "Arbour Lake";
mapSA_MobilePark_nameOfRegion[2] = "Arbour Lake";
mapSA_MobilePark_idOfRegion[2] = "443";

mapSA_MobilePark_titleOfArea[3] = "Blackfoot Mobile Park";
mapSA_MobilePark_nameOfRegion[3] = "Blackfoot Mobile Prk";
mapSA_MobilePark_idOfRegion[3] = "217";

mapSA_MobilePark_titleOfArea[4] = "Bowness";
mapSA_MobilePark_nameOfRegion[4] = "Bowness";
mapSA_MobilePark_idOfRegion[4] = "478";

mapSA_MobilePark_titleOfArea[5] = "Forest Lawn";
mapSA_MobilePark_nameOfRegion[5] = "Forest Lawn";
mapSA_MobilePark_idOfRegion[5] = "764";

mapSA_MobilePark_titleOfArea[6] = "Greenwood Village";
mapSA_MobilePark_nameOfRegion[6] = "Greenwood Village";
mapSA_MobilePark_idOfRegion[6] = "479";

mapSA_MobilePark_titleOfArea[7] = "Monterey Park";
mapSA_MobilePark_nameOfRegion[7] = "Monterey Park";
mapSA_MobilePark_idOfRegion[7] = "670";

mapSA_MobilePark_titleOfArea[8] = "Old Town";
mapSA_MobilePark_nameOfRegion[8] = "Old Town";
mapSA_MobilePark_idOfRegion[8] = "";

mapSA_MobilePark_titleOfArea[9] = "Parkridge Estates";
mapSA_MobilePark_nameOfRegion[9] = "Parkridge Estates";
mapSA_MobilePark_idOfRegion[9] = "671";

mapSA_MobilePark_titleOfArea[10] = "Points West Resort";
mapSA_MobilePark_nameOfRegion[10] = "Points West Resort";
mapSA_MobilePark_idOfRegion[10] = "";

mapSA_MobilePark_titleOfArea[11] = "Redcarpet Mountview";
mapSA_MobilePark_nameOfRegion[11] = "Redcarpet_Mountview";
mapSA_MobilePark_idOfRegion[11] = "770";

mapSA_MobilePark_titleOfArea[12] = "South Hill";
mapSA_MobilePark_nameOfRegion[12] = "South Hill";
mapSA_MobilePark_idOfRegion[12] = "306";

mapSA_MobilePark_titleOfArea[13] = "Winston Heights Mountview";
mapSA_MobilePark_nameOfRegion[13] = "Winston Heights_Mountview";
mapSA_MobilePark_idOfRegion[13] = "490";

mapSA_MobilePark_titleOfArea[14] = "Not Specified";
mapSA_MobilePark_nameOfRegion[14] = "None";
mapSA_MobilePark_idOfRegion[14] = "";

mapSA_MobilePark_strList = "";
for (var n=0; n < mapSA_MobilePark_titleOfArea.length; n++){
		//alert (mapCalgRES_titleOfArea[i]);
		if (mapSA_MobilePark_titleOfArea[n]){
			mapSA_MobilePark_strList = mapSA_MobilePark_strList + '"' + mapSA_MobilePark_nameOfRegion[n] + '",';
		}
}
mapSA_MobilePark_strList =mapSA_MobilePark_strList.substring(0,mapSA_MobilePark_strList.length-1);
//alert('mobile park list:' + mapSA_MobilePark_strList);



//This function shows the title and side panel on mouseover action
function mapSA_MobilePark_showAt(id,mapSA_MobilePark_titleLayer,mapSA_MobilePark_sideLayer) {
    var x=y=0;
	var sidebarhtml="";

	var blnValueSelected = false;
	var strSelectBox = getSelectBox();
	if(strSelectBox.options[id].selected){
			blnValueSelected = true;
	}

	if (blnValueSelected)
		mapSA_MobilePark_changeContent (mapSA_MobilePark_titleLayer, '<img name="checkit" src="../images/maps/checkit.gif" border="0" align="bottom"> ' + mapSA_MobilePark_titleOfArea[id]);
	else
		mapSA_MobilePark_changeContent (mapSA_MobilePark_titleLayer, mapSA_MobilePark_titleOfArea[id]);


	if (document.getElementById) {//netscape 6 and above
		document.getElementById(mapSA_MobilePark_titleLayer).style.left = mapSA_MobilePark_titleposx;
		document.getElementById(mapSA_MobilePark_titleLayer).style.top = mapSA_MobilePark_titleposy-5;
		document.getElementById(mapSA_MobilePark_titleLayer).style.visibility = 'visible';
	
	}
    else if (document.layers && document.layers[mapSA_MobilePark_titleLayer] != null) {//netscape 4
        document.layers[mapSA_MobilePark_titleLayer].left = mapSA_MobilePark_titleposx;
        document.layers[mapSA_MobilePark_titleLayer].top = mapSA_MobilePark_titleposy;
        document.layers[mapSA_MobilePark_titleLayer].visibility = 'visible';

    }
    else if (document.all) { //internet explorer
        document.all[mapSA_MobilePark_titleLayer].style.posTop = mapSA_MobilePark_titleposy;
        document.all[mapSA_MobilePark_titleLayer].style.posLeft = mapSA_MobilePark_titleposx;
        document.all[mapSA_MobilePark_titleLayer].style.visibility = 'visible';
    }

   return

}
//This function changes the content for the title or sidepanel
function mapSA_MobilePark_changeContent(layerid,shtml) {
	
   if (document.getElementById || document.all) {
      var el = document.getElementById? document.getElementById(layerid): document.all[layerid];
      if (el && typeof el.innerHTML != "undefined") el.innerHTML = shtml;
   }
   return
}
//This function hides the title and sidepanel layers.
function mapSA_MobilePark_hide(mapSA_MobilePark_titleLayer,mapSA_MobilePark_sideLayer) {
	//mapSA_MobilePark_hide title layer
	if (document.getElementById)	
		document.getElementById(mapSA_MobilePark_titleLayer).style.visibility = 'hidden';
    else if (document.layers && document.layers[mapSA_MobilePark_titleLayer] != null)
        document.layers[mapSA_MobilePark_titleLayer].visibility = 'hidden';
    else if (document.all)
        document.all[mapSA_MobilePark_titleLayer].style.visibility = 'hidden';
   return

}
//This function allows the map to be clicked and the select box values are selected.
function mapSA_MobilePark_selectRegion(id) {
	var strSelectBox = getSelectBox();
	//var frmField = strSelectBox.options[id];
	for (var i = 0; i < strSelectBox.options.length; i++) {
		if(strSelectBox.options[i].value==('"'+mapSA_MobilePark_nameOfRegion[id]+'"') ){
			//alert ('Zones:'+strSelectBox.options[i].value);
			if (strSelectBox.options[i].selected)
				strSelectBox.options[i].selected = false;
			else
				strSelectBox.options[i].selected = true;
		}
	}
	mapSA_MobilePark_hide('mapSA_MobilePark_titleLayer','mapSA_MobilePark_sideLayer');
	mapSA_MobilePark_showAt(id,'mapSA_MobilePark_titleLayer','mapSA_MobilePark_sideLayer');

}
//this function is used when the form is submitted.  it does nothing but display an alert box with the submitted values from the maps.  
//NOTE: this function is not needed for implementation.
function mapSA_MobilePark_fillValues() {
	var strSelectBox = getSelectBox();
	var rural_strList = "";
	for (var i = 0; i < strSelectBox.options.length; i++) {
		if(strSelectBox.options[i].selected){
			rural_strList = rural_strList + strSelectBox.options[i].value +',';
			//alert ('Zones:'+strSelectBox.options[i].value);
		}
	}
	rural_strList = rural_strList.substring(0,rural_strList.length-1);
	alert ('Zones : '+rural_strList);
	return false
}

/* *****************STANDARD FUNCTIONS ************************************************/

// This function adds a new line to the title if it is too long.
function addanewline(s, t, u,startIndex) {
  /*
  **  Replace a token in a string
  **    s  string to be processed
  **    t  token to be found and removed
  **    u  token to be inserted
  **  returns new String
  */
  i = s.indexOf(t,startIndex);
  r = "";
  if (i == -1) return s;
  
  r += s.substring(0,i) + u;
	//alert (r);
  
    r += s.substring(i);
  return r;
}
// This function changes between the overall maps.  Currently it swaps between the 3 maps, Residential, Rural and Mobile Park.  
function changeMap(frmField) {
//	alert('HERE2');
	var mapLayer = "";

			for (var n = 0; n < frmField.options.length; n++) {
				if(frmField.options[n].selected){
					for (var i = 0; i < document.forms.length; i++) {
						if (document.forms[i].name == "newlistingsearch"){
							if ((frmField.options[n].value==4)||(frmField.options[n].value==8)||(frmField.options[n].value==12)){
								mapLayer = "mapSA_RURAL_mapLayer";
							}
							else if (frmField.options[n].value==16){
								mapLayer = "mapSA_MobilePark_mapLayer";
							}
							else {
								mapLayer = "CalgaryMapLayer";
							}
						}
						if (document.forms[i].name == "lowpaymentsearch"){
							 
							if ((frmField.options[n].value==4)||(frmField.options[n].value==8)||(frmField.options[n].value==12)){
								mapLayer = "mapSA_RURAL_mapLayer";
							}
							else {
								mapLayer = "CalgaryMapLayer";
							}
						}


					}		

				}
			}


			//mapLayer = "CalgaryMapLayer";
		
		
		if (document.getElementById) {//netscape 6 and above
			document.getElementById('CalgaryMapLayer').style.visibility = 'hidden';
			document.getElementById('nwLayer').style.visibility = 'hidden';
			document.getElementById('neLayer').style.visibility = 'hidden';
			document.getElementById('seLayer').style.visibility = 'hidden';
			document.getElementById('swLayer').style.visibility = 'hidden';
			document.getElementById('mapSA_RURAL_mapLayer').style.visibility = 'hidden';
			document.getElementById('mapSA_MobilePark_mapLayer').style.visibility = 'hidden';
			document.getElementById('mapCalgRES_quadranttitle').style.visibility = 'hidden';
			
			document.getElementById(mapLayer).style.visibility = 'visible';
		}
		else if (document.layers && document.layers[mapLayer] != null) {
			document.layers['CalgaryMapLayer'].style.visibility = 'hidden';
			document.layers['nwLayer'].style.visibility = 'hidden';
			document.layers['neLayer'].style.visibility = 'hidden';
			document.layers['seLayer'].style.visibility = 'hidden';
			document.layers['swLayer'].style.visibility = 'hidden';
			document.layers['mapSA_RURAL_mapLayer'].style.visibility = 'hidden';
			document.layers['mapSA_MobilePark_mapLayer'].style.visibility = 'hidden';
			document.layers['mapCalgRES_quadranttitle'].style.visibility = 'hidden';

			document.layers[mapLayer].style.visibility = 'visible';
		}
		else if (document.all) {
			document.all['CalgaryMapLayer'].style.visibility = 'hidden';
			document.all['nwLayer'].style.visibility = 'hidden';
			document.all['neLayer'].style.visibility = 'hidden';
			document.all['seLayer'].style.visibility = 'hidden';
			document.all['swLayer'].style.visibility = 'hidden';
			document.all['mapSA_RURAL_mapLayer'].style.visibility = 'hidden';
			document.all['mapSA_MobilePark_mapLayer'].style.visibility = 'hidden';
			document.all['mapCalgRES_quadranttitle'].style.visibility = 'hidden';

			document.all[mapLayer].style.visibility = 'visible';
		}
}
// Function to get the select box name from the forms on the page.
function getSelectBox() {
		//alert("here");
	for (var i = 0; i < document.forms.length; i++) {
		//alert (document.forms[i].name);
		if (document.forms[i].name=="housesearch")
			return document.forms[i].NEIGHBOURHOOD;
		else if (document.forms[i].name=="condosearch")
			return document.forms[i].NEIGHBOURHOOD;
		else if (document.forms[i].name=="lotsearch")
			return document.forms[i].RES_ZONE;
		else if (document.forms[i].name=="acreagehomesearch")
			return document.forms[i].ACE_ZONE;
		else if (document.forms[i].name=="acreagenohomesearch")
			return document.forms[i].ACEN_ZONE;
		else if (document.forms[i].name=="mobilesearch")
			return document.forms[i].MOB_ZONE;
		else if (document.forms[i].name=="commercialsearch")
			return document.forms[i].COM_ZONE;
		else if (document.forms[i].name=="newhousesearch")
			return document.forms[i].ZONE;
		else if (document.forms[i].name=="lowpaymentsearch")
			return document.forms[i].ZONE;
		else if (document.forms[i].name=="newlistingsearch")
			return document.forms[i].ZONE;
	}
}

function LoadImage(imageName,imageFile)
{
	var loadingImage = false;
	
  if ((!document.images) || loadingImage) return;
  loadingImage = true;
  
imgTmp = new Image();
imgTmp.src = imageFile;


document.images[imageName] = imgTmp; 

/*  
	if (document.images[imageName].src.indexOf(imageFile)<0)
	{
		document.images[imageName].src = imageFile;
	}
*/  
  loadingImage = false;
}

LoadImage('checkit','../images/maps/checkit.gif');