// JScript File
function ShowCalendar(ob) {
    var gerR = showModalDialog('Kira_Modal.aspx?Tit=Calendario&Url=Kira_Calender.aspx&id=0', window, 'dialogWidth:300px;dialogHeight:170px;status:0;scroll:0;help:0;resizable:yes;status:no');
    if (gerR != '') {
        if (gerR != undefined) {
            ob.value = gerR
       }
    }
}
function CallPrintNoticia(strid) 
{ 
var prtContent = document.getElementById(strid); 
var WinPrint = window.open('','','letf=0,top=0,width=300,height=300,toolbar=0,scrollbars=1,status=0,resizable=yes'); 
WinPrint.document.write(prtContent.innerHTML); 
WinPrint.document.close(); 
WinPrint.focus(); 
// PARA IMPRESSÃO
WinPrint.print(); 
WinPrint.close();
} 
function SelecionaChatSend(){
try{
var itens=document.getElementById('UsuarioTotais').value;
var selecionado=document.getElementById('UsuarioSelecionado').value;
    for (i = 1; i < (itens+1); i++) {
        if(i!=selecionado){
        document.getElementById('UserChat'+i).className='ChatUserNormal';
        }
        else{
        document.getElementById('UserChat'+i).className='ChatUserSelecionado';
        }
    }
    }
catch(e){}
}
    function OpenSpeedForm(okiraform){
    var PopWidth=((screen.width/2)+100);
    var PopHeight=((screen.height/2)+100);
    var PopLeft=0
    var PopTop=0
    var dinamic="okiraform=window.open('KiraSpeedForm.aspx',okiraform,'toolbar=no,status=yes,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,width='+PopWidth+',height='+PopHeight+',top='+PopTop+',left='+PopLeft);okiraform.focus();";
	 eval(dinamic);
 }
    function OpenHelpForm(okiraform){
    var dinamiccv=okiraform+'Help';
    var PopWidth=(screen.width-259);
    var PopHeight=(screen.height-100);
    var PopLeft=0
    var PopTop=0
    var dinamic="dinamiccv=window.open('KiraViewHelp.aspx?pg='+okiraform,dinamiccv,'toolbar=no,status=yes,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,width='+PopWidth+',height='+PopHeight+',top='+PopTop+',left='+PopLeft);dinamiccv.focus();";
    eval(dinamic);
 }
    function OpenEditPagina(url_pop){
    var PopWidth=(screen.width-259);
    var PopHeight=(screen.height-100);
    var PopLeft=0
    var PopTop=0
     editPg=window.open(url_pop,'editPg','toolbar=no,status=yes,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,width='+PopWidth+',height='+PopHeight+',top='+PopTop+',left='+PopLeft);
	 editPg.focus();
 }
     function OpenverAEIC(url_pop){
    var PopWidth=400;
    var PopHeight=300;
    var PopLeft=0
    var PopTop=0
     editPg=window.open(url_pop,'editPg','toolbar=no,status=yes,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,width='+PopWidth+',height='+PopHeight+',top='+PopTop+',left='+PopLeft);
	 editPg.focus();
 }

//CustonValidators
function ValidarDrop(src, args){
if(args.Value==0){
args.IsValid=false;
    }
    else{
    args.IsValid=true;
    }
}

function ValidarCPF(src, args){
var s=args.Value;
s=s.replace('.','');
s=s.replace('.','');
s=s.replace('-','');
var i; 
var c = s.substr(0,9); 
var dv = s.substr(9,2); 
var d1 = 0; 
for (i = 0; i < 9; i++) 
{ 
d1 += c.charAt(i)*(10-i); 
} 
if (d1 == 0){ 

args.IsValid=false;
return false;
  
} 
  
d1 = 11 - (d1 % 11); 
  
if (d1 > 9) d1 = 0; 
  
if (dv.charAt(0) != d1) 
  
{ 
   args.IsValid=false;
return false;
} 
  
  
d1 *= 2; 
  
for (i = 0; i < 9; i++) 
  
{ 
  
d1 += c.charAt(i)*(11-i); 
  
} 
  
d1 = 11 - (d1 % 11); 
  
if (d1 > 9) d1 = 0; 
  
if (dv.charAt(1) != d1) 
  
{ 
    args.IsValid=false;
  return false;
} 
  
    args.IsValid=true;
  
} 

function ValidarCNPJ(src, args){
   args.IsValid=true;
}   
function ValidarData(src, args){
args.IsValid=VerificaData(args.Value);
}

function VerificaData(cData) {
  // implementado em 12/02/2008 às 01:31 para validacao de datas (Formataca)
	var predata =cData;
	if(predata.substr(1,1)=='/'){
		predata='0'+predata;
	}
	else{

	if(predata.substr(4,1)=='/'){
		predata=predata.substr(0,2)+'/0'+predata.substr(3,predata.length)
	}
	}
	if(predata.substr(4,1)=='/'){
		predata=predata.substr(0,2)+'/0'+predata.substr(3,predata.length)
	}
 	if(predata.length==8){
 	//01/01/06
 		if(predata.substr(6,1)=='0'){
 		predata=predata.substr(0,5)+'/20'+predata.substr(6,predata.length);
 		}
 		else
 		{
 		predata=predata.substr(0,5)+'/19'+predata.substr(6,predata.length);
 		}
 	}
 	cData=predata;
    var data = cData; 
    var tam = data.length;
    if (tam != 10) {
 return false;
    }
    var dia = data.substr(0,2)
    var mes = data.substr (3,2)
    var ano = data.substr (6,4)    
    if (ano < 1880)    {
 return false;
    }
   if (ano > 2050)    {
 return false;
    }

    switch (mes) {
 case '01':
     if  (dia <= 31) 
   return (true);
     break;
 case '02':
     if  (dia <= 29) 
   return (true);
     break;
 case '03':
     if  (dia <= 31) 
   return (true);
     break;
 case '04':
     if  (dia <= 30) 
   return (true);
     break;
 case '05':
     if  (dia <= 31) 
   return (true);
     break;
 case '06':
     if  (dia <= 30) 
   return (true);
     break;
 case '07':
     if  (dia <= 31) 
   return (true);
     break;
 case '08':
     if  (dia <= 31) 
   return (true);
     break;
 case '09':
     if  (dia <= 30) 
   return (true);
     break;
 case '10':
     if  (dia <= 31) 
   return (true);
     break;
 case '11':
     if  (dia <= 30) 
   return (true);
     break;
 case '12':
     if  (dia <= 31) 
   return (true);
     break;
    }
    {
 return false;
    }
    return true; 
}
// fim custons
function OpenReportW(arg){
var PopWidth=700;
var PopHeight=403;
var PopLeft=0
var PopTop=0
var url_pop='Kira3/Tools/KiraGeradorRelatoriosUsuario.aspx?t='+arg;
     RptW=window.open(url_pop,'RptW','toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=no,scrollbars=no,width='+PopWidth+',height='+PopHeight+',top='+PopTop+',left='+PopLeft);
	 RptW.focus();
}
function OpenReport(url_pop){
var PopWidth=700;
var PopHeight=600;
var PopLeft=0
var PopTop=0
     RptK=window.open(url_pop,'RptK','toolbar=no,status=yes,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,width='+PopWidth+',height='+PopHeight+',top='+PopTop+',left='+PopLeft);
	 RptK.focus();
}

function OpenUserR(Id,Hr){
var PopWidth=600;
var PopHeight=600;
var PopLeft=0
var url_pop='Kira3/GenUser/UserObjetos.aspx?id='+Id+'&hr='+Hr;
    if((Id=='')||(Id=='0')){
    return false;
    }
    
     var PopTop=0
     UserR=window.open(url_pop,'UserR','toolbar=no,status=yes,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,width='+PopWidth+',height='+PopHeight+',top='+PopTop+',left='+PopLeft);
	 UserR.focus();
 }




function GaleriaDeImagens(folder){
//Verificar compatibilidade com o Firefox
	var galleryscript = 'Kira3/tinymce/jscripts/tiny_mce/plugins/kiracomp/Kiratools/ftb.imagegallery.aspx?rif='+folder+'&cif='+folder;
		imgArr = showModalDialog(galleryscript,window,'dialogWidth:560px; dialogHeight:500px;help:0;status:0;resizeable:1;');

	if (imgArr != null) {
		//imagestring = '<IMG SRC="' + imgArr['filename'] + '" HEIGHT=' + imgArr['height'] + ' WIDTH=' + imgArr['width'] + ' BORDER=0>';
		return imgArr['filename'];
		} else {
		return '';
	}
}

//Kira Modal Mensagens Implentado em 03/09/2007 às 23:45
function AtivarMsg(amsm){
try{
var msg=new CriaArray(3);
msg=amsm.split("æ");
document.getElementById('ModalMsn').style.display='';
if(msg[2]==''){
document.getElementById('ModalMsn').innerHTML='<div id="ContainerMSG" style=" display:none; z-index:99999; width:118px; height:73px; position:absolute; top:110px; left:624px; float:left;" class="modalBackgroundKira"></div><DIV id="CorpoMSG" style="WIDTH: 500px;  display:none; left: 232px; top: 215px;" class="modalPopupKira"><table cellpadding="0" cellspacing="0" class="logindialog"><tr><td style="height: 113px"><table cellpadding="0" cellspacing="0" class="dialogbox"><tr><td><div class="dialoghead"><div id="titleId">::: MENSAGEM</div><div id="titleIdOu" style="display: none"></div></div><div id="ocLoginForm"style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px;padding-top: 0px"><div class="dialogcontent"><table border="0"><tr><td rowspan="1" style="vertical-align: top; width: 60px; text-align: center"><img alt="Confime" src="'+msg[0]+'"/></td><td id="TD2"align="left" colspan="2" style="width: 400px" valign="top"><b>'+msg[1]+'</b></td></tr><tr><td rowspan="1" style="vertical-align: top; width: 60px; text-align: center"></td><td id="TD2x" align="left" colspan="2" style="width: 400px" valign="top">&nbsp;</td></tr><tr><td colspan="3" rowspan="1" style="vertical-align: top; width: 100%; text-align: center"><div style="float:right"><input type="submit" name="Submit" value="Fechar" class=""CommandButton"" style="font-size:8pt;font-weight:bold;" onClick="DesativarMsg();return false;"></div></td></tr></table></div></div></td></tr></table></td></tr></table></div>';
}
else{
document.getElementById('ModalMsn').innerHTML='<div id="ContainerMSG" style=" display:none; z-index:99999; width:118px; height:73px; position:absolute; top:110px; left:624px; float:left;" class="modalBackgroundKira"></div><DIV id="CorpoMSG" style="WIDTH: 500px;  display:none; left: 232px; top: 215px;" class="modalPopupKira"><table cellpadding="0" cellspacing="0" class="logindialog"><tr><td style="height: 113px"><table cellpadding="0" cellspacing="0" class="dialogbox"><tr><td><div class="dialoghead"><div id="titleId">::: MENSAGEM</div><div id="titleIdOu" style="display: none"></div></div><div id="ocLoginForm"style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px;padding-top: 0px"><div class="dialogcontent"><table border="0"><tr><td rowspan="1" style="vertical-align: top; width: 60px; text-align: center"><img alt="Confime" src="'+msg[0]+'"/></td><td id="TD2"align="left" colspan="2" style="width: 400px" valign="top"><b>'+msg[1]+'</b></td></tr><tr><td rowspan="1" style="vertical-align: top; width: 60px; text-align: center"></td><td id="TD2x" align="left" colspan="2" style="width: 400px" valign="top">&nbsp;</td></tr><tr><td colspan="3" rowspan="1" style="vertical-align: top; width: 100%; text-align: center"><div style="float:right"><a href="'+msg[2]+'" class="CommandButton" ><b>CONTINUAR</b></a></div></td></tr></table></div></div></td></tr></table></td></tr></table></div>';
}
/*VER SCROOL
http://www.codehouse.com/javascript/articles/scroll_area/
*/
document.getElementById('ModalMsn').style.width='100%';
document.getElementById('ModalMsn').style.height='200%';
document.getElementById('ContainerMSG').style.width='100%';
document.getElementById('ContainerMSG').style.height='100%';
document.getElementById('ContainerMSG').style.left=0;
document.getElementById('ContainerMSG').style.top=0;
document.getElementById('CorpoMSG').style.left=((screen.width)/2)-(document.getElementById('CorpoMSG').style.width.replace('px','')/2);
document.getElementById('CorpoMSG').style.top=(screen.height/2)-150;
document.getElementById('ContainerMSG').style.display='';
document.getElementById('CorpoMSG').style.display='';

}
catch(e){
alert('ERRO\n'+e.message);
}
}
function DesativarMsg(){
document.getElementById('ContainerMSG').style.display='none';
document.getElementById('CorpoMSG').style.display='none';
document.getElementById('ModalMsn').innerHTML='';
document.getElementById('ModalMsn').style.display='none';
}
////Kira Modal Mensagens

function MudaCampo(evento) {
     if(navigator.appName.substring(0,9) == "Microsoft"){
        // ? window.event.keyCode : e.which; if (k == 13) { // preciona tecla enter SubmitForm(); } } 
        if(event.keyCode==13){event.keyCode = 9;} 
         }
        else{
        var tecla = window.event ? tecla : evento.which;
            if((evento.which==13)||(evento.which==10)){
            tecla = 9;
            evento.returnValue = false;
            return false;
            }
        }
}
function BaixaCaixa(objt) {
	objt.value=objt.value.toLowerCase();
	     }
function SobeCaixa(objt){
	objt.value=objt.value.toUpperCase();
     }
function CaptalizaCaixa(objt) {
var tmpStr, tmpChar, preString, postString, strlen;
tmpStr = objt.value.toLowerCase();
stringLen = tmpStr.length;
if (stringLen > 0)
{
  for (i = 0; i < stringLen; i++)
  {
    if (i == 0)
	{
      tmpChar = tmpStr.substring(0,1).toUpperCase();
      postString = tmpStr.substring(1,stringLen);
      tmpStr = tmpChar + postString;
    }
    else
	{
      tmpChar = tmpStr.substring(i,i+1);
      if (tmpChar == " " && i < (stringLen-1))
	  {
      tmpChar = tmpStr.substring(i+1,i+2).toUpperCase();
      preString = tmpStr.substring(0,i+1);
      postString = tmpStr.substring(i+2,stringLen);
      tmpStr = preString + tmpChar + postString;
      }
    }
  }
}
objt.value = tmpStr;
}
function SetColor(obj){
var color=showModalDialog('Kiratools/ftb.colorpicker.aspx',window,'dialogWidth:170px;dialogHeight:150px;status:0;scroll:0;help:0;');
if(color!=undefined){
obj.value=color;
}
}
//Auxiliares
function CriaArray(n) { 
this.length = n 
for (var i = 1 ; i <= n ; i++) 
{ this[i] = ""
}
}
//fim dos auxiliares


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//                                FUNÇÕES DE MASCARA
//               2005 ® by Arthur Fernando Mello Lobato for Kira 2.00
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


function AjustarCep(Objeto,evento)
{
var tecla = window.event ? tecla : evento.which;
if ((tecla == 13)) { 
tecla = 9;
evento.returnValue = false;	
return false;
}

	if ((tecla < 48) || (tecla > 57))
	{
	    if ((tecla != 8) && (tecla != 0)){
		evento.returnValue = false;
		return false;
		}
	} 
	else 
	{ 
		if(Objeto.value.length == 2)
		{
			Objeto.value = Objeto.value + ".";
		}
		else if(Objeto.value.length == 6)
		{		
			Objeto.value = Objeto.value + "-";
		}
		else if(Objeto.value.length == 10)
		{
	    if ((tecla != 8) && (tecla != 0)){
		  evento.returnValue = false;
		  return false;
		  }
		}
	}
}

function AjustarFone(Objeto,evento)
{
var tecla = window.event ? tecla : evento.which;
if ((tecla == 13)) { 
tecla = 9;
evento.returnValue = false;
return false;	
}
if ((tecla == 8) || (tecla == 0)){
return true;
}
	if ((tecla < 48) || (tecla > 57))
	{
		if (Objeto.value.indexOf("-") == -1)
	  {
      if ((tecla = 45) && ((Objeto.value.length == 9) || (Objeto.value.length == 8)))
      {
        Objeto.value = Objeto.value + "-";
      }
	  }
	  	if ((tecla != 8) && (tecla != 0)){
		evento.returnValue = false;
		return false;
		}
	} 
	else 
	{	 	  
		if (Objeto.value.length == 0)
		{
			Objeto.value = "(" + Objeto.value;
		}
		else if ((Objeto.value.length == 1) && (Objeto.value.indexOf("(") == -1))
		{
		  Objeto.value = "(" + Objeto.value;
		}
		else if (Objeto.value.length == 3)
		{
			Objeto.value = Objeto.value + ") ";
		}				
		else if (Objeto.value.length == 4)
		{
			Objeto.value = Objeto.value + " ";
		}
		else if ((Objeto.value.length == 9) && (Objeto.value.indexOf("-") == -1))
    {
      Objeto.value = Objeto.value + "-";
    }
    else if ((Objeto.value.length == 13) && (Objeto.value.indexOf("-") == 8))
		{
		if ((tecla != 8) && (tecla != 0)){
		  evento.returnValue = false;
		  return false;
		}
		}
		else if (Objeto.value.length == 14)
		{
		 if ((tecla != 8) && (tecla != 0)){
		  evento.returnValue = false;
		  return false;
		 }
		}
	}
}

function AjustarData(Objeto,evento) 
{
var tecla = window.event ? tecla : evento.which;
if ((tecla == 13)) { 
tecla = 9;
evento.returnValue = false;
return false;
}
	if ((tecla < 48) || (tecla > 57)) 
	{
	    if ((tecla != 8) && (tecla != 0)){
		evento.returnValue = false; 
		return false;
		}
	}
	else 
	{
		if ((Objeto.value.length == 2) || (Objeto.value.length == 5))
		{
			Objeto.value = Objeto.value + "/";
		}
		else if (Objeto.value.length == 10)
		{
	      if ((tecla != 8) && (tecla != 0)){
		  evento.returnValue = false;
		  return false;
		  }
		}
	}
}

function AjustarInteiro(Objeto,evento) 
{
var tecla = window.event ? tecla : evento.which;
if ((tecla == 13)) {
tecla = 9;
evento.returnValue = false;	
return false;
}
	if(tecla == 44){
		evento.returnValue = true; 	
		return true;
	}
	if ((tecla < 48) || (tecla > 57)) 
	{
	    if ((tecla != 8) && (tecla != 0)){
		evento.returnValue = false;
		return false;
		}
	}
	else
	{
		evento.returnValue = true; 	
	}
}

function AjustarInteiroPerce(Objeto,evento) 
{
var tecla = window.event ? tecla : evento.which;
if ((tecla == 13)) {
tecla = 9;
evento.returnValue = false;	
return false;

}
	if ((efento.keyCode < 48) || (tecla > 57)) 
	{
	    if ((tecla != 8) && (tecla != 0)){
		evento.returnValue = false; 
	    }
	}
	else
	{
		evento.returnValue = true; 	
	}
}

function AjustarCpf(Objeto,evento)
{
var tecla = window.event ? tecla : evento.which;
if ((tecla == 13)) { 
tecla = 9;
evento.returnValue = false;	
}
	if ((tecla < 48) || (tecla > 57))
	{
	if ((tecla != 8) && (tecla != 0)){
	    evento.returnValue = false;
	    return false;
	}
	
	} 
	else 
	{ 
		if ((Objeto.value.length == 3) || (Objeto.value.length == 7))
		{
			Objeto.value = Objeto.value + "." ;
		}
		else if (Objeto.value.length == 11)
  	{		
			Objeto.value = Objeto.value + "-" ;
		}
		else if (Objeto.value.length == 14)
		{
		  evento.returnValue = false;
		  return false;
		}
	}
}

function AjustarCgc(Objeto,evento)
{
var tecla = window.event ? tecla : evento.which;
if ((tecla == 13)) { 
tecla = 9;
evento.returnValue = false;	
return false;
}
	if ((tecla < 48) || (tecla > 57))
	{
		if ((tecla != 8) && (tecla != 0)){
		evento.returnValue = false;
		return false;
		}
	} 
	else 
	{ 
		if((Objeto.value.length == 2) || (Objeto.value.length == 6))
		{
			Objeto.value = Objeto.value + "." ;
		}
		else if(Objeto.value.length == 10)
  	{		
			Objeto.value = Objeto.value + "/" ;
		}		
		else if(Objeto.value.length == 15)
  	{		
			Objeto.value = Objeto.value + "-" ;					
		}
		else if(Objeto.value.length == 18)
  	{		
  		    if ((tecla != 8) && (tecla != 0)){
			evento.returnValue = false;
			return false;
			}
		}		
	}		
}


function AjustarValor(Objeto,evento)
{
var tecla = window.event ? tecla : evento.which;
if ((tecla == 13)) { 
tecla = 9;
evento.returnValue = false;	
return false;
}
if ((tecla == 8) || (tecla == 0)){
    return true;
}
	var tam=10;
	var tecla;
	
	if (!tam) {
		tam = 13;
	} else {
		if (tam < 6) {
			tam = tam + 1;
		} else {
			if (tam < 9) {
				tam = tam + 2;
			} else {
				if (tam < 11) {
					tam = tam + 3
				} else {
					tam = tam + 3
				}
			}
		}
	}
	
	if (document.all) {		tecla = tecla;	} else {
	if (document.layers) tecla = Objeto.which;	}
	
	if ((((tecla) > 47) && ((tecla) < 58)) || (tecla = 8)) //teclas numericas
	{
		//valor do Objeto
		numdig = Objeto.value;
		//tamanho (caracteres) do valor do Objeto
		tamdig = numdig.length;
		//inicia variavel contador
		contador = 0;
		if (tamdig > -1 && tamdig < tam) { //limita 13 caracteres (99.999.999,99)
			//inicia variavel numer		
			numer = "";
			for (i = tamdig; (i >= 0); i--){ //looping de acordo com a variavel tamdig
			
if ((tecla == 13)) { 
tecla = 9;
}
if ((parseInt(numdig.substr(i,1))>=0) && (parseInt(numdig.substr(i, 1))<=9)) { //
					//incrementa a variavel contador
					contador++;
					if (contador == 2) {
						//adiciona a "," (vírgula)
						numer = ","+numer;
					}
					if ((contador == 5) || (contador == 8) || (contador == 11)) { //de 3 em 3
						//adiciona o "." (ponto)
						numer = "."+numer;
					}
					//soma o resto do valor com o ponto
					numer = numdig.substr(i, 1)+numer;
					
					}
			}
			//seta o valor do Objeto
			Objeto.value = numer;
			//retorno da funcao
			return true;
		} else {
			//retorno da funcao
			return false;
		}
	} else {
		//retorno da funcao
		return(false)
	}
}

	function AjustarDigito(Objeto,evento)
{
var tecla = window.event ? tecla : evento.which;
if ((tecla == 13)) { 
tecla = 9;
evento.returnValue = false;	
return false;
}
	if ((tecla < 48) || (tecla > 57))
	{
		if ((tecla != 8) && (tecla != 0)){
		evento.returnValue = false;
		return false;
		}
	} 
	else 
	{ 
		if(Objeto.value.length > 0)
		{
			Objeto.value = Objeto.value + "-";
			
			var tx=Objeto.value
			tx=tx.replace("-", "");
		if(Objeto.value.length > 2){
		var x1=tx.substring(0, ((tx.length)));
		x1=x1.replace("-", "");
		var x2=tx.substring((tx.length), (tx.length))
		x2=x2.replace("-", "");
			tx=x1 + '-' + x2
}			
				Objeto.value=tx;
}
	}
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//                              FIM DAS FUNÇÕES DE MASCARA
//               2005 ® by Arthur Fernando Mello Lobato for Kira 2.00
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function GetImagem(folder){
var galleryscript = 'Kira3/tinymce/jscripts/tiny_mce/plugins/kiracomp/Kiratools/ftb.imagegallery.aspx?rif='+folder+'&cif='+folder;
var imgArr = showModalDialog(galleryscript,window,'dialogWidth:560px; dialogHeight:500px;help:0;status:0;resizeable:1;');
	if (imgArr != null) {
	alert(imgArr['filename']);
	return imgArr['filename'];
	} else {
	return '';
	}
}