function boxhome_on(id,id_img,src_img){
	document.getElementById(id).style.background='#FFF';
	document.getElementById(id_img).src=''+src_img+'';
}

function boxhome_off(id,id_img,src_img){
	document.getElementById(id).style.background='none';
	document.getElementById(id_img).src=''+src_img+'';
}

function noticia_on(id){
	document.getElementById(id).style.background='url(images/ico_bullet3_inst.gif) 4px 10px no-repeat #FFF';
}

function noticia_off(id){
	document.getElementById(id).style.background='url(images/ico_bullet2_inst.gif) 4px 10px no-repeat';
}

function verif()
{
	if (document.restrito.email.value == '' || document.restrito.email.value.indexOf("@")==-1 || document.restrito.email.value.indexOf(".")==-1)
	{
	alert('Campo EMAIL inválido!')
	}
	else
	document.restrito.submit();
}

function verif_eng()
{
	if (document.restrito.email.value == '' || document.restrito.email.value.indexOf("@")==-1 || document.restrito.email.value.indexOf(".")==-1)
	{
	alert('Field EMAIL incorrect!')
	}
	else
	document.restrito.submit();
}

// função que verifica as manifestações investor excessão até o momento IOCHPE
function verif_manifestacao()
{
	if (document.frm.assunto.value == '' || document.frm.assunto.value.indexOf("@")==-1 || document.frm.assunto.value.indexOf(".")==-1)
	{
	alert('Campo ASSUNTO inválido!')
	}
	else if (document.frm.comentario.value == '')	
	{
	alert('Campo Descrição não pode ser em branco!')	
	}
	else
	document.frm.submit();
}

function verif_manifestacao_eng()
{
	if (document.frm.assunto.value == '' || document.frm.assunto.value.indexOf("@")==-1 || document.frm.assunto.value.indexOf(".")==-1)
	{
	alert('Field ASSUNTO incorrect!')
	}
	else if (document.frm.comentario.value == '')	
	{
	alert('Field Message blank!')	
	}	
	else
	document.frm.submit();
}
 
function MostraMenu(obj){

	if(document.getElementById){
	var el = document.getElementById(obj);
		if(el.style.display != "block"){ //DynamicDrive.com change
			el.style.display = "block";			
		}else{
			el.style.display = "none";
			//MM_swapImgRestore()
		}
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function verif_email() {
    if (document.form1.nome.value == '') {
        alert('Campo Nome não pode ser em branco!')
    }    
    else if (document.form1.email.value == '' || document.form1.email.value.indexOf("@") == -1 || document.form1.email.value.indexOf(".") == -1) {
        alert('Campo E-mail inválido!')
    }
    else if (document.form1.tipo.value == 1) {
        alert('Escolha um Tipo!')
    }
    else if (document.form1.assunto.value == '') {
        alert('Campo Assunto não pode ser em branco!')
    }
    else if (document.form1.msg.value == '') {
        alert('Campo Texto não pode ser em branco!')
    }
    else
        document.form1.submit();
}

function verif_email_eng() {
    if (document.form1.nome.value == '') {
        alert('Field Name can note be blank!')
    }
    else if (document.form1.email.value == '' || document.form1.email.value.indexOf("@") == -1 || document.form1.email.value.indexOf(".") == -1) {
        alert('Field Email incorrect!')
    }
    else if (document.form1.tipo.value == 1) {
        alert('Choose a Type!')
    }
    else if (document.form1.assunto.value == '') {
        alert('Subject field can not be blank!')
    }
    else if (document.form1.msg.value == '') {
        alert('Field Message blank!')
    }
    else
        document.form1.submit();
}
 
function Imprimir(url) {
window.open(url, 'print', 'width=1,height=1,left=0,top=0,scrollbars=0,resizable=0,menubar=0,toolbar=0');
} 

function Mostra(nome)
{
//alert(navigator.appVersion)
//alert(navigator.appName)
	if (navigator.appName=="Microsoft Internet Explorer" /*|| navigator.appName=="Netscape"*/ ){
			var objeto = eval("document.all." + nome);

		}
		else
		{
		
		var objeto = eval("document.getElementById(\"" + nome + "\")"+"");
}
				if ( objeto )
				{
					if ( objeto.style.display == "none" )
					{
					objeto.style.display = "";
					}
						else
						{
						objeto.style.display = "none";
						}
			}
}

function setActiveStyleSheet(title) {
var i, a, main;
for(i=0;(a=document.getElementsByTagName("link")[i]);i++)
 {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}

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() { 
  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; }
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function abrir_imagem(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {

	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);

	newWindow.document.open();

	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');

	newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>');

	newWindow.document.write('</body></html>');

	newWindow.document.close();

	newWindow.focus();

}

