$(document).ready(function() {
	$("#requestCallback").click(function(){
		openContactForm ();
	});
	
});

function openContactForm () {
	$("div#contactFormContainer").css("display", "block");
	$("div#contactFormContainer").css("height", "390px");
	$("div#contactFormContainer").css("width", "305px");
	$("div#contactFormContainer").css("padding", "20px");
	$("div#contactFormContainer").css("padding-top", "10px");
	$("div#contactFormContainer").css("border", "4px solid #FE8E3D");
	//$("body").addClass("fade");
	$("#contactFormFade").show();
	$("div#contactFormContainer").center();
	$("div#closeButton").click(function(){
		$("div#contactFormContainer").css("display", "none");			
	});

}
function closeContactForm(){
	$("div#contactFormContainer").css("display", "none");
	$("#contactFormFade").hide();
}
jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
    this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
    return this;
}

function validateContactForm() {
	f = document.getElementById("contact_form");
	if (f.contact_name.value == "") {
		f.contact_name.focus();
		alert("Please fill out the Name field !");
		return false;
	} else if (f.contact_phone.value == "") {
		f.contact_phone.focus();
		alert("Please fill out the Telephone field !");
		return false;
	} else {
		f.submit();
	}
}
