// JavaScript Document
var isW3C	= document.getElementById	? true : false ;
var isIE	= document.all				? true : false ;
var isNS4	= document.layers			? true : false ;
var filter	= /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
var txtPagina = "";

// Functie om divCMcontent a.h.w. te resetten 
function startLeeg()
{
	javascript:ajaxpage('pages/home/leeg.html', 'divCMcontent');
	return true;
}

// Als het ware een volledige nieuwe pagina laden, let op content midden wordt eerst leeg gemaakt om a.h.w. te resetten
function startHomepage()
{
	javascript:ajaxpage('pages/home/leeg.html', 'divCMcontent');
	javascript:ajaxpage('pages/home/home_links.html', 'divClinks');
	javascript:ajaxpage('pages/home/home_rechts.html', 'divCrechts');
	return true;
}

// Als het ware een volledige nieuwe pagina laden, let op content midden wordt eerst leeg gemaakt om a.h.w. te resetten
function startMediaWintercup()
{
	javascript:ajaxpage('pages/home/leeg.html', 'divCMcontent');
	javascript:ajaxpage('pages/media/media_links.html', 'divClinks');
	javascript:ajaxpage('pages/media/media_rechts.html', 'divCrechts');
	return true;
}

function startUitslagenWintercup()
{
	javascript:ajaxpage('pages/home/leeg.html', 'divCMcontent');
	javascript:ajaxpage('pages/home/uitslagen_links.html', 'divClinks');
	return true;
}

// Checken van form veld txtmail als deze niet leeg is voordat pagina opnieuw (voor niets) wordt geladen
function MailValideren(form)
{
	txtPagina=""
	with(form.txtEmail)
	{
		if (value=='' || value==null)
		{
			changeTekst("E-mail adres niet ingevuld!","txtMelding");
			focus();
			return false;
		} else if (!filter.test(value)) {
			changeTekst("Onjuist emailadres","txtMelding");
			focus();
			return false;
		} else {
			changeTekst("Voer uw e-mailadres in.","txtMelding");	
		}
	}
txtPagina = 'pages/home/nieuwsbrief.php?email=' + form.txtEmail.value + "&";
javascript:ajaxpage(txtPagina,'txtMelding') // vraag.php uitvoern in div frmReacties
form.reset();
return false; //normaal true, echter pagina mag niet opnieuw geladen worden anders verdwijnt het formulier 
}


// Checken van formuliervelden reactie/vraag opmerking 
function chkForm(form)
{
txtPagina = "";

	with(form.naam)
	{
		if (value=='' || value==null)
		{
			changeTekst("* Naam niet ingevuld!","chkNaam");
			focus();
			return false;
		} else {
			changeTekst("*","chkNaam");	
		}
	}
	with(form.email)
	{
		if (value=='' || value==null)
		{
			changeTekst("* Email niet ingevuld!","chkEmail");
			focus();
			return false;
		} else if (!filter.test(value)) {
			changeTekst("* Onjuist emailadres","chkEmail");
			focus();
			return false;
		} else {
			changeTekst("*","chkEmail");	
		}
	}
	with(form.reactie)
	{
		if (value=='' || value==null)
		{
			changeTekst("* Reactie niet ingevuld!","chkReactie");
			focus();
			return false;
		} else {
			changeTekst("*","chkReactie");	
		}
		
	}
txtPagina = 'pages/contact/vraag.php?naam=' + form.naam.value + "&email=" + form.email.value + "&reactie=" + form.reactie.value; + "&";
javascript:ajaxpage(txtPagina,'frmReacties') // vraag.php uitvoern in div frmReacties
return false; //normaal true, echter pagina mag niet opnieuw geladen worden anders verdwijnt het formulier 
}

// Aanroep vanuit chkForm()  a.d.h.v. keuze welk DOM model wordt de tekst vervangen!
function changeTekst(txtInfo , welkID) {
	if ( isW3C && document.getElementById( welkID ) ) {
		document.getElementById( welkID ).innerHTML=txtInfo;
	} else if ( isIE && document.all[ welkID ] ) {
		document.all[ welkID ].innerHTML=txtInfo;
	} else if ( isNS4 && document.layers[ welkID ] ) {
		document.layers[ welkID ].innerHTML=txtInfo;
	}
}

// Aanroep vanuit html/imagemap en a.d.h.v. keuze welk DOM model de tekst en plaatje vervangt!
function changeParcours(txtInfo, picPlaatje) {
	if ( isW3C && document.getElementById( "fototekst" ) ) {
		document.getElementById( "fototekst" ).innerHTML=txtInfo;
	} else if ( isIE && document.all[ "fototekst" ] ) {
		document.all[ "fototekst" ].innerHTML=txtInfo;
	} else if ( isNS4 && document.layers[ "fototekst" ] ) {
		document.layers[ "fototekst" ].innerHTML=txtInfo;
	}
	if(picPlaatje != "") {
		document.Plaatje.src=picPlaatje;
	}
}