//form google
function f_buscaGoogle(busca){
	var pagGoogle='http://www.google.com.br/search?hl=pt-BR&q='+busca+'&meta=';
	window.open(pagGoogle);
}

//form email
function f_loginMail(){
		with(document.login){
				if (username.value == ""){
					alert("Você deve preencher o campo E-mail!");
					username.focus();
					return false;
				} else {
						if (username.value.indexOf('@')>0 || username.value.indexOf('tca.com.br')>0){
							alert('Digite somente seu nome de USUÁRIO!\n\nExemplo: Seu e-mail é joaosilva@tca.com.br - Digite somente joaosilva.');
							username.value = '';
							password.value = '';
							username.focus();
							return false;
						} else {
								if (password.value == ""){
									alert('Você deve preencher o campo Senha!');
									password.focus();
									return false;
								} else {
									return true;
								}
						}
				}
		}
}

function hideshow(t, id) { 
var tags = document.getElementsByTagName(t);
for (var i = 0; i < tags.length; i++) {   
if (tags[i].id == id) {
    if(tags[i].style.display==''||tags[i].style.display=='block') {
    tags[i].style.display = 'none';
    }
    else
    {
    tags[i].style.display='block';  
    }
}
}
}

//**************** EFEITO QUANDO PASSA O MOUSE EM CIMA DE ALGO "HOVER" ****************************
function rollOver (elemento) {
	elemento.style.backgroundColor='#e0e0e0';
}

function rollOut (elemento) {
	elemento.style.backgroundColor='';
}

// Abre janela Grande -> Gata 
function gata(pagina){
	window.open(pagina,'Gata','fullscreen,channelmode')
}

//funcao classificados
function classificados() { 
  window.open('http://www.tca.com.br/classificados/anuncio/index.php','Classificados','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,left=200,top=200,width=340,height=340')
}
function resizepage(){
	centralizado = (document.body.offsetWidth-580)/2;
	if (centralizado < 0) { centralizado = 0; }
	if (navigator.appName.indexOf("Microsoft") != -1)
	document.getElementById('janelabusca').style.left = centralizado;
	else
	document.getElementById('janelabusca').style.marginLeft = centralizado;
}
//funcao previsao do tempo
function tempo(){
	var pagTempo='http://www.paranhana.com.br/tempo/tempopagina.html';
	window.open(pagTempo,'previsaotempo','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=200,top=200,width=120,height=200');
}

//funcao previsao do tempo
function adsl_off(){
	window.open('manutencao/conexao.html','ADSL','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=200,top=200,width=320,height=380');
}

var buscanosite=0;
function busca(){
	if (buscanosite == 0)
		{
		document.getElementById('janelabusca').style.visibility = "visible";
		document.getElementById('campodabusca').focus();
		buscanosite=1;
		}
	else
		{
		document.getElementById('janelabusca').style.visibility = "hidden";
		buscanosite=0;
		}
}
	function PopupPic(sPicURL)
	{ 
		window.open("popImage.php?"+sPicURL, "", "resizable=0,HEIGHT=50,WIDTH=50,left=100,top=100");
	}
	
	
function limpa(){
	document.PesquisaDominio.domain.value="";
}

function f_ouvidoria(){
		with(document.ouvidoria){
				if (usermail.value == ""){
					alert("Você deve preencher seu NOME!");
					usermail.focus();
					return false;
				} else {
					if (username.value == ""){
						alert("Você deve preencher seu E-MAIL!");
						username.focus();
						return false;
					} else {
						if (userfone.value == ""){
							alert("Você deve preencher seu TELEFONE!");
							userfone.focus();
							return false;
						} else {
							if (coment.value == ""){
								alert("Você deve preencher seu COMENTÁRIO!");
								coment.focus();
								return false;
							} else {
								var ok=false;
								for(i=0; i < sendto.length; i++){
									if (sendto[i].checked){
										ok=true;
									}
								}
								if (!ok){
									alert("Você deve selecionar um DESTINATÁRIO!");
									return false;
								} else {
									return true;
								}
							}
						}
					}
				}
		}
}

