
		function SetSearchField (listbox,field) {
			
		   if (listbox.selectedIndex > 1)
			  field.value = listbox.options[listbox.selectedIndex].text;
		   else
			  field.value = listbox.options[listbox.selectedIndex].value;
		}

		function Zoek() {

		   //parent.data.document.forms['theForm'].elements['s-beschikbaar'].value=document.theForm.elements['s-beschikbaar'].checked;

		   SetSearchField(document.theForm.wie, parent.data.document.theForm.elements['l-doelgroep']);
		   SetSearchField(document.theForm.wat, parent.data.document.theForm.elements['l-sector']);
		   SetSearchField(document.theForm.waar,parent.data.document.theForm.elements['l-plaats']);
		   
		   
		   result=0;
		   if (parent.data.document.theForm.elements['l-doelgroep'].value == "none" ||
		       parent.data.document.theForm.elements['l-doelgroep'].value == "Alle" ){
 	       	       result++;
	       	   }
		   if (parent.data.document.theForm.elements['l-sector'].value == "none" ||
		       parent.data.document.theForm.elements['l-sector'].value == "Alle" ){
 	       	       result++;
 	       	   }	
 	       	   
		   if (parent.data.document.theForm.elements['l-plaats'].value == "none" ||
		       parent.data.document.theForm.elements['l-plaats'].value == "Alle" ){
 	       	       result++;
 	       	   }	 	       	   
					
		   if(result==3){
		       alert ("Kies minimaal 1 item");
		   } else {
			  parent.data.document.theForm.submit();void(0);
	   	   }
		}

		function InitSearchForm() {
		   if (parent.data.loaded == null) {
			  myTimer = setTimeout("InitSearchForm()",1000)
		   }
		   else
			  parent.data.LoadForm(document.theForm);
		}

      
      var ajLocaties;

      function loadLocaties(root, formName) {
         if(typeof(loadedAjaxObject) == 'undefined') {
            //alert('Kon het locatiezoekmenu niet vullen. Laad de pagina a.u.b. opnieuw');
         }else {
            ajLocaties = new AjaxObject('ajLocaties','','vulLocatieZoekbox')
            ajLocaties.Load(root+'php/main.php','c-Object=locatie&c-Action=ListLocaties&c-Database=medewerkers','GET', formName);
         }
      }
      
      function vulLocatieZoekbox(txt,arr,data,script) {
         var select = document.forms[data].waar;
         // IE vind het niet leuk als je direct alles in de innerHTML van de select zet dus moeten we in een loopje options toevoegen...
         for(var i=1;i<arr.length-1;i++) {
            var option = document.createElement('option');
            value = arr[i].split(":");
            option.value     = value[0].trim(); 
            option.innerHTML = value[1].trim();
            select.appendChild(option);
         }
      }
      function zoekLocaties() {
         var frm = document.forms['theForm'];
         var cObject = document.createElement('input');
         cObject.type  = 'hidden';
         cObject.name  = 'c-Object';
         cObject.value = 'locatie';
         var cAction = document.createElement('input');
         cAction.type  = 'hidden';
         cAction.name  = 'c-Action';
         cAction.value = 'SearchLocaties';
         var cDB = document.createElement('input');
         cDB.type  = 'hidden';
         cDB.name  = 'c-Database';
         cDB.value = 'medewerkers';
         var cLimit = document.createElement('input');
         cLimit.type  = 'hidden';
         cLimit.name  = 'c-Limit';
         cLimit.value = '10';
         frm.appendChild(cObject);
         frm.appendChild(cAction);
         frm.appendChild(cDB);
         frm.appendChild(cLimit);
         frm.submit();
      }
      
String.prototype.firstToUpper = function() {

}
String.prototype.ltrim = function() {
   return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
   return this.replace(/\s+$/,"");
}
String.prototype.trim = function() {
   return this.replace(/^\s+|\s+$/g,"");
}
      
