advtsTime=20000;  // mseconds advert is shown
standTime=7000;   // mseconds advert is hidden
startTime=3000;   // mseconds until start

var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"
adCount=0;
function initAd(){
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.ads.style');
	else if(ns)	adDiv=eval('document.layers["ads"]');
	else if(w3)	adDiv=eval('document.getElementById("ads").style');
    setTimeout("showAds()",startTime);
}
function showAds(){
	if(adCount<5){
		adDiv.visibility = '';
		adCount+=1;
	    if (adDiv.MozOpacity) {
	        adDiv.MozOpacity = adCount*0.2
	    } else {
	        adDiv.filter = 'alpha(opacity='+adCount*20+')';
	    }
		setTimeout("showAds()",3);
    }else{
        setTimeout("closeAds()",advtsTime);
    }
}
function closeAds(){
	if(adCount>0){
		adCount-=1;
	    if (adDiv.MozOpacity) {
	        adDiv.MozOpacity = adCount*0.2
	    } else {
	        adDiv.filter = 'alpha(opacity='+adCount*20+')';
	    }
		setTimeout("closeAds()",3);
    }else{
        adDiv.visibility = 'hidden';
        setTimeout("showAds()",standTime);
	}
}
onload=initAd;
