// laura blog core
jQuery(document).ready(function($) {
															   			
	//paging featured post
	$('#featured_pager').pajinate({
		items_per_page : 1,
		item_container_id : '.featured_pager_content',
		nav_panel_id : '.alt_page_navigation'
	});
			
	//lazyload
	$(".entry img").lazyload({
    	placeholder : "grey.gif",
        effect      : "fadeIn"
    });
	
	/* Resize too large images */
	var size = 600;
	var image = jQuery('#contentPost img');
	
	for (i=0; i<image.length; i++) {
		var bigWidth = image[i].width;
		var bigHeight = image[i].height;
	
		if (bigWidth > size) {	
			var newHeight = bigHeight*size/bigWidth;
			image[i].width = size;
			image[i].height = newHeight;
		}
	}
	
	jQuery(".left:empty + .right:empty").parent().remove();

	//scrolling
	$('#goup span').click(function(){
		$('html, body').animate({
			scrollTop: $("#header").offset().top
			}, 1000);				   
	});
	
	//image size
	$('.post .post_image_index img').css({'height':'96px', 'width':'170px'});
	
	//hover border effect
	$('.related_post img').mouseover(function() {
		$(this).css({'border':'5px solid #444'});
		}).mouseout(function() {
		$(this).css({'border':'5px solid #fff'});
	});
	
	//share it
	$("#share").jsocial({highlight: true,
		buttons: "delicious,facebook,stumbleupon,technorati,twitter,digg,google,newsvine,yahoo,", 
		imagedir: "http://www.lauragatto.net/wp-content/themes/Laura/images/", 
		imageextension: "png", 
		blanktarget: true});
	
	//open flickr external link
	$("#footer_wrap a[href]").attr('target','_blank');
	
	// Get latest 6 tweets by Graphicgatto twitter account
    $('#tweetsFeed').jTweetsAnywhere({
        username: 'Laura_Gatto',
        count: 4,
        showTweetBox: { label: '<span style="color: #D1C7BA">Spread the word ...</span>' }
    });
	
	// Get latest 5 rss by Beat Fly Blog
    $('#rssnews').rssfeed('http://feeds.feedburner.com/BeatFlyBlog', {
		limit: 3,
		titletag: 'h4',
		date: false,
		content: true,
		showerror: true,
		errormsg: 'Problem on getting News!'
	});
	
});//end

Cufon.replace('#blog_title span', {
	color: '-linear-gradient(#6A53C3, #3D3070)',
	textShadow: '0 1px 0 #fff',
	hover: {
		color: '-linear-gradient(#3D3070, #6A53C3)'
	}
});

Cufon.replace('h1.description', {
	color: '-linear-gradient(#222, #000)',
	textShadow: '0 1px 0 #fff',
	hover: {
		color: '-linear-gradient(#000, #222)'
	}
});

Cufon.replace('h2, h3, #RSSWrap h3', {
	textShadow: '0 1px 0 #fafafa',
	hover: {
		color: '#333'	
	}
});

Cufon.replace('h3, h4', {
	textShadow: '0 1px 0 #fafafa'
});

Cufon.replace('span.description', {
	textShadow: '0 1px 0 #fafafa'
});

Cufon.replace('.featuredpost .overlay a');

