﻿// GET THE NEAREST STORES FOR THE GIVEN POSTCODE
function changeTab(iTab)
{
    $get('TabBody1').style.display = "none";
    $get('TabBody2').style.display = "none";
    $get('TabBody3').style.display = "none";
    
    $get('TabBody' + iTab).style.display = "block";
    
    $get('TabHeader1').style.background = "url(../images/siteimages/Tab_Header_Grey.gif) no-repeat top left";
    $get('TabHeader2').style.background = "url(../images/siteimages/Tab_Header_Grey.gif) no-repeat top left";
    $get('TabHeader3').style.background = "url(../images/siteimages/Tab_Header_Grey.gif) no-repeat top left";
    
    $get('TabHeader' + iTab).style.background = "url(../images/siteimages/Tab_Header_Green.gif) no-repeat top left";
}


function InitializeMap() 
{      
    if (document.getElementById("map_canvas") != null) 
    {    
        if (GBrowserIsCompatible()) 
        {   
            var map = new GMap2(document.getElementById("map_canvas"));
            map.addControl(new GSmallZoomControl());
            map.setCenter(new GLatLng(53.9504, -1.0472), 14);
            var sInfoContent = "<div style='float:left;margin-top:5px;'><img src='../images/siteimages/purenet_miniLogo.gif' /></div><div style='float:left;margin-left:10px;margin-top:4px;font-size:80%;font-weight:bold;font-family:Arial;'>PureNet Solutions Ltd<span style='font-size:100%;font-weight:normal;'><br />Enterprise House<br />York Science Park<br />Innovation Way<br />YO10 5NY<br /><b>Tel.</b> 01904 898 444</span></div>";
            //map.openInfoWindowHtml(map.getCenter(), "<div>" + sInfoContent + "</div>");  
            
            // Create Marker Icon
            var icon = new GIcon();
            icon.image = "../images/siteimages/purenet_miniLogo.gif";
            icon.iconSize = new GSize(60, 23);
            icon.iconAnchor = new GPoint(17, 10);
            icon.infoWindowAnchor = new GPoint(17, 10);

            // Add Marker Icon
            var marker = new GMarker(new GLatLng(53.9504, -1.0472), icon); 
            GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(sInfoContent);  });
            map.addOverlay(marker);    
        } 
    }  
}