/**
* @version        1.8.04.2
* @copyright        Copyright (C) 2008 PHPiRX. All rights reserved.
* @license        GNU/GPL
*/
window.addEvent('domready', function(){
    $ES('img.autorefresh').each(function(el){
        if(!isNaN(el.alt)) {             
            el.setAttribute('id', 'autorefresh-' + Math.round(Math.random()*100));
            rAutoRefresh(el.id, el.alt);
        }
    });
    iFrameHeight = function(){return;};
});
function rAutoRefreshInit(data){
    var data = data.split(',');
    for(i=0;i<data.length;i++) {
      var params = data[i].split('=');
      $ES('iframe.wrapper'+params[0]).each(function(el){
        var eid = 'autorefresh-' + Math.round(Math.random()*100);
        el.setAttribute('id', eid);
        //el.onload(rIFrameHeight);
        rAutoRefresh(eid, params[1]);
      });      
    }
};
function rAutoRefresh(i, t){
    $(i).src=$(i).src;
    eval("setTimeout(\"rAutoRefresh('"+i+"', "+t+");\", "+(t*1000)+");");
}
function rIFrameHeight(e) {
  var h = 0;
  if ( !window.ie ) {  
    h = e.currentTarget.contentDocument.height;
    e.currentTarget.style.height = h + 60 + 'px';
  } else {
    h = document.frames(e.currentTarget.id).document.body.scrollHeight;
    document.all.blockrandom.style.height = h + 20 + 'px';
  }
}

