<!--

  // © 2004 Bitpalast GmbH. All rights reserved.

  function setpage() {
    musiccontrollocation="http://www.santabyrequest.com/music/music_on.html";
    musiccontrol = window.open('','musicpanel','alwaysRaised,width=120,height=60,toolbar=0,menubar=0,scrollbars=0,status=0,resizable=0');
    if ( musiccontrol.closed || (! musiccontrol.document.URL) || (musiccontrol.document.URL.indexOf("music") <= 0)) 
      musiccontrol.location=musiccontrollocation;
    musiccontrol.focus;
  }

  function printpage() {
    printlocation="http://www.santabyrequest.com/phprint.php?page="+window.location;
    window.open(printlocation,'','width=690,height=440,toolbar=0,menubar=0,scrollbars=1,status=0,resizable=0');
  }

  function tellafriend() {
    window.location="http://www.santabyrequest.com/service/referral.html?"+window.location;
  }

  function setnews() {
    setpage();
    if(document.location.search != "") {
      emailaddress=document.location.search;
      document.newssubscriber.email.value=emailaddress.substring(1,emailaddress.length);
      document.newssubscriber.submit();
    }
  }

  function setreferral() {
    setpage();
    if(document.location.search != "") {
      previouslocation=document.location.search;
      document.sendreferralform.url.value=previouslocation.substring(1,previouslocation.length);
    }
    else document.sendreferralform.url.value='http://www.santabyrequest.com/';
  }  

  function sendreferral(theForm)
  {

    if (theForm.senderemail.value.length < 8)
    {
      alert("Please make sure your friend can answer you!\nYour e-mail address should be at least 8 characters long.");
      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("Please enter letters, digits, and \"_.-@\" characters only as the sender's address.");
      theForm.senderemail.focus();
      return (false);
    }

    if (theForm.recipientemail.value.length < 8)
    {
      alert("Sorry, but Santa's reindeers complain that they will only deliver your mail,\nwhen the recipient's address is at least eight characters long.");
      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("Please enter letters, digits, and \"_.-@\" characters only as the recipient's address.");
      theForm.recipientemail.focus();
      return (false);
    }
    return (true);
  }

  function contact_validator(theForm)
  {
    if (theForm.message.value == "")
    {
      alert("Let Santa know about your wishes.\nPlease enter your text message.");
      theForm.message.focus();
      return (false);
    }

    if (theForm.message.value.length < 20)
    {
      alert("Santa loves to read your message\n(but only when it is at least 20 characters long).");
      theForm.message.focus();
      return (false);
    }
    
    if (theForm.phone.value == "")
    {
      alert("When you do not enter your phone number,\nSanta cannot verify that you have deserved his full attention.\nPlease enter your phone number.");
      theForm.phone.focus();
      return (false);
    }

    if (theForm.phone.value.length < 10)
    {
      alert("Sorry, reindeer Dancer brings to your attention, it has never seen phone numbers\nshorter than ten digits (including the area code) so far.");
      theForm.phone.focus();
      return (false);
    }

    var checkOK = "0123456789()[]- ";
    var checkStr = theForm.phone.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("Into the field \"phone number\" please enter digits, spaces, dashs and brackets only.");
      theForm.phone.focus();
      return (false);
    }

    if (theForm.email.value == "")
    {
      alert("When you do not enter your e-mail address,\nSanta won't be able to answer your mail.\nPlease enter your e-mail address.");
      theForm.email.focus();
      return (false);
    }

    if (theForm.email.value.length < 8)
    {
      alert("Sorry, reindeer Rudolph complains that he can only deliver mails\nwith e-mail addresses longer than 8 characters.");
      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("Into the field \"e-mail\" please enter letters, digits and \"@-_.\" only.");
      theForm.email.focus();
      return (false);
    }

    if (theForm.conditions.checked == false)
    {
      alert("You must agree to this website's privacy policy,\notherwise Santa's appointment manager cannot forward your message.");
      theForm.conditions.focus();
      return (false);
    }

    return (true);
  }

  function email_validator(theForm)
  {

    if (theForm.email.value.length < 8)
    {
      alert("Sorry, reindeer Dancer thinks, your e-mail address should be at least 8 characters long.\nHe won't deliver your sign-up request unless you put a correct mail address on it.");
      theForm.email.focus();
      return;
    }

    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("Please enter letter, digits and \"_-@.\" characters only into the field \"e-mail address\".");
      theForm.email.focus();
      return;
    }

    var chkVal = theForm.email.value;
    var prsVal = chkVal;
    if (chkVal != "" && !(prsVal != "my@e-mail.com"))
    {
      alert("The default value \"my@e-mail.com\" is an example.\nPlease enter your own e-mail address into the \"e-mail address\" field,\notherwise Santa's appointment manager cannot sign you up.");
      theForm.email.focus();
      return;
    }
    window.location="http://www.santabyrequest.com/service/newssubscription.html?"+theForm.email.value;
  }
  
  function subscriptionform_validator(theForm)
  {

    if (theForm.email.value.length < 8)
    {
      alert("Sorry, reindeer Dancer thinks, your e-mail address should be at least 8 characters long.\nHe won't deliver your sign-up request unless you put a correct mail address on it.");
      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("Please enter letter, digits and \"_-@.\" characters only into the field \"e-mail address\".");
      theForm.email.focus();
      return (false);
    }

    var chkVal = theForm.email.value;
    var prsVal = chkVal;
    if (chkVal != "" && !(prsVal != "my@e-mail.com"))
    {
      alert("The default value \"my@e-mail.com\" is an example.\nPlease enter your own e-mail address into the \"e-mail address\" field,\notherwise Santa's appointment manager cannot sign you up.");
      theForm.email.focus();
      return (false);
    }

    return (true);
  }  

  function order_validator(theForm)
  {
    if (theForm.shippingaddress.value.length < 20)
    {
      alert("Santa needs to know where to ship the bookmark to.\nPlease enter the shipping address.");
      theForm.shippingaddres.focus();
      return (false);
    }

    if (theForm.invoiceaddress.value.length < 20)
    {
      alert("We will need your invoice address, please.");
      theForm.invoiceaddress.focus();
      return (false);
    }

    if (theForm.email.value == "")
    {
      alert("When you do not enter your e-mail address,\nSanta won't be able to process your order.\nPlease enter your e-mail address.");
      theForm.email.focus();
      return (false);
    }

    if (theForm.email.value.length < 8)
    {
      alert("Sorry, reindeer Rudolph complains that he can only deliver orders\nwith e-mail addresses longer than 8 characters.");
      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("Into the field \"e-mail\" please enter letters, digits and \"@-_.\" only.");
      theForm.email.focus();
      return (false);
    }

    if (theForm.conditions.checked == false)
    {
      alert("You must agree to this website's privacy policy,\notherwise Santa's staff cannot forward your order.");
      theForm.conditions.focus();
      return (false);
    }

    return (true);
  }



//-->