;jQuery.noConflict();
jQuery(function($) {
	
	/*
	 * Products images
	 */
	$('.fancybox').fancybox({
		titlePosition : 'inside'
	});

	/*
	 * Gallery slideshow
	 */
	var $galleryContainer = $('.cms-home .home-slideshow');
	if ($galleryContainer.length) {
		$galleryContainer.wrapInner($('<div class="inner-wrapper"></div>'));
		$galleryContainer.easySlider({
			auto : true,
			pause : 3000,
			continuous : true,
			numeric : true,
			numericId : 'slideshow-controls'
		});
	}

	/*
	 * Twitter
	 */
	var $twitter = $('#tweet > div:first');
	var twitterCookieName = 'woodrow-twitter-cache';
	var twitterHtml = $.cookie(twitterCookieName);

	if (twitterHtml) {
		$twitter.html(twitterHtml);
	} else {
		$twitter.getTwitter({
			userName : $twitter.attr('class'),
			numTweets : 1,
			loaderText : 'Loading tweet...',
			slideIn : false,
			showHeading : false,
			headingText : 'Latest Tweet',
			showProfileLink : false,
			showTimestamp : true,
			callbackOnComplete : function() {
				var cacheExpiration = new Date();
				cacheExpiration.setTime(cacheExpiration
						.getTime() + 60 * 60 * 1000);

				$('a', $twitter).attr('target', '_blank');
				$.cookie(twitterCookieName, $twitter.html(), {
					expires : cacheExpiration,
					path : '/'
				});
			}
		});
	}
	
});
