
jQuery(document).ready(function($) {
    	
		var images = new Array;				
		
	    var myPics = preloadImages ($(".hover_image"));
	
	    function preloadImages(pics) {	
	
	        $.each(pics, function(){
	        	pic_id = $(this).attr("id")
	        	images[pic_id] = new Image();
	            images[pic_id].src = ($(this).attr("data-hover-src"));
	        });
	
	        return(images);
	    }

      
      var original_src = "";
      
       $(".hover_image").hover(
	      function () {   
	   			original_src = $(this).attr("src");
	      	 	$(this).attr({"src": images[$(this).attr("id")].src});			
	      }, 
	      function () {
				$(this).attr({"src": original_src});
	      }
  	  );
  	  
	var fieldText = '';
	/* this is Contact form field */
	$('#your_name_text').focus(function(){
			fieldText = $(this).attr('value');			
			if(fieldText == 'Name'){ $(this).attr('value',""); }
			
	});
	
	$("#your_name_text").blur(function () {
			fieldText = $(this).attr('value');			
			if(fieldText == ""){ $(this).attr('value', "Name"); }
			else{ $(this).attr('value', fieldText); }
	});

	$('#your_email_text').focus(function(){
			fieldText = $(this).attr('value');			
			if(fieldText == 'Email'){ $(this).attr('value',""); }
			
	});
	
	$("#your_email_text").blur(function () {
			fieldText = $(this).attr('value');			
			if(fieldText == ""){ $(this).attr('value', "Email"); }
			else{ $(this).attr('value', fieldText); }
	});
	
	$('#your_message_text').focus(function(){
			fieldText = $(this).attr('value');			
			if(fieldText == 'Message'){ $(this).attr('value',""); }
			
	});
	
	$("#your_message_text").blur(function () {
			fieldText = $(this).attr('value');			
			if(fieldText == ""){ $(this).attr('value', "Message"); }
			else{ $(this).attr('value', fieldText); }
	});
		
  });
