var LoteriaGlobalDivName, LoteriaGlobalDivName2, LoteriaGlobalDivName3;

function DivsRefresh(DivName,DivName2,DivName3,Second4Price,OnPressButton, ButtonPress)
{
	if(Second4Price)
	{
	 //alert("Faltan "+ Second4Price +" para el proximo juego");
	 setTimeout('DivsRefresh("'+DivName+'","'+DivName2+'","'+DivName3+'",0)',Second4Price);
	}
	else
	{
		if(DivName)
		{
			Url = "/index.php?Ajax=1&Type=QUIN";
//alert("Div1 "+DivName+" con "+Url);
			RefreshAjaxDiv(DivName,Url);
			//alert("Quiniela");
		}
		if(DivName3)
		{
			Url3 = "/index.php?Ajax=1&Type=LOTE";
//alert("Div3 "+DivName3+" con "+Url3);
			RefreshAjaxDiv(DivName3,Url3);
			//alert("Loteria");
		}
		if(DivName2)
		{
			Url2 = "/index.php?Ajax=1&Type=TOMB";
//alert("Div2 "+DivName2+" con "+Url2);
			setTimeout('RefreshAjaxDiv("'+DivName2+'","'+Url2+'")',2000);
		}
		
		if(!OnPressButton && !ButtonPress)
			setTimeout('DivsRefresh("'+DivName+'","'+DivName2+'","'+DivName3+'")',30000);
	}
}

/*function SetVideo(DivName,Second4Price)
{
	Url = "/index.php?ShowVideo=1";
	setTimeout('RefreshAjaxDiv("'+DivName+'","'+Url+'")',Second4Price);
}

function setConexion(DivName,Hash)
{
	if(!Hash)
		Hash=0;
	Url = "/index.php?Conection=1&Hash="+Hash;
	//RefreshAjaxDiv(DivName,Url);
	setTimeout('setConexion("'+DivName+'","'+Hash+'")',10000);
}*/

function SetGlobalLayers(Layer1,Layer2,Layer3)
{
	//alert("Seteo LoteriaGlobalDivName:"+Layer1+", LoteriaGlobalDivName2:"+Layer2+", LoteriaGlobalDivName3:"+Layer3);
	LoteriaGlobalDivName = Layer1;
	LoteriaGlobalDivName2 = Layer2;
	LoteriaGlobalDivName3 = Layer3;
}

ie4 = (document.all)? true:false;
if(ie4==false)
	var ns4=true;

function SpaceBarPress(e)
{
	if (ns4) 
		Key = e.which; 
	else
		Key = event.keyCode; 
	
	if(Key==32)
	{
 		//alert('LoteriaGlobalDivName: '+LoteriaGlobalDivName+' - LoteriaGlobalDivName2: '+LoteriaGlobalDivName2+' - LoteriaGlobalDivName3: '+LoteriaGlobalDivName3);
		DivsRefresh(LoteriaGlobalDivName,LoteriaGlobalDivName2,LoteriaGlobalDivName3,0,1,1);
	}
}

document.onkeypress = SpaceBarPress;
if(ns4) 
	document.captureEvents(Event.KEYPRESS);