function MM_findObj(n, d)
{ //v3.0
 var p,i,x;
 if(!d)
  d=document;
 if((p=n.indexOf("?"))>0&&parent.frames.length)
 {
  d=parent.frames[n.substring(p+1)].document;
  n=n.substring(0,p);
 }
 if(!(x=d[n])&&d.all)
  x=d.all[n];
  for (i=0;!x&&i<d.forms.length;i++)
   x=d.forms[i][n];
   for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    x=MM_findObj(n,d.layers[i].document);
   return x;
}

/* Functions that swaps images. */
function MM_swapImage()
{ //v3.0
 var i,j=0,x,a=MM_swapImage.arguments;
 document.MM_sr=new Array;
 for(i=0;i<(a.length-2);i+=3)
 if ((x=MM_findObj(a[i]))!=null)
 {
  document.MM_sr[j++]=x;
  if(!x.oSrc)
   x.oSrc=x.src;
  x.src=a[i+2];
 }
}

function MM_swapImgRestore()
{ //v3.0
 var i,x,a=document.MM_sr;
 for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
  x.src=x.oSrc;
}

/* Functions that handle preload. */
function MM_preloadImages()
{ //v3.0
 var d=document;
 if(d.images)
 {
  if(!d.MM_p)
   d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
  for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0)
   {
    d.MM_p[j]=new Image;
    d.MM_p[j++].src=a[i];
   }
 }
}

function MM_oBrW(theURL,winName,features)
{ 
 window.open(theURL,winName,features);
}

function MM_openDrWindow(theURL,winName,features)
{
  window.open(theURL,winName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=620,height=450,left=10,top=10');
}

function send_contactform()
{
window.open('#','contactwindow','scrollbars=no,resizable=no,width=400,height=250,left=250,top=150');
 document.kontaktmail.submit();
 document.kontaktmail.reset();
}

function MM_openBrWindow(theURL,winName,features)
{ //v2.0
 window.open(theURL,winName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700,height=430,left=10,top=30');
}

function openWindow_withNavig(theURL,winName,features)
{ //v2.0
 if(screen.width == 800)
  window.open(theURL,winName,'toolbar=yes,location=yes,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=640,height=200,left=80,top=230');
  else if(screen.width == 1024)
   window.open(theURL,winName,'toolbar=yes,location=yes,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=640,height=365,left=192,top=230');
   else if(screen.width == 1152)
   window.open(theURL,winName,'toolbar=yes,location=yes,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=640,height=440,left=256,top=230');

   else
    if(screen.width > 1279)
    window.open(theURL,winName,'toolbar=yes,location=yes,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=640,height=440,left=320,top=230');
}

function openWindow_withoutNavig(theURL,winName,features)
{ //v2.0
 if(screen.width == 800)
  window.open(theURL,winName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=280,left=80,top=230');
  else if(screen.width == 1024)
   window.open(theURL,winName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=440,left=192,top=230');
   else if(screen.width == 1152)
   window.open(theURL,winName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=520,left=256,top=230');
    else if(screen.width > 1279)
    window.open(theURL,winName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=440,left=320,top=230');
}

function openWindow_sehtest(theURL,winName,features)
{ //v2.0
if(screen.width == 800)
 window.open(theURL,winName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=800,height=600,left=0,top=0');
else if(screen.width == 1024)
  window.open(theURL,winName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=800,height=600,left=112,top=64');
 else if(screen.width == 1152)
  window.open(theURL,winName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=800,height=600,left=176,top=112');
  else if(screen.width > 1279)
   window.open(theURL,winName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=800,height=600,left=240,top=160');
}

function lkhd(alias,dmn)
{
 switch(alias)
 {
  case 'cf':
   alias = 'c.fagel'; 
  break;
  case 'mf':
   alias = 'm.fagel'; 
  break;
  case 'se':
   alias = 's.engels'; 
  break;
  case 'r':
   alias = 'redaktion'; 
  break;
  case 's':
   alias = 'service'; 
  break;
  case 'h':
   alias = 'hostmaster'; 
  break;
  default:
   alias = 'info'; 
  break;
 }

 switch(dmn)
 {
  case 'aukl.de':
   dmn = 'augen-und-kl.de'; 
  break;
  case 'auko.de':
   dmn = 'augen-und-kosmetik.de'; 
  break;
  case 'aula.de':
   dmn = 'augen-und-laser.de'; 
  break;
  case 'aumo.de':
   dmn = 'augen-und-mode.de'; 
  break;
  case 'ausp.de':
   dmn = 'augen-und-sport.de'; 
  break;
  case 'aume.de':
   dmn = 'augen-und-mehr.de'; 
  break;
  case 'euf.de':
   dmn = 'engels-fagel.de'; 
  break;
  case 'a-w.de':
   dmn = 'auge-wohin.de'; 
  break;
  case 'b-m.de':
   dmn = 'brille-und-mode.de'; 
  break;
  case 'd-b.de':
   dmn = 'der-brillenprofi.de'; 
  break;
  case 'g-s.de':
   dmn = 'gutessehen.de'; 
  break;
  case 'i-a.de':
   dmn = 'ihr-augenarzt.de'; 
  break;
  case 'i-o.de':
   dmn = 'ihr-augenoptiker.de'; 
  break;
  case 'sun.de':
   dmn = 'sunglas.de'; 
  break;
  case 'eam.com':
   dmn = 'eyes-and-more.com'; 
  break;
  case 'oem.com':
   dmn = 'ogenenmeer.com'; 
  break;
 }
 lk   = String.fromCharCode(109,97,105,108,116,111,58) + alias +
        String.fromCharCode(64,101,110,103,101,108,115,45,102,97,103,101,108,46,100,101) +
        "?subject=Mail%20von%20www." + dmn;
 window.location.href(lk);
}

function kontaktcheck(lang)
{
  if(document.kontaktform.NameFrom.value == "")
  {
     
     if (!lang )
       alert("Bitte Ihren Namen eingeben!");
     else
       if (lang == 'eng') 
         alert("Insert your name, please!");
     document.kontaktform.NameFrom.focus();
     return false;
  }

  if(document.kontaktform.MailFrom.value == "")
  {
     if (!lang )
       alert("Bitte Ihre eMail-Adresse eingeben!");
     else
       if (lang == 'eng') 
         alert("Insert your email address, please!");
     document.kontaktform.MailFrom.focus();
     return false;
  }
  else 
    if( document.kontaktform.MailFrom.value.search(/.+@.+\./) == -1)
    {
     if (!lang )
       alert("Bitte geben Sie eine gültige eMail-Adresse ein!");
     else
       if (lang == 'eng') 
         alert("Insert a valid email address, please!");
       document.kontaktform.MailFrom.focus();
      return false;
    }
}