document.onclick = function() 
{ 
	$(".ul_subsubmenu").hide();
} 

function hover(hover_id)
{
	$('#sub-'+hover_id).show();
	
	$(".ul_subsubmenu").each(function(i){
	   var loop_id = $(this).attr("id").replace("sub-","");
       if(loop_id!=hover_id) $('#sub-'+loop_id).hide();
     }); 

}

function locateShop(){
	$('#frm_shopLocator').submit();
}

function validate(address) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   return (reg.test(address));
}

function checkContactForm(){
	if(
		$('#naam').val()=="" ||
		$('#adres').val()=="" ||
		$('#postcode').val()=="" ||
		$('#plaats').val()=="" ||
		(!validate($('#email').val())) ||
		$('#land').val()==""
		){
		$('#error').show();
		return false;
	} else {
		$('#error').hide();
		var str = $('#frmContact').serialize();
	    $.ajax({type: "POST",url: URL_X+"contact.do.php", data: str,success: function(msg){ $('#frmContact').hide(); $('#resultText').html(msg).show(); }});
	}
	
}

function checkActieForm(){
	if(
		$('#naam').val()=="" ||
		$('#adres').val()=="" ||
		$('#postcode').val()=="" ||
		$('#plaats').val()=="" ||
		(!validate($('#emailadres').val()))
		){
		$('#error').show();
		return false;
	} else {
		$('#fA').hide();
	//	$('#succes').show();
		return true;
	}
	
}

function startSelector(gewicht){
	tb_show('<div id="voedingscalculator_title"></div>',URL_X+'voedingscalculator.php?height=400&width=700&gewicht='+escape(gewicht)+'&rnm='+Math.random());
}

function stapDirect(){

	var dataval = $('#formStap').serialize();
	
	$.ajax({type: "POST", url:URL_X+'voedingscalculator.do.php', data:dataval, success:function(msg){
		$('#vragen').html(msg);
	}});
	
}

function stapBack(naar){
	
	var dataval = 'naar_stap='+naar;
	
	$.ajax({type: "POST", url:URL_X+'voedingscalculator.do.php', data:dataval, success:function(msg){
			$('#vragen').html(msg);
	}});
	
}

function annuleren(){
	tb_remove();
}

function equalFooter()
{
	setTimeout(function(){
	var c_content = $('#content').height();
	var r_content = $('#right').height();
	
	if(r_content>c_content){
		//$('#content').html($('#content').html()+'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br />');
	}
	},200);
}

function checkVC(value){
	
	if(value!=''){$('#stamper').removeAttr('disabled');}else{$('#stamper').attr('disabled', 'disabled');}
}

$(document).ready(function(){ 
    $(document).pngFix(); 
}); 

function showBox(){
	
	tb_show('Hartog Compact Gras','http://www.hartog-lucerne.nl/youtube.php?keepThis=true&TB_iframe=true&height=360&width=555',true);
}