smokeId=null;

function Stopsmoke()
{
    if (browser_id=="IE" || browser_id == "FF")
    {
        if (tttt==1)
        {

            KG_pic.style.visibility="hidden";
            KG_pic.width=1;
            KG_pic.height=1;
            KG_pic.style.top=0;
            KG_pic.style.left=0;
            KG_pic.style.filter='alpha(opacity=0)';
	    KG_pic.style.opacity=0;
        }
    }

    if (smokeId!=null) clearTimeout( smokeId);
}

function Expand()
{

        if (KG_fade < -50) 
        {
            //ivm link klikken
            KG_pic.style.visibility="hidden";
            KG_pic.width=1;
            KG_pic.height=1;
            KG_pic.style.top=0;
            KG_pic.style.left=0;
            KG_pic.style.filter='alpha(opacity=0)';
	    KG_pic.style.opacity=0;

            KG_step=Math.floor(Math.random()*3)+2;
            KG_currentStep=0;
            KG_fade=80;
            KG_Yarea=window.document.body.clientHeight-80;
            KG_Xarea=window.document.body.clientWidth-80;
            KG_RY=Math.round(50+Math.random()*KG_Yarea);
            KG_RX=Math.round(50+Math.random()*KG_Xarea);
            KG_CCCC.style.top=KG_RY+document.body.scrollTop;
            KG_CCCC.style.left=KG_RX+document.body.scrollLeft;

            smokeId = setTimeout('Expand();',1000*(Math.floor(Math.random()*10)+2));
        }
        else 
        {
            KG_pic.style.visibility="visible";
            KG_pic.width=KG_currentStep*2;
            KG_pic.height=KG_currentStep*2;
            KG_pic.style.top= -KG_currentStep;
            KG_pic.style.left= -KG_currentStep;
            KG_pic.style.filter='alpha(opacity='+KG_fade+')';
	    KG_pic.style.opacity=(KG_fade)/100;
            KG_currentStep+=KG_step;
            if (KG_currentStep > 20) KG_fade-=KG_fadeStep;

            smokeId = setTimeout('Expand()',40);
        }
    
}





function bubbles()
{
var WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight;
var WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth;
var hscrll=(document.layers)?window.pageYOffset:document.body.scrollTop;
var wscrll=(document.layers)?window.pageXOffset:document.body.scrollLeft;

for (bub_i=0; bub_i < bub_Amount; bub_i++)
{
     bub_sy = bub_Speed[bub_i]*Math.sin(270*Math.PI/180);
     bub_sx = bub_Speed[bub_i]*Math.cos(bub_Cstep[bub_i]);
     bub_Ypos[bub_i]+=bub_sy;
     bub_Xpos[bub_i]+=bub_sx; 

     if (bub_Ypos[bub_i] < -50)
     {
         bub_Ypos[bub_i]=WinHeight+50;
         bub_Xpos[bub_i]=Math.round(Math.random()*WinWidth);
         bub_Speed[bub_i]=Math.random()*2+1;//4 6
         bub_grow[bub_i]=0.1;//////////// 5
         bub_nsSize[bub_i]=Math.random()*15+5;
     }

     if (bub_ns)
     {
         document.layers['sn'+bub_i].left=bub_Xpos[bub_i]+wscrll;
         document.layers['sn'+bub_i].top=bub_Ypos[bub_i]+hscrll;
     }
     else
     {
         si[bub_i].style.pixelLeft=bub_Xpos[bub_i]+wscrll;
         si[bub_i].style.pixelTop=bub_Ypos[bub_i]+hscrll;
         si[bub_i].style.width=bub_grow[bub_i];
         si[bub_i].style.height=bub_grow[bub_i]; 
     }

     bub_grow[bub_i]+=bub_rate[bub_i]; 
     bub_Cstep[bub_i]+=bub_Step[bub_i];

     if (bub_grow[bub_i] > 24) bub_grow[bub_i]=25;
}

smokeId = setTimeout('bubbles()',10);
}






if ((browser_id=="IE" && browser_version>=4) || (browser_id=="FF" && browser_version>=3))
{
     tttt = Math.floor( Math.random()*2+1);
     if (document.layers) tttt=2;
     tttt = 1; //////////
     if (tttt==1)
     {
         smokeId=null,KG_fadeStep=4,KG_fade=-51,KG_currentStep=0,KG_step=3;
	 KG_RY=0,KG_RX=0,KG_Yarea=0,KG_Xarea=0;

         document.write('<div id="KG_CCCC" style="position:absolute;top:0px;left:0px">');
         document.write('<div style="position:relative">');
         document.write('<img  id="KG_pic" src="images/plaatje_smokering.gif" height="1" width="1" style="visibility:hidden;position:absolute;top:0px;left:0px">');
         document.write('</div></div>');
	 Expand();
     }

     if (tttt==2)
     {
	 smokeId=null;
         bub_Image0=new Image();
         bub_Image0.src="images/blackbubble.gif";
         bub_Amount=4; 

         bub_Ypos=new Array();
         bub_Xpos=new Array();
         bub_Speed=new Array();
         bub_rate=new Array();
         bub_grow=new Array();
         bub_Step=new Array();
         bub_Cstep=new Array();
         bub_nsSize=new Array();
         bub_ns=(document.layers)?1:0;
         WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight;
         WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth;

         for (bub_i=0; bub_i < bub_Amount; bub_i++)
         {                                                                
              bub_Ypos[bub_i] = Math.round(Math.random()*WinHeight);
              bub_Xpos[bub_i] = Math.round(Math.random()*WinWidth);
              bub_Speed[bub_i]= Math.random()*5+3;//5 3
              bub_Cstep[bub_i]=0;
              bub_Step[bub_i]=Math.random()*0.1+0.05; 
              bub_grow[bub_i]=0;
              bub_nsSize[bub_i]=Math.random()*15+5;
              bub_rate[bub_i]=Math.random()*0.1+0.1;
         }

         if (bub_ns)
         {
             for (bub_i = 0; bub_i < bub_Amount; bub_i++)
             {
                  document.write("<LAYER NAME='sn"+bub_i+"' LEFT=0 TOP=0><img src="+bub_Image0.src+" name='N' width="+bub_nsSize[bub_i]+" height="+bub_nsSize[bub_i]+"></LAYER>");
             }
         }
         else
         {
             document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');

             for (bub_i = 0; bub_i < bub_Amount; bub_i++)
             {
                  document.write('<img id="si" src="'+bub_Image0.src+'" style="position:absolute;top:0px;left:0px;filter:alpha(opacity=100);opacity:1;">');
             }

             document.write('</div></div>');
         }

         bubbles();
     }
}
