// highlight menuitems
function highlight(e,msg){
	if(document.all){
		e.showing = true;
		e.style.color = "#FFC000";
	}
	if(msg == null)msg = ""
	window.status=msg
}

function unhighlight(e,orig){
	if(document.all){
		if(orig == null){ orig = "" };
		e.showing = false;
		e.style.color = orig;
	}
	window.status=""
}

function goURL(link,target){
	if (link != 'nourl') {
		e = eval("parent."+target)
		e.location.href = link;
	}
}

function goURL2(link,target){
	if (link != 'nourl') {
		e = eval("parent."+target)
		e.location.href = link;
	}
}


function search(){
			if(document.form1.search.value!=""){
				var s = document.form1.search.value;
				re = /\+/g;
				var r = s.replace(re,"&");
				location.href="/sportsspeakers-zoeken2.php?search="+escape(r)+"";
			}
		}

function search2(){
var cat = "";
for (var i=0; i<document.form1.selectCategorie.length; i++) {
 		if (document.form1.selectCategorie[i].selected) {
 			cat = document.form1.selectCategorie[i].value;
 		}
 	}
if(cat!="leeg" && cat!=""){
	location.href="sportsspeakers-zoeken.php?"+cat;
}
}

function search3(){
var cat = "";
for (var i=0; i<document.form1.selectSport.length; i++) {
 		if (document.form1.selectSport[i].selected) {
 			cat = document.form1.selectSport[i].value;
 		}
 	}
if(cat!="leeg" && cat!=""){
	location.href="sportsspeakers-zoeken.php?"+cat;
}
}

function checkInit(){
if(document.form1.search.value=="uw zoekwoord..."){
	document.form1.search.value="";
}
}


function On(lokatie,nieuw) {
lokatie.src=('images/'+nieuw);
}

function Off(lokatie,nieuw) {
lokatie.src=('images/'+nieuw);
}

/* slideshow script */

var slideShowSpeed = 5000
var crossFadeDuration = 3

var Pic = new Array()
Pic[0] = 'slides/1plaatje_2.jpg'
Pic[1] = 'slides/1plaatje_3.jpg'
Pic[2] = 'slides/1plaatje_4.jpg'
Pic[3] = 'slides/1plaatje_5.jpg'
Pic[4] = 'slides/1plaatje_1.jpg'

var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
  preLoad[i] = new Image()
  preLoad[i].src = Pic[i]
}

function runSlideShow(){
  if (document.all){
     document.images.SlideShow.style.filter="blendTrans(duration=2)"
     document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
     document.images.SlideShow.filters.blendTrans.Apply()      
  }
  document.images.SlideShow.src = preLoad[j].src
  if (document.all){
     document.images.SlideShow.filters.blendTrans.Play()
  }
  j = j + 1
  if (j > (p-1)) j=0
  t = setTimeout('runSlideShow()', slideShowSpeed)
}

// einde slideshow 

/* topnavigatie script */
	
var aantalimages = 7;

knop1= new Array(4); 
knop1[0]="images/home1.gif"; 
knop1[1]="images/home2.gif"; 
knop1[2]="images/home3.gif"; 
knop1[3]="/";

knop2= new Array(4); 
knop2[0]="images/zoek1.gif"; 
knop2[1]="images/zoek2.gif"; 
knop2[2]="images/zoek3.gif"; 
knop2[3]="/sportsspeakers-zoeken.php";

knop3= new Array(4); 
knop3[0]="images/boekingen1.gif"; 
knop3[1]="images/boekingen2.gif"; 
knop3[2]="images/boekingen3.gif"; 
knop3[3]="/sportsspeakers-boekingen.php";

knop4= new Array(4); 
knop4[0]="images/contact1.gif"; 
knop4[1]="images/contact2.gif"; 
knop4[2]="images/contact3.gif"; 
knop4[3]="/sportsspeakers-contact.php";

knop5= new Array(4); 
knop5[0]="images/links1.gif"; 
knop5[1]="images/links2.gif"; 
knop5[2]="images/links3.gif"; 
knop5[3]="/sportsspeakers-links.php";

knop6= new Array(4); 
knop6[0]="images/nieuws1.gif"; 
knop6[1]="images/nieuws2.gif"; 
knop6[2]="images/nieuws3.gif"; 
knop6[3]="/sportsspeakers-nieuws.php";

knop7= new Array(4); 
knop7[0]="images/tellafriend1.gif"; 
knop7[1]="images/tellafriend2.gif"; 
knop7[2]="images/tellafriend3.gif"; 
knop7[3]="/sportsspeakers-tellafriend.php";

function knopOver(Input){if(document.images[Input].src!=location.href.substring(0,location.href.lastIndexOf("/")+1)+eval(Input+"[2]")) {document.images[Input].src=eval(Input+"[1]"); document.images[Input].style.cursor = "hand";}}
function knopOut(Input){if(document.images[Input].src!=location.href.substring(0,location.href.lastIndexOf("/")+1)+eval(Input+"[2]")) {document.images[Input].src=eval(Input+"[0]"); document.images[Input].style.cursor = "default";}}
function knopClick(Input){for(var i=1;i<=aantalimages;i++){ document.images["knop"+i].src=eval("knop"+i+"[0]");}
document.images[Input].src=eval(Input+"[2]"); 
location.href=eval(Input+"[3]");
document.images[Input].style.cursor = "default";
}

/* einde topnav */

/* start code voor boekingen */

function checkNaam_Boekingen(){
	if(document.form2.bedrijfsnaam.value=="") {
		alert("Vul a.u.b. uw bedrijfsnaam in.");
		document.form2.bedrijfsnaam.focus();
		return false;
	} return true;
}

function checkContactpersoon_Boekingen(){
if(document.form2.contaktpersoon.value=="") {
	alert("Vul a.u.b. uw naam in.");
	document.form2.contaktpersoon.focus();
	return false;
} return true;
}

function checkFunctie_Boekingen(){
if(document.form2.functie.value=="") {
	alert("Vul a.u.b. uw functie in.");
	document.form2.functie.focus();
	return false;
} return true;
}

function checkAdres_Boekingen(){
if(document.form2.adres.value=="") {
	alert("Vul a.u.b. uw adres in.");
	document.form2.adres.focus();
	return false;
} return true;
}

function checkPC_Boekingen(){
if(document.form2.postcode.value=="") {
	alert("Vul a.u.b. de postcode in.");
	document.form2.postcode.focus();
	return false;
} return true;
}

function checkPlaats_Boekingen(){
if(document.form2.plaats.value=="") {
	alert("Vul a.u.b. de plaats in.");
	document.form2.plaats.focus();
	return false;
} return true;
}

function isTelefoon_Boekingen(inField){
var acceptable="0123456789 +-";
var ok=true;
for(i=0;i<inField.length;i++){
	if(acceptable.indexOf(inField.charAt(i).toUpperCase())==-1){
		ok=false;
		break;
	} 
}
return (ok);
}

function checkTelefoon_Boekingen() {
if(document.form2.telefoon.value=="") {
	alert("Vul uw telefoonnummer in.");
	document.form2.telefoon.focus();
	return false;
}
if(!isTelefoon_Boekingen(document.form2.telefoon.value) || (document.form2.telefoon.value.length<10)){
	alert("Het ingevoerde telefoonnummer is niet correct.");
	document.form2.telefoon.focus();
	return false;
} return true;
}

function checkMail_Boekingen(){
if(document.form2.email.value==""){
	alert("Vul uw email adres in.");
	document.form2.email.focus();
	return false;
	}
if(document.form2.email.value.indexOf('@')==-1 || document.form2.email.value.indexOf('@')==0 || document.form2.email.value.indexOf('@')==(document.form2.email.value.length-1)){
	alert("Het ingevoerde email adres is niet correct.");
	document.form2.email.focus();
	return false;
}
if(document.form2.email.value.indexOf('.')==-1 || document.form2.email.value.indexOf('.')==0 || document.form2.email.value.indexOf('.')==(document.form2.email.value.length-1)){
	alert("Het ingevoerde email adres is niet correct.");
	document.form2.email.focus();
	return false;
}
return true;
}

function checkZoekwoord(){
if(document.form2.hoegevonden.value=="" && document.form2.zoekwoordnvt.checked==false) {
	alert("Geef a.u.b. aan hoe/of u de site via Google heeft gevonden.");
	document.form2.hoegevonden.focus();
	return false;
} return true;
}
	
function verstuur_Boekingen(){
if(!checkNaam_Boekingen()) return;
if(!checkContactpersoon_Boekingen()) return;
//if(!checkFunctie_Boekingen()) return;
//if(!checkAdres_Boekingen()) return;
//if(!checkPC_Boekingen()) return;
//if(!checkPlaats_Boekingen()) return;
if(!checkTelefoon_Boekingen()) return;
if(!checkMail_Boekingen()) return;
//if(!checkZoekwoord()) return;
if(document.form2.spamcheck.value==''){
	document.form2.action='sportsspeakers-boekingopslaan.php';
	document.form2.submit();
}
} 

/* einde code boekingen */

/* start code routebeschrijving */
		
var aantalKaartjes = 4;

knop= new Array(aantalKaartjes); 
knop[0]="images/kaart1.gif"; 
knop[1]="images/kaart2.gif"; 
knop[2]="images/kaart3.gif";
knop[3]="images/kaart4.gif";  

function zoomIn() {
	if(document.images['kaart'].src!=location.href.substring(0,location.href.lastIndexOf("/")+1)+knop[aantalKaartjes-1]) {
		for(i=aantalKaartjes-1;i>0;i--){
			if(document.images['kaart'].src==location.href.substring(0,location.href.lastIndexOf("/")+1)+knop[i-1]) document.images['kaart'].src=knop[i];
		}
	}
}

function zoomOut() {
	if(document.images['kaart'].src!=location.href.substring(0,location.href.lastIndexOf("/")+1)+knop[0]) {
		for(i=0;i<aantalKaartjes-1;i++){ 
			if(document.images['kaart'].src==location.href.substring(0,location.href.lastIndexOf("/")+1)+knop[i+1]) document.images['kaart'].src=knop[i];
		}
	}
}

function highlight(knopje,e,msg){
	if(document.all){
		if(knopje!=1){
			if(document.images['kaart'].src==location.href.substring(0,location.href.lastIndexOf("/")+1)+knop[aantalKaartjes-1]) {e.style.cursor = "default";}
		} else {
			if(document.images['kaart'].src==location.href.substring(0,location.href.lastIndexOf("/")+1)+knop[0]) {e.style.cursor = "default";}
		}
	}
	if(msg == null)msg = "";
	window.status=msg;
}

function unhighlight(e,orig){
	if(document.all){
		if(orig == null){ 
			orig = ""; 
		} 
		e.style.cursor = orig;
	}
	window.status="";
}

/* einde script routebeschrijving */

/* start script aanvraagform bij contact */

function checkNaam_Contact(){
	if(document.form2.naam.value=="") {
		alert("Vul a.u.b. uw naam in.");
		document.form2.naam.focus();
		return false;
	} return true;
}

function isTelefoon(inField){
	var acceptable="0123456789 +-";
	var ok=true;
	for(i=0;i<inField.length;i++){
		if(acceptable.indexOf(inField.charAt(i).toUpperCase())==-1){
			ok=false;
			break;
		} 
	}
	return (ok);
}

function checkTelefoon_Contact() {
	if(document.form2.telefoon.value=="") {
		alert("Vul uw telefoonnummer in.");
		document.form2.telefoon.focus();
		return false;
	}
	if(!isTelefoon(document.form2.telefoon.value) || (document.form2.telefoon.value.length<10)){
		alert("Het ingevoerde telefoonnummer is niet correct.");
		document.form2.telefoon.focus();
		return false;
	} return true;
}

function checkMail_Contact(){
	if(document.form2.email.value==""){
		alert("Vul uw email adres in.");
		document.form2.email.focus();
		return false;
		}
	if(document.form2.email.value.indexOf('@')==-1 || document.form2.email.value.indexOf('@')==0 || document.form2.email.value.indexOf('@')==(document.form2.email.value.length-1)){
		alert("Het ingevoerde email adres is niet correct.");
		document.form2.email.focus();
		return false;
	}
	if(document.form2.email.value.indexOf('.')==-1 || document.form2.email.value.indexOf('.')==0 || document.form2.email.value.indexOf('.')==(document.form2.email.value.length-1)){
		alert("Het ingevoerde email adres is niet correct.");
		document.form2.email.focus();
		return false;
	}
	return true;
}
		
function checkZoekwoord_Contact(){
	if(document.form2.zoekwoord.value=="" && document.form2.zoekwoordnvt.checked==false) {
		alert("Geef a.u.b. aan hoe/of u de site via Google heeft gevonden.");
		document.form2.zoekwoord.focus();
		return false;
	} return true;
	}

function verstuur_Contact(){
	if(!checkNaam_Contact()) return;
	if(!checkTelefoon_Contact()) return;
	if(!checkMail_Contact()) return;
	//if(!checkZoekwoord_Contact()) return;
	document.form2.submit();
}
/* einde code contact */



/*-------------------------------------------------------------------------------toegevoegd 9 feb per */

function verstuur_Contact_engels(){
	if(!checkNaam_Contact_engels()) return;
	if(!checkTelefoon_Contact_engels()) return;
	if(!checkMail_Contact_engels()) return;
	//if(!checkZoekwoord_Contact()) return;
	document.form2_engels.submit();
}
/* einde code contact */
function checkNaam_Contact_engels(){/*check naam engelse formulier*/
	if(document.form2_engels.naam.value=="") {
		alert("Please fill in your Company name.");
		document.form2_engels.naam.focus();
		return false;
	} return true;
}

function checkTelefoon_Contact_engels(){
	if(document.form2_engels.telefoon.value=="") {
		alert("Please fill in your phonenumber.");
		document.form2_engels.telefoon.focus();
		return false;
	} return true;
}

function checkMail_Contact_engels(){
	if(document.form2_engels.email.value==""){
		alert("Please fill in your E-mail address.");
		document.form2_engels.email.focus();
		return false;
		}
	if(document.form2_engels.email.value.indexOf('@')==-1 || document.form2_engels.email.value.indexOf('@')==0 || document.form2_engels.email.value.indexOf('@')==(document.form2_engels.email.value.length-1)){
		alert("The E-mail address is not correct.");
		document.form2_engels.email.focus();
		return false;
	}
	if(document.form2_engels.email.value.indexOf('.')==-1 || document.form2_engels.email.value.indexOf('.')==0 || document.form2_engels.email.value.indexOf('.')==(document.form2_engels.email.value.length-1)){
		alert("The E-mail address is not correct.");
		document.form2_engels.email.focus();
		return false;
	}
	return true;
}


/*-------------------------------------------------------------------------------toegevoegd 9 feb*/





/* verzend functie boekingen ovezichtscherm */
function verzenden_Boekingen(){
	if(confirm("Klik op 'OK' om de boekingsaanvraag te verzenden.")){
		document.form1.submit();
	}
}
/* einde */





/* aanmelden nieuwsbrief */

function checkvNaam(){
	if(document.form2.vNaam.value=="") {
		alert("Vul a.u.b. uw voornaam in.");
		document.form2.vNaam.focus();
		return false;
	} return true;
}

function checkaNaam(){
	if(document.form2.aNaam.value=="") {
		alert("Vul a.u.b. uw achternaam in.");
		document.form2.aNaam.focus();
		return false;
	} return true;
}


function checkeMail(){
	if(document.form2.email.value==""){
		alert("Vul uw email adres in.");
		document.form2.email.focus();
		return false;
		}
	if(document.form2.email.value.indexOf('@')==-1 || document.form2.email.value.indexOf('@')==0 || document.form2.email.value.indexOf('@')==(document.form2.email.value.length-1)){
		alert("Het ingevoerde email adres is niet correct.");
		document.form2.email.focus();
		return false;
	}
	if(document.form2.email.value.indexOf('.')==-1 || document.form2.email.value.indexOf('.')==0 || document.form2.email.value.indexOf('.')==(document.form2.email.value.length-1)){
		alert("Het ingevoerde email adres is niet correct.");
		document.form2.email.focus();
		return false;
	}
	return true;
}
		
		
		
function verstuur_Nieuwsbrief(){
	if(!checkvNaam()) return;
	if(!checkaNaam()) return;
	if(!checkeMail()) return;
	document.form2.action = "aanmelden_verstuur.php";
	document.form2.method = "post";
	document.form2.submit();
}

/* einde nieuwsbrief */

/* begin tellafriend */

	function verstuur_Tellafriend(){
		if(checkNaam1_Tellafriend() && checkMail1_Tellafriend() && checkNaam2_Tellafriend() && checkMail2_Tellafriend()){
			if(confirm("Versturen?")){
				document.form2.action="sportsspeakers-tellafriend_versturen.php";
				document.form2.submit();
			}
		}
	}
	
	function checkNaam1_Tellafriend(){
		if(document.form2.name1.value==""){
			alert("Vul uw naam in");
			document.form2.name1.focus();
			return false;
		}
		return true;
	}
	
	function checkNaam2_Tellafriend(){
		if(document.form2.name2.value==""){
			alert("Vul de naam van de ontvanger in");
			document.form2.name2.focus();
			return false;
		}
		return true;
	}
	
	function checkMail1_Tellafriend(){
		if(document.form2.email1.value==""){
			alert("Voer een correct emailadres in");
			document.form2.email1.focus();
			return false;
			}
		if(document.form2.email1.value.indexOf('@')==-1 || document.form2.email1.value.indexOf('@')==0 || document.form2.email1.value.indexOf('@')==(document.form2.email1.value.length-1)){
			alert("Voer een correct emailadres in");
			document.form2.email1.focus();
			return false;
		}
		if(document.form2.email1.value.indexOf('.')==-1 || document.form2.email1.value.indexOf('.')==0 || document.form2.email1.value.indexOf('.')==(document.form2.email1.value.length-1)){
			alert("Voer een correct emailadres in");
			document.form2.email1.focus();
			return false;
		}
		return true;
	}
	
	function checkMail2_Tellafriend(){
		if(document.form2.email2.value==""){
			alert("Voer een correct emailadres in");
			document.form2.email2.focus();
			return false;
			}
		if(document.form2.email2.value.indexOf('@')==-1 || document.form2.email2.value.indexOf('@')==0 || document.form2.email2.value.indexOf('@')==(document.form2.email2.value.length-1)){
			alert("Voer een correct emailadres in");
			document.form2.email2.focus();
			return false;
		}
		if(document.form2.email2.value.indexOf('.')==-1 || document.form2.email2.value.indexOf('.')==0 || document.form2.email2.value.indexOf('.')==(document.form2.email2.value.length-1)){
			alert("Voer een correct emailadres in");
			document.form2.email2.focus();
			return false;
		}
		return true;
	}

/* eind tellafriend */

function submitForm(){
if(window.event.keyCode==13){
	search();
	return true;
} else {
	return false
	};
}

function add(){
	document.form1.namePage.value = escape(location.href);
	document.form1.action="/mandje.php";
	document.form1.submit();
}

function wis(ID){
	if(confirm("Speaker verwijderen?")){
		document.location.href="/mandjeverwijder.php?wis="+ID;
	}
}

function switchTab(tabnummer){
	//alle divjes uitzetten
	
	for(a=1;a<8;a++){
		document.getElementById('0'+a).style.visibility='hidden';
	}
	//de meegestuurde div zichtbaar maken
	document.getElementById(tabnummer).style.visibility='visible';
	
	//alle tabs op normaal zetten
	for(a=1;a<8;a++){
		document.getElementById("tab0"+a).className='detailtabdiv';
		
	}
	//de meegestuurde tab actief maken
	document.getElementById("tab"+tabnummer).className='detailtabdiv_active';
	/*
	if (tabnummer!=7) {
		//alert(tabnummer);
		 document.getElementById('MediaPlayer').Pause();
	}
	
	if (tabnummer==7) {
		//alert(tabnummer);
		 document.getElementById('MediaPlayer').Play();
	}*/
	
}




