// JavaScript Document
function popup(url,janela,larg,alt,scroll,resize){
 if (!scroll) { scroll='auto' }
 if (!resize) { resize='no' }
 window.open(url,janela,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable="+resize+",width="+larg+",height="+alt);
 return false;
}

function isEmail(s) {
  var wReturn = true;
  var sLength = s.length;
  var denied_chars = new Array(" ", "\n", "\t", "\r", "%", "$", "#", "!", "~", "`", "^", "&", "*", "(", ")", "=", "+", "{", "}", "[", "]", ",", ";", ":", "'", "\"", "?", "<", ">", "/", "\\", "|");
  // Procura @
  if (s.indexOf("@") == -1) wReturn=false;
  // Procura mais de uma @
  if (s.indexOf("@") != s.lastIndexOf("@")) wReturn=false;
  // Procura caracteres impróprios
  for (var z = 0; z < denied_chars.length; z++) {
    if (s.indexOf(denied_chars[z]) != -1) wReturn=false;
  }
  // Procura .
  if (s.indexOf(".") == -1) wReturn=false;
  // Procura ..
  if (s.indexOf("..") != -1) wReturn=false;
  // Último caracter não pode ser .
  if ((s.charAt(sLength-1) == ".") || (s.charAt(sLength-1) == "_")) wReturn=false;
  if (wReturn==false) window.alert("Email inválido!!! Verifique se não digitou nenhum caracter inválido.");
  return wReturn;
}

function GetObject(objName) {
	var elem;
	if( document.getElementById ) // this is the way the standards work
		elem = document.getElementById( areas[i] );
	else if( document.all ) // this is the way old msie versions work
		elem = document.all[areas[i]];
	else if( document.layers ) // this is the way nn4 works
		elem = document.layers[areas[i]];
	return elem;
}