function ajaxInit() 
{
	 var req;
	 
	 try 
	 {
	  req = new ActiveXObject("Microsoft.XMLHTTP");
	 } 
	 catch(e) 
	 {
	  	try 
		{
	   		req = new ActiveXObject("Msxml2.XMLHTTP");
	  	} 
		catch(ex) 
		{
	   		try 
			{
				req = new XMLHttpRequest();
	   		} 
			catch(exc) 
			{
				alert("Esse browser não tem recursos para uso do Ajax");
				req = null;
	   		}
	  	}
	}
 	return req;
}

function Invalido(CAMPO)
{		
	var Cor = '#000000';
	var CorFundo = '#F5E9E0';
	var Borda ='1px solid #CC0000';
	var FonteSize = '11px';
	var FonteFamily = 'Tahoma';
	
	CAMPO.style.color = Cor;
	CAMPO.style.backgroundColor = CorFundo;
	CAMPO.style.border = Borda;	
	CAMPO.style.fontSize  = FonteSize;
	CAMPO.style.fontFamily = FonteFamily;	
	CAMPO.style.fontWeight = 'normal';
}

function Valido(CAMPO)
{		
	var Cor = '#000000';
	var CorFundo = '#FFFFFF';
	var Borda ='1px solid #CCCCCC';
	var FonteSize = '11px';
	var FonteFamily = 'Tahoma';
	
	CAMPO.style.color = Cor;
	CAMPO.style.backgroundColor = CorFundo;
	CAMPO.style.border = Borda;	
	CAMPO.style.fontSize  = FonteSize;
	CAMPO.style.fontFamily = FonteFamily;	
	CAMPO.style.fontWeight = 'normal';
	
	return true;		
}

function Invalido2(CAMPO)
{		
	var Cor = '#000000';
	var CorFundo = '#F5E9E0';
	var Borda ='1px solid #CC0000';
	var FonteSize = '9px';
	var FonteFamily = 'Tahoma';
	
	CAMPO.style.color = Cor;
	CAMPO.style.backgroundColor = CorFundo;
	CAMPO.style.border = Borda;	
	CAMPO.style.fontSize  = FonteSize;
	CAMPO.style.fontFamily = FonteFamily;	
	CAMPO.style.fontWeight = 'normal';
	CAMPO.style.width = "94%";
}

function Valido2(CAMPO)
{		
	var Cor = '#000000';
	var CorFundo = '#FFFFFF';
	var Borda ='1px solid #999999';
	var FonteSize = '9px';
	var FonteFamily = 'Tahoma';
	
	CAMPO.style.color = Cor;
	CAMPO.style.backgroundColor = CorFundo;
	CAMPO.style.border = Borda;	
	CAMPO.style.fontSize  = FonteSize;
	CAMPO.style.fontFamily = FonteFamily;	
	CAMPO.style.fontWeight = 'normal';
	CAMPO.style.width = "94%";
	
	return true;		
}

//VISUALIZAR JOGO
function VerBolao(LT, CO, BL)
{
	var width	= 520;	
	var height	= 500;
	
	var left = ((screen.width - width)/2);
	var top = ((screen.height - height)/2);
			
	var url 		= "VerBolao.php?Lt=" + LT + "&Co=" + CO + "&Bl=" + BL;
		
	var Janela = window.open(url, 'VisualizarBolao', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no, maximize=no');
	Janela.focus();	
}

function FechaDHtml()
	{
		document.getElementById("DHtmlSwf").style.display = "none";	
	}

function MostraDHtml()
{
	document.getElementById("DHtmlSwf").style.display = "block";	
}

function Instrucoes(LT)
{
	var width	= 500;	
	var height	= 500;
	
	var left = ((screen.width - width)/2);
	var top = ((screen.height - height)/2);
			
	var url 		= "instrucoes.php?Lt=" + LT;
		
	var Janela = window.open(url, 'Instrucoes', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no, maximize=no');
	Janela.focus();	
}

function Indicar()
{
	var width	= 400;	
	var height	= 300;
	
	var left = ((screen.width - width)/2);
	var top = ((screen.height - height)/2);
			
	var url 		= "popups/indicar.php";
		
	var Janela = window.open(url, 'VisualizarBolao', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no, maximize=no');
	Janela.focus();	
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function mouseX(evt) {if (!evt) evt = window.event; if (evt.pageX) return evt.pageX; else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft); else return 0;}

function mouseY(evt) {if (!evt) evt = window.event; if (evt.pageY) return evt.pageY; else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); else return 0;}

function InfoBolao(I, L, C, B)
{
	 ajax = ajaxInit();
	if(ajax) 
	{
		var dt = new Date();		
		ajax.open("GET", "http://www.sorte24horas.com.br/Info.php?L="+L+"&C="+C+"&B="+B+"&Rnd=" + encodeURI(Math.random() + "_" + dt.getTime()), true);
		ajax.onreadystatechange = function() 
		{
			if(ajax.readyState == 4) 
			{
				if(ajax.status == 200) 
				{
					var Status = ajax.responseText;
							
					document.getElementById("InfoBolao"+I).alt = Status;
					document.getElementById("InfoBolao"+I).title = Status;
				} 
				else 
				{
					document.getElementById("InfoBolao"+I).alt = "";
					document.getElementById("InfoBolao"+I).title = "";
				}
			}
		}
		
		ajax.send(null);
	}
}

function InfoBolaoOff()
{
    document.getElementById("info").innerHTML = "";
	document.getElementById("info").style.display = "none"
}

function AbrirBanking(URL)
{
	var width	= screen.width;	
	var height	= screen.height;
	
	var left = ((screen.width - width)/2);
	var top = ((screen.height - height)/2);
			
	var url 		= URL;
		
	var Janela = window.open(url, 'InternetBanking', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=yes, toolbar=yes, location=no, directories=no, menubar=no, resizable=no, fullscreen=no, maximize=no');
	Janela.focus();	
}

function AddFavorito()
{
    var url        = "http://www.sorte24horas.com.br";
    var title    	= "Sorte 24 Horas - Sua Sorte o Dia Todo";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}

MM_preloadImages('imagens/loading.gif');

