<!--FF innerText-->

function isIE(){ //ie? 
   if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1) 
    return true; 
   else 
    return false; 
} 

if(!isIE()){ //firefox innerText define
   HTMLElement.prototype.__defineGetter__(     "innerText", 
    function(){
     var anyString = "";
     var childS = this.childNodes;
     for(var i=0; i<childS.length; i++) {
      if(childS[i].nodeType==1)
       anyString += childS[i].tagName=="BR" ? '\n' : childS[i].textContent;
      else if(childS[i].nodeType==3)
       anyString += childS[i].nodeValue;
     }
     return anyString;
    } 
   ); 
   HTMLElement.prototype.__defineSetter__(     "innerText", 
    function(sText){ 
     this.textContent=sText; 
    } 
   ); 
}

<!--FF innerText-->

function logo(){
	$("#logo_kong").fadeOut(0);
	$("#logo").fadeIn("slow");
	}
	
var li=0;
function kong(){
	document.getElementById('serch').style.borderBottomWidth='2px';
	$("#xiakk").fadeOut("slow");
	}
	


function change(e){
    var currKey=0,e=e||event;
    currKey=e.keyCode||e.which||e.charCode;
	if(currKey==38){
		if (li>1){
			li--;
			
			out((li+1));
			over(li);
			}
		}
    else if(currKey==40){
		if (li<10){
			li++;
			if(li!=1){
				out((li-1));
				}
			over(li);
			}
		}
	else{
		var words=document.getElementById('w').value;
        if(words==''){return;}
     	$.ajax({
             url: "ajax_serch.php",
             data: "w="+words,
             success: callback
        });
		}	
	
	}

function callback(data){ 

var info=JSON.parse(data);
document.getElementById('xiakk').innerHTML='';

if (info[0][0]>1){
	$("#index_info").fadeOut(0);
	document.getElementById('serch').style.borderBottomWidth='0px';	
	$("#xiakk").fadeIn("slow");
	}
else{
	$("#xiakk").fadeOut("slow");
	document.getElementById('serch').style.borderBottomWidth='2px';
	}	

for(i=1;i<info[0][0];i++){
	document.getElementById('xiakk').innerHTML+='<li id="li_'+i+'" onclick="document.getElementById(\'form\').submit();" onmouseover="over('+i+')" onmouseout="out('+i+')" onblur="out('+i+')">'+info[i][0]+info[i][1]+'</li><li id="li__'+i+'" style="display:none">'+info[i][0]+'</li>';
	}
} 

function over(i){
	document.getElementById('w').value=document.getElementById('li__'+i).innerText;
	document.getElementById('li_'+i).style.backgroundColor='#F2F2F2';
	}
function out(i){
	document.getElementById('li_'+i).style.backgroundColor='#fff';
	}	
	


