
(function($){ 	// ------------------------------------------------------------------------------------------------------------------------------ 	$ closure

	$(document).ready(function(){// -------------------------------------------------------------------------------------------	Document ready
		
		homeBlog = jQuery('#home-blog');
	
		updateBlogContent();
		
		
		$('#rotator').find('li img').WaitForImgLoad({
			onload: function(){
				
				$('#rotator-holder').find('.cover').animate({opacity:0},350,'swing',function(){
					
					$(this).remove();
					
					rotator	= $('#rotator').Slider({
						duration: 1000,
						interval: 10000,
						effect: 'easeInOutExpo',
						panelsNum: 1,
						orientation: 'horizontal',
						continuous: true,
						playOrder: 'ascending',
						holderQuery: '.items',
						panelsQuery: '.item',
						hasPrevNext: true,
						prevQuery: '.prev',
						nextQuery: '.next'
					});
					
				});
			}
		});
	
	
	
	
	}); // --------------------------------------------------------------------------------------------------------------------	Document ready

})(jQuery);	// ---------------------------------------------------------------------------------------------------------------------------------- 	$ closure


//-------------------------------------------------------------------------------------------	PUBLIC PROPERTIES

	var homeBlog = null;
	var rotator = null;
	//var patternOverlay = null;

//-------------------------------------------------------------------------------------------	PUBLIC METHODS

function updateBlogContent()
{
	homeBlog.find('.post-content').each(function(){
		var e = jQuery(this);
		var sText = e.text().substring(0,400);
		var sHref = e.parent().find('h2 a').attr('href');
		e.html('<p>' + sText.substring(0,sText.lastIndexOf(' ')) + ' ... <a class="more" href="' + sHref + '" title="Read more">Read more</a></p>').css('display','block');
	});	
}




