// JavaScript Document

$(document).ready(function(){$("a").bind("focus",function(){if(this.blur)this.blur();});});


function loadflash(input)
{
	var label='home1';
	if (sa==1) { label="home"; }
	SkipToFrame(label);

}


var nfm = 'U heeft geen Flash plugin geinstalleerd. Deze is nodig om de site te bekijken. Klik <a href="http://www.adobe.com/shockwave/download/index.cgi?Lang=Dutch&amp;P1_Prod_Version=ShockwaveFlash" target="_blank">hier</a> om deze te installeren. ';


onload = function()
{
	lang = $("body").attr("class");
	$("#header").html(nfm);
	file="header2_"+lang+".swf";
	if (sa==1) { file="header_"+lang+".swf"; }
	var d = new SWFObject(file, "header", "950", "202", "8");
	d.addParam("wmode", "transparent");
	d.write("header");

}
$(function() {

	$("#contact_verzenden").click(function()
	{
		if (!$("#contact_naam").val()) { alert('Vul een naam in'); return; }
		if (!validate_email($("#contact_email").val())) { alert('Vul een geldig e-mail adres in'); return; }
		if (!$("#contact_bericht").val()) { alert('Vul een bericht in'); return; }
		var naam = $('#contact_naam').val();
		var bedrijf = $('#contact_bedrijf').val();
		var email = $('#contact_email').val();
		var bericht = $('#contact_bericht').val();

		$("#contacttable").fadeOut();
		$("#contacttable input, #contacttable textarea").val("");
		$("#verzonden").html("<img src=\"images/contact/load.gif\" alt=\"\"/> even geduld a.u.b.");
		setTimeout('$("#verzonden").fadeIn();',200);


		$.post('verzend_contact.php', {
		naam:naam,
		bedrijf:bedrijf,
		email:email,
		bericht:bericht,
		post_id:'contact_form_verzenden'
		}, function() {
			$("#verzonden").html("Het bericht is verzonden.");
			setTimeout('$("#verzonden").fadeOut();',3000);
			setTimeout('$("#contacttable").fadeIn();',3500);
		});

	});
});
function showThickbox(){
setTimeout(function(){ tb_show('toto', 'test.php?keepThis=true&TB_iframe=true&height=300&width=500', null);
}, 10);
}

function validate_email(email)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(email)) { return true; } else { return false; }
}

