var popupStatus = 0;
function loadPopup_3(){
	if(popupStatus==0){
		$("#backgroundPopup_3").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup_3").fadeIn("slow");
		$("#popupContact_3").fadeIn("slow");
		popupStatus = 1;
	}
}
function disablePopup_3(){
	if(popupStatus==1){
		$("#backgroundPopup_3").fadeOut("slow");
		$("#popupContact_3").fadeOut("slow");
		popupStatus = 0;
	}
}
function centerPopup_3(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupContact_3").height();
	var popupWidth = $("#popupContact_3").width();
	$("#popupContact_3").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	$("#backgroundPopup_3").css({
		"height": windowHeight
	});
	
}
$(document).ready(function(){
	$("#button_3").click(function(){
		centerPopup_3();
		loadPopup_3();
	});
	$("#popupContactClose_3").click(function(){
		disablePopup_3();
	});
	$("#backgroundPopup_3").click(function(){
		disablePopup_3();
	});
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup_3();
		}
	});
});

