function showWait()
{
    $(".showWait").show();
}

function submitContact()
{
	$.post("forms/contact.php", $('form').serialize(),
			function(data){
				$('.contact_form').html(data);
	   });
	return false;
}



popupStatus = 0;
//loading popup with jQuery magic!
function loadPopup(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopup").css({
		"opacity": "0.7"
	});
	$("#backgroundPopup").fadeIn("slow");
	$("#popupContact").fadeIn("slow");
	popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopup(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupContact").fadeOut("slow");
		popupStatus = 0;
	}
}

//centering popup
function centerPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth + 80;
	var windowHeight = document.documentElement.clientHeight + 40;
	
	var popupHeight = $("#popupContact").height();
	var popupWidth = $("#popupContact").width();
	//centering
	$("#popupContact").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	
	var inhoudHeight = $('.pagina').height();
	
	if (inhoudHeight > windowHeight)
	{
		windowHeight = inhoudHeight + 40
	}
	
	//only need force for IE6
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	$("#backgroundPopup").css({
		"width": windowWidth
	});
}
	
function activatePopup()
{
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
		 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		 if (ieversion < 7)
		 {	 
			//LOADING POPUP
			//centering with css
			centerPopup();
			//load popup
			loadPopup();
		 }
	}
	//CLOSING POPUP
	//Click the x event!
	$("#popupContactClose").click(function(){
		disablePopup();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 || popupStatus==1){
			disablePopup();
		}
	});
}


$(document).ready(function(){					
	$('#multi-ddm').dropDownMenu({timer: 1000, parentMO: 'parent-hover', childMO: 'child-hover1'});
	$("#multi-ddm").css({
		"opacity": "0.88"
	});
	
	var height = $(window).height() - 274;
	$('.pagina').css('min-height', height);
});

 

