window.defaultStatus="Faculdade Interativa COC";

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 Conta(formulario){
	var form = document.forms[formulario];
	total = form.mensagem.value.length;
	form.mensagem.focus();
	if(total <= 3000){
		form.total.value = 'Máximo de 3000 caracteres. '+ total +' caracteres já digitados'
	}
	else{
		form.total.value = 'Máximo de 3000 caracteres. 3000 caracteres já digitados'
		form.mensagem.value = form.msg.value.substring(0,3000);
		alert('Excedido o número máximo de caracteres.');
		return;
	}
}



function ValidaFaleConoscoRelacionamento() {
    var form = document.forms['faleConosco']

    if (form.assunto.value == 0) {
        alert('Preencha corretamente o campo assunto.');
        form.assunto.focus();
        return;
    }

    if (form.nome.value == '' || form.nome.value.length < 5) {
        alert('Preencha corretamente o campo nome.');
        form.nome.focus();
        return;
    }
    if (form.email.value == '' || form.email.value.indexOf(".") < 2 || form.email.value.indexOf("@") < 2) {
        alert('Preencha corretamente o campo e-mail.');
        form.email.focus();
        return;
    }
    if (form.assunto.value == '') {
        alert('Preencha corretamente o campo assunto.');
        form.assunto.focus();
        return;
    }
    if (form.mensagem.value == '') {
        alert('Preencha corretamente o campo mensagem.');
        form.mensagem.focus();
        return;
    }


    form.action = 'funcs/enviar.asp';
    form.submit();

}


function numero(event)
{

	var ValidChar = "#0;#9;#8;#48;#49;#50;#51;#52;#53;#54;#55;#56;#57;";
	
	if(navigator.appName.indexOf("Netscape")!= -1)
		tecla = event.which; 
	else
		tecla = event.keyCode;
		
	if (ValidChar.indexOf("#" + String(tecla + ";")) == -1)
		return false;
	else	
		return true;
	
}


function ValidaNews(valor) {
    var form = document.forms['news']

    var str = valor;
    
    if (form.nome.value == '') {
        alert('Preencha corretamente o campo nome.');
        form.nome.focus();
        return;
    }

    if (form.email.value == '' || form.email.value.indexOf(".") < 2 || form.email.value.indexOf("@") < 2) {
        alert('Preencha corretamente o campo e-mail.');
        form.email.focus();
        return;
    }
    form.action = 'funcs/news.asp?pg=' + str;
    form.submit();

}



function ExcluiNews(valor) {
    var form = document.forms['news']

    var str = valor;

    if (form.email2.value == '' || form.email2.value.indexOf(".") < 2 || form.email2.value.indexOf("@") < 2) {
        alert('Preencha corretamente o campo e-mail.');
        form.email2.focus();
        return;
    }

    form.action = 'funcs/news_excluir.asp?pg='+ str;
    form.submit();

}


