// JavaScript Document

window.defaultStatus="USIPEL";


function redim(iframe)
{
	if(navigator.appName=="Microsoft Internet Explorer")
		var altura = parseInt(document.body.scrollHeight);
	else
		var altura = parseInt(document.body.offsetHeight);

	//alert(altura);
	parent.document.getElementById(iframe).style.height = altura;
}

function AbreDiv(obj){	
	var div;
	div = obj;
	
	if (document.getElementById(div).style.display == "none"){
		document.getElementById(div).style.display = "block";
		}
	else{
		document.getElementById(div).style.display = "none";
    	}		
}

function ValidaFaleConosco(){

	var f = document.forms['FaleConosco'];
		
	if (f.nome.value == ''){
		alert('Preencha seu nome');
		f.nome.focus();
		return;
	}
	if (f.email.value == ''){
		alert('Preencha um email para contato');
		f.email.focus();
		return;
	}
	else
	{
		if (f.email.value.indexOf ('@',0) == -1)
		{
			alert (" Atenção! Seu e-mail não foi digitado corretamente. Digite-o novamente ");
			f.email.focus();
			return;
		}
		
		if (f.email.value.indexOf ('.',0) == -1)
		{
	     	alert (" Atenção! Seu e-mail não foi digitado corretamante. Digite-o novamente");
			f.email.focus();
			return;
		}
	
		if (f.email.length < 6)
		{
			alert (" Atenção! Seu e-mail não foi digitado corretamante. Digite-o novamente");
			f.email.focus();
			return;
		}
	}
	
	if (f.mensagem.value == ''){
		alert('Preencha sua mensagem');
		f.mensagem.focus();
		return;
	}	
	
	f.action = "funcs/faleConosco.asp"
	f.submit();

}

function AbreMidia(foto)
{
	window.open('http://www.usipel.ind.br/images/fotos/'+ foto,'midia','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=500')	
}