var cMap;

function createMarker(point,html) {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      } 

function loadCMap() {

        cMap = new GMap2(document.getElementById("contactmap"));

        //map.enableScrollWheelZoom();
        //cMap.disableDragging();
        cMap.addControl(new GSmallZoomControl); // small zoom only
        //cMap.addControl(new GHierarchicalMapTypeControl); // map, satellite, hybrid
        //cMap.addMapType(G_PHYSICAL_MAP);
        cMap.disableDoubleClickZoom();
        cMap.disableGoogleBar();

        // get the starting coords and plot the map
        //Latitude: 50.793741  Longitude: 0.045837 
        var latlng = new GLatLng(50.793741,0.045837);
        cMap.setCenter(latlng, 14);
        cMap.clearOverlays();

        var html = '<div style="width:200px;">Newhaven Lodge<br>'
                + '12 Brighton Road, Newhaven, East Sussex, BN9 9NB'
                + '</div>';
       
        var marker = createMarker(latlng,html);
        cMap.addOverlay(marker);


} // function loadCMap()

//----------------------------------------------




//Define constants
var height = "27px";
var lower_height = "26px";
var bg_color = "#3f3a3a";
//End define

function submitForm(form) {
	var sub = document.getElementById(form);
	sub.submit();
}

function goHigh(){
	//Low season decrease zIndex to 1
	//High season increase zIndex to 2
	//High season tab change colour, background, borderBottom, height
	//Low season tab change colour, background, borderBottom, height
	var highContent = document.getElementById("priceTableHigh");
	var highTab = document.getElementById("high_tab");
	var lowContent = document.getElementById("priceTableLow");
	var lowTab = document.getElementById("low_tab");
	highContent.style.zIndex = 2;
	lowContent.style.zIndex = 1;
	highTab.style.color = "#000000";
	lowTab.style.color = "#ffffff";
	highTab.style.background = "url('images/bg_table.png')";
	lowTab.style.background = "url('images/bg_tab.png')";
	highTab.style.borderBottom = "0px";
	lowTab.style.borderBottom = "1px solid " + bg_color;
	highTab.style.height = height;
	lowTab.style.height = lower_height;
}

function goLow(){
	//high season decrease zIndex to 1
	//low season increase zIndex to 2
	//low season tab change colour, background, borderBottom, height
	//high season tab change colour, background, borderBottom, height
	var highContent = document.getElementById("priceTableHigh");
	var highTab = document.getElementById("high_tab");
	var lowContent = document.getElementById("priceTableLow");
	var lowTab = document.getElementById("low_tab");
	lowContent.style.zIndex = 2;
	highContent.style.zIndex = 1;
	lowTab.style.color = "#000000";
	highTab.style.color = "#ffffff";
	lowTab.style.background = "url('images/bg_table.png')";
	highTab.style.background = "url('images/bg_tab.png')";
	lowTab.style.borderBottom = "0px";
	highTab.style.borderBottom = "1px solid " + bg_color;
	lowTab.style.height = height;
	highTab.style.height = lower_height;	
}

function confirmDelete(){
	return confirm("Are you sure?");
}

