    $(document).ready(function(){
	    $(document).keypress(function(e){
		    if(e.keyCode==27 && popupStatus==1){
			    disablePopup();
		    }
	    });
	    
	    $(window).resize(function(){
	        centerPopup();
	    });
    });
    
    var popupStatus = 0;

    function loadPopup(){
	    if(popupStatus==0){
		    $("#backgroundPopup").css({
			    "opacity": "0.3"
		    });
		    $("#backgroundPopup").fadeIn("fast");
		    $("#popupContact").fadeIn("fast");
		    popupStatus = 1;
	    }
    }

    function disablePopup(){
	    if(popupStatus==1){
		    $("#backgroundPopup").fadeOut("fast");
		    $("#popupContact").fadeOut("fast");
		    popupStatus = 0;
		    $("select").show();
	    }
    }

    function centerPopup(){
	    var windowWidth = document.documentElement.clientWidth;
	    var windowHeight = document.documentElement.clientHeight;
	    var documentWidth = $(document).width();
	    var documentHeight = $(document).height();
	    var popupHeight = $("#popupContact").height();
	    var popupWidth = $("#popupContact").width();
		
		alert(windowHeight + '*' + popupHeight);
	    //centering
	    $("#popupContact").css({
		    "position": "absolute",
		    "top": 10,
		    "left": windowWidth/2-popupWidth/2
	    });
    	
	    $("#backgroundPopup").css({
		    "height": documentHeight,
		    "width": documentWidth
	    });
	    
    }