function check(voornaam, achternaam, straat, huisnummer, postcode, plaats, email, telnr){
var check = 0;
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

if (!filter.test(email) || telnr=="" || voornaam=='' || straat== '' || huisnummer==''||postcode==''||plaats=='') {
//alert("U moet een geldig telefoonnummer invullen. Anders kan de offerte niet verwerkt worden.");
//telnr.focus;
}else{
	check=1;
}
if(!check){
	alert("U moet alle verplichte velden invullen, anders kan de offerte niet verwerkt worden");
	return false;
}
	return true;
}

$(document).ready(function() {
	
	$("#prod_options select").change(function() {
		var url = "inc/opties.php";
		url += "?prod_id="+$("input#prod_id").val();
		url += "&voorbeeld_id="+$("input#voorbeeld_id").val();
		url += "&custom_id="+$("input#custom_id").val();
		url += "&formaat="+$("select#formaat").val();
		url += "&glitter="+$("select#glitter").val();
		$('#opties').load(url,"");
	}
	)

	$("#voorkant select").change( function() {
		var url = "inc/kaart.php";
		url += "?id="+$("select#voorkant_nr").val();
		url += "&show=voorkant&name=voorkant_kaartnaam";
		$('#voorkant_preview').load(url,"");
	}
	)

	$("#binnenkant select").change(function () {
		var url = "inc/kaart.php";
		url += "?id="+$("select#binnenkant_nr").val();
		url += "&show=binnenkant&name=binnenkant_kaartnaam";
		$('#binnenkant_preview').load(url,"");
	}
	)

		$("#voorkant2 select").change( function() {
		var url = "inc/kaart.php";
		url += "?id="+$("select#voorkant_nr2").val();
		url += "&show=voorkant&name=voorkant_kaartnaam2";
		$('#voorkant_preview2').load(url,"");
	}
	)

	$("#binnenkant2 select").change(function () {
		var url = "inc/kaart.php";
		url += "?id="+$("select#binnenkant_nr2").val();
		url += "&show=binnenkant&name=binnenkant_kaartnaam2";
		$('#binnenkant_preview2').load(url,"");
	}
	)
	$("input#extraKaart").click(function() {
		$("#kaartkeuze2").show();
		$("input#extraKaart").hide();

	}
	)



	$("a.infolink").click(function() {
		var key = $(this).attr('name');
		//	$('#infolink').load("inc/chart_info.php?key="+key, "").show();
	}
	)


	$('.expand').click(function() {
		$(this).parent().next().toggleClass('hidden');
	});




	$("#chart tr.product").click(function(){
		$(this).next("tr").toggle();
		$(this).find(".arrow").toggleClass("up");
	});
	//$("#report").jExpand();
	
	// By suppling no content attribute, the library uses each elements title attribute by default
	   $('img[tooltip]').each(function(){
		   $(this).qtip({
	      // Simply use an HTML img tag within the HTML string
		      
		   //   var rel =;
	      content: '<img src="'+ $(this).attr('tooltip')+'" /><br \>'+$(this).attr('alt'),
	      position: {
			      corner: {
			         target: 'topLeft',
			         tooltip: 'topRight'
			      }
			   },
		      style: { 
				//width: 150,
				padding: 5,
				background: '#1b325e',
				color: 'white',
		      	textAlign: 'center',
		      	border: {
		         width: 7,
		         radius: 5,
		         color: '#1b325e'
		      },

		    
		      name: 'dark' // Inherit the rest of the attributes from the preset dark style
		      }
			      
	   });
	   });
	   /*
	
	$('img[alt]').qtip({ 
	      position: {
        corner: {
           target: 'bottomMiddle',
           tooltip: 'topMiddle'
        }
     },
		      style: { 
				width: 150,
				padding: 5,
				background: '#1b325e',
				color: 'white',
		      	textAlign: 'center',
		      	border: {
		         width: 7,
		         radius: 5,
		         color: '#1b325e'
		      },

		    
		      name: 'dark' // Inherit the rest of the attributes from the preset dark style
		   }
		});
		*/
});

