
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function redimensionar()
{
var largura=opener.screen.width;
var altura=opener.screen.height;

    if (navigator.appName == 'Netscape') {
         adjWidth = document.images[1].width;
         adjHeight = document.images[1].height;
    }
     else {

         adjWidth = document.images[1].width;
         adjHeight = document.images[1].height;
     }

  if(adjHeight>altura-20)
  {
  adjHeight=altura-50;
  }

	//self.moveTo(0,0);
    self.resizeTo(adjWidth + 5, adjHeight + 165 + 5);

     return
}
<!--
// dynamic drive =]



function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}



function validar_busca() {
	var a = document.formBusca;
	
	if(a.busca.value == "") {
		alert('Por favor, preencha o campo busca com uma palavra-chave.');
		a.busca.focus();
		return(true);
	} else {
		a.submit();
	}
}

function cadastro() {
  a = document.form1;
  err = '';
	if (a.nome.value.length < 1){ 
		err+='\n- Digite seu nome.';
		erro=true;
	}
    texto = a.email.value;
	if (texto.length < 1) 
	 { 
		err+='\n- Digite seu e-mail.';
		erro=true;
 	 }
	else
	 { 
		//Validando o e-mail
		var str = texto; // email string
		var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
		var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
		if (!reg1.test(str) && reg2.test(str)) // if syntax is valid
		 {  texto=''  }
		else
		 { 
	 		err+='\n- O seu endereço de e-mail é inválido.';
			erro=true; 
		 }
	 }
	 if (a.tel.value.length < 1 || a.ddd.value.length < 1){ 
		err+='\n- Digite o telefone.';
		erro=true;
	}
	if (a.cidade.value.length < 1){ 
		err+='\n- Digite sua cidade.';
		erro=true;
	}
	if (a.profissao.value.length < 1){ 
		err+='\n- Digite sua profissão.';
		erro=true;
	}
	if (a.empresa.value.length < 1){ 
		err+='\n- Digite a empresa.';
		erro=true;
	}

	  if (err.length > 0) {
		  alert('Por Favor, verifique os seguintes erros: '+err);
	  } else {
		  a.submit();
	  } 
}


function muda_frame ( nid ) {
	var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1];
	var FFextraHeight=getFFVersion>=0.1? 16 : 0; //extra height in px to add to iframe in FireFox 1.0+ browsers
	var currentfr=document.getElementById(nid);
	if (currentfr && !window.opera) {
		currentfr.style.display="block";
	}
	if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) { //ns6 syntax
		currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
	} else if (currentfr.Document && currentfr.Document.body.scrollHeight) { //ie5+ syntax
		currentfr.height = currentfr.Document.body.scrollHeight;
	}
}


function validar_comentario() {
  a = document.form1;
  err = '';
	if (a.nome.value == ''){ 
		err+='\n- Digite seu nome.';
		erro=true;
	}
    texto = a.email.value;
	if (texto.length < 1) 
	 { 
		err+='\n- Digite seu e-mail.';
		erro=true;
 	 }
	else
	 { 
		//Validando o e-mail
		var str = texto; // email string
		var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
		var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
		if (!reg1.test(str) && reg2.test(str)) // if syntax is valid
		 {  texto=''  }
		else
		 { 
	 		err+='\n- O seu endereço de e-mail é inválido.';
			erro=true; 
		 }
	 }
	if (a.comentario.value.length < 1){ 
		err+='\n- Digite seu comentário.';
		erro=true;
	}

	  if (err.length > 0) {
		  alert('Por Favor, verifique os seguintes erros: '+err);
	  } else {
		  a.submit();
	  } 
}

function validar_contato() {
  a = document.form1;
  err = '';
	if (a.nome.value == ''){ 
		err+='\n- Digite seu nome.';
		erro=true;
	}
    texto = a.email.value;
	if (texto.length < 1) 
	 { 
		err+='\n- Digite seu e-mail.';
		erro=true;
 	 }
	else
	 { 
		//Validando o e-mail
		var str = texto; // email string
		var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
		var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
		if (!reg1.test(str) && reg2.test(str)) // if syntax is valid
		 {  texto=''  }
		else
		 { 
	 		err+='\n- O seu endereço de e-mail é inválido.';
			erro=true; 
		 }
	 }
	 if (a.assunto.value == ''){ 
		err+='\n- Digite o assunto.';
		erro=true;
	}
	if (a.mensagem.value.length < 1){ 
		err+='\n- Digite sua mensagem.';
		erro=true;
	}

	  if (err.length > 0) {
		  alert('Por Favor, verifique os seguintes erros: '+err);
	  } else {
		  a.submit();
	  } 
}



//Trim(string) : Returns a copy of a string without leading or
//               trailing spaces
//=============================================================
function Trim(str)
/***
        PURPOSE: Remove trailing and leading blanks from our string.
        IN: str - the string we want to Trim

        RETVAL: A Trimmed string!
***/
{
        return RTrim(LTrim(str));
}


function toInteger(checkString)
{
 var newString = "";    
 var count = 0;         
    for (i = 0; i < checkString.length; i++) {
        ch = checkString.substring(i, i+1);
        if (ch >= "0" && ch <= "9") 
        {
            newString += ch;
        }
        else
        {
         if (ch == "-") newString += ch;
         if (ch == ".") newString += ch;
         if (ch == "/") newString += ch;
        }
    }
    
    return newString; //checkString;
}


//function so_numero(pForm,pCampo,pTeclaPres)
//{
// var wTecla 
//  var nerro = true;
//    wTecla =  pTeclaPres.keyCode;
//	if ( wTecla == 8 || wTecla == 88 || wTecla >= 48 && wTecla <= 57 || wTecla >= 96 && wTecla <= 105)
//	{
//		pForm[pCampo].value = toInteger(pForm[pCampo].value);
//		nerro = true;
//	}
//	else
//	{
//		pForm[pCampo].value = toInteger(pForm[pCampo].value);
//		nerro = false;
//	}
// return nerro;	
//}


var keyCodigo = 0;

function soNumeroPress(evento){

	if (keyCodigo == 0){
	
		keyCodigo = evento.keyCode;
	
	}
	
	if ((keyCodigo == 8 || keyCodigo == 13 || keyCodigo == 9 || keyCodigo == 71 || keyCodigo == 46 || keyCodigo  == 37  || keyCodigo  == 39) || (keyCodigo >= 48 && keyCodigo <= 57) || (keyCodigo >= 96 && keyCodigo <= 105)) 
	{
		VerifiqueTAB=true; 

		return true;

	} else {

		return false;

	}


}


function soNumeroDown(evento){


	keyCodigo = evento.keyCode;

	if ((keyCodigo == 8 || keyCodigo == 13 || keyCodigo == 9 || keyCodigo == 46) || (keyCodigo >= 48 && keyCodigo <= 57) || (keyCodigo >= 96 && keyCodigo <= 105)){
		VerifiqueTAB=true; 

		return true;

	} else {

		return false;

	}

}




VerifiqueTAB=true;
function Mostra(quem, tammax) {
	if ( (quem.value.length == tammax) && (VerifiqueTAB) ) {
		var i=0,j=0, indice=-1;
		for (i=0; i<document.forms.length; i++) {
			for (j=0; j<document.forms[i].elements.length; j++) {
				if (document.forms[i].elements[j].name == quem.name) {
					indice=i;
					break;
				}
			}
			if (indice != -1)
		         break;
		}
		for (i=0; i<=document.forms[indice].elements.length; i++) {
			if (document.forms[indice].elements[i].name == quem.name) {
				while ( (document.forms[indice].elements[(i+1)].type == "hidden") &&
						(i < document.forms[indice].elements.length) ) {
							i++;
				}
				document.forms[indice].elements[(i+1)].focus();
				VerifiqueTAB=false;
				break;
			}
		}
	}
}

//<!-- -->

function PararTAB() 
{ 
   VerifiqueTAB=false; 
} 

//<!-- -->

function ChecarTAB(evento) 
{ 

   VerifiqueTAB=true; 
   		
   keyCodigo = evento.keyCode;

   if ((keyCodigo == 8 || keyCodigo == 13 || keyCodigo == 9 || keyCodigo == 71) || (keyCodigo >= 48 && keyCodigo <= 57) || (keyCodigo >= 96 && keyCodigo <= 105))
   {
	return true;
    } else 
	
    {
	return false;
	}

} 