	var PH_HOTWORDS=['古田','食用菌','翠屏湖在线','农村','玉田'];
	var search_action_array=['http://www.cph.com.cn/search.asp?ModuleName=Article&Field=Title&Keyword=','http://www1.baidu.com/s?wd=','http://www.google.com/search?hl=zh-CN&inlang=zh-CN&ie=GB2312&oe=GB2312&q='];
	var search_array=['ra0','ra1','ra2'];
	var search_index=0;
	function switch_search(index)
	{
		$('c').value = index==0?5:1;
		$('searchForm').action=search_action_array[index];
	}
	function init_search()
	{
		switch_search(search_index);
		V.addListener(search_array,'click',
			function(e,obj)
			{
				var tmp=0;
				for(var i=0;i!=search_array.length;i++)
				{
					if(obj.id==search_array[i])
					{
						tmp=i;break;
					}
				}
				switch_search(tmp);
			}
		)
		V.addListener('searchbutton','click',function(e,obj){$('searchForm').submit();});
		$('searchForm').q.focus();
		$('searchForm').q.value=PH_HOTWORDS[1];
	}
	
function clickLoginSelect(){
	if($("loginFldselectop").style.display == "block"){
		$("loginFldselectop").style.display = "none";
	}else{
		$("loginFldselectop").style.display = "block";
		selectlist();
	}
}
function myclick(obj)
{
	$("loginUl").innerHTML = obj.innerHTML;
	$("loginFldselectop").style.display = "none";
}
function selectlist(){
	var liObj = $("loginFldselectop").getElementsByTagName("li");
	for (var j=0;j<liObj.length;j++){
		liObj[j].onmouseover=function(){
			this.style.background="B4777A";
			this.getElementsByTagName("a")[0].style.color="white";
			
		}
		liObj[j].onmouseout=function(){
			this.style.background="white";
			this.getElementsByTagName("a")[0].style.color="black";
		}
		liObj[j].onclick=function(){
			$("loginFldselectop").style.display == "none";
		}
	}
}
function getHotwords()
{
	var PH_HOTWORDS_TRAGET='http://gsearch.ifeng.com/gsearch/gsearch.jsp?q=', __s='';
	for(var i=1;i<5;i++){__s+='<a href="'+PH_HOTWORDS_TRAGET+encodeURIComponent(PH_HOTWORDS[i])+'" target="_blank">'+PH_HOTWORDS[i]+'</a>  ';}
	return __s;
}
function clear_text(){
	var t = document.getElementById("q");
	t.value="";
}

function scrollnews(){	
	var text_holder = document.getElementById("newscommend");	
	text_holder.innerHTML=document.getElementById("Icesan_newsScroll").innerHTML;
}

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);
		}
	},
	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;
}
window.onerror = ignoreError; 