﻿var rlocation;
var txbgn = 0; 
document.write("<span id='location__obj'></span>");


function reload(rfloc, txend, mytext) 
{ 
     var xreloac = document.getElementById("location__obj");
     xreloac.className = "xlocation";
     this.txend = txend;
     this.rfloc = rfloc;
     this.mytext = mytext;

     if(mytext == "null") mytext = "";
     else mytext = mytext + "<br>";
     if(txbgn == parseInt(this.txend)) document.location.href = this.rfloc; 
     var rlocation = this.txend - txbgn;
     xreloac.innerHTML = mytext + "Перенаправление: " + rlocation;

     if(txbgn < this.txend) {  
         txbgn++; 
         setTimeout("reload(this.rfloc, this.txend, this.mytext);", 100); 
     }
}
