// JavaScript Document
			$(document).ready(function() {
				$(".resposta").hide();
				$(".pergunta").click(function(){
					$(".resposta:visible").slideUp("fast");
					$(this).next().slideDown("fast");
					return false;
				});
				
				$('#contato').jqm({modal:true, trigger: 'a.modalContato'});
				$('#aderir').jqm({modal:true, trigger: 'a.modalAdesao'});
				
				$(".opcaoContexto").hide();
		        $(":radio").change(function() {
		        	if((this.checked == true) && ($(this).val() == "sim"))
		        		$(".opcaoContexto").show();
		        	else
		        		$(".opcaoContexto").hide();
		        });
		        
		        $("#contatoTelefone").mask("(99) 9999-9999");
		        $("#adesaoTelefone").mask("(99) 9999-9999");
				
				/*$('ul.corFundo li a').click(function () {
	            	$('ul.corFundo li a').removeClass('selected');
	                $(this).addClass('selected');
	                return false;
	             });*/
			
			});

			function carregar()
            {
                document.getElementById('usuario').focus();
            }

            function autenticar()
            {
                document.login.submit();
            }
                       
            $(document).ready(function(){
					$('#senha').keypress(function (evt) {
     					if (evt.keyCode == 13) {
     					autenticar();
     					}
 					})
 			});             
                        
            function atualizarListaEstados( poRede, psIdentificador, psUnidade )
			{
			    var lsRede = poRede.options[poRede.selectedIndex].value + '';
			    var loListaEstado = document.getElementById( psIdentificador );
			    var loListaUnidades = document.getElementById( psUnidade );
			    loListaEstado.selectedIndex = 0;
			    if ( lsRede.length == 0 )
			    {
			        while ( loListaEstado.options.length > 1 )
			        {
			            loListaEstado.options[1] = null;
			        }
			        loListaEstado.disabled = true;
			    }
			    else
			    {
			    	loListaEstado.disabled = true;
			    	loListaUnidades.disabled = true;
			        $.getJSON( URL + 'core/Autenticacao/pegar-Estados-De-Rede/sRede/' + Url.encode( lsRede ), function(paLista){
			        	if( paLista.length > 0 )
			        	{
			        		loListaEstado.disabled = false;
			        	}
			        	preencherListaEstados( psIdentificador, paLista ); 
			        } );
			    }
			}
            
            function atualizarListaUnidades( poListaRede, poEstado, psIdentificador )
			{
			
			    var lsRede = poListaRede.options[poListaRede.selectedIndex].value + '';
			    var lsEstado = poEstado.options[poEstado.selectedIndex].value + '';
			    var loListaUnidade = document.getElementById( psIdentificador );
			    loListaUnidade.selectedIndex = 0;
			    if ( lsRede.length == 0 )
			    {
			        while ( loListaUnidade.options.length > 1 )
			        {
			            loListaUnidade.options[1] = null;
			        }
			        loListaUnidade.disabled = true;
			    }
			    else
			    {
			    	loListaUnidade.disabled = true;
			        var lsDominio = 'st=' + lsEstado + ',c=BR,o=' + lsRede + ',o=RID';
			        $.getJSON( URL + 'core/Autenticacao/pegar-Unidades-De-Dominio/sDominio/' + Url.encode( lsDominio ), function(paLista){
			        	if( paLista.length > 0 )
			        	{
			        		loListaUnidade.disabled = false;
			        	}
			        	preencherListaUnidades( psIdentificador, paLista ); 
			        } );
			    }
			}
			
			function preencherListaEstados( psIdentificador, paEstado )
			{
			    var loOpcao = null;
			    var loListaEstado = document.getElementById( psIdentificador );
			    while ( loListaEstado.options.length > 1 )
			    {
			        loListaEstado.options[1] = null;
			    }
			    for( var i=0; i < paEstado.length; i++ )
			    {
			        loListaEstado[i+1] = new Option( paEstado[i], paEstado[i] );
			    }
			}
			
			function preencherListaUnidades( psIdentificador, paUnidade )
			{
			    var loOpcao = null;
			    var loListaUnidade = document.getElementById( psIdentificador );
			    while ( loListaUnidade.options.length > 1 )
			    {
			        loListaUnidade.options[1] = null;
			    }
			    for( var i=0; i < paUnidade.length; i++ )
			    {
			        loListaUnidade[i+1] = new Option( paUnidade[i], paUnidade[i] );
			    }
			}