	//This function checks the required field and makes sure that user input some data in those and it is not just empty spaces
function CheckReqField(strFormName, strReqParam){
 var blnReturn = true;
 for (var i=0;i<eval(strFormName).length;i++){
  if (eval(strFormName).elements[i].name.substr(0, strReqParam.length) == strReqParam){
   var strTemp = Trim(eval(strFormName).elements[i].value);
   if (strTemp == ''){
    blnReturn = false;
   }
  }
 }
 
 if (blnReturn){
  eval(strFormName).submit();
 }
 else{
  alert("Wilt u alle velden met een * invullen?");
 }
}

//This function takes out all the spaces from a string from both sides and the middle and returns the result.
//It is used in conjunction with the above funtion to make sure the user simply didn't put it spaces in the input text field
function Trim(strInput){
 var strTrimmmed = '';
 for (var i = 0;i<strInput.length; i++){
  if (strInput.charCodeAt(i)!=32){
   strTrimmmed += strInput[i];
  }
 }
 return strTrimmmed;
}

