
 function mostraFilial(a){
	$(".mapafilial").attr("href","index.php?metodo=mostrafilial&e="+a)
	$(".mapafilial").fancybox({
				'width'				: 750,
				'height'			: 300,
				'autoScale'			: false,
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'type'				: 'iframe',
				'overlayOpacity'	: 0.9,
				'overlayColor'		: "#FFF"
			});
	$(".mapafilial").click();		
} 
 
 window.onload = function()
{
	$("a[rel^='prettyPhoto']").prettyPhoto();

	if($('.gal-box li').size() > 7) {
		$('.gal-box').jCarouselLite({
			btnNext: "#nextN",
			btnPrev: "#prevN",
			speed: 300,  
			circular: true,
			scroll: 1,
			visible: 7
    	});
	}
	
	if($('.gal-cliente ul li').size() > 1) {
		
		 $(".gal-cliente").jCarouselLite({
			btnNext: "#nextC",
			btnPrev: "#prevC",			
			speed: 300,
			circular: true,
			scroll: 1,
			visible: 3
    	});
		
		
	}
	
	

	
	$('.data').mask('99/99/9999');
	$('.telefone').mask('(99) 9999-9999');
	$('.cpf-mask').mask('999.999.999-99');
	$('.cnpj-mask').mask('99.999.999/9999-99');
	
	
	// Monta janelas DIALOG JQUERY UI
	$(".dialog").dialog({
		bgiframe: true,
		modal: true,
		buttons: {
			Ok: function() {
				$(this).dialog('close');
			}
		}
	});
	$(".dialog-info").dialog({
		bgiframe: true,
		modal: true,
		autoOpen: false,
		buttons: {
			Ok: function() {
				$(this).dialog('close');
			}
		}
	});
	
	$(".im-loc").goMap({ 
        markers: [{  
            latitude: -18.382944,
            longitude: -49.208483, 			
            html: { 
                content: 'Transbandeirantes', 
                popup: true 
            } 
        },{  
            latitude: -18.382944, 
            longitude:-49.208483, 
            html: '' 
        }],
		zoom: 17,
		maptype: 'ROADMAP',
        hideByClick: false
    }); 
    
    $('#bt-apaga').click(function(){
	
		$("#formContato")[0].reset();	
	
	});
    
	
	$("#bx-estado").change(function(){		
	
		$.ajax({
			url: "?metodo=geraCidade",
			dataType: "html",
			type: "post",
			beforeSend: function(){ $("#bx-cidade").hide(); },
			data: "estado="+$("#bx-estado").val(),
			success: function(data){
				$("#bx-cidade").show();
				$("#bx-cidade").html(data);				
			},
			error: function(){ alert("Erro!");}			
			});
	
	});
	
	$("#curriculo").change(function() {
        var filename = $(this).val();
        var file_arr = filename.split('.');
        var last_item = file_arr.length - 1;
        var file_ext = file_arr[last_item];
        if(file_ext == 'DOC' || file_ext == 'doc' || file_ext == 'pdf' || file_ext == 'PDF' || file_ext == 'DOCX' || file_ext == 'docx') {
            
        } else {
        	
            alert('Somente são permitidos as extensões .DOC e .PDF');
            $(this).val("");
        }
    });
	
	
	
	

}




