Cufon.replace('h1, h2');
jQuery.noConflict();

jQuery(document).ready(function() {
	var tweetContainer = jQuery('<div id="twitter"></div>').prependTo('body').css({opacity : '0'}).animate({opacity :'1'}, 500);
    jQuery('#twitter').getTwitter({
					userName: "osmany",
					numTweets: 1,
					loaderText: "Wait for it...",
					slideIn: true,
					slideDuration: 750,
					showHeading: false,
					headingText: "OH MY TWEETNESS",
					showProfileLink: false,
					showTimestamp: true
				},function(){
					jQuery('div#twitter li').css({'opacity':'0','margin-right':'0'})
										   .animate({opacity:'1',marginRight :'120',textShadow:'0px 0px 5px #fff'}, 800)
										   .animate({textShadow:'0px 0px 2px #fff'}, 1500);
				});
	jQuery('.content h2').css({opacity:'0.9'});
	jQuery('div.content').addClass('corner-all');
	jQuery('div#right').addClass('corner-all');
	jQuery('div.tabs').show();
	jQuery('.content h2 span').css({'paddingTop':'0px', 'paddingBottom':'0px', lineHeight :'100%', opacity :'0'}).animate({paddingTop :'10px', paddingBottom :'10px', lineHeight :'200%', opacity :'1'}, 500);
	jQuery('#box-recentposts').addClass('tabContent');
	jQuery('#box-recentcomments').addClass('tabContent');
	jQuery('#box-archives').addClass('tabContent').append('<div class="spacer">&nbsp;</div>');
	//on passe tous les onglets dans une variable
	var tabContainer = jQuery('div.tabContent');
	//afichage par default du premier onglet
	tabContainer.hide().find('.decorator2').hide().parent().filter(':first').show();
	//comportement au click des onglets
	jQuery('div.tabs ul.tabNavigation a').click(function () {
	        tabContainer.hide();
	        tabContainer.filter(this.hash).stop().css({'opacity':'0'}).show().animate({'opacity':'1'}, 1500);
	        jQuery('div.tabs ul.tabNavigation span').removeClass('selected');
	        jQuery(this).parent().addClass('selected');
	        return false;
	}).filter(':first').click();
	jQuery('.sidebar .boxcontent-decorator3 a:not("div.tabs a")').hover(
	        function(){
	            jQuery(this).stop()
	            			.animate({textShadow :'0px 0px 10px #ff0000'},1500)
	        },
	        function(){
	            jQuery(this).stop()
	            			.animate({textShadow :'0px 0px 0px transparent'},200)
	        }
	)
	//
	    var postPreview = jQuery('div.postpreview');
	    jQuery('<div class="cat-watermark"></div>').appendTo('div.vignette').hide();
	    postPreview.hover(
	        function(){
	            jQuery(this).find('div.cat-watermark')
	            			.stop()
	            			.css({'opacity' : 0})
	            			.show()
	            			.animate({'opacity': 0.8}, 'fast');
	        },   
	        function(){
	            jQuery(this).find('div.cat-watermark')
	            			.stop()
	            			.animate({'opacity': 0}, 'fast');
	        })
	   
	   //TWITTER ANIM
	   
	
	jQuery('div#twitter p')
		.css({'opacity':'0','margin-right':'0'})
		.animate({opacity:'1',marginRight :'120',textShadow:'0px 0px 5px #fff'}, 800)
		.animate({textShadow:'0px 0px 2px #fff'}, 1500);

	var titleHover = jQuery('.content h2').stop();
	titleHover.hover(
	        function(){
	            jQuery(this).find('span').stop().animate({opacity:'0.2'}, 200)
	        },
	        function(){
	            jQuery(this).find('span').stop().animate({opacity:'1'}, 200)
	        }
	);

	var commentCounter = jQuery('span.meta.comments');
	commentCounter.css({marginRight : '-30px', opacity : '0'}).animate({marginRight : '10px', opacity : '1'}, 500);
});