var i = j = 0;
var fade = fadebody = divName = "";
var speed = 30; //  <--- tu menis rychlost zobrazenia (ms)
var speedbody = 50;

function show(divId){
 divName=divId;
 clearTimeout(fade);
 fade = setInterval('opacity(1)', speed);
}

function hide(divId){
 divName=divId;
 clearTimeout(fade);
 fade = setInterval('opacity(-1)', speed);
}

function opacity(side){
 i += side;
 document.getElementById(divName).style.opacity = (i/20);	
 document.getElementById(divName).style.filter = 'alpha(opacity='+ (i*5) +')';
 document.getElementById(divName).style.top = 300 + (i) + 'px';
 
 if(i >= 10 || i <= 0) clearTimeout(fade);
}



function start(){
 clearTimeout(fadebody);
 fadebody = setInterval('opacitybody(1)', speedbody);
}

function setPage(e){
 clearTimeout(fadebody);
 fadebody = setInterval('opacitybody(-1)', speedbody);
 setTimeout("prelink("+ e +")",640);
}

function prelink(e){
 if(e==1)path='portfolio';
 if(e==2)path='info';
 if(e==3)path='nechaj-odkaz';
 document.location = path;
}

function opacitybody(sidebody){
 j += sidebody;
 document.getElementById('body').style.opacity = (j/10);	
 document.getElementById('body').style.filter = 'alpha(opacity='+ (j*10) +')';
 
 if(j >= 10 || j <= 0) clearTimeout(fadebody);
}

