$(document).ready(function() {
	var columnR=$('#right li');
	var columnLast=$('#right li:last-child');
	var columnL=$('#left div');
	var n=columnR.length;
	var indexC;
	columnR.mouseover(function () {
		columnR.find('a').removeClass();
		$(this).find('a').addClass('current');

		columnR.find('a').each(function (index,domEl) {
			if (domEl.className=='current') {
				indexC=index;
			}
		});

		columnR.removeClass();
		columnLast.addClass('end')
		if ($(this).prev())	{
			$(this).prev().addClass('end')
			$(this).addClass('end');
		} else {
			$(this).addClass('end');
		}

		columnL.css({display:'none'});
		columnL.eq(indexC).css({display:'block'});

		return false;
	});

	//¹ö¶¯ÐÂÎÅ

	var step=1;
	var limit=18;
	var partMaxH=$('#part1').height();
	$('#part2').html($('#part1').html());

	var initNews;
	var moveTop
	
	function moveLayer() {
		moveTop=parseInt($('#newsScroll').css('top'));
		moveTop=moveTop-step;
		$('#newsScroll').css({top:moveTop.toString()+'px'});
	}
	function flagLayer() {
		if (moveTop%limit==0)	{
			clearInterval(initNews);
			if (moveTop==(partMaxH*(-2)+limit))	{
				$('#newsScroll').css({top:(partMaxH*(-1)+limit).toString()+'px'});
			}
			var timer=setTimeout(function () {
				initNews=setInterval(function () 
				{
					moveLayer();
					flagLayer();
				},100);
			},2000)
		}
	}
	initNews=setInterval(function () 
	{
		moveLayer();
		flagLayer();
	},100);
	
})