jQuery(function($) {
	$("ul.lnb:eq(0)>li:eq(0)>ul").css({"left": 0});
	$("ul.lnb:eq(0)>li:eq(1)>ul").css({"left": 152});
	$("ul.lnb:eq(0)>li:eq(2)>ul").css({"left": 238});
	$("ul.lnb:eq(0)>li:eq(3)>ul").css({"left": 328});
	$("ul.lnb:eq(0)>li:eq(4)>ul").css({"left": 450});
	$("ul.lnb:eq(0)>li:eq(5)>ul").css({"left": 530});
	//$("ul.lnb:eq(0)>li:eq(7)>ul").css({"left": 225});
	$("ul.lnb:eq(0)>li:eq(7)>ul").css({"left": 215});

	//$('.widgetContainer:eq(0)').attr("id", "mainFeatured");
	$('.widgetContainer:eq(0)').attr("id", "mainEvent");
	$('.widgetContainer:eq(1)').attr("id", "mainCampaign");
	$('.widgetContainer:eq(2)').attr("id", "mainPeople");
	$('.widgetContainer ul').removeAttr("style");
	$('.widgetContainer ul *').removeAttr("style");

	$('#mainPeople ul li .thumbArea').css({ "display": "none", "opacity": 0 });
	$("<div id='mainPeopleNav'></div>").appendTo("#mainPeople");
	$("<h2><img src='/layouts/jh2c_layout/images/h_main_people.jpg' border='0' /></h2>").appendTo("#mainPeople");
	for (i=0; i<$('#mainPeople ul li').length; i++) {
		$("<a href='#'></a>").appendTo("#mainPeopleNav");
		$("#mainPeople .text:eq("+i+")").appendTo("#mainPeople .titleArea:eq("+i+")");
	}
	$("#mainPeopleNav a").each(function(index, elem) {
		$(elem).click(function() {
			window.clearTimeout(mainPeopleTimer);
			if ($(this).attr("class").indexOf("selected") > -1)
				return false;
			$("#mainPeopleNav a.selected").removeClass("selected");
			$(this).addClass("selected");
			$("#mainPeople ul li.selected .thumbArea").animate({ "opacity": 0}, 600);
			$("#mainPeople ul li.selected .thumbArea").css({ "display": "none" });
			$("#mainPeople ul li.selected").removeClass("selected");
			$("#mainPeople ul li:eq("+$(this).index()+")").addClass("selected");
			$("#mainPeople ul li:eq("+$(this).index()+") .thumbArea").animate({ "opacity": 1}, 600)
			$("#mainPeople ul li:eq("+$(this).index()+") .thumbArea").css({ "display": "block" });
			mainPeopleTimer = setTimeout("autoRollMainPeople("+($(this).index()+1)+");", 5000);
			return false;
		});
	});
	/*
	$("#mainPeople ul li").each(function(index, elem) {
		$(elem).hover(function() {
			$(this).find(".titleArea").animate({ "top": 205 }, 300);
		}, function() {
			$(this).find(".titleArea").animate({ "top": 305 }, 300);
		});
	});
	*/
	$("#mainPeopleNav a:eq(0)").click();

	$('ul.lnb>li').hover(function() {
		$(this).addClass('selected');
	}, function() {
		$(this).removeClass('selected');
	});
});
var mainPeopleTimer = null;
function autoRollMainPeople(mainPeopleIndex) {
	if (mainPeopleIndex == jQuery("#mainPeopleNav a").length) mainPeopleIndex = 0;
	jQuery("#mainPeopleNav a").eq(mainPeopleIndex).click();
}
