﻿
// JScript File
// Limites para as Janelas
var isConnected = false; // controle de Conexao do Cliente
var minTop    = 55;
var minLef    = 0;
var maxLeft   = 0;
var maxBottom = 0;

var isStarted = false; 
var zindex = 10; 
var janela = 0;

/********************************************************************************************
// Funcao para Liberar acesso ao usuario logado
********************************************************************************************/
function fnLogin(isRccmail,openPage)
{
  // Versao 28/03
  isRccmail = ((isRccmail == null)?false:isRccmail);
  openPage = ((openPage==null)?'assinante/default.aspx': openPage);
  if(isDebug)
     a=a+1;
  //alert('openpage='+openPage+' isRccmail='+isRccmail); 
    showDialog('hide'); // esconde painel de fundo
    isConnected=true;        // Coloca status = True quando o cliente se logar
    fechaJanelas();
    onFechaLayers();
    //onClienteStatus(true);
    onLoadIntoFrame('frmCentral', openPage);
	  return;
}

/********************************************************************************************
// Funcao para Carregar pagina do Cliente. Chamado viar rcc.site.master.cs.CarregaPaginaCliente();
 //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "xy",
        //"MM_showHideLayers('ctl00_divMenuLogado','','show');" +
        //((Request.QueryString["rccmail"] == null) ? "onPageClient('" + PaginaCliente + "');" : "") + "MM_showHideLayers('ctl00_divMenuLogado','','show');document.getElementById('" + this.lblEmpresaLogado.UniqueID + "').innerHTML='" + RCGlobal.Nome.Replace("$", "_") + "';", true);

********************************************************************************************/
function onPageClient(PaginaStart, isDownloadFile, nomeEmpresa, lblEmpresaLogado)
{
 //a=a+1;
  //alert('paginaStart=onPageClient('+PaginaStart+')'); 
    if(dlgWaiting)
    {
      if(typeof(dlgWaiting) == 'object')
        dlgWaiting.show();
    }
      //alert('pagina: '+PaginaStart);
    loadintoIframe('frmCentral', PaginaStart)

    if(document.getElementById('ctl00_divMenuLogado'))
    {
      // em 04/09/2008 -  delay de 6 segundos para mostrar nome da Empresa
      var strDelay = 'MM_showHideLayers("ctl00_divMenuLogado","","show");document.getElmentById("';
      strDelay += 'ctl00_divMenuLogado").innerHTML="' + nomeEmpresa + '"';
      setTimeout(strDelay,6000);
    }
    
    MM_showHideLayers('divCaptcha','','hide');	
    MM_showHideLayers('divForget','','hide');	
    if(dlgWaiting)
      dlgWaiting.hide();	
}

/********************************************************************************************
// Funcao para Posicionar tela no topo
********************************************************************************************/
function MoveTopo()
{
  if(document.all)
    window.scrollTo(0,0);

}

/********************************************************************************************
// Funcao para Mostrar Mensagem via dojo.dialog - 01/02/2007
********************************************************************************************/
function Mensagem(texto)
{
    var obj = document.getElementById('ctl00_lblMsg');
    if(obj && obj != null)
    {
      obj.innerHTML = texto;
      //MM_showHideLayers('divMensagem','','show');
      if(dlgMensagem == null)
      {
          dlgMensagem = dojo.widget.byId("DialogMensagem");
      }
      if(dlgMensagem)
          dlgMensagem.show();
      else
          alert(texto.replace('<br>','\n'));
     }
     else
          alert(texto.replace('<br>','\n'));
}   

/********************************************************
// 06/08/2008 - 

*********************************************************/
function showPopup(link)
{
    var obj = document.getElementById('tblDialogMensagem');
    obj.innerHTML = texto;
    //MM_showHideLayers('divMensagem','','show');
    if(dlgMensagem == null)
    {
        dlgMensagem = dojo.widget.byId("DialogMensagem");
    }
    if(dlgMensagem)
        dlgMensagem.show();
    else
        alert(texto.replace('<br>','\n'));
    posField=null;
    if(field != null)
      posField=field.replace('$','_');
 
}

/********************************************************************************************
// Funcao para Mostrar Mensagem via dojo.dialog - 01/11/2007
// posiciona no campo pedido
********************************************************************************************/
var posField=null; // botao para posicionar
function showMensagem(texto, field)
{
    if(typeof(ctl00_lblMsg) == 'object')
    {
     var obj = document.getElementById('ctl00_lblMsg');
     obj.innerHTML = texto;
     //MM_showHideLayers('divMensagem','','show');
     if(dlgMensagem == null)
        dlgMensagem = dojo.widget.byId("DialogMensagem");
    if(dlgMensagem)
        dlgMensagem.show();
    else
        alert(texto.replace('<br>','\n'));
    }
    else
     alert(texto.replace('<br>','\n'));
     
    posField=null;
    if(field != null)
      posField=field.replace('$','_');
}   

/********************************************************************************************
// Funcao para fechar Mensagem e posicionar Campo
// posiciona no campo pedido
********************************************************************************************/
function fnFecharMensagem()
{
  // Esconde Mensagem
  if(dlgMensagem)
    dlgMensagem.hide();
    
   // Posiciona no campo, se existir
  if(posField != null)
  {
      if(document.getElementById(posField))
      {
        document.getElementById(posField).focus();
        //setTimeout('document.getElementById("' + field + '");',3000);
      }
  }
  posField=null;
}

//     
function AbreWinliKe(){
 
	maxLeft   = 500; //document.body.scrollHeight;
	maxBottom = 780;
	
	// Pega Posicionamento da tag 'divPosWinLike'
	var divPW = document.getElementById('divLicitacao');
	var posPW = '1';
	var posPY = '1';
    if(divPW)
	{
	    posPW = findPosX(divLicitacao) + 2; //divPW.style.left;
	    posPY = findPosY(divLicitacao) - ((isConnected)?21:0); //divPW.style.left;  
	}
    //AbreJanela(Nome, Titulo, Link, Width, Height, Top, Left, Mover, Sizer,Visi, Titu, skin, ForceNew, Center, Min, LD, HD, SD)
	AbreJanela('WinLicitacao','Licitações','about:blank', '950', 600, posPW-200, posPY,  true, true, true, true,'default',null,true,true,true,true,true);
	//AbreJanela('WinLicitacao','Licitações','about:blank',maxBottom, maxLeft, posPW, posPY-20, true, true, true, true,'default',null,true,true,true,true,true);

 	AbreJanela('WinRemessas','Remessas Anteriores','waiting.htm', '780', maxLeft,posPW, posPY,true, true,true, true, 'default',null,null,true,true,true,true);
	WinLIKE.windows[WinLIKE.searchwindow('WinLicitacao')].hideshow(); 
	WinLIKE.windows[WinLIKE.searchwindow('WinRemessas')].hideshow(); 

  // em 02/04/2004 - PARA JORNAL
 	AbreJanela('WinJornal',':: Jornal de Licitação ::','waiting.htm', '950', 700, posPW, posPY,true, true,true, true, 'default',null,true ,true,true,true,true);
  WinLIKE.windows[WinLIKE.searchwindow('WinJornal')].hideshow(); 

	// em 05/05/2007 - PARA VITRINE LATERAL
	loadintoIframe('frmVitrine', 'vitrine_lateral.aspx'); 
	

    }

/********************************************************************************************
// Funcao para Abrir pagina de licitacao (resultado da consulta)
********************************************************************************************/
function VerLicitacao(){
    //WinLIKE.windows[WinLIKE.searchwindow('WinLincitacao')].hideshow();  
    WinLIKE.openaddress('licitacao_detalhe.aspx',null,'WinLicitacao'); 
}
    
    
// Funcao para bloquear tela
function onBlockWindow(modo) 
    {
        var mode = ((modo==null || modo == 'h')?false:modo=='h');
        if(document.getElementById('ih_'));
            Display('ih_',mode);
        if(document.getElementById('ig_'));
            Display('ig_',mode);
    }

/********************************************************************************************
// Funcao para pré-Carregar imagens usadas em ações tipo onMouseOver
********************************************************************************************/
function MM_preCarregaImagens() { //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_preCarregaImagens.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];}}
}

/********************************************************************************************
// Funcao para o evento window.onload
********************************************************************************************/
function onLoadPage() {
    // Mostra ou Escnode o Menu do Cliente

  // Carrega Flash Iso.sfw
  
  //MM_preCarregaImagens('menus/images/menu-topo-3-over_02.gif','menus/images/menu-topo-3-over_04.gif','menus/images/menu-topo-3-over_13.gif','menus/images/menu-topo-3-over_12.gif','menus/images/menu-topo-3-over_11.gif','menus/images/menu-topo-3-over_10.gif','menus/images/menu-topo-3-over_09.gif','menus/images/menu-topo-3-over_08.gif','menus/images/menu-topo-3-over_07.gif','menus/images/menu-topo-3-bt_sair_over.gif');
  
	// Definicao inicial do WinLIKE
	WinLIKE.definewindows = mydefs; 
	WinLIKE.init();
	maxLeft   = document.body.scrollHeight;
	maxBottom = document.body.scrollWidth;
	
	// Pega Posicionamento da tag 'divPosWinLike'
	var divPW = document.getElementById('divPosWinLike');
	var posPW = '32%';
	var posPY = '103';
	if(divPW)
	{
	    posPW = findPosX(divPosWinLike) + 2; //divPW.style.left;
	    posPY = findPosY(divPosWinLike) - ((isConnected)?21:0); //divPW.style.left;  
	}
    
	//AbreJanela('WinCliente','Acesso Restrito','rcc_acesso.aspx',612, 200, posPW, posPY, true, true, false, false,'explosive');
	//WinLIKE.windows[WinLIKE.searchwindow('WinCliente')].hideshow(); 

  // 12/11/2007
  abreFlash4(); // está no final do arquivo siteversao3.master
  
  // 26/06/2008 -  Abre Popup - veja em rcc.site.versao4.master e popup.inc
  if(typeof(abrePopUp)=='function')
    abrePopUp();
	
	}




/********************************************************************************************
// Funcao para FECHAR TODAS AS JANELAS DO WINLIKE que estiverem abertas
********************************************************************************************/
function fechaJanelas()
{
    if(WinLIKE)
    {
      if(WinLIKE.windows)
      {
        for(var i=0;i<WinLIKE.windows.length;i++)
        {
            if(WinLIKE.windows[i] != null) 
            {
		        if (WinLIKE.windows[i].Vis == true) 
    		    {
	    		    WinLIKE.windows[i].hideshow(); // esconde se tiver aberto
		        }
		    }
	    }
	    }	
    }
}

/********************************************************************************************
// Funcao para Criar ou Reabrir janela
********************************************************************************************/
function AbreJanela(Nome, Titulo, Link, Width, Height, Top, Left, Mover, Sizer,Visi, Titu, skin, ForceNew, Center, Min, LD, HD, SD) {

   //Nome = nome da janela // Titulo=titulo da janela // Link = url // Width = tam // Height = larg
   //Top = altura // Left = move XXX da esquerda // Mover = true/false .. Permitir mover
   // Visi = mostra ou esconde  // Titu == mostra titulo ou esconde
   // Sizer == permitido ampliar/reduzir
   // ForceNew = Força reabrir a janela
   // Centraliza?
   
   //alert('Height='+Height+' Width=' + Width + ' Top='+Top+ ' left='+Left);
   //WinLIKE.maxvals('10%','0%','0%','0%');

   var numJan = WinLIKE.searchwindow(Nome); 
		
   // Bloqueia tela para usuario nao clicar duas vezes
   Display('ih_',true);
   Display('ig_',true);

   // Defaults
   Titu = ((Titu == null)?true:Titu);
   Visi = ((Visi == null)?true:Visi);
   Min = ((Min == null)?true:Min);
   LD = ((LD == null)?true:LD);
   HD = ((HD == null)?true:HD);
   SD = ((Min == null)?true:SD);
   skin = ((skin == null)?'ceitonblue':skin);
   ForceNew = ((ForceNew == null)?false:ForceNew);
   Center = ((Center == null)?false:Center);
   
   if(numJan > - 1 && WinLIKE.windows[numJan]) {
        if(Visi) 
        {
		    if (WinLIKE.windows[numJan].Mn)  {
			    WinLIKE.windows[numJan].minmax(); // expand if minimized
			    }
    				
		    if (WinLIKE.windows[numJan].Vis == false) {
			    WinLIKE.windows[numJan].hideshow(); // make the changes happen
			    }
    		
		    WinLIKE.windows[numJan].draw(); // make the changes happen
		    WinLIKE.windows[numJan].front();  // coloca na frente
		}
        if(ForceNew) 
        {
            WinLIKE.openaddress(Link,null,WinLIKE.windows[numJan].Nam)
        }   

	}	
   else {
      Width = ((Width == null || Width < 0) ? 250 : Width); 
      Height = ((Height == null || Height < 0) ? 250 : Height); 
      Top = ((Top == null || Top < 0 || Top < minTop) ? minTop : Top); 
      //Left = ((Left == null || Left < 0 || Left < minLef) ? minLef : Left); 
      Mover = ((Mover == null) ? false : Mover); 
      Sizer = ((Sizer == null) ? false : Sizer); 
      zindex = zindex + 1; 

      // Centralizar
      if(Center)	
      {
        var w=800;
        var h=600;
        if(document.all || document.layers || document.getElementById) 
        {
		    w = screen.availWidth; h = screen.availHeight;
		    //alert('w='+w + ' h='+h);
		}
		Top = (w - Width)/2;
		Left = (h - Height) /2;
      }
        
      var j = new WinLIKE.window(Titulo, Top, Left, Width, Height,zindex); 
      //j.HD=true;
      //j.SD=true;
      //j.LD=true; //
      
    j.LD=LD;
    j.HD=HD;
    j.SD=SD;
    
      j.Mov = Mover; // PERMITIR mover
      j.Siz = Sizer; // ampliar/reduzir permited
      j.Nam = Nome;      // nome da Janela
	  j.Adr = 'about:blank';
      j.Ttl = Titulo;
      j.Tit = Titu;                     // Mostra (true) ou esconde titulo
      j.Ski = skin; 
      j.onEvent = 'onWinLikeFuncao'; 
      j.Vis = (Visi==null)?true:Visi;  // visivel
      //j.HD=false;
      //j.limit = janela; 
      j.Min = Min;
      if(Center) 
      {
        j.RLeft="WinLIKE.browsersize().Width/2 - Width/2";  // centraliza
        j.RTop="WinLIKE.browsersize().Height/2 - Height/2 - 10";  //centraliza top
       }

      WinLIKE.addwindow(j); 
	  
      //alert('janela criada');
      janela = WinLIKE.windows[WinLIKE.searchwindow(Nome)];  //.front();
      janela.Adr = Link;      // Link para abrir
	  janela.Vis = true;
	  if(janela.Mn) 
		  janela.minmax();
	  janela.draw(); // make the changes happen
	  janela.front();  // coloca na frente
      //
      }

    // libera bloqueio de tela
   Display('ih_',false);
   Display('ig_',false);

   }


/********************************************************************************************
// Funcao da janela. Executado quando algum evento eh  disparado 
********************************************************************************************/
function onWinLikeFuncao(win, acao) {
 	var divMsg = document.getElementById('lblMsg');
	//divMsg.innerText = divMsg.innerText + ' // acao=='+acao;
 	if (acao== 1) {
    	;                                           /*return false;*/ 
		} // minimizing
	else if (acao== 2) {    ;   /*return false;*/ } // restore
	else if (acao== 3) {    
		win.hideshow();    
		
		// 05/03/2007 - incluido para fechar o dojo.dialog, se houver
		if(typeof(dlg) == 'object')
		{
		  if(dlg)
		  {
		      showDialog('hide');
		      //alert('fechando winlike e abrindo dojo ');
		  }
		}
		
		// end
		   
		return false;   
		} // close
	else if (acao== 4) {    ;    /*return false;*/ } // open/reload
	else if (acao== 5) {    ;   /*return false;*/ } // source change
	else if (acao== 6) {    ;   /*return false;*/ } // history back
	else if (acao== 7) {    ;   /*return false;*/ } // history forward
	else if (acao== 8) {    ;                     } // risizing start
	else if (acao== 9) {    
		if(win.Top) {
			if(win.Top < minTop) {
				win.Top = minTop; //+'px';
				}    
			} 
		} // resizing end
	else if (acao==10) {    ;                     } // moving start
	else if (acao==11) {  
		if(win.Top) {
			if(!isNaN(win.Top) && (win.Top < minTop)) {
				win.Top = minTop;
				//divMsg.innerText = divMsg.innerText + '<br>Acao=11 --> win.Top='+win.Top;
				win.draw();
				}     
			}
			
			// Salva Cookie
			var cc = '';
			//document.cookie = 'name = ' + escape('WinLIKE') + ';win.Width + ';'+win.Height+';'+win.Top+';'+win.Left;				
		} // moving end
	else if (acao==12) {    ;   /*return false;*/ } // maximizing
	else if (acao==13) {    ;   /*return false;*/ } // restore
	else if (acao==14) {    ;   /*return false;*/ } // resizing
	else if (acao==15) {    
		if(win.Top) {
			if(!isNaN(win.Top) && (win.Top < minTop)) {
				win.Top = minTop;
				//divMsg.innerText = divMsg.innerText + '<br>Acao=15 --> win.Top='+win.Top;
				win.draw();
				}       /*return false;*/ 
			}
		} // moving

 }

/********************************************************************************************
// Funcao para Definir largura da Janela
********************************************************************************************/
function setHeight(Janela, Height) {
   if (document.body.offsetHeight == 0) // this is necessary for Mozilla because the onLoad event comes to early for offsetHeight...
   {
      setTimeout('setHeight("' + Janela + '", ' + myheight + ')', 100); 
      // call this procedure later again
      return; 
      // exit for now
      }
   var NNoffset = 16 // really don't know why (default skin use 16; for white skin 8 ...)
   var myoffset = WinLIKE.ie ? document.body.scrollHeight + 18 + 13 + 2 + 2 : // IE: scrollHeight + SkinTop + SkinBottom + SkinBorderTop + SkinBorderBottom (see wm-window.html of the skin for correct values)
   document.body.offsetHeight + 18 + 13 + 2 + 2 + NNoffset; 
   // NN: scrollHeight + SkinTop + SkinBottom + SkinBorderTop + SkinBorderBottom + ????? (see wm-window.html of the skin for correct values)
   // set Height to the minimum without scrollbars
   if (myheight ==- 1) myheight = myoffset; 
   number = WinLIKE.searchwindow(Janela) // find Menu window
   WinLIKE.windows[number].Height = myheight; 
   // set Height
   WinLIKE.windows[number].draw(); 
   // lets happen
   }

/********************************************************************************************
// Funcao para inicializar o WinLIKE
********************************************************************************************/
function mydefs() {
   /*
   var j = new WinLIKE.window('Hello', minLef+300, minTop+200, 200, 200, 1); 
   j.Nam = 'webMail';     // nome da Janela
   j.Adr = 'http://www.rcc.com.br/webmail';     // Link para abrir
   j.Ski = 'ceitonblue'; 
   j.Tit='Inicio';
   //j.onEvent = 'onWinLikeFuncao()'; 
   //j.limit = 1; 
   //j.Vis=false;
   // this is not a WinLIKE property; indicates, that x coordinate is not changable
   //j.skinTitleHeight = 21; 
   // this is not a WinLIKE property; we need it to limit the y-moving (see wm-window.html for the exact height value of the title)
   WinLIKE.addwindow(j); 
   //WinLIKE.windows[1].innerdoc().getElementByTagName('body').innerHTML ='OK<br><SC' +'RIP' + 'T>ALER' +'T("ok. janela ");</' + 'scri' + 'pt>';
   */
   }
   
   

// Apenas para teste
function onTeste() {
   var ELenght = window.screen.width; 
   // Determine screen resolution width
   var EHeight = window.screen.height; 
   //var oTest = document.getElementById('test');
   xScroll = document.body.scrollWidth; 
   yScroll = document.body.scrollHeight; 
   //oTest.style.top = (xScroll - 200)+'px';
   //oTest.innerText='TESTE? '+(xScroll - 200);
   alert('xScroll=' + xScroll + ' yScroll=' + yScroll); 
   }

var Forced=false;

/********************************************************************************************
// Sai do Sistema (encerra sessao)
********************************************************************************************/
function sairSistema(forced) 
{   // Forced, não pergunta nada ao usuário
    var isConfirmed=false;
    forced = ((forced==null)?false:forced);
    if(!forced)
    {
	    if(confirm("Deseja encerrar sua conexão com a Área do Assinante da RCC?"))
	    {
    	    isconfirmed=true;
    	    fechaAcessoCliente();
    	    MM_showHideLayers('ctl00_divMenuLogado','','hide');	
    	}
    }
	else
	{
	    isConfirmed=true;
	    fechaAcessoCliente();
	}
	    
}

// Fecha Acesso do Cliente
function fechaAcessoCliente(is2Logout)
{
	   //alert('fechando!');
	   is2Logout = ((is2Logout == null)?true:is2Logout);
     if(is2Logout)
     {
                //alert('Fechando conexao! -- fechaAcessoCliente.default');
	            //window.open('rcc_logout.aspx','frmHidden');         // Executa pagina para zerar SESSIONS
	    }
	    else
	        Mensagem('Sua sessao foi desconectada do sistema. Favor logar-se novamente!');
        //	    if(parent)    
        //            parent.location.href='http://'+urlPATH+'/default.aspx';
        //	    
        //Display('trMenuCliente',false);                     // Esconde menu do Cliente
        //        isConnected=false;                                  // desconecta controle
        //        fechaJanelas();                                     // Fecha janelas do Winlike que estiverem abertas
        //        loadintoIframe('frmCentral', 'rcc_principal.aspx'); // Abre pagina principal
    //alert('irá finalizar agora');
    isConnected=false;
    fechaJanelas();
    
    // esconde divMenuLogado
    //onAcessoShow();
    MM_showHideLayers('ctl00_divMenuLogado','','hide');	
    __doPostBack('ctl00$btnLogout','');     
    loadintoIframe('frmCentral', '/v8/rcc_principal.aspx');
            
}
/********************************************************************************************
// Mostra pagina de acesso do Cliente ou mostra Area de cliente
********************************************************************************************/
function onClienteStatus(status){
    //var menu = document.getElementById('divMenuCliente');
    //alert('status='+status);
    if(status == null)
      status = isConnected;
    //alert('status='+status);
    if(status==true){
        // Chamando evento do ASPNET
        //MM_showHideLayers('divMenuTopoLogado','','show');		
        //__doPostBack('ctl00$btnLogin','');            <-- Esta chamando direto do rcc.site.versao3.Master.cs. Bloco btnSecurity_click
    }
    //else{
		// em 12/07/2007
      //MM_showHideLayers('divMenuTopoLogado','','hide');		
			// Pega Posicionamento da tag 'divPosWinLike'
      //	    var divPW = document.getElementById('divAcesso');
      //	    var posPW = '1';
      //	    var posPY = '1';
      //      if(divPW)
      //	    {
      //	      posPW = findPosX(divAcesso) - 2; //divPW.style.left;
      //	      posPY = findPosY(divAcesso) + 20; // - ((isConnected)?21:0); //divPW.style.left;  
      //	    }
      //      var dvLogin = document.getElementById('divLogin');
      //      dvLogin.style.top = posPY+'px';
      //      dvLogin.style.left = posPW + 'px';
      //		
      //         var frmA = document.getElementById('frmAcessoCliente');
      //          frmA.style.width='335px'; //270
      //          frmA.style.height='200px'; //200
      //          frmA.src='rcc_login.aspx';
      //		  	  showLogin(); //hideLogin(); // esta na pagina master
			//return;
    //}
    isConnected=status;
    
    

}


/**
// Funcao para Tratar captura d eTecla <ENTER>
**/
function onEnter(ev,fld_target, funcao, isDebug) {

    var pF = document.forms[0];
    // Usario teclou enter
     if((document.layers && e.which == 13) || (document.all && window.event.keyCode == 13)) 
     { 
        if(pF.elements[fld_target])
        {
            if(funcao != null)
            {
                if(isDebug != null) 
                    alert('executará funcao: '+funcao);
                eval(funcao);
            }
            else
                pF.elements[fld_target].focus();

            return false;
        }
        else
        {
            //if(document.getElementById(fld_target))
            return true;
        }
     }
     else
     {
        return true;
     }

}


/********************************************************************************************
// Funcao para Mostrar/Esconder Objeto
// Use: Display('nomeDiv',false); // esconde
//      Display('nomeDiv',true);  // Mostra elemento
********************************************************************************************/
function Display(Objeto,Show) 
{
    var isIE = WinLIKE.ie; // IE?
    var Modo = '';
    var Ext='';

    if(Show) 
        Modo = ((isIE)?'':'visible');
    else
        Modo = ((isIE)?'none':'hidden');
    var Doc='';
    Doc =(isIE==true) ? 'document.all.':'document.getElementById("'; // Modo IE ou outros
    Ext =(isIE==true) ? '.style.display=':'\').style.visibility=';

    var executar = Doc+Objeto+Ext+'\''+Modo+'\';';

    //alert('executar=\n'+executar+'\nie='+isIE);

    if(document.getElementById(Objeto))
        eval(executar); // Executa operacao caso o objeto exista
}


/********************************************************************************************
// Funcao para Acionar menu do Cliente
********************************************************************************************/
function onMenuCliente(Menu) 
{
    if(dlgWaiting)
      dlgWaiting.show(); 
      
    switch(Menu) 
    {
        case 1: // Area central do Cliente
            loadintoIframe('frmCentral', 'assinante/default.aspx');
            break;
        case 2: // Licitações
            loadintoIframe('frmCentral', 'areacliente/licitacao.aspx?modalidade=all');
            break;
        case 3: // Remessas Anteriores
            loadintoIframe('frmCentral', 'areacliente/emails_enviados.aspx');
            break;
        case 4: //Serviços de Apoio
            loadintoIframe('frmCentral', 'areacliente/apoio.aspx');
            break;
        case 5: // Meu Cadastro
            loadintoIframe('frmCentral', 'areacliente/cadastro.aspx');
            break;
        case 6:  //Sair
            sairSistema();
            break;
        case 7:
          loadintoIframe('frmCentral', 'assinante/configuracao.aspx')
          break;
        case 8: // usado no Vitrine Flash sobre o lancamento do portal
          loadintoIframe('frmCentral','http://www.rcc.com.br/newrcc/mkt/2007/cursos_rcc/generica/novidade2007/novidade2007.asp');
          break;
          
        default:
            loadintoIframe('frmCentral', 'assinante/default.aspx');
            break;
    }
   ;
}

/*****************************************************************
// FEchar a janela (geral) - em 22/10/2008 - 19:06 - Luis ATL
*****************************************************************/
function onClosePage()
{
  self.close();
}