function initialize() {
    var latlng = new google.maps.LatLng(51.46494, -0.21276);
    var myOptions = {
      zoom: 15,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("google-map"),
        myOptions);

	var image = new google.maps.MarkerImage('/images/google-maps-icon.png',
      // This marker is 20 pixels wide by 32 pixels tall.
      new google.maps.Size(91, 40),
      // The origin for this image is 0,0.
      new google.maps.Point(0,0),
      // The anchor for this image is the base of the flagpole at 0,32.
      new google.maps.Point(44, 42));
      
	var marker = new google.maps.Marker({
        position: latlng,
        map: map,
        icon: image
    });
  }


$(document).ready(function() {

	if ($('.main-contact').size()>0) {
  		initialize();
  	};


	// Open Links in New Window (XHTML 1.0 Strict does not allow target attribute)
	$('a.external').attr('target', '_blank');

	// Fancybox
	$('a.fancybox').fancybox({
		'type':					'iframe',
		'width':				960,
		'height':				'90%',
		'centerOnScroll':		true,
		'hideOnOverlayClick':	true,
		'titleShow':			false
	});

	// Clear Fields
	function clickclear(field, defaulttext) {
		if (field.value == defaulttext) {
			field.value = "";
		}
	}
	function clickrecall(field, defaulttext) {
		if (field.value == "") {
			field.value = defaulttext;
		}
	}

	$("#dob-day").focus(function(){
		clickclear(this, "DD");
	});
	$("#dob-day").blur(function(){
		clickrecall(this, "DD");
	});

	$("#dob-month").focus(function(){
		clickclear(this, "MM");
	});
	$("#dob-month").blur(function(){
		clickrecall(this, "MM");
	});

/*
	// Image Rotation
	var currImage = 1;
	var prevImage = 1;
	var count = 0;

	$('#image-rotation img').each(function() {
		count++;
	});

	if (count > 1) {
		setInterval(nextImage,4000);
	}

	function nextImage() {
		if(currImage == count) {
			currImage = 0;
		}

		currImage++;
		$('#image-' + prevImage).fadeOut();
		$('#image-' + currImage).fadeIn();
		prevImage = currImage;
	}
*/

	// Show/Hide Text
		$('#content').show();
		$('#show-text').hide();
		$('#hide-text').show();

	$('#show-text').click(function(event){
		event.preventDefault();
		$('#show-text').hide();
		$('#content').show();
		$('#hide-text').show();
		//$('h1').show();
	});
	
	$('#hide-text').click(function(event){
		$("#content-wrapper").css({ "height" : $("#content-wrapper").height() }); //fix for different hieghts
		event.preventDefault();
		$('#hide-text').hide();
		$('#content').hide();
		$('#show-text').show();
		//$('h1').hide();
	});

	//Hide all but first image
	$('#images img:not(":first")').hide();
	
	(function imageTransition(){
		setTimeout(function(){
			//Fade all images out
			$('#images img:visible').fadeOut();
			
			//Fade in images
			if($('#images img:visible').next('img').size() < 1)
			{
				$('#images img:first').fadeIn();
			}
			else
			{
				$('#images img:visible').next('img').fadeIn();
			}
			imageTransition();
		}, 5000);
	})();

	if ($('#content-home').length > 0){

	//	$('#show-text').show();
		$('#hide-text').show();
	//	$('#content-home').hide();

$('#show-text').click(function(event){
		event.preventDefault();
		$('#show-text').hide();
		$('#content-home').show();
		$('#hide-text').show();
	});

	$('#hide-text').click(function(event){
		$("#content-wrapper").css({ "height" : $("#content-wrapper").height() }); //fix for different hieghts
		event.preventDefault();
		$('#hide-text').hide();
		$('#content-home').hide();
		$('#show-text').show();
	});

}

$("#images").css({ "height" : $("#content-wrapper").height() }); //fix for different hieghts

});

