function logon(){
	var tecla
	tecla = event.keyCode
	if (tecla == 13) {
		enviar()
	}
}

function enviar()
{
     if (navigator.appName == "Netscape")
       document.mainform.submit();
     else
       document.forms["mainform"].submit();       
}
 
function MM_Go_Url(targ,url)
{ 
  eval(targ+".location='"+url+"'");
}

function MM_jumpMenu(targ,selObj,restore)
{ 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openWindow(url,name,width,height,position) { 
	var x
	
	if(position) {
		array = position.split(",")
		for(x=0; x<=array.length; x++) {
			if(url.selectedIndex!=0 && array[x]==url.selectedIndex) {
				eval("location='"+url.options[array[x]].value+"'")
				x = 100
			}
		}
		if(x!=101) {
			if(url.selectedIndex!=0) {
				window.open(url.options[url.selectedIndex].value, name,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height)
			}	
		}
	}
	else { 
		if(url.selectedIndex!=0) {
			window.open(url.options[url.selectedIndex].value, name,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height)
		}	
	}
}	

function openWindow(url,name,width,height) {
  window.open(url, name,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height)
}

function valida_submit_forum(){
var 	name	=	document.mainform.name.value;
var 	email	=	document.mainform.email.value;
var 	subject	=	document.mainform.subject.value;
var 	message	=	document.mainform.message.value;


// Valida email
if (email==""){
alert("O campo E-MAIL deve ser preenchido!")
document.mainform.email.focus()
return false

        }


// Valida subject

if (subject==""){
alert("O campo ASSUNTO deve ser preenchido!")
document.mainform.subject.focus()
return false
        }

// Valida message

if(message==""){
alert("O campo MENSAGEM deve ser preenchido!")
document.mainform.message.focus();
return false
        }

//alert(message.length);
if(message.length >= 255){
	alert("Por favor, reduza o conteúdo de sua mensagem pois passou o limite de tamanho.");
	alert("Tamanho máximo : 255\nTamanho atual : " + message.length);
	document.mainform.message.focus();
	return false;
}
        
if(email!=""){
	if (email.indexOf('@', 0) == -1 || email.indexOf('.', 0) == -1){ 
		alert("Endereço de e-mail inválido!");
		document.mainform.email.focus()
		return false
	}
                }
        
return true;
}

