oudeOffsetCar=0;
deRichting=1;
pauze=0;


function mycarousel_initCallback(carousel){
	theCarousel=carousel;
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
    	deRichting=1;
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
    	deRichting=-1;
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
    
};
function showDiv(inDiv) {
	obj= document.getElementById(inDiv);
	if(obj){obj.style.display="block";}
}
function hideDiv(inDiv) {
	obj= document.getElementById(inDiv);
	if(obj){obj.style.display="none";}
}
function schuif(){
		var offSetCar = $("#mycarousel").offset(); 
	 	var widthCar =$("#mycarousel").attr("scrollWidth"); 	 	
}
//on mousedown een pauze invoeren zodat de autoscroll niet werkt, verder ok, behalve aan einde
function zoeken(){
	document.formulier.action="index.php?page=zoek_resultaat&woord="+document.formulier.woord.value;
	document.formulier.submit();
}
function wisselSubNavBG(inNaam){
	ob=document.getElementById(inNaam);
	oudebg=ob.style.backgroundColor;
	ob.style.backgroundColor='#d8e0f6';
}
function wisselSubsubNavBG(inNaam){
	ob=document.getElementById(inNaam);
	oudebg=ob.style.backgroundColor;
	ob.style.backgroundColor='#bfcbea';
}
function wisselNavBGterug(inNaam){
	ob=document.getElementById(inNaam);
	ob.style.backgroundColor=oudebg;
}
function verstuur(velden){ 
	var argv = verstuur.arguments;
	var argc = (verstuur.arguments.length)/3 
	//1=veldnaam, 2=naam, 3=type
	for(i=0;i<argc;i++) {
		fld = eval('document.formulier.' + argv[i])
		switch(argv[i+(2*argc)]){
			case '1':
			  if(fld.value==''){ 
					alert (argv[i+argc]+' is verplicht')
					fld.focus();
					return;
				}
			  break;
			case '2':
			  
			  break;
			case '3'://email
			  	val = fld.value.indexOf(' ') == -1 //geen spaties
				val &= fld.value.indexOf('@') > 0 //er zit een @ in
				val &= fld.value.indexOf('@') == fld.value.lastIndexOf('@') //slechts 1 @
				val &= fld.value.indexOf('@') < fld.value.lastIndexOf('.') //een @ voor een punt
				val &= fld.value.lastIndexOf('.') < fld.value.length-2 //twee letters achter de punt
				if (!val){  				  
					alert ('Er is geen geldig email adres ingevuld')
					fld.focus();
					return;
				}
				if(document.formulier.vanemail){document.formulier.vanemail.value=fld.value}
			  break;
			case '4'://pulldown
			  if(fld.selectedIndex==0){ 				  
					alert (argv[i+argc]+' is verplicht')
	 				fld.focus();
					return;
				}
			  break;
			default:
			 //rest
		}
	}
	if(document.formulier.verstuurd){
		document.formulier.verstuurd.value=1;
	}
	document.formulier.stap.value=3;
	document.formulier.submit()
}
function logout(){
	document.formulier.stap.value=100;
	document.formulier.submit()
}
