$(document).ready(function(){
/* EXAMPLE SYNTAX
	 $("a").click(function(){
	   alert("Example");
	 });
	$('#gallery a').lightBox(); // Lightbox script. 
*/
	$(".thumb").click(function(){

		href = $(this).attr("href");
		$("#bigPicImg").attr("src",href);
		$(".thumb").removeClass("current");
		
		$(this).addClass("current");
		$(".thumb").each(function(){
			if ($(this).hasClass("current")) {

			} else {
				$(this).fadeTo(500,0.3);
			}
		});
		return false
	});
	$("#thumbsInner").jScrollPane({scrollbarWidth:27,showArrows:true});
	$(".thumb").fadeTo(0.1,0.3)
	$(".thumb:first").fadeTo(500,1);
	$(".thumb").hover(function(){
		if ($(this).hasClass("current")) {
			
		} else {
			$(this).fadeTo(500,1);
		}
	},function(){
		if ($(this).hasClass("current")) {
			
		} else {
			$(this).fadeTo(500,0.3);
		}		
	});
	$(".thumb:odd").css("margin-left","20px");
	$("#formWrapper").load("actions/form.html",function(){
	$("#loader").hide();
	$("#success").hide();
	
	jQuery().ajaxStart(function() {
		$("#loader").show(100);
	}).ajaxStop(function() {
		$("#loader").hide(100);
		
	}).ajaxError(function(a, b, e) {
		throw e;
	});
	function showResponse (argument) {
		$("#success").show(300);
	}
	$('#form').validate({
		submitHandler: function(form) {
			jQuery(form).ajaxSubmit({
				success: showResponse,
				clearForm: true
			});
		},
		rules: {
			first_name: "required",
			last_name: "required",
			address1: "required",
			city: "required",
			zip: "required",
			phone: "required",
			email: {
				required: true,
				email: true
			}			
		},
		messages: {
			first_name: "Please enter your First Name",
			last_name: "Please enter your Last Name",
			address1: "Please enter your Address",
			city: "Please enter your  City",
			zip: "Please enter your Zip",
			phone: "please enter your Phone number",
			email: "Please enter a valid email address"
		}
	});
	
	
});


	
});