
// JavaScript Document
DEBUG = true ;
function debug(s){
	if(DEBUG){
		console.log(s);
	}
}

$(document).ready(function(){
	ae_lista_menu_servico();
});

var click_status = 1 ; 

var vetor_estados = {
	'AC' : {
			'e_nome' 	: 'Acre' ,
			'cidade'	: '' ,
			'endereco'	: '' ,		
			'telefone'	: ''	
	},
	'AL' : {
			'e_nome'	: 'Alagoas' 
	},
	'AP' : {
			'e_nome'	:  'Amap&aacute;'
	},			
	'AM' : {
			'e_nome'	: 'Amazonas' ,
	},			
	'BA' : {
			'e_nome'	: 'Bahia' ,
			'cidade'	: 'Salvador' ,
			'endereco'	: 'Centro' ,		
			'telefone'	: 'Tel: (71) 9252-8810'				
	},			
	'CE' : {
			'e_nome'	: 'Cear&aacute;' ,
	},			
	'DF' : {
			'e_nome'	: 'Distrito Federal' ,
			'cidade'	: '' ,
			'endereco'	: '' ,		
			'telefone'	: ''				
	},			
	'ES' : {
			'e_nome'	: 'Esp&iacute;rito Santo' ,
			'cidade'	: 'Vitória' ,
			'endereco'	: '' ,
			'telefone'	: 'Tel: (21) 7988-7933'
	},			
	'GO' : {
			'e_nome'	: 'Goi&aacute;s' ,
			'cidade'	: 'Goiania' ,
			'endereco'	: '' ,		
			'telefone'	: 'Tel: (34) 3238-3497'			
	},			
	'MA' : {
			'e_nome'	: 'Maranh&atilde;o' ,
	},			
	'MT' : {
			'e_nome'	: 'Mato Grosso' ,
	},			
	'MS' : {
			'e_nome'	: 'Mato Grosso do Sul' ,
	},			
	'MG' : {
			'e_nome'	: 'Minas Gerais' ,
			'cidade'	: 'Belo Horizonte' ,
			'endereco'	: 'Av. Nossa Senhora do Carmo nº 1885 – Sion' ,		
			'telefone'	: 'Tel: (31) 2105-5650 / Tel: (31) 2105-5628'			
	},			
	'PA' : {
			'e_nome'	: 'Par&aacute;' ,
	},			
	'PB' : {
			'e_nome'	: 'Para&iacute;ba' ,
	},			
	'PR' : {
			'e_nome'	: 'Paran&aacute;' ,
			'cidade'	: 'Curitiba' ,
			'endereco'	: '' ,
			'telefone'	: 'Tel: (51) 3474-8841'			
	},			
	'PE' : {
			'e_nome'	: 'Pernambuco' ,
	},			
	'PI' : {
			'e_nome'	: 'Piau&iacute;' ,
	},			
	'RJ' : {
			'e_nome'	: 'Rio de Janeiro' ,
			'cidade'	: 'Filial – Rio de Janeiro' ,
			'endereco'	: 'Rio de Janeiro' ,
			'telefone'	: 'Tel: (11) 4335-9713 / Cel: (11) 7767-7515 / Cel: (31) 9155-4298 <br/> Nextel: 54*7251 '
	},			
	'RN' : {
			'e_nome'	: 'Rio Grande do Norte' ,
	},			
	'RS' : {
			'e_nome'	: 'Rio Grande do Sul' ,
			'cidade'	: 'Sapucaia do Sul' ,
			'endereco'	: '' ,
			'telefone'	: 'Tel: (51) 3474-8841'
	},			
	'RO' : {
			'e_nome'	:  'Rond&ocirc;nia' ,
	},			
	'RR' : {
			'e_nome'	:  'Roraima' ,
	},			
	'SC' : {
			'e_nome'	: 'Santa Catarina' ,
			'cidade'	: 'Florianópolis' ,
			'endereco'	: '' ,		
			'telefone'	: 'Tel: (51) 3474-8841'
	},			
	'SP' : {
			'e_nome'	: 'S&atilde;o Paulo' ,
			'cidade'	: 'São Bernardo do Campo' ,
			'endereco'	: 'Rua Mario Zampieri nº 57 – Sala 36 – Santa Rita de Cássia' ,		
			'telefone'	: 'Tel: (11) 4335-9713 / Cel: (11) 7767-7515 / Cel: (31) 9155-4298 <br/> Nextel: 54*7251'			
	},			
	'SE' : {
			'e_nome'	: 'Sergipe' ,
			'cidade'	: 'Aracaju' ,
			'endereco'	: '' ,		
			'telefone'	: 'Tel: (71) 9252-8810'
	},			
	'TO' : {
			'e_nome'	:  'Tocantins'
	},					
}


function SgiEnviaEmailContato(){
	$.post('../ajax_portal/AjaxPortalContato',$('#frm-contato').serialize(),function(data){if(data){eval(data.js);}},'json');	
}

function SgiSalvaAlteracaoSenha(p){
	
	if(!p) { p = http_path + '/ajax_portal/AjaxSalvaInfoEmailAcesso' ; }

	$.post( p , $('#sgi_frm_recsenha').serialize() , function(data){

		if(data){
			eval(data.js);
		}

	},'json');
	
}

var clicked = 0;
function ae_lista_menu_servico(){
	$('.bgmenucontainer .servico').click(function(){
		if(clicked == 0){
			clicked = 1;
			$('.servico-lista').css({
				'left' : $('.bgmenucontainer .servico').position().left - 25
			}).show();
			$(this).unbind('mouseleave').mouseleave(function(){$('.servico-lista').hide();clicked = 0;});
			$('.servico-lista .infcontainer').css('margin-left',-($('.servico-lista .infcontainer').width()/2));	
		}
	});
}


function retorna_estado_info(estado){
	if(click_status == 1){
		click_status = 0 ; 
		$('.estado-info').slideUp({ duration: 100,  easing: 'easeInQuad' , complete : function(){
			$('.titulo_filiais').html("Filiais em " + vetor_estados[estado].e_nome);
			$('.cidade').html(vetor_estados[estado].cidade);
			$('.endereco').html(vetor_estados[estado].endereco);
			$('.telefone').html(vetor_estados[estado].telefone);

		} }).slideDown({ duration: 1000,  easing: 'easeOutBounce' , complete : function(){ click_status = 1; } });
	}
}

