<!--
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


function setstatus(msgStr) { window.status = msgStr; }


function muda(elem_id) {
	if ( document.getElementById(elem_id).style.display != 'none' ) {
		document.getElementById(elem_id).style.display = 'none';
	} else {
		document.getElementById(elem_id).style.display = '';
	}
	
}

function esconde(elem_id) {
		document.getElementById(elem_id).style.display = 'none';
}


function mostra(elem_id) {
		document.getElementById(elem_id).style.display = '';
}


function validanews(str_email){
	if (str_email.value==""){
			alert('Deve indicar um email!');
			str_email.select();
			str_email.focus();
			return false;
	}
	
	invalidChars = " /;,:'!?#$%";
	if (str_email == ""){
		alert('Email inválido!');
		str_email.select();
		str_email.focus();

		return false;
	}

	for (var i=0; i< invalidChars.length; i++){
		badChar = invalidChars.charAt(i)
		if (str_email.value.indexOf(badChar,0) > -1){
			alert('Email inválido!\rContem caracteres inválidos!');
			str_email.select();
			str_email.focus();

			return false;
			}
	}

	atPos = str_email.value.indexOf("@",1)
	
	// there must be one "@" symbol
	if (atPos == -1){
		alert('Email inválido!\rTem de ter pelo menos um símbolo ARROBA - @ -');
		str_email.select();
		str_email.focus();
		return false;
	}
         
	if (str_email.value.indexOf("@", atPos+1) != -1){
		// and only one "@" symbol
		alert('Email inválido!\rSó pode ter um símbolo ARROBA - @ -');
		str_email.select();
		str_email.focus();

		return false;
	}
        
	periodPos = str_email.value.indexOf(".",atPos)
	
	if(periodPos == -1){
		// and at least one "." after the "@"
		alert('Email inválido!\rTem de ter pelo menos um PONTO depois do símbolo ARROBA - @ -');
		str_email.select();
		str_email.focus();

		return false;
	}

	if ( atPos +2 > periodPos){
		// and at least one character between "@" and "."
		alert('Email inválido!\rTem de ter pelo menos um caractere entre o ARROBA e o PONTO');
		str_email.select();
		str_email.focus();

		return false;
	}

	if ( periodPos +3 > str_email.length){
		str_email.select();
		str_email.focus();

		return false;
	}
	
	return true;

}
//-->
