/* ---------------------------------------------------- */
/* JQuery												*/
/* ---------------------------------------------------- */
$jQuery(document).ready(function() 
{
	
	/*############################################################################	
	Clear form elements when clicked on (after checking that contents are the defaults - so user entered content is not removed)
	############################################################################ */
	$jQuery("#searchbox").focus(function() { 
		if ( $jQuery("#searchbox").val() == "Search this site" ) {$jQuery("#searchbox").attr('value','');}
	});	
	$jQuery("#contactname").focus(function() { 
		if ( $jQuery("#contactname").val() == "Name" ) {$jQuery("#contactname").attr('value','');}
	});
	$jQuery("#contactphone").focus(function() { 
		if ( $jQuery("#contactphone").val() == "Phone" ) {$jQuery("#contactphone").attr('value','');}
	});	
	$jQuery("#contactemail").focus(function() { 
		if ( $jQuery("#contactemail").val() == "Email" ) {$jQuery("#contactemail").attr('value','');}
	});
	$jQuery("#contactquestion").focus(function() { 
		if ( $jQuery("#contactquestion").val() == "Your question for us..." ) {$jQuery("#contactquestion").attr('value','');}
	});	
	
	
	/*############################################################################	
	Prevent the default search box text from being submitted as a search phrase
	############################################################################ */
	$jQuery("input#search_button").click(function() {
		if ( $jQuery("#searchbox").val() == "Search this site" ) {return false;}
	});	
	
	/*############################################################################
	Start the homepage image display system
	############################################################################ */
	/* Hide the non Javascript image display */
	$jQuery("#imagedisplay").css("visibility","hidden");
	/* make the image area visible - and then fade it in */
	$jQuery("#image_rotate").css("visibility","visible");
	$jQuery("#image_rotate").fadeIn(2000);
	
	/* Fade through the images */
	$jQuery('#image_rotate').innerfade({ 
		speed: 3000, 
		timeout: 6000, 
		type: 'sequence', 
		containerheight: '323px'
	});		
	 
});

