(function($) {
$.fn.logos = $.fn.logos = function(delay)
{
	delay = delay || 2000;
	initLogos = function(el)
	{
		stopLogos(el);
		el.items = $("li", el);
		// hide all items (except first one)
		el.items.not(":eq(0)").hide().end();
		// current item
		el.currentitem = 0;
		$("<div id='liLoader2' style='background:none; margin:10px 0px 50px 50px;'><span style='display:inline'><span style='font-weight:normal; font-size:11px;float:left;margin-top:5px; margin-left:7px;'>Loading ...</span></span></div>").appendTo("div.logos");
		startLogos(el);
	};
	startLogos = function(el)
	{
		el.tickfnlgo = setInterval(function() { doTicklgo(el) }, delay)
	};
	stopLogos = function(el)
	{
		clearInterval(el.tickfnlgo);
	};
	pauseTicker = function(el)
	{
		el.pause = true;
	};
	resumeTicker = function(el)
	{
		el.pause = false;
	};
	doTicklgo = function(el)
	{ 	
		// remove loader
		$("div#liLoader2").remove();
		
		// don't run if paused
		if(el.pause) return;
		// pause until animation has finished
		el.pause = true;
		// hide current item
		$(el.items[el.currentitem]).fadeOut("slow",
			function()
			{
				$(this).hide();
				// move to next item and show
				el.currentitem = ++el.currentitem % (el.items.size());
				$(el.items[el.currentitem]).fadeIn("slow",
					function()
					{
						el.pause = false;
					}
				);
			}
		);
	};
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase()!= "ul") return;
			initLogos(this);
		}
	)
	.addClass("logos")
	.hover(
		function()
		{
			// pause if hovered over
			pauseTicker(this);
		},
		function()
		{
			// resume when not hovered over
			resumeTicker(this);
		}
	);
	return this;
};

})(jQuery);



$(document).ready(
	function()
	{
		// show loader
		//$("<div id='liLoader' style='background:none'><img src='common/images/loader.gif' />&nbsp;&nbsp;<h3 style='display:inline'>Loading ...</h3></div>").appendTo("div.banner_border");
		$("#banner2").logos(4000);
	}
);
