﻿var $=document.getElementById;
function AddFavorite(sURL, sTitle)
{
     try
     {
         window.external.addFavorite(sURL, sTitle);
     }
     catch (e)
     {
         try
         {
             window.sidebar.addPanel(sTitle, sURL, "");
         }
         catch (e)
         {
             alert("加入收藏失败，有劳您手动添加。\n\n按{Alt+D}快捷键！");
         }
     }
}

function OpenWindow(url,iWidth,iHeight)
{
   var url;
   var iWidth;
   var iHeight;
   var iTop = (window.screen.availHeight-30-iHeight)/2;
   var iLeft = (window.screen.availWidth-10-iWidth)/2;
   window.open(url,'newwindow','height='+iHeight+',innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
}

function GoSou(id)
{
   var nkey=$(id).value;
   nkey=nkey.replace(/\s|　/gi,"");
   if(nkey.length!=0)
   {
       location.href="/list.aspx?t="+escape($(id).value);
   }
   else
   {
       alert("你还没有输入要搜索的关键字哦~!");
   }
}

function KeyDown(id)
{
    if (event.keyCode == 13)
    {
        event.returnValue=false;
        event.cancel = true;
        GoSou(id);
    }
}