function mycarousel_itemLoadCallback(carousel, state) {
	// Check if the requested items already exist
	if (carousel.has(carousel.first, carousel.last)) {
		return;
	}

	$.get('/scrollFooterFeature/', {
		first : carousel.first,
		last : carousel.last
	},
			function(xml) {
				mycarousel_itemAddCallback(carousel, carousel.first,
						carousel.last, xml);
				setTimeout(function() {
					$(window).trigger('resize');
				}, 1000);
			}, 'xml');
};

function mycarousel_itemAddCallback(carousel, first, last, xml) {
	// Set the size of the carousel
	carousel.size(parseInt($('total', xml).text()));

	$('image', xml).each(function(i) {
		carousel.add(first + i, mycarousel_getItemHTML($(this).text()));
	});
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(url) {
	myurl = url.split("|");
	return '<a title="' + myurl[2] + '" href="' + myurl[1] + '"><img src="'
			+ myurl[0] + '" width="100" height="75" alt="" /></a>';
};

$(document).ready(function() {
	$('#mycarousel').jcarousel( {
		itemLoadCallback : mycarousel_itemLoadCallback
	});

	$("#mycarousel ul img").live('hover', function() {
		$('#scrollDivContent').html($(this).parent().attr('title'));
	});

	$('#mycarousel2').jcarousel( {
		scroll : 2
	});
	$('#mycarousel3').jcarousel( {
		scroll : 1
	});

	$('li.navMore').hover(function() {
		$('ul.navMoreUl').toggle();
	});

	$('ul.navMoreUl').mouseenter(function() {
		$(this).show();
	}).mouseleave(function() {
		$(this).hide();
	});

	$(window).resize(function() {
		if ($(window).width() > 1198)
			$('#staticAd').show();
		else
			$('#staticAd').hide();
	}).trigger('resize');

	var Div3 = $("div.div3");
	$("#lgHover").click(function(e) {
		if (Div3.is(':hidden')) {
			Div3.show();
		}
	});
	$("div.div3").mouseleave(function() {
		$("div.div3").hide();
		$("div.brLogo").hide();
	});

});
