/**
 * 
 */
j = jQuery.noConflict();
j(document).ready(function($){
	//MASCARAS NOS INPUTS
	$("#data").mask("99/99/9999");
    $("#tel_res").mask("(99) 9999-9999");
	$("#tel_cel").mask("(99) 9999-9999");
	$("#tel_com").mask("(99) 9999-9999");
    $("#cep").mask("99.999-999");

	
	$.featureList(
		$("#tabs li a"),
		$("#output li"), {
			start_item	:	0
		}
	);
	
	
	// Exibe/Oculta conteudo Redes Sociais
	$(".campo_redes_esconde").hide();
	$(".exibir_redes").click(function(){
		$(this).toggleClass("ocultar_redes")
		$(".campo_redes_esconde").slideToggle('slow')
		$(".espandir").toggleClass("ocultar")
	});
	$('#ex').toggle(function(){
		$('#espandirT').html('Ocultar')
	},function(){
		$("#espandirT").html('Expandir')
	});
	
	//ACCORDION BUTTON ACTION	
	$('h5.accordionBotao').click(function() {
		if(false == $(this).next().is(':visible'))
		{
		$('.accordionConteudo').slideUp('slow');
		}
		//$('.accordionConteudo:visible').slideToggle('slow');	
		$(this).parent().find('.accordionConteudo').slideToggle('slow');
		//return false;
	});
	
	$('ul#galleryIndex').carouFredSel({
    items: 1,
	height:320,
	width:850,
	auto : { pauseDuration : 8000 },
	direction: "left",
	prev : {   
	        button  : "#prevG",
	        key     : "left"
	},
	next : {
	        button  : "#nextG",
	        key     : "right"
	},
		scroll : {
		items: 1,
		effect: "easeOutBounce",
		duration: 1500,                        
		pauseOnHover: true
		}
	});
	
	$("#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('Envie seu currículo em Word ou PDF');
            $(this).val("");
        }
    });
	
	// 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');
			}
		}
	});
	
	// This initialises carousels on the container elements specified, in this case, carousel1.
	$("#carousel1").CloudCarousel(		
		{			
			reflHeight: 56,
			reflGap:2,
			xPos: 320,
			yPos: 50,
			xRadius: 150,
			yRadius: -1,
			buttonLeft: $("#left-but"),
			buttonRight: $("#right-but"),
			altBox: $("#alt-text"),
			titleBox: $("#title-text"),
			mouseWheel: true,
			FPS:30,
			speed: 0.15,
			autoRotate: 'left',
			autoRotateDelay: 5000
			//bringToFront:true
		}
	);
	
	$("#carousel2").CloudCarousel(		
			{			
				reflHeight: 56,
				reflGap:2,
				xPos: 320,
				yPos: 0,
				xRadius: 150,
				yRadius: -1,
				buttonLeft: $("#left-but2"),
				buttonRight: $("#right-but2"),
				altBox: $("#alt-text2"),
				titleBox: $("#title-text2"),
				mouseWheel: false,
				FPS:30,
				speed: 0.15,
				autoRotate: 'left',
				autoRotateDelay: 5000
				//bringToFront:true
			}
		);
		
		$("#right-but2").click(function(){
			
			$(".cloudcarousel").each(function(i){
				
				if($(this).css("z-index")==100){
					
					$("#title-text2").html($(this).attr("title"));
					$("#alt-text2").html($(this).attr("alt"));
				
				}
			
			});
		
		});
		
		$(".port-item").hover(function(){
		
			$(this).css("background-color","#75B733");
			$(this).find('span').css("color","#FFF");
			$(this).find('p').css("color","#FFF");
		},function(){
		
			$(this).css("background-color","#DCF0C1");
			$(this).find('span').css("color","#666");
			$(this).find('p').css("color","#693");
		});
		 
		$(".box_local").goMap({ 
        markers: [{  
            latitude: -16.690872, 
            longitude: -49.284389,			
            html: { 
                content: 'Raddar Online', 
                popup: true 
            } 
        },{  
            latitude: -16.690872, 
            longitude:-49.284389, 
            html: '' 
        }],
		zoom: 18,
		maptype: 'HYBRID',
        hideByClick: false
    }); 
		
});	
