function btSrhOnClick()
{
  if( edtKey.text=="" )
  {
    //widget.alert("请输入要翻译的单词.");
    widget.showTrayHint("提示","请先输入要翻译的单词.");
    return;
  }
  	
  showFlyoutPanel();
  
}

function showFlyoutPanel()
{
  LockRefresh;
  
  widget.widgetHeight = 255;	
  bgFlyOut.Visible = true;
  
  UnLockRefresh;
  
  var word = edtKey.Text;
  HtmlPanelUrl = "http://mini.www.iciba.com/index.php?module=widget&act=index&uid=29466&sid=0&s=" + encodeURIComponent(word);
  //Print( encodeURIComponent(word) );
  HtmlPanelVisible = true;

}

function hideFlyoutPanel()
{
  LockRefresh;
  HtmlPanelVisible = false;  
  bgFlyOut.Visible = false;
  UnLockRefresh;
  
  widget.widgetHeight = 55;      
}

function widgetOnDeActive()
{
  hideFlyoutPanel();
}

function edtKeyOnKeyDownReturn()
{
  btSrhOnClick();
}

function widgetOnDock()
{
  hideFlyoutPanel();
}