function popup(href,width,height,target){
      window.open(href, target, config='width='+width+',height='+height+',toolbar=0,resizable=1,menubar=0,status=0');
   }

function goThere(){
	var list = document.forms[0].urlList;
	location = list.options[list.selectedIndex].value;
}

//banners block start
//var current = Math.floor(Math.random()*3+1);
var current = 3;
//var current = 1;
var previous;
var last;
current == 1 ? previous = 3 : previous = current-1;
var idTimer;
var id;



function again(){
   idTimer=setTimeout('rotate()',1000);
}

function rotate(){
   current++; 
   if(current>3) current=1;
   document.getElementById('banner'+previous).style.display='none';
   document.getElementById('banner'+current).style.display='block';   
   previous=current; 
   idTimer = setTimeout('rotate()',5000);      
}

function freeze(id){    
   clearTimeout(idTimer);      
   //debug("freeze:"+id+"; hide: "+current+"; none: "+previous);   
   document.getElementById('banner'+current).style.display='none';
   //document.getElementById('banner'+current).style.zIndex=2;
   current=id;
   //alpha('banner'+id,0);
   document.getElementById('banner'+id).style.display='block';      
   //document.getElementById('banner'+id).style.zIndex=3;
   //fadeIn('banner'+id,0);   
   previous = id;   
}

function alpha(id, value) {
   document.getElementById(id).style.opacity = value/100; //Opera & FF
   document.getElementById(id).style.filter = 'alpha(opacity=' + value*1 + ')'; // IE
}

function fadeIn(id,aIn){
   if(aIn<=100){
      aIn+=10;
      alpha(id, aIn);
	  setTimeout('fadeIn(\''+id+'\','+aIn+')',10);
   }
}

function fadeOut(id){
   this.id = id;
   if(a>=50){
      alpha(this.id, a);
	  a-=1+100;
	  setTimeout('fadeIn(id)',10);
   }
}

function debug(msg){   
   document.getElementById('debug').innerHTML="Debug("+new Date().getSeconds()+"): "+msg+" ";
}
//banners block end
