﻿if(typeof(myhost)!="string")
{
    myhost=location.host;
}
document.write('<sc'+'ript language="javascript" type="text/javascript" src="http://'+myhost+'/js/util/util.js"></script>');
document.write('<sc'+'ript language="javascript" type="text/javascript" src="http://'+myhost+'/js/lang/l_common.js"></script>');
function adcureturn(link)
{
//    if(!link)return;
//    var c=link.href.split("?")[0];
//    link.href=c+"?return="+encodeURIComponent(location.href);
}
var barSrh=new Object();
barSrh.init=function()
{
    if($Get("q"))
    {
        $("barsrh_b").checked=true;
        $("barsrh_txt").value=$Get("q");
    }
    addEvent($("barsrh_txt"),"keydown",barSrh.detectEnter);
    addEvent($("barsrh_btn"),"click",barSrh.doSearch);
}
barSrh.detectEnter=function()
{
    var e=getEvent();
    var key;
    if(isIE)
        key = e.keyCode; 
    else
        key=e.which;
    if(key==13)
    {
        barSrh.doSearch();
        return false;
    }
    return true;   
}
barSrh.doSearch=function()
{
    var q=$("barsrh_txt").value.trim();
    if(!q)return;
    if($("barsrh_a").checked)
    {
        reloadpage("/tieba/"+encodeURIComponent(q)+"/"+(enPath==1?"":"Default.aspx"));
    }
    else if($("barsrh_b").checked)
    {
       reloadpage("/postsearch.aspx?q="+encodeURIComponent(q));
    }
}

function reposFloatBox(id)
{
    var temdiv=document.createElement("div");
    document.body.insertBefore(temdiv,document.body.firstChild);
    document.body.replaceChild($(id), temdiv);
}

function openOPHint(_id,hint) 
{
   OPHint.open(hint);
}
function fadeOPHint(_id,hint,cssclass)
{
   OPHint.fade(hint,cssclass);
}
function removeOPHint(_id)
{
   OPHint.remove();
}
function setOPHint(_id,hint,cssclass)
{
   OPHint.setHint(hint,cssclass);
}

