<!--
function open_window(nota) 
{
  window.open(nota,'Informativo',"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=700,height=500");
}
NS4 = (document.layers);
  IE4 = (document.all);
  ver4 = (NS4 || IE4);
  isMac = (navigator.appVersion.indexOf("Mac") != -1);
  isMenu = (NS4 || (IE4 && !isMac));
  function popUp(){return};
  function popDown(){return};
  function startIt(){return};
  if (!ver4) event = null;

  if (isMenu) 
  {
	menuVersion = 3;
	menuWidth = 150;
	borWid = 1;
	borSty = "";
	borCol = "#ffffff";
	separator = 1;
	separatorCol = "#ffffff";
	fntFam = "Verdana";
	fntBold = false;
	fntItal = false;
	fntSiz = 8;
	fntCol = "#ffffff";
	overFnt = "#000000";
	itemPad = 4;
	backCol = "#990000";
	overCol = "#C14949";
	imgSrc = "tri.gif";
	imgSiz = 10;
	
	childOffset = 6;
	childOverlap = 60;
	perCentOver = null;
	
	clickStart = false;
	clickKill = false;
	secondsVisible = 0.5;
	
	keepHilite = false;
	NSfontOver = false;
	
	isFrames = false;
	navFrLoc = "top";
	mainFrName = "main";
  }
	

function FormataData(Campo,teclapres) {
	var tecla = teclapres.keyCode;
	vr = document.form[Campo].value;
	vr = vr.replace( ".", "" );
	vr = vr.replace( "/", "" );
	vr = vr.replace( "/", "" );
	tam = vr.length + 1;

	if ( tecla != 9 && tecla != 8 ){
		if ( tam > 2 && tam < 5 )
			document.form[Campo].value = vr.substr( 0, tam - 2  ) + '/' + vr.substr( tam - 2, tam );
		if ( tam >= 5 && tam <= 10 )
			document.form[Campo].value = vr.substr( 0, 2 ) + '/' + vr.substr( 2, 2 ) + '/' + vr.substr( 4, 4 ); }
}

function FormataData2(Campo,teclapres) {
	var tecla = teclapres.keyCode;
	vr = document.form[Campo].value;
	vr = vr.replace( ".", "" );
	vr = vr.replace( "/", "" );
	vr = vr.replace( "/", "" );
	tam = vr.length + 1;

	if ( tecla != 9 && tecla != 8 ){
		if ( tam > 2 && tam < 5 )
			document.form[Campo].value = vr.substr( 0, tam - 2  ) + '/' + vr.substr( tam - 2, tam );
		if ( tam >= 5 && tam <= 10 )
			document.form[Campo].value = vr.substr( 0, 2 ) + '/' + vr.substr( 2, 2 ) + '/' + vr.substr( 4, 4 ); }
}

function mOvr(src,clrOver)
{
  if (!src.contains(event.fromElement)) {
	  src.bgColor = clrOver;
  }
}
function mOut(src,clrIn)
{
  if (!src.contains(event.toElement)) {
	  src.bgColor = clrIn;
  }
}

function FormataString(Campo) 
{	
 texto = document.form[Campo].value;
 textoFinal ="";
 tamanhoParteTexto = 0;
 tamanhoTexto = 0;
 textoSemBranco=""
 i = 0;
 posicaoEspaco = 0;
 parteTexto  = "";
 parte1 = "";
 parte2 = "";
 var y;
 var x;
 var ch;

 tam = texto.length;
 for (var i=0; i < tam; i++)
 {	
  var ch =  texto.substring(i, i+1);  
  if (  ch == " " )
  {
 	ch2 = texto.substring (i+1 , i+2);
    if (  ch2 != " " )
    {
      textoSemBranco = textoSemBranco + ch;
    }
  }
  else
  {
    textoSemBranco = textoSemBranco + ch;
  }
 }
 texto = textoSemBranco;
 tamanhoTexto = texto.length ; 
 texto = texto.toLowerCase() + " ";
 i = 0;
 while ( i < tamanhoTexto  )
 {
   posicaoEspaco = texto.indexOf(" ");

   if ( posicaoEspaco == 0 )
   {
     parteTexto  = texto.substring( 0 );
   }
   else
   {
     parteTexto  = texto.substring( 0 , posicaoEspaco + 1 );
   }

   tamanhoParteTexto = parteTexto.length;
   textoSemBranco="";
   for ( x =0 ;  x <  parteTexto.length; x++)
   {
     ch =  parteTexto.substring (x, x + 1);
     if ( ch != " " )
	textoSemBranco = textoSemBranco + ch;  
   }  
   parteTexto = textoSemBranco;
  
   if ( parteTexto == "de" || parteTexto == "da" || parteTexto == "do" || parteTexto  == "das" || parteTexto == "dos" || parteTexto == "e" )
   {
     parteTexto = parteTexto.toLowerCase();
   }
   else
   {
     parte1 = ( parteTexto.substring(0,1)).toUpperCase();
     parte2 = parteTexto.substring(1);
     parteTexto = parte1 + parte2;
   }

   textoFinal = textoFinal + parteTexto + " ";
   i = i + tamanhoParteTexto;   
   texto = texto.substring( posicaoEspaco ) ;
 
   cond = false;	
 
   for ( y =0; !cond ; y++)
   {
    ch = texto.substring (y, y + 1);
    if ( ch != " " )
    {
      cond = true;
    }
   }  
   texto = texto.substring( y - 1 );
   posicaoEspaco = 0;
   parteTexto = "";
   tamanhoParteTexto = 0;
 } 
 document.form[Campo].value = textoFinal; 
}

function FormataUpperCase(Campo) 
{
  texto = document.form[Campo].value;
  texto = texto.toUpperCase();  
 document.form[Campo].value = texto; 
}

function FormataLowerCase(Campo) 
{
  texto = document.form[Campo].value;
  texto= texto.toLowerCase();  
 document.form[Campo].value = texto; 
}

function Retorna (Url)
{
 location.href=Url;
} 

function makeArray()
{
   this.length = makeArray.arguments.length
   for (var i = 0; i < this.length; i++)
   this[i + 1] = makeArray.arguments[i]
}

function randNum (num)
{
   var now = new Date();
   var rand = Math.round(num * Math.cos(now.getTime()));
   if (rand < 0) rand = - rand; if (rand == 0) rand++;
   return rand;
}

function ValidarWebMail (theForm)
{
  if (theForm.imapuser.value == "")
  {
	alert("Campo \"usuário\" deve ser preenchido.");
	theForm.imapuser.focus();
	return (false);
  }
  else
  {
  	var comp = theForm.imapuser.value;
  	if ( comp.indexOf(".mp.se") < 1 )
  	{ 
	  theForm.imapuser.value = theForm.imapuser.value + ".mp.se"
  	}	
  }
  
	  
  if (theForm.pass.value == "")
  {
	alert("Campo \"senha\" deve ser preenchido.");
	theForm.pass.focus();
	return (false);
  } 
  
  var comp = theForm.imapuser.value;
  if ( comp.indexOf(".mp.se") < 1 )
  { 
	  theForm.imapuser.value = theForm.imapuser.value + ".mp.se"
  }		
  
  return (true);
}

function completarWebMail (theForm)
{  
  var comp = implogin.imapuser.value;
  if ( comp.indexOf(".mp.se") < 1 )
  { 
	  implogin.imapuser.value = implogin.imapuser.value + ".mp.se"
  }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function close_window() {
    window.close();
}

function Imprimir(nota) 
{ 
var link = "ImprimirNoticia.asp?ident=" + nota;
window.open(link,'Imprimir','top=0,left=5000'); 
}

function ImprimirGeral(link) 
{ 
window.open(link,'Imprimir','top=0,left=5000'); 
}

var novaJanela;
function openWindow(nota) 
{
 novaJanela = window.open(nota,'tela2', "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,top=30, width=520,height=400");
}
function closeWindow(nota) 
{
 if ( novaJanela )
 {
  novaJanela.close();
  novaJanela = null;
 } 
}

function Redirecionar(url) 
{ 
//var link = "Redirecionar.asp?ident=" + id;
window.open(url,'Redirecionar','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=n,copyhistory=no,top=30, width=400,height=270"'); 
}
//-->
