var ind;

function loadMap(ind)
    {
    //<![CDATA[
    
    if (GBrowserIsCompatible()) { 
    	
      var blueIcon = new GIcon(G_DEFAULT_ICON);
      blueIcon.image = "http://www.altech.com.au/images/mapIcon.gif";
      blueIcon.iconSize = new GSize(22, 24);
      markerOptions = { icon:blueIcon };

      // A function to create the marker and set up the event window
      // Dont try to unroll this function. It has to be here for the function closure
      // Each instance of the function preserves the contends of a different instance
      // of the "marker" and "html" variables which will be needed later when the event triggers.    
      function createMarker(point,html) {
        var marker = new GMarker(point, markerOptions);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      }

      // Display the map, with some controls and set the initial location 
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      
      if (ind=='1')  //sydney
      {
      	  map.setCenter(new GLatLng(-33.817467, 151.033945),14);
      	  document.getElementById("mapname").innerHTML = "Sydney Map<span style='padding-left:10px;'><a href='tryGoogleMap.aspx'>Global Map</a></span>";
      }
      else if (ind=='2') //bris
      {
      	  map.setCenter(new GLatLng(-27.473701, 153.016457),14);
      	  document.getElementById("mapname").innerHTML = "Brisbane Map<span style='padding-left:10px;'><a href='tryGoogleMap.aspx'>Global Map</a></span>";
      }
      else if (ind=='3') //melb
      {
      	  map.setCenter(new GLatLng(-37.942850, 145.170105),14);
      	  document.getElementById("mapname").innerHTML = "Melbourne Map<span style='padding-left:10px;'><a href='tryGoogleMap.aspx'>Global Map</a></span>";
      }
      else if (ind=='4') //perth
      {
      	  map.setCenter(new GLatLng(-31.902105, 115.804306),14);
      	  document.getElementById("mapname").innerHTML = "Perth Map<span style='padding-left:10px;'><a href='tryGoogleMap.aspx'>Global Map</a></span>";
      }
      else if (ind=='5') //nz
      {
      	  map.setCenter(new GLatLng(-36.920271,174.847487),14);
      	  document.getElementById("mapname").innerHTML = "New Zealand Map<span style='padding-left:10px;'><a href='tryGoogleMap.aspx'>Global Map</a></span>";
      }
      else if (ind=='6') //hk
      {
      	  map.setCenter(new GLatLng(22.372704, 114.107028),14);
      	  document.getElementById("mapname").innerHTML = "Hong Kong<span style='padding-left:10px;'><a href='tryGoogleMap.aspx'>Global Map</a></span>";
      }
      else
      	map.setCenter(new GLatLng(-9.561329,135.78125),3);
       
      var SydHtml = '<div style="font-size:12px; width:240px; height:240px;"><img src="http://www.altech.com.au/images/sydOffice.jpg" width="92px" height="70px" alt="" />';
      SydHtml = SydHtml + '&nbsp;&nbsp;&nbsp;&nbsp;<a href="sydGoogleMap.aspx">Sydney Map</a><br/>';
      SydHtml = SydHtml + '<b>Altech Computers Sydney Office</b><br />Unit R, 10-16 South Street Rydalmere Business Park Rydalmere NSW 2116 Australia<br />';
      SydHtml = SydHtml + '<b>Ph</b>: (+61 2) 8831 9999<br />';
      SydHtml = SydHtml + '<b>Fax</b>: (+61 2) 8831 9988<br />';
      SydHtml = SydHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=sales-syd" target="_blank">Sales Inquiries</a><br />';
      SydHtml = SydHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=rma-syd" target="_blank">RMA</a><br />';
      SydHtml = SydHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=tech-syd" target="_blank">Technical Support</a><br />';
      SydHtml = SydHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=accounts-syd" target="_blank">Accounting</a><br />';
      SydHtml = SydHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=mar-syd" target="_blank">Marketing</a><br />';
      SydHtml = SydHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=web-syd" target="_blank">Webmaster</a>';
      SydHtml = SydHtml + '</div>';
      
      var MelHtml = '<div style="font-size:12px; width:240px; height:200px;"><img src="http://www.altech.com.au/images/melOffice.jpg" width="92px" height="70px" alt="" />';
      MelHtml = MelHtml + '&nbsp;&nbsp;&nbsp;&nbsp;<a href="melGoogleMap.aspx">Melbourne Map</a><br/>';
      MelHtml = MelHtml + '<b>Altech Computers Melbourne Office</b><br />Building 3, 13-15 Brough Street Springvale, VIC, 3171 Australia<br />';
      MelHtml = MelHtml + '<b>Ph</b>: (+61 3) 9558 5090<br />';
      MelHtml = MelHtml + '<b>Fax</b>: (+61 3) 9558 5091<br />';
      MelHtml = MelHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=sales-mel" target="_blank">Sales Inquiries</a><br />';
      MelHtml = MelHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=rma-mel" target="_blank">RMA</a><br />';
      MelHtml = MelHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=tech-mel" target="_blank">Technical Support</a><br />';
      MelHtml = MelHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=accounts-mel" target="_blank">Accounting</a><br />';
      MelHtml = MelHtml + '</div>';
      
      var BriHtml = '<div style="font-size:12px; width:240px; height:200px;"><img src="http://www.altech.com.au/images/brisOffice.jpg" width="92px" height="70px" alt="" />';
      BriHtml = BriHtml + '&nbsp;&nbsp;&nbsp;&nbsp;<a href="briGoogleMap.aspx">Brisbane Map</a><br/>';
      BriHtml = BriHtml + '<b>Altech Computers Brisbane Office</b><br />62 Hope Street South Brisbane, QLD. 4101 Australia<br />';
      BriHtml = BriHtml + '<b>Ph</b>: (+61 7) 3017 2000<br />';
      BriHtml = BriHtml + '<b>Fax</b>: (+61 7) 3017 2020<br />';
      BriHtml = BriHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=sales-bne" target="_blank">Sales Inquiries</a><br />';
      BriHtml = BriHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=rma-bne" target="_blank">RMA</a><br />';
      BriHtml = BriHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=tech-bne" target="_blank">Technical Support</a><br />';
      BriHtml = BriHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=accounts-bne" target="_blank">Accounting</a><br />';
      BriHtml = BriHtml + '</div>';
      
      var PerHtml = '<div style="font-size:12px; width:240px; height:200px;"><img src="http://www.altech.com.au/images/perOffice.jpg" width="92px" height="70px" alt="" />';
      PerHtml = PerHtml + '&nbsp;&nbsp;&nbsp;&nbsp;<a href="perGoogleMap.aspx">Perth Map</a><br/>';
      PerHtml = PerHtml + '<b>Altech Computers Perth Office</b><br />Unit 2, 8 Carbon Ct, Osborne Park, WA, 6017 Australia<br />';
      PerHtml = PerHtml + '<b>Ph</b>: (+61 8) 9242 8822<br />';
      PerHtml = PerHtml + '<b>Fax</b>: (+61 8) 9242 7383<br />';
      PerHtml = PerHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=sales-wa" target="_blank">Sales Inquiries</a><br />';
      PerHtml = PerHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=rma-wa" target="_blank">RMA</a><br />';
      PerHtml = PerHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=tech-wa" target="_blank">Technical Support</a><br />';
      PerHtml = PerHtml + '<a href="http://www.altech.com.au/emailaltech.aspx?dept=accounts-wa" target="_blank">Accounting</a><br />';
      PerHtml = PerHtml + '</div>';     
      
      var NZHtml = '<div style="font-size:12px; width:240px; height:200px;">';
      NZHtml = NZHtml + '<a href="nzGoogleMap.aspx">New Zealand Map</a><br/>';
      NZHtml = NZHtml + '<b>Altech Computers Corporation Ltd.</b><br />Unit 3. 99 Carbine Road<br />Mt. Wellington. Auckland. NZ. 1060<br />';
      NZHtml = NZHtml + '<b>Ph</b>: (+64 0) 9 573 9300<br />';
      NZHtml = NZHtml + '<b>NZ Toll Free</b>: 0800 383 888<br />';
      NZHtml = NZHtml + '<b>Fax</b>: (+64 0)9 573 9399<br />';
      NZHtml = NZHtml + '<a href="http://www.altechcomputers.co.nz/emailaltech.aspx?dept=sales-nz" target="_blank">Sales Inquiries</a><br />';
      NZHtml = NZHtml + '<a href="http://www.altechcomputers.co.nz/emailaltech.aspx?dept=rma-nz" target="_blank">RMA</a><br />';
      NZHtml = NZHtml + '<a href="http://www.altechcomputers.co.nz/emailaltech.aspx?dept=tech-nz" target="_blank">Technical Support</a><br />';
      NZHtml = NZHtml + '<a href="http://www.altechcomputers.co.nz/emailaltech.aspx?dept=accounts-nz" target="_blank">Accounting</a><br />';
      NZHtml = NZHtml + '<a href="http://www.altechcomputers.co.nz/emailaltech.aspx?dept=mar-nz" target="_blank">Marketing</a><br />';
      NZHtml = NZHtml + '<a href="http://www.altechcomputers.co.nz/emailaltech.aspx?dept=web-nz" target="_blank">Webmaster</a>';
      NZHtml = NZHtml + '</div>'; 
      
      var HKHtml = '<div style="font-size:12px; width:240px; height:200px;">';
      HKHtml = HKHtml + '<a href="hkGoogleMap.aspx">Hong Kong Map</a><br/>';
      HKHtml = HKHtml + '<b>Altech Computers(HK) Ltd.</b><br />Unit 2505 Cable TV Tower, 9 Hoi Hing Road<br />Tsuen Wan Hong Kong<br />';
      HKHtml = HKHtml + '<b>Ph</b>: (+852) 3187 4111<br />';
      HKHtml = HKHtml + '<b>Fax</b>: (+852) 3187 4122<br />';
      HKHtml = HKHtml + '<a href="http://www.altech.com.hk/emailaltech.aspx?dept=sales-hk" target="_blank">Sales Inquiries</a><br />';
      HKHtml = HKHtml + '<a href="http://www.altech.com.hk/emailaltech.aspx?dept=rma-hk" target="_blank">RMA</a><br />';
      HKHtml = HKHtml + '<a href="http://www.altech.com.hk/emailaltech.aspx?dept=tech-hk" target="_blank">Technical Support</a><br />';
      HKHtml = HKHtml + '<a href="http://www.altech.com.hk/emailaltech.aspx?dept=accounts-hk" target="_blank">Accounting</a><br />';
      HKHtml = HKHtml + '<a href="http://www.altech.com.hk/emailaltech.aspx?dept=mar-hk" target="_blank">Marketing</a><br />';
      HKHtml = HKHtml + '<a href="http://www.altech.com.hk/emailaltech.aspx?dept=web-hk" target="_blank">Webmaster</a>';
      HKHtml = HKHtml + '</div>'; 

      // Set up three markers with info windows 
      var point = new GLatLng(-33.817467, 151.033945);      
      var marker = createMarker(point,SydHtml);     
      map.addOverlay(marker);

      var point = new GLatLng(-37.942850, 145.170105);
      var marker = createMarker(point, MelHtml);
      map.addOverlay(marker);

      var point = new GLatLng(-27.473701, 153.016457);
      var marker = createMarker(point,BriHtml);
      map.addOverlay(marker);

      var point = new GLatLng(-31.902105, 115.804306);
      var marker = createMarker(point,PerHtml);
      map.addOverlay(marker);
      
      var point = new GLatLng(-36.920271,174.847487);
      var marker = createMarker(point,NZHtml);
      map.addOverlay(marker);
      
      var point = new GLatLng(22.372704, 114.107028);
      var marker = createMarker(point,HKHtml);
      map.addOverlay(marker);
    }
    
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }

    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/   
    // http://econym.googlepages.com/index.htm

    //]]>
    }