$(function() {
	Cufon.replace('h1', { fontFamily: 'Sue Ellen Francisco' });
	Cufon.replace('h2', { fontFamily: 'Helvetica Neue' });
	Cufon.replace('h3', { fontFamily: 'Sue Ellen Francisco' });
	Cufon.replace('p', { fontFamily: 'Helvetica Neue' });
	Cufon.now();
	initMap();
	$("#newsSignup").validationEngine({promptPosition : "topLeft"});
	
	$("#clientLogos img").hover(function() {
			$(this).attr("src", $(this).attr("src").split(".").join("-hov."));
		}, 
		function() {
			$(this).attr("src", $(this).attr("src").split("-hov.").join("."));
	});
});
	
function initMap() {
	if( document.getElementById( "gMapCanvas" ) == undefined )
		return;
		
	var locations = [
		['Little Green Frog - Where Big Ideas Grow', -32.924805,151.747485, 5]
	];
	
	loadMap( locations );	 
}
	
function loadMap( locations_ )
{
	var map = new google.maps.Map(document.getElementById('gMapCanvas'), {
	  zoom: 12,
	  center: new google.maps.LatLng(-32.924805,151.747485),
		mapTypeId: google.maps.MapTypeId.ROADMAP,
		disableDefaultUI: true,
		zoomControl: true
	});

	var infowindow = new google.maps.InfoWindow();

	var marker, i;

	for (i = 0; i < locations_.length; i++) {  
	  marker = new google.maps.Marker({
		position: new google.maps.LatLng(locations_[i][1], locations_[i][2]),
		map: map/*,
		icon: new google.maps.MarkerImage( 'http://www.littlegreenfrog.com.au/images/google-map-marker.png' )*/
	  });
	  
	  google.maps.event.addListener(marker, 'click', (function(marker, i) {
		return function() {
		  window.open('http://maps.google.com/maps?q=27a+murray+street+hamilton&hl=en&ll=-32.925996,151.752348&spn=0.054177,0.090551&sll=-32.927148,151.745825&sspn=0.052663,0.090551&vpsrc=6&hnear=27A+Murray+St,+Hamilton+New+South+Wales+2303,+Australia&t=m&z=14',
			 'open_window',
			 'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, left=0, top=0')		  		 
		}
	  })(marker, i));
	}
}
