/* ---------------------------------------------------- */
/* JQuery												*/
/* ---------------------------------------------------- */
$jQuery(document).ready(function() 
{
	
	/*############################################################################
	Use jQuery to action onchanges from the header select drop-downs
	############################################################################ */
	$jQuery('#selectservice').change( function() {
		if ( $jQuery(this).val() != "" ) { location.href = $jQuery(this).val(); }
	});
	$jQuery('#selectpartners').change( function() {
		if ( $jQuery(this).val() != "" ) { location.href = $jQuery(this).val(); }
	});	

	/*############################################################################	
	Clear Search form when clicked on
	############################################################################ */
	$jQuery("#searchbox").focus(function() { 
		$jQuery("#searchbox").attr('value','');
	});
	
	/*############################################################################	
	Prevent the default search box text from being submitted as a search phrase
	############################################################################ */
	$jQuery("input#search_arrow").click(function() {
		if ( $jQuery("#searchbox").val() == "Fetch..." ) {return false;}
	});	
	
	/*############################################################################	
	Redirect visitor to the contact form when the Contact input box is clicked
	############################################################################ */
	var Browser = 
	{
	  Version: function() {
	    var version = 999; // let's assume non IE browser
	    if (navigator.appVersion.indexOf("MSIE") != -1)
	      // IE - lets get version number
	      version = parseFloat(navigator.appVersion.split("MSIE")[1]);
	    return version;
	  }
	}
	$jQuery("input#contact-us").click(function() {
		$jQuery("input#contact-us").attr('disabled','disabled');
		// if IE 6 or IE 7
		if ( Browser.Version() < 8 )
		{
			window.location.href = "http://www.harrison-clark.co.uk/contactus/";
		}
		else
		{
			window.location.href = "contactus/";
		}
	});	
	
	 
});
