//调整页面高度
$(window).load(function(){
	var leftHeight = $("#PageLeft #Head").height()+$("#PageLeft #Foot").height();
	//alert(leftHeight);
	var rightHeight = $("#PageRight #HeadR").height()+$("#PageRight #Body").height()+$("#PageRight #FootR").height();
	//alert(rightHeight);
	if( leftHeight < rightHeight )
	{
		$("#PageLeft #Foot").height( rightHeight-$("#PageLeft #Head").height() );
	}
	
	if( leftHeight > rightHeight )
	{
		$("#PageRight #Body").height( leftHeight-75-($("#PageLeft #HeadR").height()+$("#PageRight #FootR").height()) );
	}
})

// JavaScript Document
//翻动
function Turn( LR )
{
	var AltPic = document.getElementById("AltPic");
	var AltPicFirst = document.getElementById("AltPic").firstChild;
	var AltPicLast = document.getElementById("AltPic").lastChild;
	AltPic.insertBefore(AltPicLast,AltPicFirst);
	var BigPic = document.getElementById("AltPic").lastChild;
	if( LR == "R" )
	{
		BigPic.style.left = "-872px";
		MovePic("R");
	}else if( LR == "L" ){
		BigPic.style.left = "872px";
		MovePic("L");
	}
}
//移动
function MovePic( LR )
{
	var BigPic = document.getElementById("AltPic").lastChild;
	if( LR == "R" )
	{
		BigPic.style.left = ""+(parseInt(BigPic.style.left)+6)+"px";
		var TimeOut = setTimeout( "MovePic('R')",10 );
		if( parseInt(BigPic.style.left) >= 0 )
		{
			BigPic.style.left = "0px";
			clearTimeout( TimeOut );
		}
	}else if( LR == "L" ){
		BigPic.style.left = ""+(parseInt(BigPic.style.left)-6)+"px";
		var TimeOut = setTimeout( "MovePic('L')",10 );
		if( parseInt(BigPic.style.left) <= 0 )
		{
			BigPic.style.left = "0px";
			clearTimeout( TimeOut );
		}
	}
}
