function autoRefresh(uid){
   new PeriodicalExecuter(
     function(){
        new Ajax.Request(
           'IpListener.php?link_id='+uid,
          { method: 'get',
           onSuccess: function(response){
                 //set_stat(response.responseText);
                var re = /<table>/i 
                var html = $('last_ips').innerHTML.replace(re,'<table>'+response.responseText);
                $('last_ips').innerHTML = html;
                // $('last_ips_table').appendChild(response.responseText);
                 
               }}
        );
     }
     , 5
   );
}

function gebi(uid){
   return document.getElementById(uid);
}

function set_stat(ip_html){
	kk =gebi('last_ips').innerHTML;
	gebi('last_ips').innerHTML=ip_html+kk; 	
} 

function expand (link,browser,div_id,img_id,level,subv1){

	  if (gebi(div_id).style.display=='none'){	
	  gebi(img_id).src='themes/boom/images/dakecva.gif';
	  gebi(div_id).style.display='block';
	  gebi ('boom_loader').style.display = 'block';	
	  	
	  ajx = new Ajax.Updater (div_id,'browserSwitcher.php?browser='+browser+'&level='+level+'&link='+link+'&subv1='+subv1,{
  		
  			method: 'get', 
			frequency: 5, 
            decay: 0,
            evalScripts:  true,
            onSuccess: function(){
				gebi ('boom_loader').style.display = 'none';				
			}
        });	
       }else{
			gebi(div_id).style.display='none';
			gebi(img_id).src='themes/boom/images/gashla.gif';
		} 
}

function showhostinfo(host_id){
	gebi(host_id).style.display = 'block';
}
function hidehostinfo(host_id){
	gebi(host_id).style.display = 'none';
}
