﻿// JScript File

function initialize(form) 
{      

	if (GBrowserIsCompatible()) 
	{        
				
		var map = new GMap2(document.getElementById("map_canvas"));        
		
		var fields = document.getElementById("ctl00$ContentPlaceHolder2$hidZoom").value;
		var field = fields.split("|")
		
//		map.setCenter(new GLatLng(20, 60), parseInt(zoom));     
		map.setCenter(new GLatLng(field[0], field[1]), parseInt(field[2]));     

//      Default to Satellite 
//		map.setMapType(G_SATELLITE_MAP);
//		map.disableDragging() 

//      Show Hybrid/Map/Satellite buttons...	
//		var mapControl = new GMapTypeControl();
//		map.addControl(mapControl);		


        var points = document.getElementById("ctl00$ContentPlaceHolder2$hidUKLoc").value;
        var point = points.split("|")
  	    var pointUK = new GLatLng(point[0], point[1]);
			
        points = document.getElementById("ctl00$ContentPlaceHolder2$hidSriLoc").value;
        point = points.split("|")
  	    var pointSri = new GLatLng(point[0], point[1]);

        points = document.getElementById("ctl00$ContentPlaceHolder2$hidMorLoc").value;
        point = points.split("|")
  	    var pointMor = new GLatLng(point[0], point[1]);

        points = document.getElementById("ctl00$ContentPlaceHolder2$hidMauLoc").value;
        point = points.split("|")
  	    var pointMau = new GLatLng(point[0], point[1]);

        points = document.getElementById("ctl00$ContentPlaceHolder2$hidBanLoc").value;
        point = points.split("|")
  	    var pointBan = new GLatLng(point[0], point[1]);

        points = document.getElementById("ctl00$ContentPlaceHolder2$hidCamLoc").value;
        point = points.split("|")
  	    var pointCam = new GLatLng(point[0], point[1]);

        points = document.getElementById("ctl00$ContentPlaceHolder2$hidChiLoc").value;
        point = points.split("|")
  	    var pointChi = new GLatLng(point[0], point[1]);
      					
        points = document.getElementById("ctl00$ContentPlaceHolder2$hidIndoLoc").value;
        point = points.split("|")
  	    var pointIndo = new GLatLng(point[0], point[1]);
      	      					
        //var pointUK = new GLatLng(53.129, -1.292);  	    
		//map.addOverlay(new GMarker(pointUK));
		
		var markerUK = new GMarker(pointUK);
		var markerSri = new GMarker(pointSri);
		var markerMor = new GMarker(pointMor);
		var markerMau = new GMarker(pointMau);
		var markerBan = new GMarker(pointBan);
		var markerCam = new GMarker(pointCam);
		var markerChi = new GMarker(pointChi);
		var markerIndo = new GMarker(pointIndo);
		map.addOverlay(markerUK);
		map.addOverlay(markerSri);
		map.addOverlay(markerMor);
		map.addOverlay(markerMau);
		map.addOverlay(markerBan);
		map.addOverlay(markerCam);		
		map.addOverlay(markerChi);
		map.addOverlay(markerIndo);

        var domain = document.getElementById("ctl00$ContentPlaceHolder2$hidDomain").value;
        
        GEvent.addListener(markerUK,"click",function() {
			var myHtml = "<SPAN CLASS='world'>";   
			myHtml = myHtml + document.getElementById("ctl00$ContentPlaceHolder2$hidUK").value;
			myHtml = myHtml + "<a href='" + domain + "ContactUK.aspx'>Visit</a>"; 
			myHtml = myHtml + "</span>";
			map.openInfoWindowHtml(pointUK, myHtml);
			});

        GEvent.addListener(markerSri,"click",function() {
			var myHtml = "<SPAN CLASS='world'>";    
			
			myHtml = myHtml + document.getElementById("ctl00$ContentPlaceHolder2$hidSri").value;
			myHtml = myHtml + "<a href='" + domain + "ContactSri.aspx'>Visit</a>"; 
			myHtml = myHtml + "</span>"; 
			map.openInfoWindowHtml(pointSri, myHtml);
			});

        GEvent.addListener(markerMor,"click",function() {
			var myHtml = "<SPAN CLASS='world'>";   
			myHtml = myHtml + document.getElementById("ctl00$ContentPlaceHolder2$hidMor").value;
            myHtml = myHtml + "<a href='" + domain + "ContactMor.aspx'>Visit</a>"; 
			myHtml = myHtml + "</span>";
			map.openInfoWindowHtml(pointMor, myHtml);
			});

		GEvent.addListener(markerMau,"click",function() {
			var myHtml = "<SPAN CLASS='world'>";   
			myHtml = myHtml + document.getElementById("ctl00$ContentPlaceHolder2$hidMau").value;
			myHtml = myHtml + "<a href='" + domain + "ContactMau.aspx'>Visit</a>"; 			
			myHtml = myHtml + "</span>";
			map.openInfoWindowHtml(pointMau, myHtml);
			});

        GEvent.addListener(markerBan,"click",function() {
			var myHtml = "<SPAN CLASS='world'>";   
			myHtml = myHtml + document.getElementById("ctl00$ContentPlaceHolder2$hidBan").value;
			myHtml = myHtml + "<a href='" + domain + "ContactBan.aspx'>Visit</a>"; 		
			myHtml = myHtml + "</span>";
			map.openInfoWindowHtml(pointBan, myHtml);
			});

		GEvent.addListener(markerCam,"click",function() {
			var myHtml = "<SPAN CLASS='world'>";   
			myHtml = myHtml + document.getElementById("ctl00$ContentPlaceHolder2$hidCam").value;
            myHtml = myHtml + "<a href='" + domain + "ContactCam.aspx'>Visit</a>"; 					
			myHtml = myHtml + "</span>";
			map.openInfoWindowHtml(pointCam, myHtml);
			});

        GEvent.addListener(markerChi,"click",function() {
			var myHtml = "<SPAN CLASS='world'>";   
			myHtml = myHtml + document.getElementById("ctl00$ContentPlaceHolder2$hidChi").value;
			myHtml = myHtml + "<a href='" + domain + "ContactChi.aspx'>Visit</a>"; 			
			myHtml = myHtml + "</span>";
			map.openInfoWindowHtml(pointChi, myHtml);
			});
					
        GEvent.addListener(markerIndo,"click",function() {
			var myHtml = "<SPAN CLASS='world'>";   
			myHtml = myHtml + document.getElementById("ctl00$ContentPlaceHolder2$hidIndo").value;
			myHtml = myHtml + "<a href='" + domain + "ContactIndo.aspx'>Visit</a>"; 			
			myHtml = myHtml + "</span>";
			map.openInfoWindowHtml(pointIndo, myHtml);
			});
								
	} // browsercompatible
	// display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }


} // function initialize