function openwindow(win,winname,w,h,wx,wy,balken)
{
  var winl = (screen.width-w)/2;  // Zentriert Wizard öffnen
  if (screen.height < h) {
    wint=0;
    h=screen.height-30;
  } else wint = (screen.height-h)/2-20;
  if (wx) winl=wx-1;
  if (wy) wint=wy-1;
  wbalk=1;
  if (balken) wbalk=balken;
  newWin = window.open(win,winname,'toolbar=0,location=no,directories=0,status=0,menubar=0,scrollbars='+wbalk+',resizable=1,width='+w+',height='+h+',top='+wint+',left='+winl);
  if (newWin) newWin.focus(); else alert('Konnte Extrafenster nicht öffnen! Um ooge.com vollständig zu sehen bitte Popups erlauben.');
}


function msg($text) {
   this.text.innerText = "[ "+$text+" ]";
   window.status = $text;
   this.text.fgcolor = "#ffffff";
}

function galerie($text) {
   this.text.innerHTML = "<a href=\"index.php\" onmouseover=\"wstatus('');return true;\" onmouseout=\"wstatusout();return true;\"><b>Originale</b></a> | <a href=\"index.php\" onmouseover=\"wstatus('');return true;\" onmouseout=\"wstatusout();return true;\"><b>Computerkunst</b></a>";
   window.status = '';
}

function wstatus($text) {
   window.status = $text;
}

function wstatusout() {
   window.status = '';
}

function out() {
   this.text.innerText = " ";
   window.status='';
}

function msg2() {
  $x=0;
// alert(document.calcprice.material.value + ':'+ document.calcprice.omaterial.value);
  if (document.calcprice.pstate.value == 1) {
   if (document.calcprice.otop.value != document.calcprice.top.value || document.calcprice.obottom.value != document.calcprice.bottom.value || document.calcprice.oleft.value != document.calcprice.left.value || document.calcprice.oright.value != document.calcprice.right.value) $x=1;
  }
  if (document.calcprice.omaterial.value != document.calcprice.material.value || document.calcprice.osizex.value != document.calcprice.sizex.value || document.calcprice.osizey.value != document.calcprice.sizey.value || $x == 1) {
    alert('Bitte erst den Preis neu berechnen.');
    return false;
  } else {
    window.setTimeout('window.close();',100);
    return true;
  }
}

function distest () {
  if (document.oogecart.BillCountry.selectedIndex != 0) {
    document.oogecart.BillPayment[2].checked=false;
    document.oogecart.BillPayment[2].disabled=true;
    document.oogecart.BillPayment[1].checked=false;
    document.oogecart.BillPayment[1].disabled=true;
    document.oogecart.BillKto.disabled=true;
    document.oogecart.BillIns.disabled=true;
    document.oogecart.BillBLZ.disabled=true;
    document.oogecart.BillKtoOwner.disabled=true;
  } else {
    document.oogecart.BillPayment[2].disabled=false;
    document.oogecart.BillPayment[1].disabled=false;
    document.oogecart.BillIns.disabled=false;
    document.oogecart.BillKto.disabled=false;
    document.oogecart.BillBLZ.disabled=false;
    document.oogecart.BillKtoOwner.disabled=false;
  }
}

function checktest () {
    document.oogecart.BillPayment[1].checked=true;

}

IE  = document.all &&!window.opera;
GK  = window.sidebar;
AOB = [];
x   = 0;

function Fader()
{
  this.timeOut=false;
  this.fade=function(y)
    {
      clearTimeout(this.timeOut);
      this.value=Number(eval('this.object.'+this.attr))+(this.delta*this.evt[y]);
      if(this.value>=this.min && this.value<=this.max)
        {
          eval('this.object.'+this.attr+'='+this.value)
          this.timeOut=setTimeout('AOB['+this.index+'].fade('+y+')',this.rate);
        }
    }
}


function init_fader(obj,delta,rate,min,max,dir)
{
  if(IE || GK)
    {
      AOB.push(new Fader(x));
      OB        = AOB[x];
      OB.index  = x;
      OB.object = obj;
      if(IE)
        {
          OB.attr = 'filters.alpha.opacity';
          OB.faktor = 1;
        }
      else
        {
          OB.attr   = 'style.MozOpacity';
          OB.faktor = 100;
        }
      OB.delta = delta/OB.faktor;
      OB.rate  = rate;
      OB.min   = min/OB.faktor;
      OB.max   = max/OB.faktor;
      OB.evt=[-1,1];if(dir)OB.evt.reverse();
      OB.object.onmouseover = new Function('f1','AOB['+x+'].fade(0)');
      OB.object.onmouseout  = new Function('f2','AOB['+x+'].fade(1)');
      OB.fade(0);x++;
    }
}

