function recuperar(URL) {

  var width = 680;

  var height = 480;

  var left = 50;

  var top = 10

  window.open(URL, 'recuperar', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function Script01(URL) {

  var width = 680;

  var height = 700;

  var left = 50;

  var top = 0

  window.open(URL, 'Script01', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function Script02(URL) {

  var width = 600;

  var height = 400;

  var left = 50;

  var top = 0

  window.open(URL, 'Script02', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function eMpresa(URL) {

  var width = 680;

  var height = 520;

  var left = 50;

  var top = 10

  window.open(URL, 'eMpresa', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function indica(URL) {

  var width = 470;

  var height = 220;

  var left = 15;

  var top = 10

  window.open(URL, 'IndIca', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function eMpresaVer(URL) {

  var width = 680;

  var height = 580;

  var left = 20;

  var top = 5

  window.open(URL, 'Empresa', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function LogMeInn(URL) {

  var width = 805;

  var height = 460;

  var left = 0;

  var top = 0

  window.open(URL, 'LogMeInn', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function GuiaFor(URL) {

  var width = 610;

  var height = 550;

  var left = 50;

  var top = 0

  window.open(URL, 'GuiFor', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function alterarUser(URL) {

  var width = 709;

  var height = 395;

  var left = 50;

  var top = 10

  window.open(URL, 'alteraUser', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');



}

function download(URL) {

  var width = 280;

  var height = 280;

  var left = 12;

  var top = 15

  window.open(URL, 'download', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function falecli(URL) {

  var width = 399;

  var height = 280;

  var left = 12;

  var top = 15

  window.open(URL, 'download', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function faleclie(URL) {

  var width = 520;

  var height = 300;

  var left = 12;

  var top = 15

  window.open(URL, 'falaclie', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function DescClass(URL) {

  var width = 680;

  var height = 520;

  var left = 12;

  var top = 15

  window.open(URL, 'DescClass', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function administrar(URL) {

  var width = 776;

  var height = 600;

  var left = 0;

  var top = 0

  window.open(URL, 'administrar', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function atualizacoes(url) {

  window.open(url,'atualizacoes','width=500, height=350, top=12, left=15, scrollbars=yes, status=yes, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no')

}

function AddPal(url) {

  window.open(url,'AddPal','width=500, height=350, top=12, left=15, scrollbars=yes, status=yes, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no')

}

function noticia(url) { 

  window.open(url,'noticiaPrint','width=500, height=350, top=12, left=15, scrollbars=yes, status=yes, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no')

}

function Print(url) { 

  window.open(url,'Print','width=500, height=350, top=12, left=15, scrollbars=yes, status=yes, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no')

}

function cores(url) {

  window.open(url,'cores','width=225, height=169, top=10, left=10, scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no')

}

function Amplia(url) {

  window.open(Amplia,'amplia','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')

}

function fotos_noticias(url) {

  window.open(fotosnoticias,'popupImageWindow','width=400, height=300, screenX=0, screenY=0, top=150, left=20, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no')

}

function alterarSenha(URL) {

  var width = 280;

  var height = 180;

  var left = 200;

  var top = 100

  window.open(URL, 'produto', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function VerImAgEnS(URL) {

  var width = 776;

  var height = 500;

  var left = 0;

  var top = 0

  window.open(URL, 'produto', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}

function TestaSenha(valor) {

   var d = document.getElementById('Segurança');

   ERaz = /[a-z]/;

   ERAZ = /[A-Z]/;

   ER09 = /[0-9]/;

   ERxx = /[@!#$%&*+=?|-]/;



   if(valor.length == ''){

      d.innerHTML = 'Segurança: !';

   } else {

      if(valor.length < 5){

         d.innerHTML = 'Segurança: <font color=\'red\'> BAIXA</font>';

      } else {

         if(valor.length > 7 && valor.search(ERaz) != -1 && valor.search(ERAZ) != -1 && valor.search(ER09) != -1 || valor.length > 7 && valor.search(ERaz) != -1 && valor.search(ERAZ) != -1 && valor.search(ERxx) || valor.length > 7 && valor.search(ERaz) != -1 && valor.search(ERxx) != -1 && valor.search(ER09) || valor.length > 7  && valor.search(ERxx) != -1 && valor.search(ERAZ) != -1 && valor.search(ER09)){

            d.innerHTML = 'Segurança: <font color=\'green\'> ALTA</font><';

         } else {

            if(valor.search(ERaz) != -1 && valor.search(ERAZ) != -1 || valor.search(ERaz) != -1 && valor.search(ER09) != -1 || valor.search(ERaz) != -1 && valor.search(ERxx) != -1 ||valor.search(ERAZ) != -1 && valor.search(ER09) != -1 ||valor.search(ERAZ) != -1 && valor.search(ERxx) != -1 ||valor.search(ER09) != -1 && valor.search(ERxx) != -1){

               d.innerHTML = 'Segurança: <font color=\'orange\'> MEDIA</font>';

            } else {

               d.innerHTML = 'Segurança: <font color=\'red\'> BAIXA</font>';

            }

         }

      }

   }

} 











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_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 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_nbGroup(event, grpName) { //v6.0

  var i,img,nbArr,args=MM_nbGroup.arguments;

  if (event == "init" && args.length > 2) {

    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {

      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;

      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();

      nbArr[nbArr.length] = img;

      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {

        if (!img.MM_up) img.MM_up = img.src;

        img.src = img.MM_dn = args[i+1];

        nbArr[nbArr.length] = img;

    } }

  } else if (event == "over") {

    document.MM_nbOver = nbArr = new Array();

    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {

      if (!img.MM_up) img.MM_up = img.src;

      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);

      nbArr[nbArr.length] = img;

    }

  } else if (event == "out" ) {

    for (i=0; i < document.MM_nbOver.length; i++) {

      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }

  } else if (event == "down") {

    nbArr = document[grpName];

    if (nbArr)

      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }

    document[grpName] = nbArr = new Array();

    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {

      if (!img.MM_up) img.MM_up = img.src;

      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;

      nbArr[nbArr.length] = img;

  } }

}









/////////////////////////////////////////

function maskIt(w,e,m,r,a){



// Cancela se o evento for Backspace

if (!e) var e = window.event

if (e.keyCode) code = e.keyCode;

else if (e.which) code = e.which;



// Variáveis da função

var txt = (!r) ? w.value.replace(/[^\d]+/gi,'') : w.value.replace(/[^\d]+/gi,'').reverse();

var mask = (!r) ? m : m.reverse();

var pre = (a ) ? a.pre : "";

var pos = (a ) ? a.pos : "";

var ret = "";



if(code == 9 || code == 8 || txt.length == mask.replace(/[^#]+/g,'').length) return false;



// Loop na máscara para aplicar os caracteres

for(var x=0,y=0, z=mask.length;x<z && y<txt.length;){

if(mask.charAt(x)!='#'){

ret += mask.charAt(x); x++;

} else{

ret += txt.charAt(y); y++; x++;

}

}



// Retorno da função

ret = (!r) ? ret : ret.reverse() 





if (w.value.match("-")){

w.value = "-"+ret+pos;

}else{

w.value = pre+ret+pos;

}



}



// Novo método para o objeto 'String'

String.prototype.reverse = function(){

return this.split('').reverse().join('');

};

/////////////////////////////////////////

//////////Aumenta Fonte e Titulo///////////////////

function TamanhoFonte(num, id){

	document.getElementById(id).className = "fonte"+num;

}

function TamanhoTitulo(num, id){

	document.getElementById(id).className = "titulo"+num;

}

////////////////////////////////

///// excluir

function confirmaExclusao(aURL) {

	if(confirm('Você tem certeza que deseja excluir?')) {

		location.href = aURL;

	}

}

//////habilitar alteração de imagem

function Habilitar() {

nForm = document.forms['alterar'];

    if(nForm.elements['nova_imagem'].checked = true) {

        nForm.elements['imagem'].disabled = false;

		nForm.elements['imagem'].className= "sim";

		} 

}

function desabilitar() {

nForm.elements['imagem'].disabled = true;

nForm.elements['imagem'].className = "nao";

}



////// campo data

function mascaraDataEv(campoDataEv){

	var dataEv = campoDataEv.value;

	if (dataEv.length == 2){

		dataEv = dataEv + '/';

		document.forms[0].dataEv.value = dataEv;

		return true;

	}

	if (dataEv.length == 5){

		dataEv = dataEv + '/';

		document.forms[0].dataEv.value = dataEv;

		return true;

	}

}

function mascaraDataCad(campoDataCad){

	var dataCad = campoDataCad.value;

	if (dataCad.length == 2){

		dataCad = dataCad + '/';

		document.forms[0].dataCad.value = dataCad;

		return true;

	}

	if (dataCad.length == 5){

		dataCad = dataCad + '/';

		document.forms[0].dataCad.value = dataCad;

		return true;

	}

}



////////////////////////////////////////

/*

function mascaraDataEv(campoDataEv, e){

if(document.all) // Internet Explorer

	var tecla = event.keyCode;

	else //Outros Browsers

	var tecla = e.which;

	

	if(tecla >= 47 && tecla < 58){ // numeros de 0 a 9 e "/"

		var dataEv = campoDataEv.value;

	if (dataEv.length == 2 || dataEv.length == 5){

		dataEv += '/';

		campoDataEv.value = dataEv;

	}

}else if(tecla == 8 || tecla == 0) // Backspace, Delete e setas direcionais(para mover o cursor, apenas para FF)

	return true;

else

return false;

}

*/

////////////////////////////////////////





///////////////////