function kollaData() {


if (document.f1.epost.value == "min-kompis@hotmail.com") {
alert("Det här fungerar inte\nom du inte skriver in rätt adress!\n\nFörsök igen!");
             document.f1.epost.focus();
             document.f1.epost.select();
             return false;
            }

if (document.f1.epost.value.length > 0) {
var y = 1; var x = 0;

for (var i = 0; i < document.f1.epost.value.length; i++) {

if (document.f1.epost.value.length > 70) {

       alert("The email address is too long.")
             document.f1.epost.focus();
             document.f1.epost.select();
             return false;
            }

if (document.f1.epost.value.length < 5) {

       alert("The email address is too short")
             document.f1.epost.focus();
             document.f1.epost.select();
             return false;
            }

// UTESLUT VISSA TECKEN I INMATNINGSFÄLTET
// =======================================================================

      if (document.f1.epost.value.charAt(i) == "'" ||
          document.f1.epost.value.charAt(i) == "<" ||
          document.f1.epost.value.charAt(i) == ">" ||
          document.f1.epost.value.charAt(i) == "å" ||
          document.f1.epost.value.charAt(i) == "Å" ||
          document.f1.epost.value.charAt(i) == "ä" ||
          document.f1.epost.value.charAt(i) == "Ä" ||
          document.f1.epost.value.charAt(i) == "ö" ||
          document.f1.epost.value.charAt(i) == "Ö" ||
          document.f1.epost.value.charAt(i) == " ")
      {
       alert("Non valid characters in the email address:\n\n" +
             "å Å ä Ä ö Ö < ' > or whitespace.")
             document.f1.epost.focus();
             document.f1.epost.select();
       return false;
      }

if (document.f1.epost.value.charAt(i) == "@") { x = 1; }

if (document.f1.epost.value.length == y && x != 1) {
            alert("There must be an @ in the email address.")
            document.f1.epost.focus();
            document.f1.epost.select();
            return false;
           }

y = y + 1;

       } // avslutar for-loopen
      } // avslutar if huvudsatsen

     else
            {
             alert("The email textbox is empty")
             document.f1.epost.focus();
             return false;

            } // SLUT PÅ EPOSTKONTROLLEN


bus1 = 0;
bus2 = 0;
bus3 = 0;

// NAMNRUTAN
// ========================================
if (document.f1.ta.value.length > 0) { // ***taOK

str = document.f1.ta.value;
 for (var i = 0; i < document.f1.ta.value.length; i++) {


// UTESLUT VISSA TECKEN I INMATNINGSFÄLTET
// =======================================================================
if (document.f1.ta.value.charAt(i) == "'") { bus1 = 1; }
if (document.f1.ta.value.charAt(i) == "<") { bus2 = 1; }
if (document.f1.ta.value.charAt(i) == ">") { bus3 = 1; }


// SE TILL ATT ANTALET TECKEN HAMNAR MELLAN 50 OCH 1000
// =======================================================================

if (document.f1.ta.value.length > 50) {

       alert("Your name is too long.")
             document.f1.ta.focus();
             document.f1.ta.select();

       return false;
      }
     }  // end for

// OM OTILLÅTNA TECKEN ANVÄNTS SÅ RÄTTAR VI TILL DET HÄR
// ========================================================
if(bus1 == 1){ str = str.replace(/'/gi, " "); document.f1.ta.value = str; bus1 = 0;}
if(bus2 == 1){ str = str.replace(/</gi, " "); document.f1.ta.value = str; bus2 = 0;}
if(bus3 == 1){ str = str.replace(/>/gi, " "); document.f1.ta.value = str; bus3 = 0;}

    }  // end if ***taOK

    else  // körs om textrutan är tom
           {
             alert("Type your own name in the textbox.")
             document.f1.ta.value = "Carlos";
             document.f1.ta.focus();
             return false;
            }


if(confirm("Okej " + document.f1.ta.value + ", du kommer nu att skicka\n" +
           "ett tips om den här webbsidan till " + document.f1.epost.value + "\n" +
           "OK om adressen är korrekt.\n" +
           "Avbryt, om adressen är felstavad, eller om du ångrat dej.")) {
            return true;
           }
                              else {
                              document.f1.epost.focus();
                              document.f1.epost.select();
                              return false;
                             }


     } // end kollaData()

