// JavaScript Document
$(document).ready(function(){
	var page = $('input[name=page]').val();
	if (page == 'home') {
		$('#home').addClass('current');
		$("body").attr("id","page1");
	} else {
		$("body").attr("id","page7");
	}
	if (page == 'development') {
		$('#development').addClass('current');
	}
	if (page == 'marketing') {
		$('#marketing').addClass('current');
	}
	if (page == 'technologies') {
		$('#technologies').addClass('current');
	}
	if (page == 'portfolio') {
		$('#portfolio').addClass('current');
	}
	if (page == 'free-quote') {
		$('#free-quote').addClass('current');
	}
});


$(document).ready(function(){
	$("div#msgbox").hide();
	$('#loadingDiv')
		.hide()  // hide it initially
		.ajaxStart(function() {
			$("div#contact-form").hide();							
			$(this).show();
		})
		.ajaxStop(function() {
			$(this).hide();
    });

	
	$("#submit").click(function(){
		$('#contact-form form').validate({
			rules: {
			  name: {
				required: true,
			  },
			  email: {
				required: true,
				email: true
			  }
			}
	    });
		if ($("#contacts-form").valid()) {
			$.post('includes/process.php', {
					name:$("#name").val(),
					email:$("#email").val()	,
					message:$("#message").val()
				},
				function (response) {
					$("div#msgbox #msg").html("<strong>Thank you for contacting Project 51 Web Development. Your message has been sent.<br /> We will contact you within 24 hours.");
					$("div#msgbox").show();
				}
			);
			return false;
		}
	});
});

function hideBa() {
$(document).ready(function(){
	$("div#ba_head").fadeOut();
});
}
