function displayStore( location, storeNum ) {	pageTracker._trackPageview(text.pageURL+'?province='+location+'&store_num='+storeNum);	if( storeNum ) {		var address = stores[ location ][ storeNum ].street + ',' + stores[ location ][ storeNum ].city + ',' + stores[ location ][ storeNum ].province + ',' + stores[ location ][ storeNum ].pc;		var mapLink = 'http://maps.google.ca/maps?daddr=' + address + "@" + storeMap[storeNum].lat + "," + storeMap[storeNum].lng+'&hl='+text.lang;		var name   = '<strong>'+stores[ location ][ storeNum ].city.toUpperCase()+'<br/>'+ stores[ location ][ storeNum ].name +'</strong><br/><a href="'+mapLink+'" target="_blank">'+text.directions+'</a>';		var street = stores[ location ][ storeNum ].street;		var city   = stores[ location ][ storeNum ].city +', '+ stores[ location ][ storeNum ].province;		var pc     = stores[ location ][ storeNum ].pc;		var phone  = stores[ location ][ storeNum ].phone;		var hours  = '<table style="margin: 0; padding:0;"><tr><th style="border-top: none;">';		var currHour = '';		var currDay = '';		var multiDay = 0;		var first = 0;		for( var j in text.days ) { 			if (currHour == ''){				hours += text.days[ j ];				currHour = stores[ location ][ storeNum ].hours[ j ];			}			else{				if(currHour != stores[ location ][ storeNum ].hours[ j ]) {					if(multiDay == 1) hours += ' - '+currDay;					hours += '</th><td';					if (first == 0){						hours += ' style="border-top: none;"';						first = 1;					}					hours += '>'+ currHour +'</td></tr><tr><th>'+text.days[j];					currHour = stores[ location ][ storeNum ].hours[ j ];					multiDay = 0;					}				else multiDay = 1;			}			currDay = text.days[ j ];		}        if ( multiDay == 1 ) hours += ' - '+currDay;		hours += '</th><td>'+currHour+'</td></tr></table>';				var remarks = stores[ location ][ storeNum ].remarks;				var html = '<table width="569" cellspacing="0" cellpadding="0" border="0">';		html +=	'<tr><th width="166" valign="top">'+name+'</th><td width="226" valign="top">'+street+'<br/>'+city+'<br/>'+pc+'<br/>'+phone+'</td><td width="200" valign="top" align="center">'+hours+'</td></tr>';		if (remarks) { html += '<tr><th colspan="3">'+remarks+'</th></tr>'; }		//html += '<tr><th colspan="3" style="color: red">'+text.holidayHours+'</th></tr>';		html += '</table>';				document.getElementById('store-details').innerHTML = html;		document.getElementById('store-info').style.display = 'block';		window.scroll(0,0); //scroll target		showAddress(address, storeNum)			}}// Pour afficher l'addresse lors du clic dans la liste des magasins  function showAddress(address, storeNum) {		if( geocoder ) {			if(storeMap[storeNum]) {								if(storeMap[storeNum].lat && storeMap[storeNum].lng) {					var point = new GLatLng(parseFloat(storeMap[storeNum].lat), parseFloat(storeMap[storeNum].lng));					positionPoint(point);				}				else {					geocoder.getLatLng(address, positionPoint);				}			}    		else {     			geocoder.getLatLng(address, positionPoint);    		}		}  }    function positionPoint( point ) {      if( !point ) {        // Gestion d'erreurs        document.getElementById('map').style.display = 'none';      } else {        map.setCenter(point, 16); // Center map on point              }    }  		function init() {			var stretchers = document.getElementsByClassName('stretcher');			var toggles    = document.getElementsByClassName('display');			var myAccordion = new fx.Accordion( toggles, stretchers, { opacity: true, duration: 400 } );			function checkHash(){					var found = false;					toggles.each( function( h3, i ) {							if( window.location.href.indexOf( h3.title ) > 0 ) {									myAccordion.showThisHideOpen(stretchers[i]);									found = true;							}					} );					return found;				}			//if (!checkHash()) myAccordion.showThisHideOpen(stretchers[0]);			}      var storeMap = new Object();  storeMap[840] = {storeNum: 840,prov: 'NB',lat:48.0039552, lng:-66.6802386};  storeMap[693] = {storeNum: 693,prov: 'NB',lat:47.0536822, lng:-67.7441676};  storeMap[646] = {storeNum: 646,prov: 'NB',lat:47.5231523, lng:-64.9103369};  storeMap[788] = {storeNum: 788,prov: 'ON',lat:45.610318, lng:-74.605846};  storeMap[724] = {storeNum: 724,prov: 'YK',lat:60.719659,lng:-135.052466};  storeMap[630] = {storeNum: 630,prov: 'QC',lat:48.5491118, lng:-71.6508132};  storeMap[855] = {storeNum: 855,prov: 'QC',lat:48.571895,lng:-78.118871};  storeMap[637] = {storeNum: 637,prov: 'QC',lat:48.4646864, lng:-67.4321098};  storeMap[674] = {storeNum: 674,prov: 'QC',lat:48.0438586, lng:-65.4892345};  storeMap[890] = {storeNum: 890,prov: 'QC',lat:45.336415,lng:-72.651778};  storeMap[616] = {storeNum: 616,prov: 'QC',lat:47.3853859, lng:-61.8587026};  storeMap[677] = {storeNum: 677,prov: 'QC',lat:48.1153408, lng:-66.2722701};  storeMap[650] = {storeNum: 650,prov: 'QC',lat:49.9136501, lng:-74.3609782};  storeMap[622] = {storeNum: 622,prov: 'QC',lat:48.8779357, lng:-72.228941};  storeMap[689] = {storeNum: 689,prov: 'QC',lat:45.8887303, lng:-72.5070172};  storeMap[681] = {storeNum: 681,prov: 'QC',lat:48.8238673, lng:-64.474083};  storeMap[837] = {storeNum: 837,prov: 'QC',lat:45.3954139, lng:-75.8371564};  storeMap[621] = {storeNum: 621,prov: 'QC',lat:45.5878979, lng:-75.4167788};  storeMap[635] = {storeNum: 635,prov: 'QC',lat:48.335688, lng:-70.8946975};  storeMap[623] = {storeNum: 623,prov: 'QC',lat:47.646663, lng:-70.149452};  storeMap[636] = {storeNum: 636,prov: 'QC',lat:47.364823,lng:-70.037262};  storeMap[639] = {storeNum: 639,prov: 'QC',lat:48.8053318, lng:-79.202482};  storeMap[694] = {storeNum: 694,prov: 'QC',lat:45.5892639, lng:-70.9049506};  storeMap[691] = {storeNum: 691,prov: 'QC',lat:45.61007479239146, lng:-73.69568824768066};  storeMap[668] = {storeNum: 668,prov: 'QC',lat:45.526645,lng:-73.781433};  storeMap[673] = {storeNum: 673,prov: 'QC',lat:45.735055, lng:-73.613113};  storeMap[455] = {storeNum: 455,prov: 'QC',lat:48.8523451, lng:-67.5204937};  storeMap[507] = {storeNum: 507,prov: 'QC',lat:46.5509884, lng:-75.4868952};  storeMap[671] = {storeNum: 671,prov: 'QC',lat:46.1187692, lng:-74.5693782};  storeMap[680] = {storeNum: 680,prov: 'QC',lat:46.9793743, lng:-70.5697962};  storeMap[697] = {storeNum: 697,prov: 'QC',lat:45.3823638, lng:-73.9920142};  storeMap[620] = {storeNum: 620,prov: 'QC',lat:46.401009,lng:-74.866381};  storeMap[603] = {storeNum: 603,prov: 'QC',lat:48.5241802, lng:-72.2334314};  storeMap[849] = {storeNum: 849,prov: 'QC',lat:48.2417353, lng:-79.0252028};  storeMap[626] = {storeNum: 626,prov: 'QC',lat:46.5639557, lng:-72.7406085};  storeMap[501] = {storeNum: 501,prov: 'QC',lat:45.402458,lng:-71.953239};  storeMap[604] = {storeNum: 604,prov: 'QC',lat:48.6493537, lng:-72.441513};  storeMap[527] = {storeNum: 527,prov: 'QC',lat:46.1307592, lng:-70.6967422};  storeMap[652] = {storeNum: 652,prov: 'QC',lat:46.8980072, lng:-71.8484261};  storeMap[628] = {storeNum: 628,prov: 'QC',lat:46.0486618, lng:-74.2883662};  storeMap[683] = {storeNum: 683,prov: 'QC',lat:49.1241292, lng:-66.4921976};  storeMap[545] = {storeNum: 545,prov: 'QC',lat:46.110322,lng:-71.303211};  storeMap[838] = {storeNum: 838,prov: 'QC',lat:45.4055047, lng:-74.0399444};  storeMap[667] = {storeNum: 667,prov: 'QC',lat:45.4648953, lng:-73.5668062};  storeMap[669] = {storeNum: 669,prov: 'QC',lat:47.3304015, lng:-79.4415653};  storeMap[3601] = {storeNum: 3601,prov: 'QC',lat:46.057558, lng:-71.953464};  storeMap[764] = {storeNum: 764,prov: 'AB',lat:51.0838355, lng:-114.1524807};  storeMap[761] = {storeNum: 761,prov: 'AB',lat:51.0651752, lng:-114.1034623};  storeMap[766] = {storeNum: 766,prov: 'AB',lat:53.486392,lng:-113.514004};  storeMap[765] = {storeNum: 765,prov: 'AB',lat:50.010834, lng:-110.650412};  storeMap[767] = {storeNum: 767,prov: 'AB',lat:52.244892, lng:-113.818183};  storeMap[3600] = {storeNum: 3600,prov: 'AB',lat:55.16988543495549, lng:-118.84625673294067};  storeMap[750] = {storeNum: 750,prov: 'BC',lat:50.0266108, lng:-125.2451197};        var provinceMap = new Object();  provinceMap['NB'] = {lat:47.137425,lng:-66.09375,zm: 7};  provinceMap['ON'] = {lat:44.315988,lng:-78.33252,zm: 6};  provinceMap['AB'] = {lat:53.486392,lng:-113.514004,zm: 5};  provinceMap['BC'] = {lat:50.0266108, lng:-125.2451197,zm: 5};  provinceMap['QC'] = {lat:48.458352,lng:-68.532715,zm: 5};  provinceMap['YK'] = {lat:60.719659,lng:-135.052466,zm: 5};	         // Google Maps code    var map;    var geocoder;        function initialize() {     	if (GBrowserIsCompatible()) {	        document.getElementById( 'mapBorder' ).style.display = 'block';     		map = new GMap2(document.getElementById("map"));            map.setCenter(new GLatLng(58.217025,-96.855469), 3);            geocoder = new GClientGeocoder();            map.addControl(new GSmallMapControl());            map.addControl(new GMapTypeControl());            map.enableScrollWheelZoom();/*	        	       	var i = 0;			for (var province in stores){			  for (var store in stores[province]){				setTimeout('latList("'+store+'","'+province+'")', i++*1000);              }        	}*/        	        	addPoints();    	}    }	function latList(store, province){		var link = stores[province][store].street + ',' + stores[province][store].city + ',' + stores[province][store].province + ',' + stores[province][store].pc;				geocoder.getLocations(link, function(response){			if(!response || response.Status.code != 200)				document.getElementById( 'pop' ).innerHTML += 'storeMap[' + store + '] = "'+link+'";<br/>';			else {    				var place = response.Placemark[0];				document.getElementById( 'pop' ).innerHTML += 'storeMap[' + store + '] = {lat:' + place.Point.coordinates[1] + ', lng:'+place.Point.coordinates[0]+'};<br/>';				}			}		);	}	function showProvince(province) {		pageTracker._trackPageview(text.pageURL+'?province='+province);		map.clearOverlays();		addPoints();        map.setCenter(new GLatLng(provinceMap[province].lat,provinceMap[province].lng), provinceMap[province].zm);		}        function addPoints() {                    // Set up "tiny" marker icon          var isIcon = new GIcon(G_DEFAULT_ICON);          isIcon.image = "/img/store/map/intersport.png";                               // Set up GMarkerOptions object          markerOptions = { icon:isIcon };          // Setup markers          for(var store in storeMap){              if(storeMap[store].lat){                  var point = new GLatLng(storeMap[store].lat, storeMap[store].lng);	          	  	                // Add marker to the map	                map.addOverlay(createMarker(point, store));                  }              }        }    function createMarker(point, store) {        var marker = new GMarker(point, markerOptions);                GEvent.addListener(marker,"click", function() {        	displayStore(storeMap[store].prov,store);    	  });    	  return marker;    	}
