function validate()
{
		
}
$(document).ready(function() 
{
	$("#contactformpage tr").mouseout(function () 
	{
		$(this).css("background-color","white")
	}).mouseover(function () 
	{
		if($("input",this).size() >0 ||  $("textarea",this).size()>0 ) 
		{
			$(this).css("background-color","#F3F84F")
		}
	}).click(function (){
				if ($("input", this).size() == 1) {
			$("input[type=radio]", this).click();
			//console.log("All "+$(this).children("input").size()+" inner html"+$(this).html());
			//console.log("radio"+$(this).children("input[type=radio]").size());
			//console.log("radio2"+$("input[type=radio]",this).size());
			
			$("input[type=text]:first", this).focus();
			$("textarea", this).focus();
		}
	});
	$('#contactformpage').validate({
            errorClass: "formerror",
			onsubmit:true,
			groups: {
			    phonenumber: "phone1 phone2 phone3"
			  },
			errorPlacement: function(error, element) {
		     if (element.attr("name") == "phone1" 
		                 || element.attr("name") == "phone2" || element.attr("name") == "phone3")
		       error.insertBefore("#phoneend");
		     else
		       error.insertAfter(element);
		   },
            rules: {
                // simple rule, converted to {required:true}
                name:{
                    required: true
                },
				comment:{
                    required: true
                },
                emailaddress: {
                    required: function(element){
						return $("#emailpref:checked").size() > 0;
					},
                    email: true
                },
				phone1: {
					required: function(element){
						return $("#phonepref:checked").size() > 0;
					}
				},
				phone2: {
					required: function(element){
						return $("#phonepref:checked").size() > 0;
					}
				},
				phone3: {
					required: function(element){
						return $("#phonepref:checked").size() > 0;
					}
				}
            }
        });
});