var queryString;
var vxmlHttp;

function setHomepage()//设置首页
{
　　 if (document.all)
　　 {
　　 document.body.style.behavior='url(#default#homepage)';
　　 document.body.setHomePage('http://www.hudong.com');
　　 }
　　 else if (window.sidebar)
　　 {
　　 if(window.netscape)
　　 {
　　 try
　　 {
　　 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
　　 }
　　 catch(e)
　　 {
　　 alert("抱歉！您的浏览器不支持直接设为首页。请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为“true”，点击“加入收藏”后忽略安全提示，即可设置成功。");
　　 }
　　 }
　　 var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
　　 prefs.setCharPref('browser.startup.homepage','http://www.hudong.com');
　　 }
}

function addBookmark(title) { //设置收藏夹
	var url=parent.location.href;
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
	 	window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
}

//added by wdd for getting title from url to input
function getTitleFromUrl()
{
	var title=null; 
	var titleStr=null;
	var pos=null;
	var posChar=null;
	var q=null;	
	try{
		var url = window.location.href;
		var len = url.length;
		if( (pos = url.indexOf("/wiki/")) !=-1)
		{
			titleStr = url.substring(pos+6, len);
		}else if( (pos = url.indexOf("/s/doc/"))!=-1 )
		{
			titleStr = url.substring(pos+7, len);
		}
		if(titleStr != null)
		{
			if((posChar=titleStr.indexOf("#"))!=-1)
			{
				titleStr=titleStr.substring(0, posChar);
			}
			if((posChar=titleStr.indexOf("?"))!=-1)
			{
				titleStr=titleStr.substring(0, posChar);
			}
			title = decodeURIComponent(titleStr);
			if(title!=null && (title.indexOf("+")!=-1))
			{
				title=title.replace("+"," ");
			}
			q = document.searchForm.q;
			if(q!=null && title != null)
			title=title.replace(/\%26/g,"&");
			title=title.replace(/\%2B/g,"+");
			q.value = title;
		}
	}catch(e)
	{}
}

function searchSubmit()
{ 
  var qvalue = document.searchForm.q.value;
  qvalue=qvalue.replace(/(^\s*)|(\s*$)/g, "");
  qvalue=qvalue.replace(/\/|\%|\\/g, "");
  qvalue=qvalue.replace(/\&/g,"%26");
  qvalue=qvalue.replace(/\+/g,"%2B");
  if(qvalue.length>100){
  	qvalue=qvalue.substring(0,100);
  }
  
  if(qvalue == "" || /^(\.)*(\.){1,}(\.)*$/.test(qvalue)){
  	alert("请输入搜索内容");
  	return false;
  }else if(window.location.href.indexOf("http://yun.hudong.com") == -1 && window.location.href.indexOf("/docweb/web.jsp") == -1){
  	var type = document.searchForm.so.value;
  	window.location="http://so.hudong.com/s/"+type+"/"+encodeURIComponent(qvalue);
  }else
  {
    queryString = qvalue;
  	ajxDocWeb(qvalue);
  	return false;
  }
  //return false;
}

String.prototype.trim = function(){return this.replace(/(^\s*)|(\s*$)/g, "");}

function searchSubmit1(type0)
{
	var q;
	var currUrl = location.href;
	if(type0 =="3" || type0=="4")
	{
		q = document.getElementById("q2").value;
		type0 -= 2;
	}else
	{
    	q = document.getElementById("q").value;
    }
    q=q.replace(/(^\s*)|(\s*$)/g, "");
    q=q.replace(/\/|\%|\\/g, "");
    q=q.replace(/\&/g,"%26");
    q=q.replace(/\+/g,"%2B");
    if(q == null || q.trim() == "")
    {
        alert("请输入搜索内容");
        return false;
    }
    
    if(q.length>100){
  		q=q.substring(0,100);
  	}
  	
  	if((window.location.href.indexOf("http://yun.hudong.com") != -1 || window.location.href.indexOf("/docweb/web.jsp") != -1) && type0 == "1")
  	{
  		queryString = q;
  		if(q.indexOf("输入你感兴趣的人或事物的名字，如") != -1)
  		{
  			window.location.reload();
  		}else
  		{
  			ajxDocWeb(q);
  		}
  		return false;
  	}
  	
    var so = document.getElementById("so").value;
    //小组
    if(so == "group")
    {
    	if(currUrl.indexOf("/inc/index_head_tg")>=0)
		{
			window.open("http://group.hudong.com/s/" + encodeURIComponent(q),"_blank");
			return false;
		}
        window.location.href = "http://group.hudong.com/s/" + encodeURIComponent(q);
        return false;
    }
    if(type0 == "1" && so == "doc")
    {
    	if(currUrl.indexOf("/inc/index_head_tg")>=0)
		{
			window.open("http://www.hudong.com/wiki/" + encodeURIComponent(q),"_blank");
			return false;
		}	
    	window.location.href = "http://www.hudong.com/wiki/" + encodeURIComponent(q);
    	return false;
    	
    }
    //任务
    if(so == "task")
    {
    	if(currUrl.indexOf("/inc/index_head_tg")>=0)
		{
			window.open("http://task.hudong.com/searchmission.wiki?mission_title=" + encodeURIComponent(q),"_blank");
			return false;
		}
	    window.location.href="http://task.hudong.com/searchmission.wiki?mission_title=" + encodeURIComponent(q);
	    return false;
    }
    //图片版权中心
    if(so == "copyright_photo")
    {
    	if(currUrl.indexOf("/inc/index_head_tg")>=0)
		{
			window.open("http://photo.hudong.com/photocenter/photoSearch?query=" + encodeURIComponent(q),"_blank");
			return false;
		}  
	    window.location.href="http://photo.hudong.com/photocenter/photoSearch?query=" + encodeURIComponent(q);
	    return false;
    }
	if(currUrl.indexOf("/inc/index_head_tg")>=0)
	{
		window.open("http://so.hudong.com/s/" + so + "/" + encodeURIComponent(q),"_blank");
		return false;
	}
	
	//图片搜索区分普通图片和版权图片
	if(so == "tupian"){
	  try{
		var selectvalue=document.getElementById("copyright_photoSelect");
		if(selectvalue.checked){
		    window.location.href="http://photo.hudong.com/photocenter/photoSearch?query=" + encodeURIComponent(q);
			return false;
		}
	  }catch(e){}
	}
		
    window.location.href="http://so.hudong.com/s/" + so + "/" + encodeURIComponent(q);
    return false;
}

function searchSubmit_tg(type0)
{
    var q = document.getElementById("q").value;
    q=q.replace(/(^\s*)|(\s*$)/g, "");
    q=q.replace(/\/|\%|\\/g, "");
    q=q.replace(/\&/g,"%26");
    q=q.replace(/\+/g,"%2B");
    if(q == null || q.trim() == "")
    {
        alert("请输入搜索内容");
        return false;
    }
    
    if(q.length>100){
  		q=q.substring(0,100);
  	}
  	
  	var so = document.getElementById("so").value;
    if(type0 == "1" && so == "doc")
    {
    	window.open("http://www.hudong.com/wiki/" + encodeURIComponent(q));
    	return false;
    }
    window.open("http://so.hudong.com/s/" + so + "/" + encodeURIComponent(q));
    return false;
}

function viewSearchDoc()
{
	try{
		var qvalue = document.searchForm.q.value;
		qvalue=qvalue.replace(/(^\s*)|(\s*$)/g, "");
		qvalue=qvalue.replace(/\/|\%|\\/g, "");
		qvalue=qvalue.replace(/\&/g,"%26");
		qvalue=qvalue.replace(/\+/g,"%2B");
		if(qvalue.length>100)
		{
			qvalue=qvalue.substring(0,100);
		}
		if(qvalue == "" || /^(\.)*(\.){1,}(\.)*$/.test(qvalue)){
			alert("请输入搜索词条");
		//}else if(qvalue.indexOf(":") != -1 || qvalue.indexOf("：") != -1){
		//	searchSubmit();
		}else{
			window.location="http://www.hudong.com/wiki/"+encodeURIComponent(qvalue);
		}
	}catch(e){}
	return false;
}
function setIframe_logo()
{
	var fatherUrl = document.referrer;
	var logoObj = document.getElementById("logo");
	if(fatherUrl.indexOf("http://www.hudong.com/fenlei")>=0||fatherUrl.indexOf("http://www.hudong.com/wiki")>=0||fatherUrl.indexOf("http://www.hudong.com/mission")>=0||fatherUrl.indexOf("http://www.hudong.com/categorypage")>=0||(fatherUrl.indexOf("http://www.hudong.com/more/")>=0))
	{
		//百科
		if(logoObj!=null)
		{
			document.domain = "hudong.com";
			qObj = document.getElementById('q');
			qObj.setAttribute('autocomplete','off');
			logoObj.href="javascript:void(0)";
			logoObj.onclick = function(){top.location.href='http://www.hudong.com';};
			logoObj.innerHTML='<img src="/images/logo.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			
		}
	}else if(fatherUrl.indexOf("http://wiki.hudong.com")>=0||fatherUrl.indexOf("http://so.hudong.com/s/user/")>=0||(fatherUrl.indexOf("http://so.hudong.com/s/")>=0&&fatherUrl.indexOf("/user/")>0))
	{
		//空间
		if(logoObj!=null)
		{
			logoObj.innerHTML='<img src="http://www.hudong.com/images/logospace.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			logoObj.href="javascript:void(0)";
			logoObj.onclick= function(){top.location.href='http://wiki.hudong.com/';};
		}
	}else if(fatherUrl.indexOf("http://wikibar.hudong.com/")>=0||fatherUrl.indexOf("http://so.hudong.com/s/bar/")>=0||(fatherUrl.indexOf("http://so.hudong.com/s/")>=0&&fatherUrl.indexOf("/bar/")>0))
	{
		//维吧
		if(logoObj!=null)
		{
			logoObj.innerHTML='<img src="http://www.hudong.com/images/logowikibar.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			logoObj.href="javascript:void(0)";
			logoObj.onclick=function(){top.location.href='http://wikibar.hudong.com/';};
		}
	}else if(fatherUrl.indexOf("http://task.hudong.com/")>=0||fatherUrl.indexOf("http://www.hudong.com/s/task/")>=0)
	{
		//任务
		if(logoObj!=null)
		{
			logoObj.innerHTML='<img src="/images/logo.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			logoObj.href="javascript:void(0)";
			logoObj.onclick=function(){top.location.href='http://task.hudong.com/';};
		}
	}else if(fatherUrl.indexOf("http://so.hudong.com/search.do?so=tupian")>=0 || fatherUrl.indexOf("http://so.hudong.com/s/tupian/")>=0 || (fatherUrl.indexOf("http://so.hudong.com/s/")>=0&&fatherUrl.indexOf("/tupian/")>0) || fatherUrl.indexOf("http://tupian.hudong.com") >= 0)
	{
	    //图片
		if(logoObj!=null)
		{
			logoObj.innerHTML='<img src="http://www.hudong.com/images/logotupian.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			logoObj.href="javascript:void(0)";
			logoObj.onclick=function(){top.location.href='http://tupian.hudong.com/';};
		}
	}else if(fatherUrl.indexOf("http://yun.hudong.com") != -1 || fatherUrl.indexOf("/docweb/web.jsp") != -1 || fatherUrl.indexOf("/about/index.jsp") != -1)
	{
		//知识云
		if(logoObj!=null)
		{
			logoObj.innerHTML='<img src="/images/yun_logo_bg_no.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			logoObj.href="javascript:void(0)";
			logoObj.onclick=function(){top.location.href='http://yun.hudong.com/';};
		}
	}else if(fatherUrl.indexOf("http://so.hudong.com/s/doc/")>=0||(fatherUrl.indexOf("http://so.hudong.com/s/")>=0&&fatherUrl.indexOf("/doc/")>0))
	{
		//搜索百科
		if(logoObj!=null)
		{
			document.domain = "hudong.com";
			qObj = document.getElementById('q');
			qObj.setAttribute('autocomplete','off');
			logoObj.href="javascript:void(0)";
			logoObj.onclick=function(){top.location.href='http://www.hudong.com';};
			logoObj.innerHTML='<img src="/images/searchlog.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
		}
	}
}
//各个频道加亮class="op"
function setChannel(){
	//取得当前url
	var currUrl = location.href;
	var topUrl = document.referrer;
	var indexObj;
	var soForm = document.getElementById("searchForm");
	var logoObj=document.getElementById("logo");
	var title1 = document.title;
	if(currUrl.indexOf("http://www.hudong.com/wiki")>=0||currUrl.indexOf("http://www.hudong.com/fenlei")>=0||currUrl.indexOf("http://www.hudong.com/mission")>=0||currUrl.indexOf("http://www.hudong.com/categorypage")>=0||(currUrl.indexOf("http://www.hudong.com/more/")>=0))
	{
		//百科
		indexObj = document.getElementById('wiki');
		if(indexObj!=null){
			indexObj.getElementsByTagName("a")[0].className='bold';
		}
		if(logoObj!=null)
		{
			if(currUrl.indexOf("http://www.hudong.com/wiki")>=0||currUrl.indexOf("http://www.hudong.com/fenlei")>=0||currUrl.indexOf("http://www.hudong.com/categorypage")>=0){
				
			}else{
				logoObj.href='http://www.hudong.com';
				logoObj.innerHTML='<img src="/images/logo.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			}
		}
		if(currUrl.indexOf("http://www.hudong.com/wiki")>=0)
		{
			getTitleFromUrl();
		}
	}else if(currUrl.indexOf("http://wiki.hudong.com")>=0||currUrl.indexOf("http://so.hudong.com/s/user/")>=0||(currUrl.indexOf("http://so.hudong.com/s/")>=0&&currUrl.indexOf("/user/")>0)||(topUrl.indexOf("http://wiki.hudong.com")>=0 && currUrl == "/inc/index_head_tg")||(topUrl.indexOf("http://so.hudong.com/s/user/")>=0 && currUrl == "/inc/index_head_tg")||((topUrl.indexOf("http://so.hudong.com/s/")>=0&&topUrl.indexOf("/user/")>0)&& currUrl == "/inc/index_head_tg"))
	{
		//空间
		if(logoObj!=null)
		{
			logoObj.innerHTML='<img src="http://www.hudong.com/images/logospace.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			logoObj.href='http://wiki.hudong.com/';
		}
		//修改搜索相关
		//去掉进入词条按钮
		var stepIn = document.getElementById("stepIn");
		if(stepIn!=null)
			stepIn.innerHTML="";
		//修改hidden变量值
		var soType = document.getElementById("so");
		if(soType!=null)
			soType.value="user";
		//修改onsubmit;searchForm
		if(soForm!=null)
		{
			soForm.onsubmit=function anonymous()
			{   
				searchSubmit1(1);
				return false;
			}
		}
		if(currUrl.indexOf("http://so.hudong.com/s/user/")>=0||(currUrl.indexOf("http://so.hudong.com/s/")>=0&&currUrl.indexOf("/user/")>0)||(topUrl.indexOf("http://so.hudong.com/s/user/")>=0 && currUrl == "/inc/index_head_tg")||((topUrl.indexOf("http://so.hudong.com/s/")>=0&&topUrl.indexOf("/user/")>0) && currUrl == "/inc/index_head_tg"))
		{
			document.searchForm.q.value =  title1.substring(0,title1.lastIndexOf("-"));
		}
	}else if(currUrl.indexOf("http://wikibar.hudong.com/")>=0||currUrl.indexOf("http://so.hudong.com/s/bar/")>=0||(currUrl.indexOf("http://so.hudong.com/s/")>=0&&currUrl.indexOf("/bar/")>0)||(topUrl.indexOf("http://wikibar.hudong.com/")>=0 && currUrl == "/inc/index_head_tg")||(topUrl.indexOf("http://so.hudong.com/s/bar/")>=0 && currUrl == "/inc/index_head_tg")||((topUrl.indexOf("http://so.hudong.com/s/")>=0&&topUrl.indexOf("/bar/")>0)&& currUrl == "/inc/index_head_tg"))
	{
		//维吧
		try{
			indexObj = document.getElementById('wikibar');
			if(indexObj!=null){
				indexObj.getElementsByTagName("a")[0].className='bold';
			}
		}catch(e){}
		
		if(logoObj!=null)
		{
			logoObj.innerHTML='<img src="http://www.hudong.com/images/logowikibar.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			logoObj.href='http://wikibar.hudong.com/';
		}
		//document.getElementById("wikibar").getElementsByTagName("a")[0].className='bold';
		var stepIn = document.getElementById("stepIn");
		if(stepIn!=null)
			stepIn.innerHTML="";
		//修改hidden变量值
		var soType = document.getElementById("so");
		if(soType!=null)
			soType.value="bar";
		//修改onsubmit;searchForm
		if(soForm!=null)
		{
			soForm.onsubmit=function anonymous()
			{
				searchSubmit1(1);
				return false;
			}
		}
		if(currUrl.indexOf("http://so.hudong.com/s/bar/")>=0||(currUrl.indexOf("http://so.hudong.com/s/")>=0&&currUrl.indexOf("/bar/")>0)||(topUrl.indexOf("http://so.hudong.com/s/bar/")>=0 && currUrl == "/inc/index_head_tg")||((topUrl.indexOf("http://so.hudong.com/s/")>=0&&topUrl.indexOf("/bar/")>0)&& currUrl == "/inc/index_head_tg"))
		{
			document.searchForm.q.value =  title1.substring(0,title1.lastIndexOf("-"));
		}
	}else if(currUrl.indexOf("http://task.hudong.com")>=0||currUrl.indexOf("http://www.hudong.com/s/task/")>=0||(topUrl.indexOf("http://task.hudong.com/")>=0 && currUrl == "/inc/index_head_tg")||(topUrl.indexOf("http://www.hudong.com/s/task/")>=0 && currUrl == "/inc/index_head_tg"))
	{
		//任务
		indexObj = document.getElementById('mission_index');
		if(indexObj!=null){
			indexObj.getElementsByTagName("a")[0].className='bold';
		}
		if(logoObj!=null)
		{
			logoObj.innerHTML='<img src="/images/logotask.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			logoObj.href='http://task.hudong.com/';
		}
		//document.getElementById("wikibar").getElementsByTagName("a")[0].className='bold';
		var stepIn = document.getElementById("stepIn");
		if(stepIn!=null)
			stepIn.innerHTML="";
		//修改hidden变量值
		var soType = document.getElementById("so");
		if(soType!=null)
			soType.value="task";
		//修改onsubmit;searchForm
		if(soForm!=null)
		{
			soForm.onsubmit=function anonymous()
			{
				searchSubmit1(1);
				return false;
			}
		}
		if(currUrl.indexOf("http://www.hudong.com/s/task/")>=0||(currUrl.indexOf("http://www.hudong.com/s/")>=0&&currUrl.indexOf("/task/")>0)||(topUrl.indexOf("http://www.hudong.com/s/task/")>=0 && currUrl == "/inc/index_head_tg")||((topUrl.indexOf("http://www.hudong.com/s/")>=0&&topUrl.indexOf("/task/")>0)&& currUrl == "/inc/index_head_tg"))
		{
			document.searchForm.q.value =  title1.substring(0,title1.lastIndexOf("-"));
		}
	}else if(currUrl.indexOf("http://wikibar.hudong.com/olympic")>=0||currUrl.indexOf("http://2008.hudong.com")>=0)
	{
		//奥运
		indexObj = document.getElementById('olypic');
	}else if(currUrl.indexOf("http://so.hudong.com/search.do?so=tupian")>=0 || currUrl.indexOf("http://so.hudong.com/s/tupian/")>=0 || (currUrl.indexOf("http://so.hudong.com/s/")>=0&&currUrl.indexOf("/tupian/")>0) || currUrl.indexOf("http://tupian.hudong.com") >= 0||(topUrl.indexOf("http://tupian.hudong.com") >= 0 > 0 && currUrl == "/inc/index_head_tg"))
	{
	    //图片
		indexObj = document.getElementById('tupian');
		if(indexObj!=null){
			indexObj.getElementsByTagName("a")[0].className='bold';
		}
		if(logoObj!=null)
		{
			logoObj.innerHTML='<img src="http://www.hudong.com/images/logotupian.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			logoObj.href='http://tupian.hudong.com/';
		}
		var stepIn = document.getElementById("stepIn");
		if(stepIn!=null)
			stepIn.innerHTML="";
		//修改hidden变量值
		var soType = document.getElementById("so");
		if(soType!=null)
			soType.value="tupian";
		//修改onsubmit;searchForm
		if(soForm!=null)
		{
			soForm.onsubmit=function anonymous()
			{
				searchSubmit1(1);
				return false;
			}
		}
		if(currUrl.indexOf("http://so.hudong.com/search.do?so=tupian")>=0 || currUrl.indexOf("http://so.hudong.com/s/tupian/")>=0 || (currUrl.indexOf("http://so.hudong.com/s/")>=0&&currUrl.indexOf("/tupian/")>0)||topUrl.indexOf("http://so.hudong.com/search.do?so=tupian")>=0 || topUrl.indexOf("http://so.hudong.com/s/tupian/")>=0 || (topUrl.indexOf("http://so.hudong.com/s/")>=0&&topUrl.indexOf("/tupian/")>0))
		{
			document.searchForm.q.value =  title1.substring(0,title1.lastIndexOf("-"));
		}
	}else if(currUrl.indexOf("http://yun.hudong.com") != -1 || currUrl.indexOf("/docweb/web.jsp") != -1 || currUrl.indexOf("/about/index.jsp") != -1)
	{
		//知识云
		if(logoObj!=null)
		{
			logoObj.innerHTML='<img src="/images/yun_logo_bg_no.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			logoObj.href='http://yun.hudong.com/';
		}
		var stepIn = document.getElementById("stepIn");
		var signMessage = '输入你感兴趣的人或事物的名字，如：小沈阳';
		document.searchForm.Button1.setAttribute("value", "进入知识云");
		document.searchForm.q.setAttribute("value", signMessage);
		document.searchForm.q.onclick = function(){this.value="";this.onclick=""};
		document.searchForm.q.style.color = "#666666";
		document.getElementById("PIECE_INDEX_HEAD_STA").innerHTML = "<LABEL class='green bold'>全球最大的知识关系网络:</LABEL>只有起点，没有终点，只有想不到的联系，没有到不了的角落";
	}else if(currUrl.indexOf("http://so.hudong.com/s/doc/")>=0||(currUrl.indexOf("http://so.hudong.com/s/")>=0&&currUrl.indexOf("/doc/")>0)||(topUrl.indexOf("http://so.hudong.com/s/doc/")>=0 && currUrl == "/inc/index_head_tg")||((topUrl.indexOf("http://so.hudong.com/s/")>=0&&topUrl.indexOf("/doc/")>0)&& currUrl == "/inc/index_head_tg"))
	{
		//搜索百科
		indexObj = document.getElementById('wiki');
		if(indexObj!=null){
			indexObj.getElementsByTagName("a")[0].className='bold';
		}
		if(logoObj!=null)
		{
			logoObj.href='http://www.hudong.com';
			logoObj.innerHTML='<img src="/images/searchlog.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
		}
		getTitleFromUrl();
	}else if( (currUrl.indexOf("http://www.hudong.com/inc/index_head_tg.html")>=0 && topUrl.indexOf("http://photo.hudong.com")>=0) || currUrl.indexOf("http://photo.hudong.com")>=0)
	{
		//图片版权中心
		if(logoObj!=null)
		{
			logoObj.innerHTML='<img src="/images/logobanquan.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			logoObj.href='http://photo.hudong.com/images/logobanquan.gif';
			logoObj.onclick=function(){top.location.href='http://photo.hudong.com/';};
		}
		//修改搜索相关
		//去掉进入词条按钮
		var stepIn = document.getElementById("stepIn");
		if(stepIn!=null)
			stepIn.innerHTML="";
		//修改hidden变量值
		var soType = document.getElementById("so");
		if(soType!=null)
			soType.value="copyright_photo";
		//修改onsubmit;searchForm
		if(soForm!=null)
		{
			soForm.onsubmit=function anonymous()
			{   
				searchSubmit1(1);
				return false;
			}
		}

		document.searchForm.q.value =  title1.substring(0,title1.lastIndexOf("-"));
	}else if(currUrl.indexOf("http://so.hudong.com/s/wenzhang/")>=0  || (currUrl.indexOf("http://so.hudong.com/s/")>=0 && currUrl.indexOf("/wenzhang/")>0)  || (topUrl.indexOf("http://so.hudong.com/s/wenzhang/")>=0 && currUrl == "/inc/index_head_tg") || ((topUrl.indexOf("http://so.hudong.com/s/")>=0&&topUrl.indexOf("/wenzhang/")>0)&& currUrl == "/inc/index_head_tg"))
	{
		//文章
		if(logoObj!=null)
		{
			logoObj.innerHTML='<img src="/images/searchlog.gif" alt="互动百科，一个华人编辑，分享知识的社区"/>';
			logoObj.href='javascript:void(0)';
			logoObj.onclick=function(){top.location.href='http://w.hudong.com/';};
		}
		
		var stepIn = document.getElementById("stepIn");
		if(stepIn!=null)
			stepIn.innerHTML="";
		//修改hidden变量值
		var soType = document.getElementById("so");
		if(soType!=null)
			soType.value="wenzhang";
		//修改onsubmit;searchForm
		if(soForm!=null)
		{
			soForm.onsubmit=function anonymous()
			{
				searchSubmit1(1);
				return false;
			}
		}
		if(currUrl.indexOf("http://so.hudong.com/s/wenzhang/")>=0||(currUrl.indexOf("http://so.hudong.com/s/")>=0&&currUrl.indexOf("/wenzhang/")>0)||(topUrl.indexOf("http://so.hudong.com/s/wenzhang/")>=0 && currUrl == "/inc/index_head_tg")||((topUrl.indexOf("http://so.hudong.com/s/")>=0&&topUrl.indexOf("/wenzhang/")>0)&& currUrl == "/inc/index_head_tg"))
		{
			document.searchForm.q.value =  title1.substring(0,title1.lastIndexOf("-"));
		}
	}
	
	if(indexObj!=null){
		indexObj.setAttribute("class","link_black");
		indexObj.setAttribute("className","link_black");
	}
	if(currUrl.indexOf("/inc/index_head_tg") == -1)
	{
		setTop(currUrl);
	}
	
}

function setTop(currUrl)
{
	if(currUrl != "http://so.hudong.com/search.do?so=tupian")
	{
		if(document.location != top.location)
		{
			top.location = document.location;
		}
	}
}
function cooSearchSubmit1(type0)
{
    var q = document.getElementById("search").value;
    q=q.replace(/(^\s*)|(\s*$)/g, "");
    q=q.replace(/\/|\%|\\/g, "");
    q=q.replace(/\&/g,"%26");
    q=q.replace(/\+/g,"%2B");
    if(q == null || q.trim() == "")
    {
        alert("请输入搜索内容");
        return false;
    }
    
    if(q.length>100){
  		q=q.substring(0,100);
  	}
    var so = document.getElementById("so").value;
    if(type0 == "1" && so == "doc")
    {
    	window.location.href="http://so.hudong.com/s/" + so + "/" + encodeURIComponent(q);
    	return false;
    	
    }
    window.location.href="http://so.hudong.com/s/tupian/" + encodeURIComponent(q);
    return false;
}

function ajxDocWeb(q)
{
  vxmlHttp = createXMLHttpRequestByObject(vxmlHttp);
  vxmlHttp.open("GET", '/docWeb.do?action=getDocInfo&docTitle='+encodeURIComponent(q), true);
  vxmlHttp.onreadystatechange = callback_docweb;
  vxmlHttp.send(null);  
}


function callback_docweb()
{
  if (vxmlHttp.readyState == 4)
  {
  
	   if(vxmlHttp.status == 200) 
	   {
	        try{
		   		var status = vxmlHttp.responseText;
		   		if(status == 1)
		   		{
		   			document.getElementById('hudong_SWF').query(queryString);
		   			return;
		   		}else
		   		{
		   			window.location.href = "http://www.hudong.com/wiki/" + encodeURIComponent(queryString);
		   			return;
		   		}
	   		}catch(e)
	   		{
	   			window.location.href = "http://yun.hudong.com/" + encodeURIComponent(queryString) + ".html";
	   		}
	   }
   }
}