function oeffnefenster (url) {
 fenster=window.open(url, "_blank", "width=800,height=600,status=no,screenX=10,screenY=10,left=10,top=10,scrollbars=yes,resizable=yes");
 fenster.focus();
 return false;
}
function oeffnefenster_var (url, width, height) {
 fenster=window.open(url, "_blank", "width="+width+",height="+height+",status=no,screenX=10,screenY=10,left=10,top=10,scrollbars=auto,resizable=yes");
 fenster.focus();
 return false;
}
function changetext(whichcontent,offset){
   if (document.all||document.getElementById){
      cross_el=document.getElementById? document.getElementById("descriptions"):document.all.descriptions
      cross_el.innerHTML='<div style="position: relative; left:'+offset+'px;">'+whichcontent+'</div>'
   }
   else if (document.layers){
      document.d1.document.d2.document.write('<div style="position: relative; left:'+offset+'px;">'+whichcontent+'</div>')
      document.d1.document.d2.document.close()
   }
}

function checkSearchString() {
        fr = document.forms["sucheForm"];
        fr2 = document.forms["sucheFormHidden"];
        searchString = fr.elements["searchval"].value.toLowerCase();
        searchString = searchString.replace(/^\s+/, '');
        searchString = searchString.replace(/\s+$/, '');
       // searchKat= fr.elements["searchThis"].value;
        firstLetter=searchString.substring(0,1);

        if (firstLetter!="+"){
           if (firstLetter!="-"){
            //  searchString="+"+searchString;
           }
        }

        if(searchString.length < 2) {
                alert("Sie müssen mindestens zwei Zeichen eingeben,\num ein Suchergebnis zu erhalten.");
        }
        else {
           fr2.elements["searchval"].value=searchString;
           fr2.submit();
        }
}
function checkWK(artikelid,frmID) {
   fr = document.forms[frmID];
   fr2 = document.forms["flyerHidden"];
   fr2.elements["artikelid"].value=artikelid;
   if(fr.elements["pauly"].checked == true){
      fr2.elements["rememberit"].value=1;
   }else{
      fr2.elements["rememberit"].value="x";
   }
   fr2.submit();
}

function open_NW(adr,winName,screenwidth,screenheight) {
     screenwidth+=20;screenheight+=20;
     if (screenwidth<(screen.availWidth/2)) {
        xPos = screen.availWidth/2 - screenwidth -10;
     } else {
        xPos = screen.availWidth - screenwidth -10;
     }
     if (screenheight<(screen.availHeight/2)) {
        yPos = screen.availHeight/2 - screenheight -10;
     } else {
        yPos = screen.availHeight - screenheight -10;
     }
     var NW = window.open(adr,winName,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width="+screenwidth+",height="+screenheight+",screenX="+xPos+",screenY="+yPos+",left="+xPos+",top="+yPos);
     NW.focus();
return
}

function Go(x)
{
 if(x == "nothing")
 {
   document.forms["pulldown"].reset();
   document.forms["pulldown"].elements[0].blur();
   return;
 }
 else
  {
      parent.frames["body"].location.href = x;
      document.forms["pulldown"].reset();
      document.forms["pulldown"].elements[0].blur();
  }
return
}
function checkall()
{
 fr2 = document.forms["input_menue"];
 for(i=1;i<=10;i++){
    if(fr2.elements["fltr_plz_"+i].checked != true){
    fr2.elements["fltr_plz_"+i].checked = true;
    }
 }
return
}


function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  frm=args[0];
  fr2 = document.forms[frm];
  for (i=0; i<(args.length-2); i+=3) {test=args[i+2]; val=MM_findObj(args[i]);
    if (val) {nm=val.id;
//      if(nm=='AGB'){
//        if(fr2.elements["AGB"].checked=false){
//           errors.='Sie müssen den allgemeinen Geschäftsbedingungen zustimmen,\n';
//           errors.='um ein Angebot einstellen zu können!';
//        }
//      }
      if ((val=val.value)!="") {
      if(nm=='Passwort'){pwd1=val;}
      if(nm=='Passwortbestätigung'){pwd2=val; if(pwd1!=pwd2){errors+='- Passwort und Passwortbestätigung müssen übereinstimmen.\n';}}
      if(nm=='Passwortbestätigung'){pwd2=val; if(pwd1!=pwd2){errors+='- Passwort und Passwortbestätigung müssen übereinstimmen.\n';}}
      if(nm=='gültig_von'){if(val.length !=10 || val.substr(2,1)!='.'){errors+='- Bitte "'+nm+'" in der Form "TT.MM.JJJJ" eingeben!\n';}}
      if(nm=='gültig_bis'){if(val.length !=10 || val.substr(2,1)!='.'){errors+='- Bitte "'+nm+'" in der Form "TT.MM.JJJJ" eingeben!\n';}}
      if(nm=='Angebotstitel'){if(val=='FLYER-ÜBERSCHRIFT BITTE HIER EINGEBEN'){errors+='- Bitte den Angebotstitel überschreiben!\n';}}
      if(nm=='Endedatum'){if(val.length !=10 || val.substr(2,1)!='.'){errors+='- Bitte "'+nm+'" in der Form "TT.MM.JJJJ" eingeben!\n';}}

      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' muß eine EmailAdresse enthalten.\n';
      }else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' muß eine Zahl enthalten.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' muß eine Zahl zwischen '+min+' und '+max+' sein.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' ist erforderlich.\n'; }
  } if (errors){ alert('Folgende Fehler sind aufgetreten:\n'+errors);
  document.MM_returnValue = (errors == '');
  }else{fr2.submit();}
}

function katalog(ausf,kat_id)

{

   var nam = 'w' + ausf;

   var para = '';

   if (document.layers)

   {

      para += 'outerWidth=' + screen.availWidth + ',outerHeight=' + screen.availHeight;

      para += ',screenX=' + screen.availLeft + 'screenY=' + screen.availTop;

   }

   else

      if (document.all)

         para += 'width=' + screen.availWidth + ',height=' + screen.availHeight;

      else

         para += 'width=500,height=400';

   if (ausf)

      para += 'resizable=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,toolbar=1';

   else

      para += 'resizable=1,location=0,directories=0,status=0,menubar=0,scrollbars=0,toolbar=0';
      link='./katalog/index.php?kat_id='+kat_id;
   neu = window.open(link,nam,para)

   if (document.all)

   {

      neu.resizeTo(screen.availWidth,screen.availHeight)

      neu.moveTo(0,0)

   }

   neu.focus();

}
// 20050308
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;
}

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];}}
}
//<a onMouseOver="MM_swapImage('main_r3_c9','','images/main_r3_c9_f2.gif',1)" onMouseOut="MM_swapImgRestore()"><img name="main_r3_c9" src="images/main_r3_c9.gif" width="82" height="25" border="0" alt=""></a>
// 20050308
