    function loadGoogleMap() {
      if (GBrowserIsCompatible()) {
        //var map = new GMap2(document.getElementById("map"));

        //map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        showAddress('Portland Street, Barnsley, S70 3QT');
      }
    }

    function showAddress(address) {

     var geocoder = new GClientGeocoder();
      geocoder.getLatLng(
        address,
        function(point) {
          var map = new GMap2(document.getElementById("map"));
          if (!point) {
            //alert(address + " not found");
          } else {
            map.setCenter(point, 13);
            var marker = new GMarker(point);
            map.addOverlay(marker);
            marker.openInfoWindowHtml(address);
          }
        }
      );
    }

$().ready(function(){
    // external urls
    $('a').click(function(){
	    if((this.href.match(/^http/i) && !this.href.match(location.host)) || this.rel=='external'){
		    window.open(this.href,'_');
		    return false;
	    }
	});
	// ie pngs
	/*@cc_on
	if(navigator.appVersion.match(/MSIE [0-6]\./)){
		$('img[@src*=".png"]').addClass('png');
		$('input[@src*=".png"]').addClass('png');
		$('.bgpng').each(function(){fnFixPng(this)});
	}
	function fnFixPng(obj){
		var bg  = obj.currentStyle.backgroundImage;
		var src = bg.substring(5,bg.length-2);
		var sizingMethod = (obj.currentStyle.backgroundRepeat == "no-repeat") ? "crop" : "scale";
		obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + sizingMethod + "')";
		obj.style.backgroundImage = "url(/interface/images/blank.gif)";
	}
	@*/

    if($('input.date').length > 0) {
        var startDate = new Date();
        startDate.setDate(startDate.getDate()+2);
        $('input.date').datepicker({
            dateFormat: "dd/mm/yy",
            minDate:    "+1d",
            startDate:  startDate
        });
                
    }

    if($('#map').length > 0) {
        loadGoogleMap();
    }
    
    if($('#return-form').length > 0) {
        $('#return-form').hide();
        
        if($('#chk_return').is(':checked')) {
            $('#return-form').show();
        } else {
            $('#return-form').hide();
        }
        
        $('#chk_return').click(function() {
            if($(this).is(':checked')) {
                $('#return-form').show();
            } else {
                $('#return-form').hide();
            }
        });
    }
});
