﻿//Function to check if google map is required
function CheckForMap(currentPage) {
    //check office location


    if (currentPage == "pnlOfficeLoc") {
        if (GBrowserIsCompatible()) {

            var map = new GMap2(document.getElementById("map"));

            //B+W Loc
            var loc = new GLatLng(-27.463526, 153.025979);

            //set center to be B+W
            map.setCenter(loc, 15);
            var zoomer = new GSmallZoomControl();
            map.addControl(zoomer);
            map.enableScrollWheelZoom();
            //add marker for B+W
            var bwMarker = new GMarker(loc, null);
            map.addOverlay(bwMarker);

            //listener for click
            GEvent.addListener(bwMarker, 'click',
              function() {
                  bwMarker.openInfoWindowHtml('Bornhorst + Ward Office <br /> Level 4 / 67 Astor Terrace Spring Hill <br /> QLD, Australia', null);
              }
          );


        }
    }

}



function ShowDiv(divToShow) {
    //hide container div
    $('#background').slideUp('normal', showNewContent);

    function showNewContent() {
        //hide all internal divs
        $('.contentDiv').hide();
        //show the current one
        $('#' + divToShow).show();
        //show the div
        $('#background').slideDown('normal');
        CheckForMap(divToShow);
    }
    return false;
}
