if (!Array.prototype.forEach)
{
	Array.prototype.forEach = function(fun /*, thisp */)
	{
		"use strict";

		if (this === void 0 || this === null)
			throw new TypeError();

		var t = Object(this);
		var len = t.length >>> 0;
		
		if (typeof fun !== "function")
			throw new TypeError();

		var thisp = arguments[1];
		
		for (var i = 0; i < len; i++)
		{
			if (i in t)
			fun.call(thisp, t[i], i, t);
		}
	};
}

var SMALL_CAROUSEL	= {
	animationEase												: 'easeInOutQuint',
	animationIntervalTime										: 6000,
	animationTime												: 1000,
	checkInterval												: null,
	hasjQuery													: true,
	jqueryQueue													: [ ],
	
	checkForjQuery												: function()
	{
		if ( typeof jQuery != 'undefined' )
		{
			clearInterval( SMALL_CAROUSEL.checkInterval );

			SMALL_CAROUSEL.jqueryQueue.forEach( function(o)
			{
				o.f.apply( null, o.a );
			});
		}
	},
	
	startCarousel												: function()
	{
		if ( !SMALL_CAROUSEL.hasjQuery )
		{
			SMALL_CAROUSEL.jqueryQueue.push( SMALL_CAROUSEL.startCarousel );
			
			return;
		}
		
		var c	= jQuery( '.small_carousel' );

		if ( c.length > 0 )
		{
			var u	= jQuery( 'ul', c );
			var m   = jQuery( 'li', c ).length;
			var w   = jQuery( 'li:first', c ).outerWidth();
			var i   = 1;
			
			u.width( m * w );
			
			if ( m == 0 )
			{
				return;
			}
			
			setInterval( function()
			{
				if ( i >= m )
				{
					i   = 0;
				}

				u.animate({
					'margin-left'   : i * w * -1 + 'px'
				}, SMALL_CAROUSEL.animationTime, SMALL_CAROUSEL.animationEase );

				i++;
		    }, SMALL_CAROUSEL.animationIntervalTime );
		}
	}
};

SMALL_CAROUSEL.checkForjQuery();

if ( typeof jQuery == 'undefined' )
{
	SMALL_CAROUSEL.checkInterval	= setInterval( SMALL_CAROUSEL.checkForjQuery, 250 );
	
	document.write( '<scr' + 'ipt src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></scr' + 'ipt>' );
	document.write( '<scr' + 'ipt src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></scr' + 'ipt>' );
}
