var AutoClose = true; // Should the fly in window auto close?
var AutoCloseAfter = 10000; // 10 seconds.
function SetWindow(w, h, wID)
{
    var self = this;
    closeSetWindow = function(wID)
    {
        document.getElementById(wID).style.display = "none";
    }
    
    moveSetWindow = function(A, S, E, wID)
    {
        if (A == "move")
        {
            S = S+20;
            document.getElementById(wID).style.left = S+"px";
            var A = (S >= E) ? "stop" : "move";
            setTimeout("this.moveSetWindow('"+A+"', "+S+", "+E+", '"+wID+"');", 20);
        }
        else if (A == "stop")
        {
            if (AutoClose) setTimeout("this.closeSetWindow('"+wID+"');", AutoCloseAfter);
        }
    }
 
    var pH = window.innerHeight? window.innerHeight : Math.max(document.body.clientHeight, document.documentElement.clientHeight);
    var pW = window.innerWidth? window.innerWidth : Math.max(document.body.clientWidth, document.documentElement.clientWidth);
    var L = (pW/w)*100;
    var T = (pH/2)-(h/2);
    
    document.getElementById(wID).className = "FlyInWindow";
    document.getElementById(wID).style.width = w+'px';
    document.getElementById(wID).style.height = h+'px';
    document.getElementById(wID).style.top = T+'px';
    document.getElementById(wID).style.left = '-'+(w+50)+'px';
    document.getElementById(wID).innerHTML = '<div style="float: right;"><a href="javascript:void(0);" onclick="self.closeSetWindow(\''+wID+'\'); return false" target="_blank" title="Close This Window" style="font-size: 12px; color: #FF0000; font-weight: bold;"><b><FONT color=#808080>Zav&#345;t okno s reklamou </b></FONT><FONT color=#FF0000> X</a></div>' + document.getElementById(wID).innerHTML;
    setTimeout("this.moveSetWindow('move', -"+(w+50)+", "+L+", '"+wID+"');", 1500);
    
    //alert('Page Height: '+pH+' Page Width: '+pW+' Top: '+T+' Left: '+L);
}
 
 


//...this should work with any version of JavaScript
function makeArray (n) {
   this.length= n
}
var rs = new makeArray(5)
//...you must explicitly indicate how many items are in the array
//...in this case 3 was choosen
rs[1]=
'<div id="DivWithContent"><br><hr><A href="http://www.akvapo.cz/fx5.html" title="Filtr  FX 5 pro akvária cca 1500 l" target="_new"><img src="img/fx5.jpg" border="0" title="Filtr FX 5 pro akvária cca 1500 l"></A><hr><A href="http://www.akvapo.cz/fx5.html" title="Filtr FX 5 pro akvária cca 1500 l" target="_new"><FONT color=#808080 face=Arial><b>Další informace</b></FONT></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size="1">' 
   ; //...first HTML item  Note first element is 1, not 0
rs[2]=
'<div id="DivWithContent"><br><hr><A href="http://akvapo.cz/atmanv.html" title="Filtr  FX 5 pro akvária cca 1500 l" target="_new"><img src="img/atmanv.jpg" border="0" title="Kompresory ATMAN 20 - 60 W"></A><hr><A href="http://akvapo.cz/atmanv.html" title="Filtr FX 5 pro akvária cca 1500 l" target="_new"><FONT color=#808080 face=Arial><b>Další informace</b></FONT></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size="1">' 
 
rs[3]=
'<div id="DivWithContent"><br><hr><A href="http://akvatechnika.sweb.cz/ec3/" title="Digitální konduktometr EC3" target="_new"><img src="http://akvapo.cz/img/ec3.jpg" border="0" title="Digitální konduktometr EC - 3 s automatickou kompenzací teploty"></A><hr><A href="http://akvatechnika.sweb.cz/ec3/" title="Digitální konduktometr EC3" target="_new"><FONT color=#808080 face=Arial><b>Další informace</b></FONT></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size="1">' 
 
rs[4]=
'<div id="DivWithContent"><br><hr><A href="http://www.akvapo.zzn.com/WEB/1148030/fx5.html" title="Filtr  FX 5 pro akvária cca 1500 l" target="_new"><img src="img/fx5.jpg" border="0" title="Filtr FX 5 pro akvária cca 1500 l"></A><hr><A href="http://www.akvapo.zzn.com/WEB/1148030/fx5.html" title="Filtr FX 5 pro akvária cca 1500 l" target="_new"><FONT color=#808080 face=Arial><b>Další informace</b></FONT></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size="1">' 
 
rs[5]=
'<div id="DivWithContent"><br><hr><A href="http://www.akvapo.zzn.com/WEB/1148030/fx5.html" title="Filtr  FX 5 pro akvária cca 1500 l" target="_new"><img src="img/fx5.jpg" border="0" title="Filtr FX 5 pro akvária cca 1500 l"></A><hr><A href="http://www.akvapo.zzn.com/WEB/1148030/fx5.html" title="Filtr FX 5 pro akvária cca 1500 l" target="_new"><FONT color=#808080 face=Arial><b>Další informace</b></FONT></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size="1">' 
 
 
//...below a pseudo-random number is picked
//...actually it is not random, but a sequence dependent on the time
//...in this case this index for the first 20 seconds it is 1, 
//...then 2 for next 20 and for the last 20 seconds it is 3
var Today = new Date()
var index = Math.floor (rs.length*Today.getSeconds()/60)+1
//...when the page is loaded a random number between 0 and rs.length is picked
//...1 is added because first element is 1,  not 0
//...the random item gets displayed by the document.write below.



document.write (rs[index] + index);
document.write ( '</Div> ');


<!--   
 SetWindow(290, 300, "DivWithContent");   
// -->







