<!--
function swap_check_value(checkbox){
	if(checkbox.value==0){
		checkbox.value=1;
	} else {
		checkbox.value=0;
	}
	
} // function swap_check_value

function select_validation(entered, alertbox) {
 
	with(entered){
		if (value==null || value=="NULL" || value=="null"){
			if (alertbox!=""){
				alert(alertbox);
			}
			return false;
		} else {
			return true;
		}
	}
   
} // function select_validation

function value_validation(entered, min, max, alertbox, datatype) {
	with (entered){
		checkvalue=parseFloat(value);
		if (datatype){
			smalldatatype=datatype.toLowerCase();
			if (smalldatatype.charAt(0)=="i"){
				checkvalue=parseInt(value);
			}
		}
	
		if ((parseFloat(min)==min && checkvalue<min) || (parseFloat(max)==max && checkvalue>max) || value!=checkvalue){
			if (alertbox!=""){
				alert(alertbox);
			}
			return false;
		} else {
			return true;
		}
	}
} //function value_validation

function radio_validation(radiobuttons, alertbox){

	var ingevuld=false;
	for(teller=0;teller<radiobuttons.length;teller++){
		if(radiobuttons[teller].checked==true){
			ingevuld=true;
		}
	}
	
	if(ingevuld){
		return true;
	} else {
		if (alertbox!=""){
			alert(alertbox);
		}
	return false;
	}

} //  function radio_validation

function empty_validation(entered, alertbox){

	with(entered){
		if (value==null || value==""){
			if (alertbox!=""){
				alert(alertbox);
			}
			return false;
		} else {
			return true;
		}
	}
  
} // function emptyvalidation

function checkbox_validation(entered, alertbox){

	with(entered){
		if (checked==false){
			if (alertbox!=""){
				alert(alertbox);
			}
			return false;
		} else {
			return true;
		}
	}
  
} // function emptyvalidation

function email_validation(entered, alertbox) {

	with (entered) {
		apos=value.indexOf("@"); 
		dotpos=value.lastIndexOf(".");
		lastpos=value.length-1;
		if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) {
			if (alertbox){
				alert(alertbox);
			}
			return false;
		} else {
			return true;
		}
	}
} // function email_validation


function telefoonnummer_validation(nummer_01,nummer_02){

	regionr=nummer_01.value;
	nummer=nummer_02.value;
	
	if(regionr+nummer!=""){
		if((regionr.length+nummer.length)!=10){
			alert("U dient een geldig telefoonnummer in te voeren");
			return false;
		} else {
			if(regionr=="06"){
				alert("Het is niet toegestaan mobiele nummers in te voeren");
				return false;
			}
		}   
	}

} // function telefoonnummer_validation

function length_validation(entered,min,max,alertbox){

	if(entered.value.length<=min){
		alert(alertbox);
		return false;
	}
	
	return true;
 
} // function length_validation

function stringtype_validation(str,alertbox){

	if(integer_validation(str.value)==true){
		alert(alertbox);
		return false;
	} else {
		return true;
	}
	
} // function stringtype_validation

function integer_validation (str){
	
	var i = parseInt (str);
	if (isNaN (i)){
		return false;
	}	
	
	i = i . toString ();
	if (i != str){
		return false;
	}	
	
	return true;

} //function integer_validation

function add_topic_validation(thisform){

	with(thisform){
		if(empty_validation(forum_topics_title,"U dient nog een titel in te geven")==false){forum_topics_title.focus(); return false;}
		if(length_validation(forum_topics_title,3,null,"U dient een geldige titel in te geven")==false){forum_topics_title.focus(); return false;}
		if(empty_validation(forum_topics_text,"U dient nog een bijdrage te schrijven")==false){forum_topics_text.focus(); return false;}
		if(length_validation(forum_topics_text,3,null,"U dient een wat langere bijdrage te schrijven")==false){forum_topics_text.focus(); return false;}

		if(empty_validation(forum_topics_author_name,"U dient uw naam nog in te geven")==false){forum_topics_author_name.focus(); return false;}

		if(forum_topics_author_notify.value==1){
			if(email_validation(forum_topics_author_email,"U dient uw emailadres nog in te geven")==false){forum_topics_author_email.focus(); return false;}	
		}
	}

} // function add_topic_validation

function add_reaction_validation(thisform){

	with(thisform){
		if(empty_validation(reactions_title,"U dient nog een titel in te geven")==false){reactions_title.focus(); return false;}
		if(length_validation(reactions_title,3,null,"U dient een geldige titel in te geven")==false){reactions_title.focus(); return false;}
		if(empty_validation(reactions_text,"U dient nog een bijdrage te schrijven")==false){forum_reactionss_text.focus(); return false;}
		if(length_validation(reactions_text,3,null,"U dient een wat langere bijdrage te schrijven")==false){reactions_text.focus(); return false;}
		if(empty_validation(reactions_author_name,"U dient uw naam nog in te geven")==false){reactions_author_name.focus(); return false;}
		if(reactions_author_name.length>0){
			if(email_validation(reactions_author_email,"U dient een geldig emailadres in te geven")==false){reactions_author_email.focus(); return false;}					
		}
	}

} // function add_reaction_validation

//-->