function wachtscherm(divvenster,visibility){
	var divvensterNew = new getObj(divvenster);
	divvensterNew.style.visibility = visibility;
	}

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 openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}

var w = 480, h = 340;

if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
}

var popW = 660, popH = 460;

var leftPos = (w-popW)/2, topPos = (h-popH)/2;


	function woordjes(woordjesLijst){
		//window.open('../frames/loading.asp','loading','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=150,height=75,top='+topPos+',left='+leftPos);
		var foto=String(woordjesLijst).split("/")[6]
		window.open('html/frames/foto.asp?foto_naam='+foto,'FotoBlok','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=660,height=460,top=10,left='+leftPos);
	}
	
//--- Module javascript ---

	function BevestigDelete(Naam){
		var name = confirm("Weet u zeker dat u " + '\n' + '\n' + Naam + '\n' + '\n' + " wilt verijderen?")
		if (name == true){
			 return true;
		}else{
			return false;
		}
	}



function LedigVeld(f){
	if (f.Naam.value=="Nieuw gerechthoofding"){
		f.Naam.value=""
	}
}

function CheckForm(f,aantal){
	var controle=false;
	for(i=1; i<aantal+1; i++){ 
		var pos1="Positie_"+i;
			for(i2=1; i2<aantal+1; i2++){
				var pos2="Positie_"+i2
				if (f[pos1].value==f[pos2].value && i != i2){
					controle=true;	
				}
			}
		}
		if (controle==true){
			alert("De waarde van de posities moeten allemaal verschillend zijn!")
			return false;
		}else{
			return true;
		}
	}
	
function SetPositie(waarde1,f,aantal){
		//alert(waarde1);
		var controle=false;
		var nummer=0
		
		var pos="Positie_"+waarde1
		for(i1=1; i1<aantal+1; i1++){
		
			for(i=1; i<aantal+1; i++){
				var pos2="Positie_"+i
					if (f[pos2].value==i1){
						controle=true;
					}
					//alert(f[pos2].value + " = " + i1 + " cont " + controle);
			}
			if(controle==false){
				nummer=i1;
				//alert(i1);
			}
			controle=false;
		}
		alert(nummer);
		f[pos].value=nummer;
	}
	
	function CheckFormB(f){
		if (f.Naam.value.length < 5){
			alert("Je moet minemum 5 karakters als Gerecht ingeven!")
			f.Naam.focus();
			return false;
		}
		
		var ValidChars = "0123456789,";
		var Char;
		for (i = 0; i < f.Prijs.value.length; i++) 
			{Char = f.Prijs.value.charAt(i); 
			if (ValidChars.indexOf(Char) == -1) 
				{
				alert("Je mag enkel de volgende tekens ' 0123456789 , ' als Prijs ingeven!")
				f.Prijs.focus();
				return false;
				}
		}
		return true;
		
	}
	
	
	
	function LedigFile(f){
		f.outerHTML = '<input type="FILE" name="FILE1" style="width: 250px" onChange="javascript: (this.form.FotoAction[2].checked=true);">';
	}
	
	function DeletePicture(){
		document.form1.FotoAction[0].checked = false;
		document.form1.FotoAction[1].checked = true;
		document.form1.FotoAction[2].checked = false;
	}

	function ViewPicture(){
		document.form1.FotoAction[0].checked = true;
		document.form1.FotoAction[1].checked = false;
		document.form1.FotoAction[2].checked = false;
	}
	
//---Wijn Javascript ---

	function CheckRadioButton(f,RadioKeuze,waarde1,waarde2){
		if (RadioKeuze=="Land"){
			f.LandNieuw[waarde1].checked = true;
			f.LandNieuw[waarde2].checked = false;
		}
		if (RadioKeuze=="Streek"){
			f.StreekNieuw[waarde1].checked = true;
			f.StreekNieuw[waarde2].checked = false;
		}
	}

	function CheckForm3(f){
	if (f.Naam.value.length < 4){
		alert("Je moet minemum 4 karakters als Wijnnaam ingeven!")
		f.Naam.focus();
		f.Naam.select();
		return false;
	}
	
	var ValidChars = "0123456789,";
	var Char;
	
	for (i = 0; i < f.Prijs.value.length; i++) 
		{Char = f.Prijs.value.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) 
			{
			alert("Je mag enkel de volgende tekens ' 0123456789 , ' als Prijs ingeven!")
			f.Prijs.focus();
			f.Prijs.select();
			return false;
			}
	}
	
	var ValidChars2 = "0123456789,";
	var Char2;
	
	for (i = 0; i < f.Jaar.value.length; i++) 
		{Char2 = f.Jaar.value.charAt(i); 
		if (ValidChars2.indexOf(Char2) == -1) 
			{
			alert("Je mag enkel de volgende tekens ' 0123456789 ' als Jaar ingeven!")
			f.Jaar.focus();
			f.Jaar.select();
			return false;
			}
	}
	
	
	if (f.Jaar.value.length < 4){
		alert("Je moet minemum 4 karakters als Jaar ingeven!")
		f.Jaar.focus();
		f.Jaar.select();
		return false;
	}
	
	return true;
	
	}

	
function KarakterControle(veld) {
		
		var karakters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ";
		var ok = true;
		var temp;
		for (var i=0; i<veld.value.length; i++) {
			temp = "" + veld.value.substring(i, i+1);
			if (karakters.indexOf(temp) == "-1") ok = false;
		}
		return ok;
	}
	
	
	
	function Controle(f,VeldNaam){
		if (f[VeldNaam].value.length > 0){
			if (KarakterControle(f[VeldNaam]) == false){
				alert("U kan enkel de volgende karakters gebruiken. \n A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \n a b c d e f g h i j k l m n o p q r s t u v w x y z \n 0 1 2 3 4 5 6 7 8 9 \n en spatie");
				return false
			}
		}
		
		return true
	}

	
	
	