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_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_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;
}

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 calcEUR(name, wert) {
	switch(name) {
		case "preis20": document.variation.preis20.value = formatPreis(wert / 1.9); break;
		case "preis21": document.variation.preis21.value = formatPreis(wert / 1.9); break;
		case "preis22": document.variation.preis22.value = formatPreis(wert / 1.9); break;
		case "preis23": document.variation.preis23.value = formatPreis(wert / 1.9); break;
		case "preis24": document.variation.preis24.value = formatPreis(wert / 1.9); break;
		case "preis25": document.variation.preis25.value = formatPreis(wert / 1.9); break;
		case 'preis26': document.variation.preis26.value = formatPreis(wert / 1.9); break;
		case "preis27": document.variation.preis27.value = formatPreis(wert / 1.9); break;
		case "preis28": document.variation.preis28.value = formatPreis(wert / 1.9); break;
		case "preis29": document.variation.preis29.value = formatPreis(wert / 1.9); break;
	}
}

function formatPreis(wert) {
	wert = String(wert);
	parts = wert.split(".");
	wert = parts[0]+"."+parts[1].substr(0,2);
	return wert;
}

function openPopUp(url,picfile,width,height,alt) {
	var windowname=String(picfile);
	var windowname2=windowname.replace(/[^a-zA-Z0-9]/gi,"");
	height2=height+120;
 	popup=window.open("/banner/openpopup.php?filename="+picfile+"&alt="+alt+"&width="+width+"&height="+height+"&url="+url,""+windowname2,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width="+width+",height="+height2+",left=550,top=100");
    popup.focus();
}

function Fensterweite()
{
	 if (window.innerWidth) return window.innerWidth;
	 else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
	 else return 0;
}

function switchDynamicBox(boxid)
{
      var obj      = window.document.getElementById(boxid);
      var listname = obj.getAttribute('name');
      var newstat  = obj.style.display == 'none' ? 'block' : 'none';
      var listels  = window.document.getElementsByName(listname);
      var numels   = listels.length;
      
      if(numels > 0) {
              for(var i = 0; i < numels; i++) {
                      listels[i].style.display = 'none';
              }
      } else {
              var i = 0;
              do {
                      tmpboxid = listname + '_' + i;
                      tmpobj   = window.document.getElementById(tmpboxid);
                      if(tmpobj != null) {
                              tmpobj.style.display = 'none';
                      }
                      i++;
              } while(tmpobj != null)
      }
      obj.style.display = newstat;
}
