
    var delta=0.8;
	var collection;
	var closeB=false;
	function divmove(adid,adidint,adtop)
	{		
		var docbody=(document.documentElement && document.documentElement.clientWidth)?document.documentElement:document.body;
		var dxdcc=document.getElementById(adid);
		if(screen.width<800|| closeB)
			{
				dxdcc.style.display	= 'none';
				return;
			}
		var scrollpos=docbody.scrollTop ;
		try {
			if(dxdcc.offsetTop!=(docbody.scrollTop + adtop)) {
				var dy=(docbody.scrollTop +adtop-dxdcc.offsetTop)*delta;
				dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
				dxdcc.style.top=dxdcc.offsetTop+dy+"px";
			}
		}catch(e){}
	}
	var Toppx;
	//var leftcontent='<div style="position:relative; top:0px;"><a href=""><embed src="http://tp.xilu.com/indexad100300_left.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="400"></embed></a></div>';
	function callmove(){
		if(screen.width>1024){
		    document.write('<div align="left" class="keywordstyle1 fright bdo" id="keyword"></div>');
		}else{
			document.write('<div align="left" class="keywordstyle2 fright bdo" id="keyword"></div>');
		}
		window.setInterval("divmove('keyword',0,50)",30);
		//window.setInterval("divmove('keywordleft',1,50)",30);
	}
	function showpush (content) {
	    $('keyword').className="keywordstyle1 fright bdo";
		$('keyword').style.width='300px';
		$('keyword').style.height='420px';
		$('img').style.display="none";
		$('cont').style.display="block";
		
	}
	function hidepush () {
		if(screen.width>1024)
		{
			$('keyword').style.width='100px';
		 	$('keyword').style.height='420px';
		}
		else
		{
		    $('keyword').className="keywordstyle2 fright bdo";
			$('keyword').style.width='22px';
		 	$('keyword').style.height='100px';
		}
		$('img').style.display="block";
		$('cont').style.display="none";
		
	}
    
    var schkey="";
    var hsearch = Class.create();
    hsearch.prototype = {
    	initialize:function(){},
    	search:function(sch_key,tie_writer,club_type) {
    		if(screen.width>=1024){
    		var dfd=$("keyword");
    		if(screen.width>1024) {
    		  dfd.innerHTML='<div  align="center"><a href=""><embed src="http://tp.xilu.com/indexad100300_left.swf" quality="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="420"></embed></a></div></div>';
    		} else {
    		  dfd.innerHTML='<img src="http://club.xilu.com/style/images/loading.gif" /><br/>';
    		}
    		var param = {"title":sch_key,"maintype":club_type};
    		gdApi.callMethod("recommand.search", param, this);
    		}
    	},
    	recommand_search_call:function(success, responseXML, html, param) {
    		alert(success+param['title']);
    		if (success) {
                    //分析xml根
                    
                    var rootNode = responseXML.documentElement;
                    var totalno=rootNode.getAttribute("notecount");
                    //alert(totalno);
                    var notes = rootNode.getElementsByTagName("note");//得到全部mod节点
           		var keycontent="";
    		for (var x=0; x<notes.length; x++) {
    			 		var title=notes[x].getAttribute("title");
    					var boardid=notes[x].getAttribute("boardid");
    					var msgid=notes[x].getAttribute("msgid");
    					var etitle=notes[x].getAttribute("etitle");
    					//keycontent+=("<li><a href='"+linkh+"' title='"+title+"' target='_blank'>"+title.substring(0,8)+"</a></li>");
    					keycontent+=("<li><a class='b1' href='/suggest.php?boardid="+boardid+"&msgid="+msgid+"&etitle="+etitle +"&title="+title+"' target='_blank'>"+title+"</a></li>");
    						}
    						//alert(keycontent);
    			var dfd=document.getElementById("keyword");
    			
    			if(totalno!=0){
    				var content='<div class="title2">相关主题'+totalno+'个:</div>';
    				content+='<div class="boxsp" ><ul class="ul2">';
    				content+=keycontent;
    				content+="</ul></div>";
    				//alert(screen.width)
    				if(screen.width>1024)
    				{ var adct='<div style="position:relative; top:0px;"><a href=""><embed src="http://tp.xilu.com/indexad100300_left.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="300"></embed></a></div>';
    					if(totalno<5)
    						dfd.innerHTML='<div id="img" onmouseover="showpush()">'+content+adct+'</div><div id="cont" style="display:block; display:none;" onmousemove="showpush();" onmouseout="hidepush();" >'+content+adct+'</div>';
    					else
    						dfd.innerHTML='<div id="img" onmouseover="showpush()">'+content+'</div><div id="cont" style="display:block; display:none;" onmousemove="showpush();" onmouseout="hidepush();" >'+content+'</div>';
    				}
    				else
    				dfd.innerHTML='<div id="img" onmouseover="showpush()"><img src="http://club.xilu.com/style/images/suggestshort.gif"/></div><div id="cont" style="display:block; display:none;" onmousemove="showpush();" onmouseout="hidepush();" >'+content+'</div>';
    				//alert(dfd.innerHTML);
    				}
    				else{
    					dfd.innerHTML='<div style="position:relative; top:0px;"><a href=""><embed src="http://tp.xilu.com/indexad100300_left.swf" quality="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="420"></embed></a></div>';
    					dfd.onmouseover="";
    					dfd.onmouseout="";
    				}
    				
    		}
    	}
    }
    var hs = new hsearch();
