// Boot JavaScript file that handles the initialisation of 
// all the JavaScript code.

$(document).ready(function(){
	
	// preload images
	$.preloadImages = function() {
		for(var i = 0; i<arguments.length; i++) {
			$("<img>").attr("src", arguments[i]);
		}
	};
	
	// set the first field to have focus
	$("input:first").focus();
	
	
	$(".button").hover(
	  function () {
	    $(this).attr("src","../images/btn_submit-over.gif");
	  },
	  function () {
	    $(this).attr("src","../images/btn_submit.gif");
	  }
	);
	
	
	// $("img.hover-gif").hover(
	// 	function(){
	// 		$(this).src = $(this).src.replace(/.gif/, '-over.gif')
	// 	}, 
	// 	function(){
	// 		$(this).src = $(this).src.replace(/-over.gif/, '.gif')
	// 	}
	// );
	
	// use a button class on span element to create submit button
	$(".button").click(function(){
		EMSON.submit_contact()
	});
	
});