var $j = jQuery.noConflict();

function buildStageAndCarousel() {	
	$j('#mainStage').cycle(
			{
				speed :1200,
				fx :'fade',
				timeout :5000,
				pager :'#mainStageNav ul',
				pause :1,
				pauseOnPagerHover :1,
				pagerEvent: 'mouseover',

				pagerAnchorBuilder : function(idx, slide) {
					return '<li><a href="' + slide.href + '">' + slide.title + '</a></li>';
				}
			});
	
	$j('#mainStage img').css("display", "block");
};

function adjustMenulist() {
	$j('.subMenuList').css("margin-top", 
		function() {
			var h1 = $j('.subMenuList').height();
			var h2 = $j('.mainItem.active').height();
			var h = h1 + h2 + 12;
			return "-" + h + "px";
		}
	);
	$j('.subMenuList').css("margin-left",
		function() {
			return "-12px" ; 
		}
	);
	
	$j('.subMenuList').css("width", 
			function() {
				var w1 = $j('.mainItem.active').width() + 24;
				var w2 = $j('.subMenuList').width() + 1;
				var w = (w2 < w1) ? w1 : w2;
				return w + "px";
			}
		);

	
	$j('.subMenuList').css("visibility", "visible");
	
};


