function AjaxAntwoord(Antwoord,Tracker,Teller){	
	if(Tracker == "VriendenKiezen"){
		document.getElementById("Vrienden").innerHTML = Antwoord;
	}
}
function AjaxStarten(){
	var Aantal = document.getElementById('VriendenAantal').value;
	var Teller = "";
	if(Aantal==""){
		alert("U dient een aantal te kiezen!");
	}
	else{
		document.getElementById("Vrienden").innerHTML = "Een ogenblik geduld a.u.b.";
		AjaxContact('http://www.mebar.nl/aj_vrienden.php?Aantal='+Aantal,'get','VriendenKiezen', Teller);
	}
}
<!--
		function toggleDiv(id,flagit) {
			if (flagit=="1"){
				if (document.layers) document.layers[''+id+''].visibility = "show"
				else if (document.all) document.all[''+id+''].style.visibility = "visible"
				else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
			}
			else
			if (flagit=="0"){
				if (document.layers) document.layers[''+id+''].visibility = "hide"
				else if (document.all) document.all[''+id+''].style.visibility = "hidden"
				else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
			}
		}
	//-->
	
	
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


//** Tab Content script v2.0- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)

////NO NEED TO EDIT BELOW////////////////////////

function ddtabcontent(tabinterfaceid){
	this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container
	this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container
	this.enabletabpersistence=true
	this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container
	this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array
	this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values)
	this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)
	this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")
}

ddtabcontent.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return ""
}

ddtabcontent.setCookie=function(name, value){
	document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)
}

ddtabcontent.prototype={

	expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers
		this.cancelautorun() //stop auto cycling of tabs (if running)
		var tabref=""
		try{
			if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr
				tabref=document.getElementById(tabid_or_position)
			else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr
				tabref=this.tabs[tabid_or_position]
		}
		catch(err){alert("Invalid Tab ID or position entered!")}
		if (tabref!="") //if a valid tab is found based on function parameter
			this.expandtab(tabref) //expand this tab
	},

	cycleit:function(dir, autorun){ //PUBLIC function to move foward or backwards through each hot tab (tabinstance.cycleit('foward/back') )
		if (dir=="next"){
			var currentTabIndex=(this.currentTabIndex<this.hottabspositions.length-1)? this.currentTabIndex+1 : 0
		}
		else if (dir=="prev"){
			var currentTabIndex=(this.currentTabIndex>0)? this.currentTabIndex-1 : this.hottabspositions.length-1
		}
		if (typeof autorun=="undefined") //if cycleit() is being called by user, versus autorun() function
			this.cancelautorun() //stop auto cycling of tabs (if running)
		this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]])
	},

	setpersist:function(bool){ //PUBLIC function to toggle persistence feature
			this.enabletabpersistence=bool
	},

	setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")
		this.selectedClassTarget=objstr || "link"
	},

	getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to
		return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref
	},

	urlparamselect:function(tabinterfaceid){
		var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)", "i")) //check for "?tabinterfaceid=2" in URL
		return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index
	},

	expandtab:function(tabref){
		var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand
		//Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through
		var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
		this.expandsubcontent(subcontentid)
		this.expandrevcontent(associatedrevids)
		for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"
			this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : ""
		}
		if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
			ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)
		this.setcurrenttabindex(tabref.tabposition) //remember position of selected tab within hottabspositions[] array
	},

	expandsubcontent:function(subcontentid){
		for (var i=0; i<this.subcontentids.length; i++){
			var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)
			subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value
		}
	},

	expandrevcontent:function(associatedrevids){
		var allrevids=this.revcontentids
		for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface
			//if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it
			document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"
		}
	},

	setcurrenttabindex:function(tabposition){ //store current position of tab (within hottabspositions[] array)
		for (var i=0; i<this.hottabspositions.length; i++){
			if (tabposition==this.hottabspositions[i]){
				this.currentTabIndex=i
				break
			}
		}
	},

	autorun:function(){ //function to auto cycle through and select tabs based on a set interval
		this.cycleit('next', true)
	},

	cancelautorun:function(){
		if (typeof this.autoruntimer!="undefined")
			clearInterval(this.autoruntimer)
	},

	init:function(automodeperiod){
		var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)
		var selectedtab=-1 //Currently selected tab index (-1 meaning none)
		var selectedtabfromurl=this.urlparamselect(this.tabinterfaceid) //returns null or index from: tabcontent.htm?tabinterfaceid=index
		this.automodeperiod=automodeperiod || 0
		for (var i=0; i<this.tabs.length; i++){
			this.tabs[i].tabposition=i //remember position of tab relative to its peers
			if (this.tabs[i].getAttribute("rel")){
				var tabinstance=this
				this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers
				this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel") //store id of sub content ("rel" attr value)
				this.tabs[i].onclick=function(){
					tabinstance.expandtab(this)
					tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
					return false
				}
				if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element
					this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))
				}
				if (selectedtabfromurl==i || this.enabletabpersistence && selectedtab==-1 && parseInt(persistedtab)==i || !this.enabletabpersistence && selectedtab==-1 && this.getselectedClassTarget(this.tabs[i]).className=="selected"){
					selectedtab=i //Selected tab index, if found
				}
			}
		} //END for loop
		if (selectedtab!=-1) //if a valid default selected tab index is found
			this.expandtab(this.tabs[selectedtab]) //expand selected tab (either from URL parameter, persistent feature, or class="selected" class)
		else //if no valid default selected index found
			this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr
		if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){
			this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)
		}
	} //END int() function

} //END Prototype assignment




// JavaScript Document

// Functie om bij een bepaalde waarde in een select box een extra veld te laten zien.
function latenzien(id,veld,waarde){
x = document.FormulierNaam.elements[veld].selectedIndex;
	if (document.FormulierNaam.elements[veld].options[x].text == waarde){
	document.getElementById(id).style.display = 'block';
	}
	else{
	document.getElementById(id).style.display = 'none';
	}
}
// Einde van deze functie.

// Functie om een element met een bepaalde id te verbergen.
function hidediv(id){
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}
// Einde van deze functie.

// Functie om een element met een bepaalde id weer te geven.
function showdiv(id) {	  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
// Einde van deze functie.

// Functie om een element met een bepaalde id weer te geven EN te verbergen door steeds te klikken.
function toggle(element){
	if (document.getElementById(element).style.display == "none"){
		document.getElementById(element).style.display = "";
	} else {
		document.getElementById(element).style.display = "none";
	}
}
// Einde van deze functie

// Functie om hetzelfde te bereiken als de toggle hierboven, maar dan met een mooie slide.
var timerlen = 5;
var slideAniLen = 1000;

var timerID = new Array();
var startTime = new Array();
var obj = new Array();
var endHeight = new Array();
var moving = new Array();
var dir = new Array();

function slidedown(objname){
        if(moving[objname])
                return;

        if(document.getElementById(objname).style.display != "none")
                return; // cannot slide down something that is already visible

        moving[objname] = true;
        dir[objname] = "down";
        startslide(objname);
}

function slideup(objname){
        if(moving[objname])
                return;

        if(document.getElementById(objname).style.display == "none")
                return; // cannot slide up something that is already hidden

        moving[objname] = true;
        dir[objname] = "up";
        startslide(objname);
}

function startslide(objname){
        obj[objname] = document.getElementById(objname);

        endHeight[objname] = parseInt(obj[objname].style.height);
        startTime[objname] = (new Date()).getTime();

        if(dir[objname] == "down"){
                obj[objname].style.height = "1px";
        }

        obj[objname].style.display = "block";

        timerID[objname] = setInterval('slidetick(\'' + objname + '\');',timerlen);
}

function slidetick(objname){
        var elapsed = (new Date()).getTime() - startTime[objname];

        if (elapsed > slideAniLen)
                endSlide(objname)
        else {
                var d =Math.round(elapsed / slideAniLen * endHeight[objname]);
                if(dir[objname] == "up")
                        d = endHeight[objname] - d;

                obj[objname].style.height = d + "px";
        }

        return;
}

function endSlide(objname){
        clearInterval(timerID[objname]);

        if(dir[objname] == "up")
                obj[objname].style.display = "none";

        obj[objname].style.height = endHeight[objname] + "px";

        delete(moving[objname]);
        delete(timerID[objname]);
        delete(startTime[objname]);
        delete(endHeight[objname]);
        delete(obj[objname]);
        delete(dir[objname]);

        return;
}

function toggleSlide(objname){
  if(document.getElementById(objname).style.display == 'none'){
    // div is hidden, so let's slide down
    slidedown(objname);
  }else{
    // div is not hidden, so slide up
    slideup(objname);
  }
}
// Einde van deze functie.

// Functie om een Enkele foto in een popup venster te openen.
function viewFotoEnkel(URL){
	var URL = URL;
	var Maxbreedte = screen.width - 50;
	var Maxhoogte = screen.height - 100;
	Nieuwscherm =window.open("http://www.bratstandards.nl/Include/Foto_popup_enkel.php?Foto="+URL,"foto_up","toolbar=no,location=no,scrollbars=no,status=yes,menubar=no,resizable=no,width="+Maxbreedte+"px,height="+Maxhoogte+"px");
	Nieuwscherm.focus();
}
// Einde van deze functie.

// Functie om meerdere foto's in een popup venster te openen.
function viewFoto(URL, Id){
	var URL = URL;
	var Id = Id;
	var Maxbreedte = screen.width - 50;
	var Maxhoogte = screen.height - 100;
	Nieuwscherm =window.open("http://www.bratstandards.nl/Include/Foto_popup.php?Foto="+URL+"&Id="+Id,"foto_up","toolbar=no,location=no,scrollbars=no,status=no,menubar=no,resizable=no,width="+Maxbreedte+"px,height="+Maxhoogte+"px");
	Nieuwscherm.focus();
}
// Einde van deze functie.

// Functie om de popup en de foto op het juiste formaat te openen.
function SizeFoto(){
	var VerhoudingOrigineel = eval(pic).width / eval(pic).height;
	var Maxbreedte = screen.width - 20;
	var Maxhoogte = screen.height-20;

	if(Maxbreedte<eval(pic).width){
		eval(pic).width = Maxbreedte;
	}
	if(Maxhoogte<eval(pic).height){
		eval(pic).height = Maxhoogte;
		eval(pic).width = (Maxhoogte*VerhoudingOrigineel);
	}

	var PositieLinks = (screen.width-eval(pic).width+28)/2;
	var PositieBoven = (screen.height-eval(pic).height+28)/2;
	var browserHeight;
	var PICHeight = eval(pic).width+28;
	switch(BrowserDetect.browser)
	{
		case "Firefox":
			if(BrowserDetect.version == 2){
				browserHeight = 68;
			}
			else if(BrowserDetect.version == "1.5")
			{
				browserHeight = 38;
			}
		break;
		case "Explorer":
			if(BrowserDetect.version == 6){
				browserHeight = 102;
			}
			else if(BrowserDetect.version == 7)
			{
				browserHeight = 112;
			}
		break;
		case "Safari":
			browserHeight = 60;
			if(eval(pic).height+60<150){PICHeight = 150}
		break;
	}
	window.moveTo(PositieLinks, PositieBoven);
	window.resizeTo(PICHeight, eval(pic).height+browserHeight+50);
	window.moveTo(PositieLinks, PositieBoven);

}
// Einde van deze functie.

// Hiermee wordt gekeken in welke browser jij de popup gaat openen en die informatie wordtgebruikt bij SizeFoto. 
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();
//alert(BrowserDetect.browser);
//alert(BrowserDetect.version);
// Einde BrowserDetect.

// Functie om het BESTEL formulier te controleren.
function VriendControleer(){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	var Foutmelding = '';
	submitOK = 'True';
	if(document.VriendOnline.VriendenAantal.value==0){
		Foutmelding = Foutmelding + '- Aantal vrienden.\n';
		submitOK = 'False';
	}
	if (document.VriendOnline.Bezorgadres.value.length == 0){
		Foutmelding = Foutmelding + '- Bezorgadres.\n';
		document.VriendOnline.Bezorgadres.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.VriendOnline.Bezorgadres.style.border = '1px solid #094e93';
	}
	if (document.VriendOnline.Postcode.value.length == 0){
		Foutmelding = Foutmelding + '- Postcode.\n';
		document.VriendOnline.Postcode.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.VriendOnline.Postcode.style.border = '1px solid #094e93';
	}
	if (document.VriendOnline.Plaats.value.length == 0){
		Foutmelding = Foutmelding + '- Plaats.\n';
		document.VriendOnline.Plaats.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.VriendOnline.Plaats.style.border = '1px solid #094e93';
	}
	if (document.VriendOnline.Telefoon.value.length == 0){
		Foutmelding = Foutmelding + '- Telefoon.\n';
		document.VriendOnline.Telefoon.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.VriendOnline.Telefoon.style.border = '1px solid #094e93';
	}
	if (document.VriendOnline.NaamBewoner.value.length == 0){
		Foutmelding = Foutmelding + '- Naam bewoner adres.\n';
		document.VriendOnline.NaamBewoner.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.VriendOnline.NaamBewoner.style.border = '1px solid #094e93';
	}			
	if (filter.test(document.VriendOnline.Email.value)){
		document.VriendOnline.Email.style.border = '1px solid #999999';
	}
	else{
		Foutmelding = Foutmelding + '- Vul een geldig emailadres in.\n';
		document.VriendOnline.Email.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	
	if (submitOK == 'False'){
		alert('De volgende velden zijn verplicht:\n' + Foutmelding);
		return false;
	}
}
// Einde van deze functie.

// Functie om het INZEND formulier te controleren.
function InzendControleer(){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	var Foutmelding = '';
	submitOK = 'True';

	if (document.InzendFormulier.Naam.value.length == 0){
		Foutmelding = Foutmelding + '- Naam.\n';
		document.InzendFormulier.Naam.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.InzendFormulier.Naam.style.border = '1px solid #094e93';
	}
	if (filter.test(document.InzendFormulier.Email.value)){
		document.InzendFormulier.Email.style.border = '1px solid #999999';
	}
	else{
		Foutmelding = Foutmelding + '- Vul een geldig emailadres in.\n';
		document.InzendFormulier.Email.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	if (document.InzendFormulier.Team.value.length == 0){
		Foutmelding = Foutmelding + '- Team.\n';
		document.InzendFormulier.Team.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.InzendFormulier.Team.style.border = '1px solid #094e93';
	}
	if (document.InzendFormulier.Onderwerp.value.length == 0){
		Foutmelding = Foutmelding + '- Onderwerp.\n';
		document.InzendFormulier.Onderwerp.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.InzendFormulier.Onderwerp.style.border = '1px solid #094e93';
	}
	if (document.InzendFormulier.Bestanden.value.length == 0){
		Foutmelding = Foutmelding + '- Bestand(en).\n';
		document.InzendFormulier.Bestanden.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.InzendFormulier.Bestanden.style.border = '1px solid #094e93';
	}
	if (submitOK == 'False'){
		alert('De volgende velden zijn verplicht:\n' + Foutmelding);
		return false;
	}
}
// Einde van deze functie.


function MissControle(){
	var Foutmelding = '';
	var email = document.Formulier.Email.value;
	var emailFilter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	submitOK = true;

	if (document.Formulier.Naam.value.length==0){
		Foutmelding = Foutmelding + '- Naam.\n';
		document.Formulier.Naam.style.border = '1px solid #FF0000';
		submitOK = false;
	}
	else{
		document.Formulier.Naam.style.border = 'inherit';
	}

	if (!emailFilter.test(email)) {
		Foutmelding = Foutmelding + '- U dient een geldig emailadres in te voeren.\n';
		document.Formulier.Email.style.border = '1px solid #ff0000';
		submitOK = false;
	}
	if (document.Formulier.Miss.selectedIndex == "0"){
		Foutmelding = Foutmelding + '- Je moet nog kiezen op welke MISS je wil gaan stemmen.\n';
		submitOK = false;
	}
	
	if (submitOK == false){
		alert('U dient de volgende velden verplicht in te vullen:\n' + Foutmelding);
		return false;
	}
}

// Functie om het NIEUWSBRIEF formulier te controleren.
function NieuwsbriefControle(){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	var Foutmelding = '';
	submitOK = 'True';

	if (document.Nieuwsbrief.Naam.value.length == 0 || document.Nieuwsbrief.Naam.value=='Naam...'){
		Foutmelding = Foutmelding + '- Naam.\n';
		document.Nieuwsbrief.Naam.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.Nieuwsbrief.Naam.style.border = '1px solid #094e93';
	}
	
	if (document.Nieuwsbrief.Email.value.length == 0 || document.Nieuwsbrief.Email.value=='E-mailadres...'){
		Foutmelding = Foutmelding + '- Email.\n';
		document.Nieuwsbrief.Email.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.Nieuwsbrief.Email.style.border = '1px solid #094e93';
	}
	if (submitOK == 'False'){
		alert('De volgende velden zijn verplicht:\n' + Foutmelding);
		return false;
	}
}
// Einde van deze functie.

// Functie om het KLEINE formulier te controleren.
function ReactieControleer(){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	var Foutmelding = '';
	submitOK = 'True';

	if (document.ReactieFormulier.Naam.value.length == 0){
		Foutmelding = Foutmelding + '- Naam.\n';
		document.ReactieFormulier.Naam.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.ReactieFormulier.Naam.style.border = '1px solid #094e93';
	}
	if (filter.test(document.ReactieFormulier.Email.value)){
		document.ReactieFormulier.Email.style.border = '1px solid #999999';
	}
	else{
		Foutmelding = Foutmelding + '- Vul een geldig emailadres in.\n';
		document.ReactieFormulier.Email.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	if (document.ReactieFormulier.Titel.value.length == 0){
		Foutmelding = Foutmelding + '- Titel.\n';
		document.ReactieFormulier.Titel.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.ReactieFormulier.Titel.style.border = '1px solid #094e93';
	}	
	if (submitOK == 'False'){
		alert('De volgende velden zijn verplicht:\n' + Foutmelding);
		return false;
	}
}
// Einde van deze functie.

// Functie om het KLEINE formulier te controleren.
function KleinControleer(){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	var Foutmelding = '';
	submitOK = 'True';

	if (document.KleinFormulier.Voornaam.value.length == 0){
		Foutmelding = Foutmelding + '- Voornaam.\n';
		document.KleinFormulier.Voornaam.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.KleinFormulier.Voornaam.style.border = '1px solid #094e93';
	}
	if (document.KleinFormulier.Achternaam.value.length == 0){
		Foutmelding = Foutmelding + '- Achternaam.\n';
		document.KleinFormulier.Achternaam.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.KleinFormulier.Achternaam.style.border = '1px solid #094e93';
	}	
	if (filter.test(document.KleinFormulier.Email.value)){
		document.KleinFormulier.Email.style.border = '1px solid #999999';
	}
	else{
		Foutmelding = Foutmelding + '- Vul een geldig emailadres in.\n';
		document.KleinFormulier.Email.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	if (submitOK == 'False'){
		alert('De volgende velden zijn verplicht:\n' + Foutmelding);
		return false;
	}
}
// Einde van deze functie.

// Functie om het UITGEBREIDE formulier te controleren.
function UitgebreidControleer(){
	var EmailCheck = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	var PostcodeCheck = /^[1-9]{1}[0-9]{3}[A-Z]{2}$/i
	/*var TelefoonCheck = /^0[0-9]{9}$/i*/
	var Foutmelding = '';
	submitOK = 'True';

	if (document.UitgebreidFormulier.Voornaam.value.length == 0){
		Foutmelding = Foutmelding + '- Voornaam.\n';
		document.UitgebreidFormulier.Voornaam.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.UitgebreidFormulier.Voornaam.style.border = '1px solid #094e93';
	}
	if (document.UitgebreidFormulier.Achternaam.value.length == 0){
		Foutmelding = Foutmelding + '- Achternaam.\n';
		document.UitgebreidFormulier.Achternaam.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.UitgebreidFormulier.Achternaam.style.border = '1px solid #094e93';
	}
	if (PostcodeCheck.test(document.UitgebreidFormulier.Postcode.value)){
		document.UitgebreidFormulier.Postcode.style.border = '1px solid #999999';
	}
	else{
		Foutmelding = Foutmelding + '- Een geldige postcode in de vorm van 1234AB.\n';
		document.UitgebreidFormulier.Postcode.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	/*if (TelefoonCheck.test(document.UitgebreidFormulier.Telefoonnummer.value)){
		document.UitgebreidFormulier.Telefoonnummer.style.border = '1px solid #999999';
	}
	else{
		Foutmelding = Foutmelding + '- Een geldig telefoonnummer.\n';
		document.UitgebreidFormulier.Telefoonnummer.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}*/
	if (EmailCheck.test(document.UitgebreidFormulier.Email.value)){
		document.UitgebreidFormulier.Email.style.border = '1px solid #999999';
	}
	else{
		Foutmelding = Foutmelding + '- Vul een geldig emailadres in.\n';
		document.UitgebreidFormulier.Email.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	if (document.UitgebreidFormulier.Email.value == document.UitgebreidFormulier.HerhaalEmail.value){
		document.UitgebreidFormulier.HerhaalEmail.style.border = '1px solid #094e93';
	}
	else{
		Foutmelding = Foutmelding + '- Herhaal uw emailadres.\n';
		document.UitgebreidFormulier.HerhaalEmail.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	if (document.getElementById('Ja').checked == true){
		if (document.UitgebreidFormulier.Telefoon.value.length==0){
			Foutmelding = Foutmelding + '- Telefoon.\n';
			document.UitgebreidFormulier.Telefoon.style.border = '1px solid #ff0000';
			submitOK = 'False';
		}
		else{
			document.UitgebreidFormulier.Telefoon.style.border = '1px solid #094e93';
		}
		if (document.UitgebreidFormulier.Fax.value.length==0){
			Foutmelding = Foutmelding + '- Fax.\n';
			document.UitgebreidFormulier.Fax.style.border = '1px solid #ff0000';
			submitOK = 'False';
		}
		else{
			document.UitgebreidFormulier.Fax.style.border = '1px solid #094e93';
		}
	}
	if (submitOK == 'False'){
		alert('De volgende velden zijn verplicht:\n' + Foutmelding);
		return false;
	}
}
// Einde van deze functie.

// Functie om het inloggen op de website te controleren.
function InlogControle(){
	var Foutmelding = '';
	submitOK='True';

	if (document.InlogFormulier.Email.value.length==0 || document.InlogFormulier.Email.value.indexOf("@")==-1){
		Foutmelding = Foutmelding + '- E-mailadres.\n';
		document.InlogFormulier.Email.style.border = '1px solid #ff0000';
		submitOK='False';
	}
	else{
		document.InlogFormulier.Email.style.border = '1px solid #094e93';
	}
	if (document.InlogFormulier.Wachtwoord.value.length==0){
		Foutmelding = Foutmelding + '- Wachtwoord.\n';
		document.InlogFormulier.Wachtwoord.style.border = '1px solid #ff0000';
		submitOK='False';
	}
	else{
		document.InlogFormulier.Wachtwoord.style.border = '1px solid #094e93';
	}
	if (submitOK=='False'){
		alert('U dient de volgende velden verplicht in te vullen:\n' + Foutmelding);
		return false;
	}
}
// Einde van deze functie.

// Functie om het reageren op een bericht te controleren.
function ReactieControle(){
	var Foutmelding = '';
	submitOK='True';

	if (document.ReactieFormulier.Titel.value.length==0){
		Foutmelding = Foutmelding + '- Titel.\n';
		document.ReactieFormulier.Titel.style.border = '1px solid #ff0000';
		submitOK='False';
	}
	else{
		document.ReactieFormulier.Titel.style.border = '1px solid #094e93';
	}
	if (document.ReactieFormulier.Tekst.value.length==0){
		Foutmelding = Foutmelding + '- Reactie.\n';
		document.ReactieFormulier.Tekst.style.border = '1px solid #ff0000';
		submitOK='False';
	}
	else{
		document.ReactieFormulier.Tekst.style.border = '1px solid #094e93';
	}
	if (submitOK=='False'){
		alert('De volgende velden zijn verplicht:\n' + Foutmelding);
		return false;
	}
}
// Einde van deze functie.

// Functie om het registreren op de website te controleren.
function RegistratieControleer(){
	var Foutmelding = '';
	submitOK='True';

	if (document.RegistratieFormulier.Naam.value.indexOf(" ")==-1 ||document.RegistratieFormulier.Naam.value.length==0){
		Foutmelding = Foutmelding + '- Er moet een naam ingevuld worden.\n';
		document.RegistratieFormulier.Naam.style.border = '1px solid #ff0000';
		submitOK='False';
	}
	else{
		document.RegistratieFormulier.Naam.style.border = '1px solid #094e93';
	}
	if (document.RegistratieFormulier.Wachtwoord.value.length==0){
		Foutmelding = Foutmelding + '- Er moet een wachtwoord ingevuld worden.\n';
		document.RegistratieFormulier.Wachtwoord.style.border = '1px solid #ff0000';
		submitOK='False';
	}
	else{
		document.RegistratieFormulier.Wachtwoord.style.border = '1px solid #094e93';
	}
	if (document.RegistratieFormulier.Wachtwoord2.value.length==0){
		Foutmelding = Foutmelding + '- Er moet een wachtwoord ingevuld worden.\n';
		document.RegistratieFormulier.Wachtwoord2.style.border = '1px solid #ff0000';
		submitOK='False';
	}
	else{
		document.RegistratieFormulier.Wachtwoord2.style.border = '1px solid #094e93';
	}
	if (document.RegistratieFormulier.Wachtwoord.value.length>0 && document.RegistratieFormulier.Wachtwoord2.value.length>0){
		if (document.RegistratieFormulier.Wachtwoord2.value!=document.RegistratieFormulier.Wachtwoord.value){
			Foutmelding = Foutmelding + '- De wachtwoorden komen niet overeen.\n';
			document.RegistratieFormulier.Wachtwoord.style.border = '1px solid #ff0000';
			document.RegistratieFormulier.Wachtwoord2.style.border = '1px solid #ff0000';
			submitOK='False';
		}
		else{
			document.RegistratieFormulier.Wachtwoord.style.border = '1px solid #094e93';
			document.RegistratieFormulier.Wachtwoord2.style.border = '1px solid #094e93';
		}	
	}
	if (document.RegistratieFormulier.Email.value.indexOf("@")==-1 || document.RegistratieFormulier.Email.value.indexOf(".")==-1){
		Foutmelding = Foutmelding + "- Er moet een geldig e-mail adres ingevuld worden.\n";
		document.RegistratieFormulier.Email.style.border = '1px solid #ff0000';
		submitOK="False";
	}
	else{
		document.RegistratieFormulier.Email.style.border = '1px solid #094e93';
	}
	if (submitOK=='False'){
		alert('Uw registratie kan niet worden voltooid, want:\n' + Foutmelding);
		return false;
	}
}
// Einde van deze functie.


// Functies voor het nieuws op de homepage.
function getObj(name){
	if (document.getElementById){
		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	}
	else if (document.all){
		this.obj = document.all[name];
		this.style = document.all[name].style;
	}
	else if (document.layers){
		this.obj = document.layers[name];
		this.style = document.layers[name];
	}
}
//
function setOpacity(obj,value){
	testObj = new getObj(obj);
	testObj.style.opacity = value/10;
	testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
}
//
function initCaroussel(){
	setOpacity("caroussel_menu_item_container2",4);
	setOpacity("caroussel_menu_item_container3",4);
	setOpacity("caroussel_menu_item_container4",4);
	currNewsId=-1;
	fadeIncrement=0;
	showNews(1);
	rotateId=1;
	startRotate();
}
//
function autoRotate(){
	if(doRotate){
		if(rotateId>4){
			rotateId=1;
		}
		showNews(rotateId);
		rotateId++;
		rotateTimer=setTimeout("autoRotate()",5000);
	}
	else{
		clearTimeout(rotateTimer);
	}
}
//
function startRotate(){
	doRotate=true;
	rotateTimer=setTimeout("autoRotate()",1000);
}
//
function stopRotate(){
	doRotate=false;
	if(typeof rotateTimer != 'undefined'){
		clearTimeout(rotateTimer);
	}
}
//
function fadeTab(id){
	if(fadeIncrement!=11){
		//setOpacity("caroussel_menu_item_container"+id,fadeIncrement);
		//setOpacity("caroussel_item"+id,fadeIncrement);
		setOpacity("caroussel_menu_item_container"+id,10);
		//setOpacity("caroussel_item"+id,10);
		//fadeIncrement++;
		//fadeTimer=setTimeout("fadeTab("+id+")",40);
	}
	else{
		//clearTimeout(fadeTimer);
	}
}
//
function showNews(id){
	if(typeof currNewsId == 'undefined' || id!=currNewsId){
		if(typeof currNewsId != 'undefined' && currNewsId != -1){
			//DEACTIVATE
			setOpacity("caroussel_menu_item_container"+currNewsId,4);

			var iTab="caroussel_menu_item"+currNewsId;
			var inActiveTab = new getObj(iTab);
			inActiveTab.obj.className="caroussel_menu_item_inact"+currNewsId;

			/*var iContent="caroussel_item"+currNewsId;
			var inActiveContent = new getObj(iContent);
			inActiveContent.style.display="none";
			inActiveContent.style.visibility="hidden";*/
		}

		//ACTIVATE
		var aTab="caroussel_menu_item"+id;
		var activeTab = new getObj(aTab);
		activeTab.obj.className="caroussel_menu_item_act";

		/*var aContent="caroussel_item"+id;
		var activeContent = new getObj(aContent);
		activeContent.style.display="block";
		activeContent.style.visibility="visible";*/

		fadeIncrement=0;
		fadeTab(id)
		currNewsId=id;
		rotateId=id;
	}
}
// Einde van deze functie.
