



function changeCodeBlock(o)   {
  if(o.style.display == "none"){o.style.display="";return "images/minus.gif";}
  else{o.style.display="none";return "images/plus.gif";}
  }
  
  
function CheckInput () {
 
  if (document.formular.surname.value == "")
  {
  alert("Please enter your family name!");
  return false;
  }
  
  if (document.formular.forename.value == "")
  {
  alert("Please enter your first name!");
  return false;
  }
  
  if (document.formular.email.value == "")
  {
  alert("Please enter your email address!");
  return false;
  }
  
   if (document.formular.email2.value == "")
  {
  alert("Please enter your email address again!");
  return false;
  }
  
  if (document.formular.email.value != document.formular.email2.value)
  {
  alert("Please enter the same email address again!");
  return false;
  }
  
  if (document.formular.email.value.indexOf("@") == -1) {
    alert("No valid email address!");
    document.formular.email.focus();
    return false;
  }
  
  if (document.formular.institut.value == "")
  {
  alert("Please enter the name of your institut or university!");
  return false;
  }

  if (document.formular.street.value == "")
  {
  alert("Please enter the street or P.O. Box!");
  return false;
  }
  
  if (document.formular.postalcode.value == "")
  {
  alert("Please enter the postal code!");
  return false;
  }
  
  if (document.formular.city.value == "")
  {
  alert("Please enter the city!");
  return false;
  }
  
  if (document.formular.country.value == "")
  {
  alert("Please enter the country!");
  return false;
  }
  
  if (document.formular.username.value == "")
  {
  alert("Please enter your asked user name!");
  return false;
  }
  
  if (document.formular.mta.checked == false)
  {
  alert("Please read the instructions and hints for registration and select the checkbox!");
  return false;
  }

  }
  
function CheckContact () {
  
   if (document.formular.email.value == "") {
    alert("No valid email address!");
    document.formular.email.focus();
    return false;
  }  
  
  if (document.formular.email.value.indexOf("@") == -1) {
    alert("No valid email address!");
    document.formular.email.focus();
    return false;
  }  
  }
  
  
function Check () {
 
  if (document.formular.checkaccount.checked == false)
  {
  alert("Please select checkbox!");
  return false;
  }
  
  }
  
function CheckShop () {
  if (document.formular.check.checked == false) {
   alert("Please select checkbox!"); 
   return false;
}
  
  }
  

function CheckQuery () {
  var y1 = document.formular.formYearFrom.value;
  var y2 = document.formular.formYearTo.value;
  var long1 = document.formular.formLongitudeFrom.value;
  var long2 = document.formular.formLongitudeTo.value;
  var lat1 = document.formular.formLatitudeFrom.value;
  var lat2 = document.formular.formLatitudeTo.value;  
 
  if(y1 != "") {
  if (isNaN(y1) || y1.length > 4 || y1.length < 4)
  {
  alert("Collection year not valid! Please enter a four-digit year.");
  return false;
  } 
  }
  
  if(y2 != "") {
  if (isNaN(y2) || y2.length > 4 || y2.length < 4)
  {
  alert("Collection year not valid! Please enter a four-digit year.");
  return false;
  } 
  }
  
  if(y1 != "" && y2 != "")
  {
  if(y1 > y2)
  {
  alert("First collection year has to be smaller than the second!");
  return false;
  }
  }
  
  if(lat1 > 90 || lat1 < -90 || lat2 > 90 || lat2 < -90 || long1 > 180 || long1 < -180 || long2 > 180 || long2 < -180)
  {
  alert("Coordinates not valid, value out of range!");
  return false;
  }
  
  
  
}          
