<!--

  // © 2005 Bitpalast GmbH. All rights reserved. All rights reserved.

  function referral() {
    window.location="http://www.campus-baustoffe.de/danish/service/referral.html?"+window.location;
  }

  function setreferral() {
    if(document.location.search != "") {
      previouslocation=document.location.search;
      document.sendreferralform.url.value=previouslocation.substring(1,previouslocation.length);
    }
    else document.sendreferralform.url.value='http://www.campus-baustoffe.de/';
  }  

  function contact_validator(theForm)
  {
    if (theForm.message.value == "")
    {
      alert("Indtast venligst din meddelelsestekst.");
      theForm.message.focus();
      return (false);
    }

    if (theForm.message.value.length < 20)
    {
      alert("Din meddelelse skal være mindst 20 ten lang.");
      theForm.message.focus();
      return (false);
    }

    if (theForm.email.value == "")
    {
      alert("Indtast venligst din e-mailadresse.");
      theForm.email.focus();
      return (false);
    }

    if (theForm.email.value.length < 8)
    {
      alert("Din e-mailadresse skal mindst være 8 tegn lang.");
      theForm.email.focus();
      return (false);
    }

    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒ0123456789@-_.";
    var checkStr = theForm.email.value;
    var allValid = true;
    var validGroups = true;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("I felt \"e-mail\" er der kun tilladt bogstaver, cifre og tegn \"@-_.\".");
      theForm.email.focus();
      return (false);
    }

    return (true);
  }

  function sendreferral(theForm)
  {

    if (theForm.senderemail.value.length < 8)
    {
      alert("Din e-mailadresse skal mindst være 8 tegn lang.");
      theForm.senderemail.focus();
      return (false);
    }

    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-_.-@";
    var checkStr = theForm.senderemail.value;
    var allValid = true;
    var validGroups = true;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("I felt \"e-mail\" er der kun tilladt bogstaver, cifre og tegn \"@-_.\".");
      theForm.senderemail.focus();
      return (false);
    }

    if (theForm.recipientemail.value.length < 8)
    {
      alert("Din e-mailadresse skal mindst være 8 tegn lang.");
      theForm.recipientemail.focus();
      return (false);
    }

    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-_-.@";
    var checkStr = theForm.recipientemail.value;
    var allValid = true;
    var validGroups = true;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("I felt \"e-mail\" er der kun tilladt bogstaver, cifre og tegn \"@-_.\".");
      theForm.recipientemail.focus();
      return (false);
    }
    return (true);
  }

//-->