var manufacturer = "";
function chkFormular()
{
   var f = document.kontakt;

   if (f.vorname.value == "")
   {
      alert("Please enter your first name!");
      f.vorname.focus();
      return false;
   }
   else if (f.nachname.value == "")
   {
      alert("Please enter your surname!");
      f.nachname.focus();
      return false;
   }
   if(f.email.value != "")
   {
     if((f.email.value.indexOf('@') == -1) || (f.email.value.indexOf('.') == -1))
     {
       alert("Entered E-Mail address is invalid!");
       f.email.focus();
       return false;
     }
   }
   else
   {
      alert("Your E-Mail address is required\nto enable us to contact you!");
      f.email.focus();
      return false;
   }

   if (f.userfile.value == "")
   {
      alert("Please enter the loudspeaker file to be uploaded!\nAttention: only file extensions &quot;.BOX&quot; are accepted.");
      f.userfile.focus();
      return false;
   }
   else
   {
     var low = f.userfile.value.toLowerCase();
     if (low.indexOf('.box') == -1)
     {
        alert("Only file extensions &quot;.BOX&quot; are accepted!");
        f.userfile.focus();
        return false;
     }
   }

   return true;
}

function chkDesires()
{
   var f = document.desires;

   if (f.vorname.value == "")
   {
      alert("Please enter your first name!");
      f.vorname.focus();
      return false;
   }
   else if (f.nachname.value == "")
   {
      alert("Please enter your surname!");
      f.nachname.focus();
      return false;
   }

   if(f.email.value != "")
   {
     if((f.email.value.indexOf('@') == -1) || (f.email.value.indexOf('.') == -1))
     {
       alert("Entered E-Mail address is invalid!");
       f.email.focus();
       return false;
     }
   }
   else
   {
      alert("Your E-Mail address is required\nto enable us to contact you!");
      f.email.focus();
      return false;
   }

   if (f.markenname.value == "")
   {
      alert("Please enter the brand name of your loudspeaker!");
      f.markenname.focus();
      return false;
   }

   if (f.loudspeaker.value == "")
   {
      alert("Please enter the name of your loudspeaker!");
      f.loudspeaker.focus();
      return false;
   }

   if (f.kommentar.value == "")
   {
      f.kommentar.value = "&nbsp;";
   }
   else if (f.kommentar.value.length > 255)
   {
      alert("Your commentary text is too long!\nPlease enter less than 256 characters.");
      f.kommentar.value = f.kommentar.value.substr(0, 255);
      f.kommentar.focus();
      return false;
   }

   return true;
}

function chkContact()
{
   var f = document.contactto;

   if (f.fullname.value == "")
   {
      alert("Please enter your name!");
      f.fullname.focus();
      return false;
   }

   if(f.pooh.value != "")
   {
     if((f.pooh.value.indexOf('@') == -1) || (f.pooh.value.indexOf('.') == -1))
     {
       alert("Entered E-Mail address is invalid!");
       f.pooh.focus();
       return false;
     }
   }
   else
   {
      alert("Your E-Mail address is required to\nenable the user to contact you!");
      f.pooh.focus();
      return false;
   }

   if (f.kommentar.value == "")
   {
      alert("Please enter a commentary text!");
      f.kommentar.focus();
      return false;
   }

   return true;
}

function chkSearch()  // vielleicht für später
{
//   if (document.searchin.search.value == "")
//   {
//      alert("Bitte geben ein Suchwort ein !");
//      document.searchin.search.focus();
//      return false;
//   }

   return true;
}

function CancelForm(Back)
{
   if(top.frames.length > 0)
   {
      if (Back.search("back") == 0)
      {
         top.frames["caracontent"].history.back();
         window.setTimeout('top.frames["caracontent"].history.back();', 200);
      }
      else
      {
         top.frames["caracontent"].location.href=Back;
      }
   }
}

function SetTitleFrame(Title, Links)
{
   if(top.frames.length > 0)
   {
      var Pars = "";
      var Reference = "";
      if(window.location.search != "") {
         Pars = window.location.search;
         Pars = Pars.substring(Pars.indexOf("f=")+2, Pars.length);
         Pars = Pars.substring(0, Pars.indexOf("&"));
         Reference = Title+"?h="+escape(top.StripKW(document.title))+"&s="+Links+"&f="+Pars+"&dmy=dmy ";
      }
      else {
         Reference = Title+"?h="+escape(top.StripKW(document.title))+"&s="+Links+"&dmy=dmy ";
      }
//      alert(Reference);
      if(top.frames) if(top.frames["caratitle"])
        top.frames["caratitle"].location.href=Reference;
   }
}
