// JavaScript Document
<!--
function verificaEspacos(string) {
 
	var cont=0;
		for(var i=0;i<string.length;i++)
			if(string.substring(i,i+1)==" ") cont++;
		if(cont==string.length)	
			return false; 
		else
			return true;	
			
 }
 
function valida_campo()
{

  var com=document.form_coment.coment.value;
  if (com=="")
  {
    alert("Necessário inserir um comentário!");
    document.form_coment.coment.focus()
    return false
  }else{
		var aprova=verificaEspacos(form_coment.coment.value);
		if(!aprova) 
			{
				alert("Não digite apenas espaços em branco no campo!");
				document.form_coment.coment.focus()
				return false;
			}
	  }
  
}
function counterUpdate() 
{
  field = document.getElementById("coment");
  txt_field = document.getElementById("Contador");
  txt_field.innerHTML = field.value.length;
  if(field.value.length >= 320)
  {
  	field.value = field.value.substring(0, 320);
  }

}
function Security(val, tamanho) 
{
 	
	document.getElementById('mensagem').innerHTML = "";
 	document.getElementById('d_baixa').style.background = 'white';
 	document.getElementById('d_media').style.background = 'white';
 	document.getElementById('d_alta').style.background = 'white';
 
	if( val.length >= tamanho && val.search(/[a-z]/) != -1 && val.search(/[A-Z]/) != -1 && val.search(/[0-9]/) != -1 
		||val.length >= tamanho && val.search(/[a-z]/) != -1 && val.search(/[A-Z]/) != -1 && val.search(/[@!#$%&*+=?|-]/) 
		||val.length >= tamanho && val.search(/[a-z]/) != -1 && val.search(/[@!#$%&*+=?|-]/) != -1 && val.search(/[0-9]/) 
		||val.length >= tamanho  && val.search(/[@!#$%&*+=?|-]/) != -1 && val.search(/[A-Z]/) != -1 && val.search(/[0-9]/) )
		{
				document.getElementById('mensagem').innerHTML = "Forte";
  			document.getElementById('d_baixa').style.background = 'green';
 				document.getElementById('d_media').style.background = 'green';
 				document.getElementById('d_alta').style.background = 'green';
  		
  	} 
  	else{
  		if( val.length >= tamanho && val.search(/[a-z]/) != -1 && val.search(/[A-Z]/) != -1 
  			||val.length >= tamanho && val.search(/[a-z]/) != -1 && val.search(/[0-9]/) != -1 
  			||val.length >= tamanho && val.search(/[a-z]/) != -1 && val.search(/[@!#$%&*+=?|-]/) != -1
				||val.length >= tamanho && val.search(/[A-Z]/) != -1 && val.search(/[0-9]/) != -1
				||val.length >= tamanho && val.search(/[A-Z]/) != -1 && val.search(/[@!#$%&*+=?|-]/) != -1
				||val.length >= tamanho && val.search(/[0-9]/) != -1 && val.search(/[@!#$%&*+=?|-]/) != -1){

				document.getElementById('mensagem').innerHTML = "Media";
 				document.getElementById('d_baixa').style.background = 'yellow';
 				document.getElementById('d_media').style.background = 'yellow';
 				document.getElementById('d_alta').style.background = 'white';
  				
  			} 
  			else {
  				if(val.length >= tamanho)
  				{
	  				document.getElementById('mensagem').innerHTML = "Fraca";
  					document.getElementById('d_baixa').style.background = 'red';
 						document.getElementById('d_media').style.background = 'white';
 						document.getElementById('d_alta').style.background = 'white';
  					
  				}
  		}
  	}
}
function Esvazia(valor_campo){
   
if (valor_campo.value == valor_campo.defaultValue)
	valor_campo.value='';
}

function Padrao(valor_campo){

if (valor_campo.value == '')
	valor_campo.value=valor_campo.defaultValue;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

var quantidade_de_menus="5";
var xd="";
var xy="";
function disableRightClick(e)
{
if(!document.rightClickDisabled){
if(document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = disableRightClick;
}
else document.oncontextmenu = disableRightClick;
return document.rightClickDisabled = true;
}
if(document.layers || (document.getElementById && !document.all)){
if (e.which==2||e.which==3){

return false;
}
}
else
{
xd=event.clientY-10;
xy=event.clientX-10;
menu.style.top=xd;
menu.style.left=xy;
add();
return false;
}
}
disableRightClick();

var quem="ba";
var x=0;
var ul=0;
var x1=0;
var ul1=0;
function add(){
if(x>=quantidade_de_menus+2){
x=quantidade_de_menus+2;
}
else
x+=1;
if(x<=quantidade_de_menus-1){on();}
if(ul==0){x1=0;ul1=0;if(x==quantidade_de_menus){on();}}
}
function rev()
{
	if(x1>=quantidade_de_menus+2)
	{
		x1=quantidade_de_menus+2;
	}
	else
	x1+=1;
	if(x1<=quantidade_de_menus-1)
	{of();}
	
	if(ul1==0)
	{
	ul=0;x=0;
	if(x1==quantidade_de_menus)
	{
		of();menu.style.top="-654654654";}
	}
}

function on(){
setTimeout(""+quem+""+x+".style.filter='alpha(opacity:0)',add()",10);
setTimeout(""+quem+""+x+".style.filter='alpha(opacity:10)'",20);
setTimeout(""+quem+""+x+".style.filter='alpha(opacity:20)'",30);
setTimeout(""+quem+""+x+".style.filter='alpha(opacity:30)'",40);
setTimeout(""+quem+""+x+".style.filter='alpha(opacity:40)'",50);
setTimeout(""+quem+""+x+".style.filter='alpha(opacity:50)'",60);
setTimeout(""+quem+""+x+".style.filter='alpha(opacity:60)'",70);
setTimeout(""+quem+""+x+".style.filter='alpha(opacity:70)'",80);
setTimeout(""+quem+""+x+".style.filter='alpha(opacity:80)'",90);
setTimeout(""+quem+""+x+".style.filter='alpha(opacity:90)'",100);
setTimeout(""+quem+""+x+".style.filter='alpha(opacity:100)'",110);
}
function of(){
setTimeout(""+quem+""+x1+".style.filter='alpha(opacity:100)',rev()",10);
setTimeout(""+quem+""+x1+".style.filter='alpha(opacity:90)'",20);
setTimeout(""+quem+""+x1+".style.filter='alpha(opacity:80)'",30);
setTimeout(""+quem+""+x1+".style.filter='alpha(opacity:70)'",40);
setTimeout(""+quem+""+x1+".style.filter='alpha(opacity:60)'",50);
setTimeout(""+quem+""+x1+".style.filter='alpha(opacity:50)'",60);
setTimeout(""+quem+""+x1+".style.filter='alpha(opacity:40)'",70);
setTimeout(""+quem+""+x1+".style.filter='alpha(opacity:30)'",80);
setTimeout(""+quem+""+x1+".style.filter='alpha(opacity:20)'",90);
setTimeout(""+quem+""+x1+".style.filter='alpha(opacity:10)'",100);
setTimeout(""+quem+""+x1+".style.filter='alpha(opacity:0)'",110);
}

//-->