/**
 * Application Scripts
 * Use it only for default methods around the website
 */
$(function(){
	/**
	 * TARGET BLANK
	 */
	$('.target-blank').click(function(){
		$(this).attr('target', '_blank').click();
		return false;
	});
	
	/**
	 * Dropdown Previous
	 */
	 
	$(".sub-nav").hide();
	$("a.previous").click(function(){
        $('.sub-nav').stop(true,true).slideToggle("fast");
        
    }, function(){	
        $('.sub-nav').stop(true,true).slideToggle("fast");
    });
    
    /**
	 * Aba Photos e Videos Home
	 */
	$('.videos').hide();
	
	$("#content-tab .tab-ul li a").click(function(){
		var self = $(this);
		var rel = self.attr("rel");
		
		$("#tab-wrap>div").each(function(){
			$(this).fadeOut('fast');
		});
		$("#content-tab .tab-ul li a").removeClass("current");
		self.addClass("current");
		
		setTimeout(function(){
			$("." + rel).fadeIn('slow', function(){
			});
		},500);
	});
	
	/**
	 * Effect Opacity
	 */
	$('.effect-opacity').css('opacity', 0.7);
	$('a.title-listing').hover(function(){
		$('.effect-opacity', this).css('opacity', 1);
	}, function(){	
       $('.effect-opacity', this).css('opacity', 0.7);
    });
    
    /* Banner Photos Home */		
	$('ul#slide-photos').innerfade({
		speed: 1000,
		timeout: 3000,
		type: 'sequence',
		containerheight: '205px'
	});					
	/* Banner Photos Home */
	
	/**
	 * Twitter  
	 */
	$('#twitterSearch').liveTwitter('sesibonecos', {limit: 2, rate: 5000});
	
	/**
	 * Banner Home
	 */
	 $('#slider-one').plusSlider({
	    displayTime: 5000, // The amount of time the slide waits before automatically moving on to the next one. This requires 'autoPlay: true'
	    sliderType: 'fader', // Choose whether the carousel is a 'slider' or a 'fader'
		width: 479, // Overide the default CSS width
		height: 300 // Overide the default CSS width
	});
});

