/*============================================================

Author: Simon Young
http://simonyoung.net
http://twitter.com/simon180

ONLOAD.JS 
Site specific JavaScript functionality

(c) Simon Young, 2010. All rights reserved.

============================================================*/
$(document).ready(function () {
	
	
	
	// uncomment the next two lines to activate Cufon to replace elements with Museo Sans
	//Cufon.replace("h1");
	
	// make links with rel=external open in new window/tab
	$(function() {
        $('a[rel*=external]').click( function() {
            window.open(this.href);
            return false;
        });
    });
    
    
    // handle newsletter subscribe text label
    $(".cm-form .input-txt").focus(function () {
        if($(this).val() === $(this).attr("title")) {
            $(this).val("");
            $(this).css({'font-style': 'normal','color': '#666666'});
        }
    }).blur(function () {
        if ($(this).val() === "") {
            $(this).val($(this).attr("title"));
            $(this).css({'font-style': 'italic','color': '#999999'});
        }
    });
    
    
    // google maps
    var map = new google.maps.Map(document.getElementById('map'), {
        zoom: 13,
        center: new google.maps.LatLng(53.181855, -2.870243),
        mapTypeId: google.maps.MapTypeId.ROADMAP
    });
    
    var marker = new google.maps.Marker({
        position: new google.maps.LatLng(53.181855, -2.870243),
        map: map
    });
    
    var infowindow = new google.maps.InfoWindow({  
      content: '<p><strong>The Red House, Chester</strong></p>'  
    });
    
    google.maps.event.addListener(marker, 'click', function() {  
      infowindow.open(map, marker);  
    });
	
});
