	function $y(o){ return (typeof o == "object")?o:document.getElementById(o);}	
	
			$z().ready(function() {
				$z('.kwicks').kwicks({
					max : 114,
					spacing : 0
				});
			});

function ScrollText(content,btnPrevious,btnNext,autoStart,timeout,isSmoothScroll)
{
    this.Speed = 10;
    this.Timeout = timeout;
	this.stopscroll =false;//是否停止滚动的标志位
	this.isSmoothScroll= isSmoothScroll;//是否平滑连续滚动
    this.LineHeight = 20;//默认高度。可以在外部根据需要设置
    this.NextButton = this.$(btnNext);
    this.PreviousButton = this.$(btnPrevious);
    this.ScrollContent = this.$(content);
    this.ScrollContent.innerHTML += this.ScrollContent.innerHTML;//为了平滑滚动再加一遍

	if(this.PreviousButton)

	{
		this.PreviousButton.onclick = this.GetFunction(this,"Previous"); 
		this.PreviousButton.onmouseover = this.GetFunction(this,"MouseOver");
		this.PreviousButton.onmouseout = this.GetFunction(this,"MouseOut");
	}
	if(this.NextButton){
		this.NextButton.onclick = this.GetFunction(this,"Next");
		this.NextButton.onmouseover = this.GetFunction(this,"MouseOver");
		this.NextButton.onmouseout = this.GetFunction(this,"MouseOut");
    }
    this.ScrollContent.onmouseover = this.GetFunction(this,"MouseOver");
    this.ScrollContent.onmouseout = this.GetFunction(this,"MouseOut");

    if(autoStart)
    {
        this.Start();
    }
}

ScrollText.prototype = {

	$:function(element)
	{
		return document.getElementById(element);
	},
	Previous:function()
	{
		this.stopscroll = true;
		this.Scroll("up");
	},
	Next:function()
	{
		this.stopscroll = true;
		this.Scroll("down");
	},
	Start:function()
	{
		if(this.isSmoothScroll)
		{
			this.AutoScrollTimer = setInterval(this.GetFunction(this,"SmoothScroll"), this.Timeout);
		}
		else
		{		
			this.AutoScrollTimer = setInterval(this.GetFunction(this,"AutoScroll"), this.Timeout);
		}
	},
	Stop:function()
	{
		clearTimeout(this.AutoScrollTimer);
		this.DelayTimerStop = 0;
	},
	MouseOver:function()
	{	
		this.stopscroll = true;
	},
	MouseOut:function()
	{
		this.stopscroll = false;
	},
	AutoScroll:function()
	{
		if(this.stopscroll) 
		{
			return;
		}
		this.ScrollContent.scrollTop++;
		if(parseInt(this.ScrollContent.scrollTop) % this.LineHeight != 0)
		{
			this.ScrollTimer = setTimeout(this.GetFunction(this,"AutoScroll"), this.Speed);
		}
		else
		{
			if(parseInt(this.ScrollContent.scrollTop) >= parseInt(this.ScrollContent.scrollHeight) / 2)
			{
				this.ScrollContent.scrollTop = 0;
			}
			clearTimeout(this.ScrollTimer);
			//this.AutoScrollTimer = setTimeout(this.GetFunction(this,"AutoScroll"), this.Timeout);
		}
	},
	SmoothScroll:function()
	{
		if(this.stopscroll) 
		{
			return;
		}
		this.ScrollContent.scrollTop++;
		if(parseInt(this.ScrollContent.scrollTop) >= parseInt(this.ScrollContent.scrollHeight) / 2)
		{
			this.ScrollContent.scrollTop = 0;
		}
	},
	Scroll:function(direction)
	{

		if(direction=="up")
		{
			this.ScrollContent.scrollTop--;
		}
		else
		{
			this.ScrollContent.scrollTop++;
		}

		if(parseInt(this.ScrollContent.scrollTop) >= parseInt(this.ScrollContent.scrollHeight) / 2)
		{
			this.ScrollContent.scrollTop = 0;
		}
		else if(parseInt(this.ScrollContent.scrollTop)<=0)
		{
			this.ScrollContent.scrollTop = parseInt(this.ScrollContent.scrollHeight) / 2;
		}
		
		if(parseInt(this.ScrollContent.scrollTop) % this.LineHeight != 0)
		{
			this.ScrollTimer = setTimeout(this.GetFunction(this,"Scroll",direction), this.Speed);
		}
	},
	GetFunction:function(variable,method,param)
	{
		return function()
		{
			variable[method](param);
		}
	}
}

function ignoreError() {
  return true;
}

function showMenu(num){
	for(var i=0;i<4;i++){
		$y("label"+i).className="";
        $y("title"+i).className="";
		$y("news-contents"+i).style.display="none";
	}
	$y("label"+num).className="labelHere";
    $y("title"+num).className="titleHere";
	$y("news-contents"+num).style.display="";
}

function callPPRoll(){
	if(ppRollTime<15){
		showPPInfoMenu(ppRollTime%2);
		ppRollTime++;
	}else clearInterval(ppRoll);
}

function callPPRollz(){
	if(ppRollTimez<15){
		showPPInfoMenuz(ppRollTime%2);
		ppRollTimez++;
	}else clearInterval(ppRollz);
}

function callPPRolly(){
	if(ppRollTimey<15){
		showPPInfoMenuy(ppRollTime%2);
		ppRollTimey++;
	}else clearInterval(ppRolly);
}

function callPPRollx(){
	if(ppRollTimex<15){
		showPPInfoMenux(ppRollTime%2);
		ppRollTimex++;
	}else clearInterval(ppRoll);
}

function callPPRollw(){
	if(ppRollTimew<15){
		showPPInfoMenuw(ppRollTime%2);
		ppRollTimew++;
	}else clearInterval(ppRoll);
}

function showMenuz(num){
	for(var i=0;i<4;i++){
		$y("labelz"+i).className="";
        $y("titlez"+i).className="";
		$y("news-contentsz"+i).style.display="none";
	}
	$y("labelz"+num).className="labelHere";
    $y("titlez"+num).className="titleHere";
	$y("news-contentsz"+num).style.display="";
}	

function showPPInfoMenu(num){
	for(var i=0;i<2;i++){
		$y("ppMenu"+i).className="";
		$y("ppMainDesc"+i).style.display="none";
	}
	$y("ppMenu"+num).className="ppMenuHere";
	$y("ppMainDesc"+num).style.display="";
}	

function showPPInfoMenuz(num){
	for(var i=0;i<2;i++){
		$y("ppMenuz"+i).className="";
		$y("ppMainDescz"+i).style.display="none";
	}
	$y("ppMenuz"+num).className="ppMenuHere";
	$y("ppMainDescz"+num).style.display="";
}	

function showPPInfoMenuy(num){
	for(var i=0;i<2;i++){
		$y("ppMenuy"+i).className="";
		$y("ppMainDescy"+i).style.display="none";
	}
	$y("ppMenuy"+num).className="ppMenuHere";
	$y("ppMainDescy"+num).style.display="";
}	

function showPPInfoMenux(num){
	for(var i=0;i<2;i++){
		$y("ppMenux"+i).className="";
		$y("ppMainDescx"+i).style.display="none";
	}
	$y("ppMenux"+num).className="ppMenuHere";
	$y("ppMainDescx"+num).style.display="";
}	

function showPPInfoMenuw(num){
	for(var i=0;i<2;i++){
		$y("ppMenuw"+i).className="";
		$y("ppMainDescw"+i).style.display="none";
	}
	$y("ppMenuw"+num).className="ppMenuHere";
	$y("ppMainDescw"+num).style.display="";
}
$z(document).ready(function(){
	var objChangeStr = ".changebox";
	$z(objChangeStr + ":not(:first)").css("display","none");
	setInterval(function(){
	if( 
	    $z(objChangeStr + ":last").is(":visible")){
		$z(objChangeStr + ":first").fadeIn("slow").addClass("advin");
		$z(objChangeStr + ":last").hide()
	}
	else{
		$z(objChangeStr + ":visible").addClass("advin");
		$z(objChangeStr + ".advin").next().fadeIn("slow");
		$z(objChangeStr + ".advin").hide().removeClass("advin")}
	},4000)
})