// This is the ready code
$(document).ready(function(){


	$("a").click(function(event){

		// Contact link
		if(this.id=='contact_link'){	
			var height = $(window).height();
			var width = $(document).width();

			$("#contact_div").css({
			'left' : width/2 - ($("#contact_div").width() / 2),  // half width - half element width
			'top' : height/2 - ($("#contact_div").height() / 2), // similar
			'z-index' : 15,                        // make sure element is on top
			});
			$("#contact_msg").hide();
			$("#contact_div").fadeIn("slow");
			event.preventDefault();
		}else if(this.id=='close_contact_div'){
			$("#contact_msg").hide();
			$("#contact_div").fadeOut("slow");		
			event.preventDefault();
		}else if(this.id=='quote_link'){	
			var height = $(window).height();
			var width = $(document).width();

			$("#quote_div").css({
			'left' : width/2 - ($("#quote_div").width() / 2),  // half width - half element width
			'top' : height/2 - ($("#quote_div").height() / 2), // similar
			'z-index' : 15,                        // make sure element is on top
			});
			$("#quote_msg").hide();
			$("#quote_div").fadeIn("slow");
			event.preventDefault();
		}else if(this.id=='close_quote_div'){
			$("#quote_msg").hide();
			$("#quote_div").fadeOut("slow");		
			event.preventDefault();
		}else{}
       });

	$("input").click(function(event){
		// Contact link
		if(this.id=='contact_btn'){	
			$.post("http://www.programmer.gr/contactus.php", $("#frmContact").serialize());
			$("#contact_msg").fadeIn("slow");
			event.preventDefault();
		}else if(this.id=='quote_btn'){	
			$.post("http://www.programmer.gr/post_project.php", $("#frmQuote").serialize());
			$("#quote_msg").fadeIn("slow");
			event.preventDefault();
		}else{}
       });
});



