 var jhead=-1;
		var temp_str;
        var suggest$=function(node){
			return document.getElementById(node);
		}
		var suggest$$=function(node){
			return suggest$("suggestul").getElementsByTagName(node);
		}
        function getsuggestkey(url)
        {
       // var obj = document.getElementById("getRemoteJs");
       // obj.src = url;
	           var obj = document.createElement( "script" );
               obj.type = "text/javascript";
               obj.setAttribute( "src" , url);
               document.getElementById('ysearchautocomplete').appendChild(obj);
        if(document.all){
                obj.onreadystatechange = function(){//IE?
                        var state = obj.readyState;
                        if (state == "loaded" || state == "interactive" || state == "complete") {
                           suggest$("ysearchcontainer").innerHTML=param;
			               jhead=-1;
                        }
                };

        } else {//alert('aaaaaaa');
               var js_obj = document.createElement( "script" );
               js_obj.type = "text/javascript";
               js_obj.setAttribute( "src" , url);
               document.body.appendChild(js_obj);
			   js_obj.onload=function(){suggest$("ysearchcontainer").innerHTML=param;};
              
                 //    suggest$("ysearchcontainer").innerHTML=param;
			   
        }
    }
function querysuggestkey()
    {
         getsuggestkey("http://redirect.mydown.com/yuisuggest/mydownsuggesthead.jsp?query="+suggest$("ysearchinput").value+"&ts=" + new Date().getTime());
    }

		function keyupdeal(e){
			
			var keyc;
			if(window.event){
				keyc=e.keyCode;
				}
			else if(e.which){
				keyc=e.which;
				}
			if(keyc!=40 && keyc!=38){
				querysuggestkey();
				suggest$("ysearchcontainer").style.visibility="visible";
				temp_str=suggest$("ysearchinput").value;
			}
			}

		function set_style(num){
			for(var i=0;i<suggest$$("li").length;i++){
				var li_node=suggest$$("li")[i];
                li_node.className="";
			}
			if(jhead>=0 && jhead<suggest$$("li").length){
				var i_node=suggest$$("li")[jhead];
                suggest$$("li")[jhead].className="select";

				}
			}
		function mo(nodevalue){
			jhead=nodevalue;
			set_style(jhead);
		}

		function hide_suggest(){
			var nodes=document.body.childNodes
			for(var i=0;i<nodes.length;i++){
				if(nodes[i]!=suggest$("ysearchinput")){
					suggest$("ysearchcontainer").innerHTML="";
					suggest$("ysearchcontainer").style.visibility="hidden";
					}
				}
			}
			function form_submit(){
			if(jhead>=0 && jhead<suggest$$("li").length){
				suggest$("ysearchinput").value=suggest$$("span")[jhead].childNodes[0].nodeValue;
				}
			
		}

function keydowndeal(e){
	      //  suggest$("ysearchcontainer").style.visibility="visible";
			var keyc;
			if(window.event){
				keyc=e.keyCode;
				}
			else if(e.which){
				keyc=e.which;
				}
			if(keyc==40 || keyc==38){
			if(keyc==40){
				if(jhead<suggest$$("li").length){
					jhead++;
					if(jhead>=suggest$$("li").length){
						jhead=-1;
					}
				}
				if(jhead>=suggest$$("li").length){
						jhead=-1;
					}
			}
			if(keyc==38){
				if(jhead>=0){
					jhead--;
					if(jhead<=-1){
						jhead=suggest$$("li").length;
					}
				}
				else{
					jhead=suggest$$("li").length-1;
				}
			}
			set_style(jhead);
			if(jhead>=0 && jhead<suggest$$("li").length){
				if(suggest$$("span")[jhead])
				{
				suggest$("ysearchinput").value=suggest$$("span")[jhead].childNodes[0].nodeValue;
				}
				}
			else{
				suggest$("ysearchinput").value=temp_str;
				}
			}
		}

		var jfoot=-1;
		var temp_strfoot;
        var suggestfoot$=function(node){
			return document.getElementById(node);
		}
		var suggestfoot$$=function(node){
			return suggestfoot$("suggestulfoot").getElementsByTagName(node);
		}
        function getsuggestfoot(url)
        {
       // var obj = document.getElementById("getRemoteJsfoot");
       // obj.src = url;
	           var obj = document.createElement( "script" );
               obj.type = "text/javascript";
               obj.setAttribute( "src" , url);
               document.getElementById('ysearchautocomplete').appendChild(obj);
        if(document.all){
                obj.onreadystatechange = function(){//IE?
                        var state = obj.readyState;
                        if (state == "loaded" || state == "interactive" || state == "complete") {
                           suggestfoot$("ysearchcontainerfoot").innerHTML=paramfoot;
			               jfoot=-1;
                        }
                };

        } else {//alert('aaaaaaa');
               var js_obj = document.createElement( "script" );
               js_obj.type = "text/javascript";
               js_obj.setAttribute( "src" , url);
               document.body.appendChild(js_obj);
			   js_obj.onload=function(){suggestfoot$("ysearchcontainerfoot").innerHTML=paramfoot;};
              
                 //    suggest$("ysearchcontainer").innerHTML=param;
			   
        }
    }
function querysuggestfoot()
    {
         getsuggestfoot("http://redirect.mydown.com/yuisuggest/mydownsuggest.jsp?queryfoot="+suggestfoot$("ysearchinputfoot").value+"&ts=" + new Date().getTime());
    }

		function keyupdealfoot(e){
			
			var keyc;
			if(window.event){
				keyc=e.keyCode;
				}
			else if(e.which){
				keyc=e.which;
				}
			if(keyc!=40 && keyc!=38){
				querysuggestfoot();
				suggestfoot$("ysearchcontainerfoot").style.visibility="visible";
				temp_strfoot=suggestfoot$("ysearchinputfoot").value;
			}
			}

		function set_stylefoot(num){
			for(var i=0;i<suggestfoot$$("li").length;i++){
				var li_node=suggestfoot$$("li")[i];
                li_node.className="";
			}
			if(jfoot>=0 && jfoot<suggestfoot$$("li").length){
				var i_node=suggestfoot$$("li")[jfoot];
                suggestfoot$$("li")[jfoot].className="select";

				}
			}
		function mofoot(nodevalue){
			jfoot=nodevalue;
			set_stylefoot(jfoot);
		}

		function hide_suggestfoot(){
			try
			{
				var nodes=document.body.childNodes
			for(var i=0;i<nodes.length;i++){
				if(nodes[i]!=suggestfoot$("ysearchinputfoot")){
					suggestfoot$("ysearchcontainerfoot").innerHTML="";
					suggestfoot$("ysearchcontainerfoot").style.visibility="hidden";
					}
				}
			}
			catch (e)
			{
				return;
			}
			
			}
			function form_submitfoot(){
			if(jfoot>=0 && jfoot<suggestfoot$$("li").length){
				suggestfoot$("ysearchinputfoot").value=suggestfoot$$("span")[jfoot].childNodes[0].nodeValue;
				}
			
		}

function keydowndealfoot(e){
	      //  suggest$("ysearchcontainer").style.visibility="visible";
			var keyc;
			if(window.event){
				keyc=e.keyCode;
				}
			else if(e.which){
				keyc=e.which;
				}
			if(keyc==40 || keyc==38){
			if(keyc==40){
				if(jfoot<suggestfoot$$("li").length){
					jfoot++;
					if(jfoot>=suggestfoot$$("li").length){
						jfoot=-1;
					}
				}
				if(jfoot>=suggestfoot$$("li").length){
						jfoot=-1;
					}
			}
			if(keyc==38){
				if(jfoot>=0){
					jfoot--;
					if(jfoot<=-1){
						jfoot=suggestfoot$$("li").length;
					}
				}
				else{
					jfoot=suggestfoot$$("li").length-1;
				}
			}
			set_stylefoot(jfoot);
			if(jfoot>=0 && jfoot<suggestfoot$$("li").length){
				if(suggestfoot$$("span")[jfoot])
				{
				suggestfoot$("ysearchinputfoot").value=suggestfoot$$("span")[jfoot].childNodes[0].nodeValue;
				}
				}
			else{
				suggestfoot$("ysearchinputfoot").value=temp_strfoot;
				}
			}
		}