// JavaScript Document
	var flashvars = {};
		flashvars.xml = "cu3er_config.php";
		var attributes = {};
		attributes.wmode = "transparent";
		attributes.id = "slider";
		swfobject.embedSWF("cu3er.swf", "cu3er-container", "950", "341", "9", "expressInstall.swf", flashvars, attributes);

function setFocus(aField) {
document.forms[0][aField].focus();
}

function isAnEmailAddress(aTextField) {
// 1+@3+ [or x@x.x] is as close as we will test

if (document.forms[0][aTextField].value.length<5) {
return false;
}
else if (document.forms[0][aTextField].value.indexOf("@") < 1) {
return false;
}
else if (document.forms[0][aTextField].value.length -
 document.forms[0][aTextField].value.indexOf("@") < 4) {
return false;
}
else { return true; }
}

function isEmpty(aTextField) {
if ((document.forms[0][aTextField].value.length==0) ||
 (document.forms[0][aTextField].value==null)) {
return true;
}
else { return false; }
}

function validate() {
// will return true or false
// Step 1: check that required fields are
// filled in, alert and exit without
// submitting if not

// check that the name field is valued
if (isEmpty("Tijdstip")) {
	alert("Vul a.u.b. alle velden in.");
	setFocus("Tijdstip");
	return false;
}

if (isEmpty("Voornaam")) {
	alert("Vul a.u.b. alle velden in.");
	setFocus("Voornaam");
	return false;
}

if (isEmpty("Achternaam")) {
	alert("Vul a.u.b. alle velden in.");
	setFocus("Achternaam");
	return false;
}

if (isEmpty("Bedrijfsnaam")) {
	alert("Vul a.u.b. alle velden in.");
	setFocus("Bedrijfsnaam");
	return false;
}

if (isEmpty("Telefoonnummer")) {
	alert("Vul a.u.b. alle velden in.");
	setFocus("Telefoonnummer");
	return false;
}

if (isEmpty("Email")) {
	alert("Vul a.u.b. alle velden in.");
	setFocus("Email");
	return false;
}

if (isEmpty("Vraag")) {
	alert("Vul a.u.b. alle velden in.");
	setFocus("Vraag");
	return false;
}


// Step 2: check that the email address is
// even close, alert and exit without
// submitting if not
if (!isAnEmailAddress("Email")) {
	alert("Het ingevuld e-mail adres is geen geldig adres");
	setFocus("Email");
	return false;
}

// if we get this far everthing is ok, so
// let the form submit
return true;

}

$(document).ready(function(){

//Larger thumbnail preview 

$("ul.thumb li").hover(function() {
	$(this).css({'z-index' : '10'});
	$(this).find('img').addClass("hover").stop()
		.animate({
			marginTop: '-50px', 
			marginLeft: '-500px', 
			top: '10px', 
			left: '-10px', 
			width: '697px', 
			height: '310px',
			padding: '0px' 
		}, 200);
	
	} , function() {
	$(this).css({'z-index' : '0'});
	$(this).find('img').removeClass("hover").stop()
		.animate({
			marginTop: '0', 
			marginLeft: '0',
			top: '0', 
			left: '0', 
			width: '250px', 
			height: '100px', 
			padding: '0px'
		}, 400);
});

//Swap Image on Click
	$("ul.thumb li a").click(function() {
		
		var mainImage = $(this).attr("href"); //Find Image Name
		$("#main_view img").attr({ src: mainImage });
		return false;		
	});
 
});

 var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-9870256-3']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
	// <![CDATA[
		var timeout    = 150000;
		var closetimer = 0;
		var ddmenuitem = 0;
		
		function ddmenu_open(){
			ddmenu_canceltimer();
		   	ddmenu_close();
		   	ddmenuitem = $(this).find('ul').css('visibility', 'visible');
		}
		
		function ddmenu_close(){ 
			if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');
		}
		
		function ddmenu_timer(){
			closetimer = window.setTimeout(ddmenu_close, timeout);
		}
		
		function ddmenu_canceltimer(){  
			if(closetimer){  
				window.clearTimeout(closetimer);
		        closetimer = null;
		}}
		
		$(document).ready(function(){  
			$('#ddmenu > li').bind('mouseover', ddmenu_open)
		    $('#ddmenu > li').bind('mouseout',  ddmenu_timer)
		});
		
		document.onclick = ddmenu_close;
	// ]]> 
	
		$(document).ready(function(){	
			$("#slider").easySlider({
				auto: true, 
				continuous: true
			});
		});	
