//Post Slider
jQuery(document).ready(function(){
	jQuery('.slides').cycle({
			fx: 'scrollHorz', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
			easing: 'easeInOutQuad',
			cleartype:  1,		
			timeout: 6000,
			speed:600,
			pause: 0,
			autostop:1, 
			pager:'.slide-nav',	
			next:'#next-slide',
			prev:'#prev-slide'

		});


});


jQuery(document).ready(function(){
// Lastest works slideshow
	jQuery('#lastest-works').cycle({
	fx: 'scrollHorz',
	easing: 'easeInOutQuad',
    speed:  'slow', 
    timeout: 0, 
    next:   '#arr-next', 
    prev:   '#arr-prev'
	});
});

jQuery(document).ready(function(){
// IE FIX
if(jQuery.browser.msie){
	jQuery('<span class="overlayIE"></span>').prependTo('a.thumb');
	jQuery('.overlayIE').css({opacity : 0});
	jQuery('a.thumb').hover(function(){				
		jQuery('.overlayIE',this).stop().animate({ opacity : .5},280);
	}, function(){
		jQuery('.overlayIE',this).stop().animate({ opacity : 0},150);
	});		
}	
// img overlay
jQuery('<span class="overlay"></span>').prependTo('a.thumb');
jQuery('.overlay').css({opacity : 0});
jQuery('a.thumb').hover(function(){				
	jQuery('.overlay',this).stop().animate({ opacity : 1},280);
}, function(){
	jQuery('.overlay',this).stop().animate({ opacity : 0},150);
	});
});

// PrettyPhoto
$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto();
});

//Roll Menu
$(document).ready(function(){
    $("#nav_principale ul span.why-rollover").css({'opacity':'0'});
	$('#nav_principale ul li.why a').hover(
		function() {
			 $("#nav_principale ul span.why-rollover").stop().fadeTo(250, 1);
		},
		function() {
		 $("#nav_principale ul span.why-rollover").stop().fadeTo(250, 0);
		}
	)
	
	$("#nav_principale ul span.about-rollover").css({'opacity':'0'});
	$('#nav_principale ul li.about a').hover(
		function() {
			 $("#nav_principale ul span.about-rollover").stop().fadeTo(250, 1);
		},
		function() {
		 $("#nav_principale ul span.about-rollover").stop().fadeTo(250, 0);
		}
	)
	
	$("#nav_principale ul span.questions-rollover").css({'opacity':'0'});
	$('#nav_principale ul li.questions a').hover(
		function() {
			 $("#nav_principale ul span.questions-rollover").stop().fadeTo(250, 1);
		},
		function() {
		 $("#nav_principale ul span.questions-rollover").stop().fadeTo(250, 0);
		}
	)
	
	$("#nav_principale ul span.contacts-rollover").css({'opacity':'0'});
	$('#nav_principale ul li.contacts a').hover(
		function() {
			 $("#nav_principale ul span.contacts-rollover").stop().fadeTo(250, 1);
		},
		function() {
		 $("#nav_principale ul span.contacts-rollover").stop().fadeTo(250, 0);
		}
	)
});


//Tips
$(function() {
	$('a[rel=tipsyw]').tipsy({fade: true, gravity: 'w'});
	$('a[rel=tipsyn]').tipsy({fade: true, gravity: 'n'});
	$('a[rel=tipsys]').tipsy({fade: true, gravity: 's'});
	$('a[rel=tipsye]').tipsy({fade: true, gravity: 'e'});
	$('a[rel=tipsyne]').tipsy({fade: true, gravity: 'ne'});
	$('a[rel=tipsyse]').tipsy({fade: true, gravity: 'se'});
});

//Tabs 1
jQuery(document).ready(function(){

	//Default Action
	jQuery("#tab-prod .tab_content").hide(); //Hide all content
	jQuery("#tab-prod ul.tabs li:first").addClass("active").show(); //Activate first tab
	jQuery("#tab-prod .tab_content:first").show(); //Show first tab content
	
	//On Click Event
	jQuery("#tab-prod ul.tabs li").click(function() {
		jQuery("#tab-prod ul.tabs li").removeClass("active"); //Remove any "active" class
		jQuery(this).addClass("active"); //Add "active" class to selected tab
		jQuery("#tab-prod .tab_content").hide(); //Hide all tab content
		var activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn(); //Fade in the active content
		return false;
	});

});

//Tab 2

jQuery(document).ready(function(){

	//Default Action
	jQuery("#tab-sidebar .tab_content").hide(); //Hide all content
	jQuery("#tab-sidebar ul.tabs li:first").addClass("active").show(); //Activate first tab
	jQuery("#tab-sidebar .tab_content:first").show(); //Show first tab content
	
	//On Click Event
	jQuery("#tab-sidebar ul.tabs li").click(function() {
		jQuery("#tab-sidebar ul.tabs li").removeClass("active"); //Remove any "active" class
		jQuery(this).addClass("active"); //Add "active" class to selected tab
		jQuery("#tab-sidebar .tab_content").hide(); //Hide all tab content
		var activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn(); //Fade in the active content
		return false;
	});

});

//Effetcs
$(document).ready(function(){
 $(".blocco_domanda_singola").hover(function() {
               $(this).stop().animate({ marginLeft: "15px"}, 200);
               },function() {
               $(this).stop().animate({ marginLeft: "0" }, 200);
               });
 });

//Twitter last
 $(document).ready(function(){
        $(".twittata").tweet({
            username: "PiaBeautyGuide",
            join_text: "auto",
            avatar_size: 30,
            count: 1,
            auto_join_text_default: "we said,",
            auto_join_text_ed: "we",
            auto_join_text_ing: "we were",
            auto_join_text_reply: "we replied to",
            auto_join_text_url: "we were checking out",
            loading_text: "caricamento tweets..."
        });
    });

	
	// TABS WIDGET 
	
	
jQuery(document).ready(function(){

		//Default Action
		jQuery(".tab_content").hide(); //Hide all content
		jQuery("ul.tabs li:first").addClass("active").append('<span class="freccetta"></span>').show(); //Activate first tab
		jQuery(".tab_content:first").show(); //Show first tab content

		//On Click Event
		jQuery("ul.tabs li").click(function() {
			jQuery("ul.tabs li").removeClass("active"); //Remove any "active" class
			jQuery(".blocchetto-rounded-chiaro").find(".freccetta").remove();
			jQuery(this).append('<span class="freccetta"></span>').addClass("active"); //Add "active" class to selected tab
			jQuery(".tab_content").hide(); //Hide all tab content
			var activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
			jQuery(activeTab).fadeIn(); //Fade in the active content
			return false;
		});

	});

