var centerCor;var lat4;var lon4;var map;var marker = new Array();var myid = new Array();	 /*function createMarker (latt , longi) {			//centerCor = map.getCenter();	        //var latmany = 1.0 * centerCor.lat();	        //latt = latmany.toFixed(6);	        //var lonmany = 1.0 * centerCor.lng();	       //longi = lonmany.toFixed(6);		marker2 = new GMarker(new GlatLng(latt,longi),{draggable: false});	return marker2;	};	*/$(document).ready(function(){	if (GBrowserIsCompatible()){		lat4=22.3919142 //$(".coordinate").attr("latitude");   //This is used for client/view		lon4= 114.156929 //$(".coordinate").attr("longitude"); // This is used for client/view		//Center of Hong Kong 22.3919142, 114.156929		map = new GMap2(document.getElementById("map_canvas"));		map.setCenter(new GLatLng(lat4,lon4), 10);		map.setUIToDefault();		var baseIcon = new GIcon(G_DEFAULT_ICON);		 //baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";		 //baseIcon.iconSize = new GSize(20, 34);		 //baseIcon.shadowSize = new GSize(37, 34);		 //baseIcon.iconAnchor = new GPoint(9, 34);		 //baseIcon.infoWindowAnchor = new GPoint(9, 2);		$("#coordinate").each(function(){ // this is used by client view			lon=$(this).attr("longitude");			lat=$(this).attr("latitude");			map.setCenter(new GLatLng(lat,lon), 18);			//alert(lat + " "+ lon);			Shopmarker=new GMarker(new GLatLng(lat,lon),{draggable: false});			map.addOverlay(Shopmarker);				/*GEvent.addListener(marker,"mouseover", function() {					var popUpMessage = "<b>#" + 'HelloWorld, I\'m Lawrecne' + "</b><br/>";					map.openInfoWindowHtml(marker.getLatLng(), popUpMessage);				});*/		});		$(".coupon_thumb").each(function(i){ // this is used by search			lon=$(this).children(".coordinate").attr("longitude");			lat=$(this).children(".coordinate").attr("latitude");			myid[i]=$(this).children(".id").attr("id");						 if (!(lon === "")){							var letteredIcon = new GIcon(baseIcon);				var letter = String.fromCharCode(i+65);				$(this).children(".referrer").before('<div class="map_char">'+letter+'</div>');				//alert(letter);								letteredIcon.image = "http://www.google.com/mapfiles/marker" + letter + ".png";				marker[i]=new GMarker(new GLatLng(lat,lon),{ icon:letteredIcon, title:letter });				map.addOverlay(marker[i]);									GEvent.addListener(marker[i],"mouseover",					function() {												$("#"+myid[i]).parent(".coupon_thumb").addClass("coupon_thumb_over")						});				GEvent.addListener(marker[i],"mouseout",					function(){									$("#"+myid[i]).parent(".coupon_thumb").removeClass("coupon_thumb_over")						});			}		});	  		$("#ClientAreaId").change(function(){ // This is used for Area option change		areaId = $(this).val();								lon3=$('#ClientAreaId option[value='+$('#ClientAreaId').val()+']').attr("longitude");								lat3=$('#ClientAreaId option[value='+$('#ClientAreaId').val()+']').attr("latitude");			map.panTo(new GLatLng(lat3,lon3));		return false;		});	}});
