function openBrWindowFever(theURL,winName,features,ref,center){
  eval("var "+winName);	if (eval(winName)==true && !winName.closed)
  {winName.focus();}else{if(ref){
  var refURL=theURL+"?URL="+document.location;}else{var refURL=theURL;}
  if(center!="vals"){a=new Array();a=center.split('|');
  t=((screen.height)-a[0])/2;l=((screen.width)-a[1])/2;
  features=features+",top="+t+",left="+l;}
  winName=window.open(refURL,winName,features);
  winName.focus();winName = true;}
}

function CheckSupportFormular()
{
  with(document.forms[0])
  {
    if(anrede.selectedIndex == 0)
    {
      anrede.focus();
      alert("Bitte wählen Sie eine Anrede aus.");
      return false;
    }
    if(vorname.value == "")
    {
      vorname.focus();
      alert("Bitte geben Sie Ihren Vornamen an.");
      return false;
    }
    if(nachname.value == "")
    {
      nachname.focus();
      alert("Bitte geben Sie Ihren Nachnamen an.");
      return false;
    } 
    if(email.value == "")
    {
      email.focus();
      alert("Bitte geben Sie Ihre E-Mail-Adresse an.");
      return false;
    }
    if(email.value != "")
    {
      reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+'(\\@)([a-zA-Z0-9\\-\\.]+)'+'(\\.)([a-zA-Z]{2,4})$');
      res = (reg.test(email.value));
      if(!res)
      {
        email.focus();
        alert("Bitte überprüfen Sie Ihre E-Mail-Adresse.");
        return false;
      }
    }
    if(produkt.selectedIndex == 0)
    {
      produkt.focus();
      alert("Bitte wählen Sie das Produkt aus, zu welchem Sie eine Frage haben.");
      return false;
    }
    if(mitteilung.value == "")
    {
      mitteilung.focus;
      alert("Bitte geben Sie Ihre Mitteilung ein.");
      return false;
    }
    else
      submit();
  }
}

function CheckGaestebuchFormular()
{
  with(document.forms[0])
  {
    if(elements["we_ui_we_global_form[Name]"].value.length == 0)
    {
      alert("Bitte geben Sie Ihren Namen ein!");
      elements["we_ui_we_global_form[Name]"].focus();
      return false;
    }
    if(elements["we_ui_we_global_form[EMail]"].value.length != 0)
    {
      reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+'(\\@)([a-zA-Z0-9\\-\\.]+)'+'(\\.)([a-zA-Z]{2,4})$');
      res = (reg.test(elements["we_ui_we_global_form[EMail]"].value));
      if(!res)
      {
        elements["we_ui_we_global_form[EMail]"].focus();
        alert("Bitte überprüfen Sie Ihre E-Mail-Adresse.");
        return false;
      }
    }
    if(elements["we_ui_we_global_form[Ort]"].value.length == 0)
    {
      alert("Bitte geben Sie Ihren Ort ein!");
      elements["we_ui_we_global_form[Ort]"].focus();
      return false;
    }
    if(elements["we_ui_we_global_form[Text]"].value.length == 0)
    {
      alert("Bitte geben Sie einen Text ein!");
      elements["we_ui_we_global_form[Text]"].focus();
      return false;
    }
    else
    {
      submit();
    }
  }
}

function HideLinkFocus()
{
  if(document.all)
  {
    for(var i = 0; i < document.links.length; i++)
     document.links[i].hideFocus = true;
  }
}



function preloadImages() {
    if (document.images)
    {
      preload_image_object = new Image();
      // set image url
      image_url = new Array();
      image_url[0] = "/images/buttons_main/but1_up.gif";
      image_url[1] = "/images/buttons_main/but2_up.gif";
      image_url[2] = "/images/buttons_main/but3_up.gif";
      image_url[3] = "/images/buttons_main/but4_up.gif";
      image_url[4] = "/images/buttons_main/but5_up.gif";
      image_url[5] = "/images/buttons_main/but6_up.gif";
      image_url[6] = "/images/buttons_main/butx_top.gif";

       var i = 0;
       for(i=0; i<=6; i++) {
         preload_image_object.src = image_url[i];
       }
    }
}  
  
function calcEnglish(form, feet, inches, pounds) {
   if ((! inches) || isNaN(inches))
     inches = 0
   TotalInches = eval(feet*12) + eval(inches)
   form.calcval.value = Math.round(pounds * 703 * 10 / TotalInches / 
TotalInches) / 10
}

function calcMetric(form, meters, kilograms) {
   form.calcval.value = Math.round(kilograms * 10 / meters / meters) / 10
}
