function zera_noticia(){
	document.getElementById('noticia1').style.background = "url(imagens/fundo_noticia_azul.png)";
	document.getElementById('noticia2').style.background = "url(imagens/fundo_noticia_azul.png)";
	document.getElementById('noticia3').style.background = "url(imagens/fundo_noticia_azul.png)";
	document.getElementById('noticia4').style.background = "url(imagens/fundo_noticia_azul.png)";
	document.getElementById('noticia5').style.background = "url(imagens/fundo_noticia_azul.png)";
}

function seleciona_noticia(x){
	zera_noticia();	
	document.getElementById(x).style.background = "url(imagens/fundo_noticia_vermelho.png)";
	document.getElementById(x).style.cursor = "pointer";
}

function altera_foto(x){
	document.getElementById('foto_destaque').src = x
}

function valida_data(pVal)
{
	var reTipo =  /^((0[1-9]|[12]\d)\/(0[1-9]|1[0-2])|30\/(0[13-9]|1[0-2])|31\/(0[13578]|1[02]))\/\d{4}$/;
	return reTipo.test(pVal);
}

function valida_hora(pVal)
{
	var reTipo =  /^([0-1]\d|2[0-3]):[0-5]\d$/;
	return reTipo.test(pVal);
}

function valida_email(pVal)
{
	var reTipo =  /^[\w-]+(\.[\w-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
	return reTipo.test(pVal);
}

function mascara_hora(edit){
    if(edit.value.length==2){
        edit.value+=":";
    }
}

function mascara_palpite_jogo(edit){
    if(edit.value.length==1){
        edit.value+="x";
    }
}

function mascara_data_hora(evento, objeto){
	var keypress=(window.event)?event.keyCode:evento.which;
	campo = eval (objeto);
	if (campo.value == '00/00/0000 00:00')
	{
		campo.value=""
	}

	caracteres = '0123456789';
	separacao1 = '/';
	separacao2 = ' ';
	separacao3 = ':';
	conjunto1 = 2;
	conjunto2 = 5;
	conjunto3 = 10;
	conjunto4 = 13;
	conjunto5 = 16;
	if ((caracteres.search(String.fromCharCode (keypress))!=-1) && campo.value.length < (16))
	{
		if (campo.value.length == conjunto1 )
		campo.value = campo.value + separacao1;
		else if (campo.value.length == conjunto2)
		campo.value = campo.value + separacao1;
		else if (campo.value.length == conjunto3)
		campo.value = campo.value + separacao2;
		else if (campo.value.length == conjunto4)
		campo.value = campo.value + separacao3;
		else if (campo.value.length == conjunto5)
		campo.value = campo.value + separacao3;
	}
	else
		event.returnValue = false;
}


function ApenasNumeros(x){
    var tecla=(window.event)?event.keyCode:x.which;
    if((tecla>47 && tecla<58)) return true;
    else{
    	if (tecla==8 || tecla==0) return true;
	else  return false;
    }
}


