/* Tells jQuery to do all the following code once the body has loaded */
$(document).ready(function(){

	/* ***************************************
	FORM FUNCTIONALITY
	*************************************** */
	
	// IE6 SPECIFIC STYLES
	jQuery.each(jQuery.browser, function(i, val) {
	  if(i=="msie" && jQuery.browser.version.substr(0,3)=="6.0")
		// Adds class of "ie6" to text & password input fields
		$(".field-container input[type='text'], .field-container input[type='password']").addClass("ie6");
	});
	
	// IE7 SPECIFIC STYLES
	jQuery.each(jQuery.browser, function(i, val) {
	  if(i=="msie" && jQuery.browser.version.substr(0,3)=="7.0")
		// Adds class of "ie7" to text & password input fields
		$(".field-container input[type='text'], .field-container input[type='password']").addClass("ie7");
	});
	
	// SHOW/HIDE
	$(".show-hide-section").hide();
	$('input[@type=checkbox]').click( 
		function() { 
		  if (this.checked) 
			$("div").find(".show-hide-section").show(); 
		  else 
			$("div").find(".show-hide-section").hide(); 
		} 
	); 
	
	// FORM VALIDATION
	$("#form-contact").RSV({
		displayType: "display-html",
		errorFieldClass: "errorField",
		rules: [
			"required,contactname,Please enter your name",
			"required,fromemail,Please enter your email address",
			"valid_email,fromemail,Please enter a valid email address",
			"required,message,Please provide some information about your enquiry"
		]
	});


/* ***************************************
DON'T DELETE - End of code run once body has loaded
*************************************** */
});