/**
 * homeInit javascript class
 *
 * @package  home
 */
var homeInit =
{

	/**
	 * onReady method
	 *
	 * @return void
	 */
	onReady: function()
	{
		this.initCarousel();
	},
	
	initCarousel: function()
	{
		$('.jcarousel').jcarousel({
			scroll: 1,
			initCallback: function(carousel) {
				$('.jcarousel-control a').bind('click', function() {
					carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
					return false;
				});
			},
			itemVisibleInCallback: {
				onAfterAnimation: function(c, o, i, s) {
					--i;
					jQuery('.jcarousel-control a').removeClass('active').addClass('inactive');
					jQuery('.jcarousel-control a:eq('+i+')').removeClass('inactive').addClass('active');
				}
			}
		});
		$('.jcarousel-item').removeClass('nodisplay');
	},
	
	socialTweeter: function()
	{
		new TWTR.Widget({
			version: 2,
			type: 'profile',
			rpp: 3,
			interval: 6000,
			width: 'auto',
			height: 300,
			theme: {
				shell: {
					background: '#a3c760',
					color: '#333333'
				},
				tweets: {
					background: '#ffffff',
					color: '#333333',
					links: '#7cb31c'
				}
			},
			features: {
				scrollbar: false,
				loop: false,
				live: false,
				hashtags: true,
				timestamp: true,
				avatars: false,
				behavior: 'all'
			}
		}).render().setUser('infotres').start();
	}
	
};


/**
 * Execute onReady method
 */
$(document).ready(function(){
	homeInit.onReady();
});

