$(document).ready
			(
				function()
				{
					var qs = window.location.search.substring(1);
					var p = qs.split('?');
					var a = p.toString().lastIndexOf("=");
					action = p.toString().substring(a+1,p.toString().length);
					highlightForm(action);
					
					$("#contactform").validate({
						rules: {
							companyname: "required",
							firstname: "required",
							lastname: "required",
							email: {
								required: true,
								email: true
							}
						},
						messages: {
							companyname: "Please enter a company name",
							firstname: "Please enter your first name",
							lastname: "Please enter your last name",							
							email: "Please enter a valid email address"
						}
					});
					
					$('input[name=informationCheck]').click(function(){
    				
						if($('input[name=informationCheck]').attr('checked') == false)
						{
							$("#information").fadeOut(400);
						}
						if($('input[name=informationCheck]').attr('checked') == true)
						{
							$("#information").fadeIn(400);
						}
						
        			}); 					
					
					$('input[name=demonstrationCheck]').click(function(){
    				
						if($('input[name=demonstrationCheck]').attr('checked') == false)
						{
							$("#demonstration").fadeOut(400);
						}
						if($('input[name=demonstrationCheck]').attr('checked') == true)
						{
							$("#demonstration").fadeIn(400);
						}
						
        			});
        			
        			$('input[name=seminarCheck]').click(function(){
    				
						if($('input[name=seminarCheck]').attr('checked') == false)
						{
							$("#seminar").fadeOut(400);
						}
						if($('input[name=seminarCheck]').attr('checked') == true)
						{
							$("#seminar").fadeIn(400);
						}
						
        			}); 
        			
        			$('input[name=trainingCheck]').click(function(){
    				
						if($('input[name=trainingCheck]').attr('checked') == false)
						{
							$("#training").fadeOut(400);
						}
						if($('input[name=trainingCheck]').attr('checked') == true)
						{
							$("#training").fadeIn(400);
						}
						
        			});  
        			
        			$('input[name=supportCheck]').click(function(){
    				
						if($('input[name=supportCheck]').attr('checked') == false)
						{
							$("#support").fadeOut(400);
						}
						if($('input[name=supportCheck]').attr('checked') == true)
						{
							$("#support").fadeIn(400);
						}
						
        			}); 			
				}				
			)
			
			function highlightForm(which)
			{
				switch(which)
				{
					case "demonstration":
						$('input[name=demonstrationCheck]').attr('checked', true);
						$("#demonstration").fadeIn(400);
					break;
					
					case "seminar":
						$('input[name=seminarCheck]').attr('checked', true);
						$("#seminar").fadeIn(400);
					break;
					
					case "training":
						$('input[name=trainingCheck]').attr('checked', true);
						$("#training").fadeIn(400);
					break;
					
					case "information":
						$('input[name=informationCheck]').attr('checked', true);
						$("#information").fadeIn(400);
					break;
					
					case "support":
						$('input[name=supportCheck]').attr('checked', true);
						$("#support").fadeIn(400);
					break;
				}
			}
