function searchSubmit()
{ 
  var qvalue = document.searchForm.q.value;
    var currUrl = location.href;
  qvalue=qvalue.replace(/%|\\|\/|\+/g, "");
  //qvalue=qvalue.toUpperCase();
  //qvalue=qvalue.replace(/\s+(AND|OR|NOT)$|\s+(AND|OR|NOT)\s+$|^(AND|OR|NOT)\s+|^(AND|OR|NOT)$/g, "");
  qvalue=qvalue.replace(/(^\s*)|(\s*$)/g, "");
  if(qvalue=="" || /^\.(\.)+\.$/.test(qvalue)){
//  if(qvalue==""){
  	alert("输入搜索字符！");
  	return false;
  }
  
 if(currUrl.indexOf("/group/inc/group_head_new_index.jsp")>=0)
{
		window.open("http://group.hudong.com/s/group/"+encodeURIComponent(qvalue),"_blank");
		return false;
}
else
{
	 if(currUrl.indexOf("/s/gdoc") > 0)
  {
  	window.location="http://group.hudong.com/s/gdoc/"+encodeURIComponent(qvalue);
  }else if(currUrl.indexOf("/s/gtopic") > 0)
  {
  	window.location="http://group.hudong.com/s/gtopic/"+encodeURIComponent(qvalue);
  }else
  {
  	window.location="http://group.hudong.com/s/group/"+encodeURIComponent(qvalue);
  }
  return false;
}
 
  
  
}

function searchGroupSubmit()
{ 
	var groupiden = document.searchForm.groupiden.value;
	var qvalue = document.searchForm.q.value;
	var currUrl = location.href;
	qvalue=qvalue.replace(/%|\\|\/|\+/g, "");
	qvalue=qvalue.toUpperCase();
	qvalue=qvalue.replace(/\s+(AND|OR|NOT)$|\s+(AND|OR|NOT)\s+$|^(AND|OR|NOT)\s+|^(AND|OR|NOT)$/g, "");
	qvalue=qvalue.replace(/(^\s*)|(\s*$)/g, "");
	if(qvalue=="" || /^\.(\.)+\.$/.test(qvalue)){
		alert("输入其它字符！");
		return false;
	}
	var soArray=document.searchForm.so;
	var so="groupdoc";
	for(i=0;i<soArray.length;i++){
		if(soArray[i].checked){
			so=soArray[i].value;
			break;
		}
	}
	if(currUrl.indexOf("/group/inc/group_head_new_index.jsp")>=0)
	{
		window.open("http://group.hudong.com/s/"+groupiden+"/"+so+"/"+encodeURIComponent(qvalue)+"/","_blank");
		return false;
	}	
	window.location="http://group.hudong.com/s/"+groupiden+"/"+so+"/"+encodeURIComponent(qvalue)+"/";
	return false;
}

//各个频道加亮class="op"
function setChannel(){
	//取得当前url
	var currUrl = location.href;
	if(currUrl.indexOf("/group/inc/group_head_new_index.jsp")==-1)
	{
		setTop(currUrl);
	}
}

function setTop()
{
	if(document.location != top.location)
	{
		top.location = document.location;
	}
}