// JavaScript Document
function SwitchNewsTags(id,num,count)
{
	ClearTagClasss(id,count);
	document.getElementById("tagname_" + id + num).className = "label1a";
	document.getElementById(id + num).className = "hexunShow";
}
function ClearTagClasss(id,count)
{
	for(i=1;i<=count;i++)
	{
		document.getElementById("tagname_" + id + i).className = "label1b";
		document.getElementById(id + i).className = "hexunHidden";
	}
}

/*产品查询*/
function SwitchSearchTags(id,num,count)
{
	ClearClasss(id,count);
	document.getElementById("searchname_" + id + num).className = "label9";
	document.getElementById(id + num).className = "hexunShow";
}
function ClearClasss(id,count)
{
	for(i=1;i<=count;i++)
	{
		document.getElementById("searchname_" + id + i).className = "label9a";
		document.getElementById(id + i).className = "hexunHidden";
	}
}



//tag.js

function hotarticles(id,img,t,num){
	document.getElementById(id).style.backgroundImage="url(http://img.hexun.com/money/"+img+")";
	hideall(t,3);
	//alert(111)
	document.getElementById(t+num).style.display="";
}

function hideall(id,count){
	for(i=1;i<=count;i++){
		document.getElementById(id+i).style.display="none";
	}
}

function interestrate(id1,id2,num){
	defaultcss(id1,3,"label8");
	hideall(id2,3);
	document.getElementById(id1+num).className="label7";
	document.getElementById(id2+num).style.display="";
}

function defaultcss(obj,count,css){
	for(i=1;i<=count;i++){
		document.getElementById(obj+i).className=css;
	}
}


//热门文章榜
function moneysearch_click(arg){
	loopmenu(7);
	if(arg==1){
	document.getElementById("ms_menu_"+arg).className="label3";
	}else{
	document.getElementById("ms_menu_"+arg).className="label3a";
	}
	document.getElementById("ms_box_"+arg).style.display="";
}
function loopmenu(arg){
	for(i=1;i<=arg;i++){
		if(i==1){
		document.getElementById("ms_menu_"+i).className="label2a";
		}else{
		document.getElementById("ms_menu_"+i).className="label2";
		}
		document.getElementById("ms_box_"+i).style.display="none";
	}
}
//精华评论
// 替换ajax_func.js中的addComment()方法
function addComment_new(entityid, dingtype) {
	document.getElementById("EntityID").value = entityid ; 
	if(dingtype == 1) {
		request = "http://comment.hexun.com/service/sptopic.action?topicId=" + entityid;
	}
	else {
		request = "http://comment.hexun.com/service/optopic.action?topicId=" + entityid;
	}
	aObj = new AjaxOverDomain(request);
	aObj.buildScriptTag();
	aObj.addScriptTag();
 	//不考虑返回数据，直接调用函数scall()
	scall();
  	aObj.removeScriptTag();
}

//进入条目搜索条目使用
function postwiki()
{
	var key=document.getElementById("wikikey").value;
	var url="http://wiki.hexun.com/search.aspx?t="+key;
	window.open(url, "_blank"); 
}
function postwiki2()
{
	var key=document.getElementById("wikikey").value;
	var url="http://wiki.hexun.com/wikisearch.aspx?sw="+key;
	window.open(url, "_blank"); 
}
function sel()
{
	document.getElementById("wikikey").select();
}
function clearInput()
{
	document.getElementById("wikikey").value="";
}



