// check for empty field

function checkempty(thisfield, fieldname) {

   if (thisfield.value.length == 0) {
      alert('Please provide your ' + fieldname + '.');
	  thisfield.focus();
	  thisfield.select();
	  return false;
   }
   
   else {
      allspaces=true;
      for(i=0;i< thisfield.value.length;i++) {
         if (thisfield.value.substring(i,i+1) != " ") {
            allspaces=false;
		 }
	  }
	  if (allspaces) {
	     //alert('error: ' + fieldname + ' cannot contained only spaces.');
	     alert('Please enter a valid ' + fieldname + '.');
		 thisfield.focus();
		 thisfield.select();
		 return false;
	  }
   }  
   return true;
   
}