var slotNo=1;
var noSwitch=false;
function pause(){
noSwitch=true;
}
function resume(){
noSwitch=false;
}
function getAdContainer(adSlot){
var slotId = 'slot'+(Number(adSlot)+1);
var cont = document.getElementById(slotId);
return cont;
}
function hidePreviousAd(){
var adContainer=null;
if (slotNo>0){
adContainer=getAdContainer(slotNo-1);
} else {
adContainer=getAdContainer(ads.length-1);
}
if(adContainer!=null&&adContainer!='undefined'){
adContainer.style.display='none';
}
}
function timedRotation(){
if (noSwitch){
return;
}
rotateAd();
}
function rotateAd(){
var adContainer = getAdContainer(slotNo);
if (adContainer!=null&&adContainer!='undefined'){
if(adContainer.innerHTML==null||adContainer.innerHTML==''){
var url='/ad/' + ads[slotNo] + '/htmlslot.htm';
new net.ContentLoader(url, displayAd);
} else {
hidePreviousAd();
adContainer.style.display="inline";
incrementSlot();
}
}
}
function incrementSlot() {
if (slotNo