function forward(dest,wait) {
   window.setTimeout("document.location.href='"+dest+"';", wait);
}




var opacity=0;
var marke;
var ins=new Array(false,false,false,false);

function over(t,s) {
   var ausblenden=true;

   ins[t]=s;
   
   for(i=0;i<ins.length;i++) if(ins[i]) ausblenden=false;
   
   if(ausblenden) outBrand();
}

function overBrand(i) {
   over(2,true);
   document.getElementById('lupenContainer').src="pix/spektrum/markenzeichen/gross/"+i+".jpg";
   window.setTimeout("slowlyPresent();", 25);
   over(3,true);
}

function outBrand() {
   opacity=0;
   document.getElementById('lupe').style.width="3.36px"
   document.getElementById('lupe').style.height="1.89px"
   document.getElementById('lupe').style.opacity=opacity/100;
   document.getElementById('lupe').style.filter='alpha(opacity='+opacity+')';
}

function slowlyPresent() {
   opacity++;
   document.getElementById('lupe').style.opacity=opacity/100;
   document.getElementById('lupe').style.filter='alpha(opacity='+opacity+')';
   document.getElementById('lupe').style.width=(3.36*opacity)+"px";
   document.getElementById('lupe').style.height=(1.89*opacity)+"px";
   document.getElementById('lupe').style.left=(288-3.36*opacity/2)+"px";
   document.getElementById('lupe').style.top=(195-1.89*opacity/2)+"px";
   if(opacity<100) {
      window.setTimeout("slowlyPresent();", 25);
   } else {
      over(3,false);
   }
}








var blendBox=1;
var blendImg=1;
var speed=5;
var bilders = new Array();
var stat = new Array(0,1,2,3,4,5,6,7,8,9,10,11,12);

function preload() {
   for(i=1;i<=35;i++) { bilders[i] = new Image(); bilders[i].src = "pix/start/start."+i+".jpg"; }
}

function searchArray(a,w) {
   var isIn=false;
   for(i in a) if(a[i]==w) isIn=i;
   return isIn;
}

function mix() {

   var shuffleBox;
   var shuffleImg;

   opacity=opacity-speed;
   
   if(opacity<0) {
      opacity=100;
      document.getElementById('bild_'+blendBox).src=bilders[blendImg].src;
      document.getElementById('bild_'+blendBox).style.opacity=1;
      document.getElementById('bild_'+blendBox).style.filter='alpha(opacity=100)';
      blendBox=parseInt(Math.random()*12)+1;
      while(searchArray(stat,blendImg)) blendImg=parseInt(Math.random()*(bilders.length-1))+1;
      stat[blendBox]=blendImg;
      document.getElementById('box_'+blendBox).style.backgroundImage='url(pix/start/start.'+blendImg+'.jpg)';
      // status="blend "+blendBox+" to "+blendImg;
   }

   document.getElementById('bild_'+blendBox).style.opacity=opacity/100;
   document.getElementById('bild_'+blendBox).style.filter='alpha(opacity='+opacity+')';
   
   window.setTimeout("mix();", 25);
}

function philosophie(i) {
   window.open("philosophie.php?spruechlein="+i, "philosophie", "width=380,height=380,resizable=no");
}

function spektrum(s) {
   window.open("index.php?content=spektrum."+s, "spektrum", "width=950,height=700");
}










