﻿function load() 
{
  if (GBrowserIsCompatible()) 
  {
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(55.167475,-1.688731), 15);
  }
}

function externalWebsite(link)
{
    if(link == 'beelocal/')
        window.open("http://www.beelocal.co.uk/")
    else if(link == 'last-night-of-freedom/')
        window.open("http://www.lastnightoffreedom.co.uk/")
    else if(link == 'turbine-services/')
        window.open("http://www.turbineservices.co.uk/")
    else if(link == 'windtrap/')
        window.open("http://www.windtrap.co.uk/")
    else if(link == 'wow-activity-gifts/')
        window.open("http://www.wowactivitygifts.com/")   
}


function displaylimit(theid, thelimit, control)
{
    //alert(theid);alert(thelimit);alert(control);
    
    var box = document.getElementById(theid);
    if(control == "message")
        xxx = theid.replace("tbEnquiry","");
    else if (control == "additional")
        xxx = theid.replace("taAdditionalInfo","");
    var lengthleft=thelimit-box.value.length
    if (box.value.length>=thelimit)    
        box.value = box.value.substring(0, thelimit)
    if(lengthleft == -1)
        lengthleft = lengthleft+1            
    if(control == "message")
        document.getElementById("remainingChars").innerHTML = 'Characters Remaining: <b><span>'+lengthleft.toString()+'</span></b>'    
    else if (control == "additional")
        document.getElementById("remainingInfoChars").innerHTML = 'Characters Remaining: <b><span>'+lengthleft.toString()+'</span></b>'    
}

function clearGeneric(theid, defaultMessage)
{
    /*
    var box = document.getElementById(theid);
    if(box.value == defaultMessage) 
    box.value = ''; 
    */
}