// JavaScript Document

function multidesign(){
	if(window.innerwidth) {
	   breedte=window.innerWidth;
	} else {
	   // internet Explorer
		breedte=document.body.clientWidth;
	}
	
	if (breedte<800) {
	stylesheet='style800.css';
	} else if (breedte<=960){
	stylesheet='style960.css';
	}
	
	document.writeln('style type="text/css"><!-- @import url('+ stylesheet+'); --> </style>');
}

function copyWoorden(isList,isForm,isVar){
        trefwStr="";
		trefwNrs="";
		var isVar1=isVar+"1";
		var isVar2=isVar+"2";
		for (i=1; i<isList.length; i++)
			{
			 if (isList.options[i].selected){
			   if (trefwNrs=="") oppNrs="";
			   else oppNrs="^";
			   if (trefwStr=="") oppStr="" ;
			   else oppStr=", ";
			   trefwNrs += oppNrs+isList.options[i].value;
			   trefwStr += oppStr+isList.options[i].text;
			 }
			}
		isForm.elements[isVar1].value=trefwStr.substr(0,trefwStr.length);
		isForm.elements[isVar2].value=trefwNrs;

		
	}
	

function confirmVerwijder(boodschap) 
{  
var agree=confirm(boodschap);
			 if (agree) 
			      return true;	//ja     
			 else	  
			  	 return false; //nee
}	  	



function makeDate(x) {
   nu = new Date(); 
   if (nu.getDate()<=9) 
   		dag='0'+nu.getDate() 
   else 
   		dag= nu.getDate();
   if (nu.getMonth()+1<=9) 
   		maand='0'+(nu.getMonth()+1) 
	else 
		maand=(nu.getMonth()+1) ;
  x.value =dag +'-'+maand+'-'+nu.getYear();

}

function isEmail(string) {

   if (!string) return false;
   var iChars = "*|,\":<>[]{}`\';()&$#%";

   for (var i = 0; i < string.length; i++) {
      if (iChars.indexOf(string.charAt(i)) != -1)
         return false;
   }
   return true;
}                      
function isProper(string) {

   if (!string) return false;
   var iChars = "*|,\":<>[]{}`\';()@&$#%";

   for (var i = 0; i < string.length; i++) {
      if (iChars.indexOf(string.charAt(i)) != -1)
         return false;
   }
   return true;
} 
                     
function isReady(form) {
    if (isEmail(form.address.value) == false) {
        alert("Please enter a valid email address.");
        form.address.focus();
        return false;
    }
    if (isProper(form.username.value) == false) {
        alert("Please enter a valid username.");
        form.username.focus();
        return false;
    }
    return true;
}



	
