// JavaScript Document
function GetSeachHistry(){
  	del_histry();	
}
function getCookie(name)
{
var tempName = name + "=";
var cks = document.cookie.split(';');
var len = cks.length;
for(var i = 0; i < len; i++)
{
   var ck = cks[i];
   while(ck.charAt(0) == ' ')
   {
    ck = ck.substring(1,ck.length);
   }
   if(ck.indexOf(tempName) == 0) return ck.substring(tempName.length,ck.length);
}
return null;
}
var pdleftdis=0;
function hideenleft(){
	if(pdleftdis==0){
     document.getElementById("disleft").innerHTML="«显示左边栏";
     document.getElementById("jq2").style.display="none";	
	  pdleftdis=1;
	}else{
		 document.getElementById("disleft").innerHTML="«隐藏左边栏";
     document.getElementById("jq2").style.display="";	
	 pdleftdis=0;
	 }
}
function del_histry(){	
     var url=serverurl+"SeachServer";
	 var pars="type=delcook&time="+Date();
		  pars=encodeURI(pars);
          pars=encodeURI(pars);
		 var myAjax=new Ajax.Request(
		 url,
		 {
		  method: 'post',
		  parameters: pars,
		  onComplete: displaydelMsg 
		 });
}
function displaydelMsg(MsgRequest){     
     var txt=MsgRequest.responseText;
     txt=trimstr(txt);	 
	 if(txt=="delok"){
       document.getElementById("histrykey").innerHTML="<li><span class=\"title\" style=\"margin-left:0px;\">&gt;搜索历史</span>-<a id=\"clearhf\" href=\"#\" class=\"clear\" onclick=\"GetSeachHistry()\">清除</a></li>";
	 }
}
function trimstr(obj){
   var newstr="";
   newstr=obj.replace(/(^\s*)|(\s*$)/g,"");
   return newstr;
}

function ChangType(obj){
  if(obj=="web"){
    document.getElementById("tp").value="web";
    document.flpage.action="s";
    document.flpage.submit();
  }else if(obj=="img"){
   document.getElementById("tp").value="img";
   document.flpage.action="img";
   document.flpage.submit();
  }else if(obj=="video"){
   document.getElementById("tp").value="video";
   document.flpage.action="v";
   document.flpage.submit();
  }else if(obj=="news"){
   document.getElementById("tp").value="news";
  document.flpage.action="news"; 
  document.flpage.submit();
  }else if(obj=="mp3"){
   document.getElementById("tp").value="mp3";
   document.flpage.action="m"; 
   document.flpage.submit();
  }
}
function showview(obj,event,kwd){
	  var x=mousePosition(event).x;
	  var y=mousePosition(event).y;
	  y=y-120;
	  x=x+150;
	  try{
	    FishChoice();
	  }catch(e){}
          obj=obj;
	  ShowDialgDiv("网页预览",obj,y,x,kwd);
}

function mousePosition(e) {     if(e.pageX && e.pageY)     {        return {            x : e.pageX,            y : e.pageY         };     }    var scrollElem = (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;    return {        x: e.clientX + scrollElem.scrollLeft,        y: e.clientY + scrollElem.scrollTop    };}

function DownUrlAdd(obj){
  var url="DownMP3.htm?"+obj;
  
  try{
	   FishChoice();
   }catch(e){}   
   ShowMuiscDown("音乐下载",url);
}

function Lingting(obj){
  var url="MP3listern.html?"+obj;
  window.open(url,"音乐试听","toolbar=no,location=no,statu=no,menubar=no,scrollbars=auto,width=410,height=133,resizable=no");
}