﻿var _LxPAGESTEP = 9;
var _LxTmplStr = "";   //Live提示模板字符串
var _LxKeywords;
var _LxTimeoutProc;
var _LxResult;
var _LxItm = 0;
var _LxItmCount = 10;
var _LxStoped = true;
var _LxKwId = "_lxkw";
var _LxDisplayOK = false;
var _LxFirstRun = true;
var _LxNoRefresh = false;
var _LxLang = new Array(200);
_LxLang[1] = "阿拉伯语";
_LxLang[2] = "保加利亚语";
_LxLang[3] = "加泰罗尼亚语";
_LxLang[4] = "中文简体";
_LxLang[132] = "中文繁体";
_LxLang[5] = "捷克语";
_LxLang[6] = "丹麦语";
_LxLang[7] = "德语";
_LxLang[8] = "希腊语";
_LxLang[9] = "英语";
_LxLang[10] = "西班牙语";
_LxLang[11] = "芬兰语";
_LxLang[12] = "法语";
_LxLang[13] = "希伯来语";
_LxLang[14] = "匈牙利语";
_LxLang[15] = "冰岛语";
_LxLang[16] = "意大利语";
_LxLang[17] = "日语";
_LxLang[18] = "朝鲜语";
_LxLang[19] = "荷兰语";
_LxLang[20] = "挪威语";
_LxLang[21] = "波兰语";
_LxLang[22] = "葡萄牙语";
_LxLang[24] = "罗马尼亚语";
_LxLang[25] = "俄语";
_LxLang[26] = "克罗地亚语";
_LxLang[27] = "斯洛伐克语";
_LxLang[28] = "阿尔巴尼亚语";
_LxLang[29] = "瑞典语";
_LxLang[30] = "泰语";
_LxLang[31] = "土耳其语";
_LxLang[32] = "乌尔都语";
_LxLang[33] = "印度尼西亚语";
_LxLang[34] = "乌克兰语";
_LxLang[35] = "白俄罗斯语";
_LxLang[36] = "斯洛文尼亚语";
_LxLang[37] = "爱沙尼亚语";
_LxLang[38] = "拉脱维亚语";
_LxLang[39] = "立陶宛语";
_LxLang[41] = "波斯语";
_LxLang[42] = "越南语";
_LxLang[43] = "亚美尼亚语";
_LxLang[44] = "阿泽里语";
_LxLang[45] = "巴斯克语";
_LxLang[47] = "马其顿语";
_LxLang[54] = "南非荷兰语";
_LxLang[55] = "格鲁吉亚语";
_LxLang[56] = "法罗语";
_LxLang[57] = "印地语";
_LxLang[62] = "马来语";
_LxLang[63] = "哈萨克语";
_LxLang[64] = "吉尔吉斯语";
_LxLang[65] = "斯瓦希里语";
_LxLang[67] = "乌兹别克语";
_LxLang[68] = "鞑靼语";
_LxLang[70] = "旁遮普语";
_LxLang[71] = "古吉拉特语";
_LxLang[73] = "泰米尔语";
_LxLang[74] = "泰卢固语";
_LxLang[75] = "卡纳达语";
_LxLang[78] = "马拉地语";
_LxLang[79] = "梵语";
_LxLang[80] = "蒙古语";
_LxLang[86] = "加利西亚语";
_LxLang[87] = "贡根语";
_LxLang[90] = "叙利亚语";
_LxLang[101] = "马尔代夫语";
var _LxFmt = new Array(200);
_LxFmt[1] = "Microsoft Office RTF文档";
_LxFmt[2] = "Microsoft Office Word文档";
_LxFmt[4] = "Microsoft Office Excel文档";
_LxFmt[5] = "Microsoft Office PowerPoint文档";
_LxFmt[6] = "Microsoft Office Publisher文档";
_LxFmt[7] = "Microsoft Office Project文档";
_LxFmt[8] = "Microsoft Office Visio文档";
_LxFmt[10] = "Adobe PDF文档";
_LxFmt[11] = "PostScript文档";
_LxFmt[100] = "网页文档（HTML格式）";
_LxFmt[101] = "纯文本文档";
_LxFmt[102] = "XML文档";

function _LxCreateLexoSearch()
{ 
    window.lexosearch = new function(){}
    window.lexosearch.Criteria = new function(){}
    window.lexosearch.Options = new function(){}
    window.lexosearch.Result = new function(){}
        
    //lexosearch.Server = "[$qryserver$]";
    lexosearch.Server = "search1.vodone.com";
                    
    lexosearch.Criteria.QueryString = "";
    lexosearch.Criteria.Site = "";
    lexosearch.Criteria.Tag = "";
    lexosearch.Criteria.Url = "";
    lexosearch.Criteria.Title = "";
    lexosearch.Criteria.Author = "";
    lexosearch.Criteria.Source = "";
    lexosearch.Criteria.TimeBegin = "";
    lexosearch.Criteria.TimeEnd = "";
    lexosearch.Criteria.TimeLength = "";
    lexosearch.Criteria.Topics = "";
    lexosearch.Criteria.TopicsToCount = "";
    lexosearch.Criteria.MatchPosition = "5";
    lexosearch.Criteria.IndexMode = "";
    lexosearch.Criteria.UserId = "";
    lexosearch.Criteria.Language = "";
    lexosearch.Criteria.Format = "";
    lexosearch.Criteria.M1L = "";
    lexosearch.Criteria.M1U = "";
    lexosearch.Criteria.M2L = "";
    lexosearch.Criteria.M2U = "";
    lexosearch.Criteria.M3L = "";
    lexosearch.Criteria.M3U = "";
    lexosearch.Criteria.M4L = "";
    lexosearch.Criteria.M4U = "";
    lexosearch.Criteria.S1 = "";
    lexosearch.Criteria.S2 = "";
    lexosearch.Criteria.S3 = "";
    lexosearch.Criteria.S4 = "";
    lexosearch.Criteria.S5 = "";
    lexosearch.Criteria.S6 = "";
    lexosearch.Criteria.S7 = "";
    lexosearch.Criteria.S8 = "";
    lexosearch.Criteria.S9 = "";
    lexosearch.Criteria.S10 = "";
    lexosearch.Criteria.S11 = "";
    lexosearch.Criteria.S12 = "";
    lexosearch.Criteria.S13 = "";
    lexosearch.Criteria.S14 = "";
    lexosearch.Criteria.S15 = "";
    lexosearch.Criteria.S16 = "";
    lexosearch.Criteria.S17 = "";
    lexosearch.Criteria.S18 = "";
    lexosearch.Criteria.S19 = "";
    lexosearch.Criteria.S20 = "";
    lexosearch.Criteria.S21 = "";
    lexosearch.Criteria.S22 = "";
    lexosearch.Criteria.S23 = "";
    lexosearch.Criteria.S24 = "";
    lexosearch.Criteria.S25 = "";
    lexosearch.Criteria.S26 = "";
    lexosearch.Criteria.S27 = "";
    lexosearch.Criteria.S28 = "";
    lexosearch.Criteria.S29 = "";
    lexosearch.Criteria.S30 = "";
    lexosearch.Criteria.QueryStringEx = new Array("","","","","","","","","","");
       
    lexosearch.Options.SubmitTo = "";
    lexosearch.Options.IframeUrl = "";
    lexosearch.Options.EnableWordBreak = true;
    lexosearch.Options.Encoding = "";
    lexosearch.Options.SortBy = "";
    lexosearch.Options.SortAscending = false;
    lexosearch.Options.ItemDetail = "";
    lexosearch.Options.PageSize = 10;
    lexosearch.Options.PageNumber = 1;
    lexosearch.Options.EnableUserItems = "";
    lexosearch.Options.AbsMaxLength = "";
    lexosearch.Options.EnableImageItems = "";
    lexosearch.Options.HighlightStart = "";
    lexosearch.Options.HighlightEnd = "";
    lexosearch.Options.LayoutId = "";
    lexosearch.Options.KwTrendsId = "";
    lexosearch.Options.MarkDuplicates = 3;  //启用全文查重
    
    lexosearch.Result.RawString = "";
    lexosearch.Result.RawBasicInfo = "";
    lexosearch.Result.RawTopicString = "";
    lexosearch.Result.RawSmartTips = "";
    lexosearch.Result.RawDocList = "";
    lexosearch.Result.Count = 0;
    lexosearch.Result.CountInSet = 0;
    lexosearch.Result.CountInPage = 0;
    lexosearch.Result.FirstNum = 0;
    lexosearch.Result.LastNum = 0;
    lexosearch.Result.Time = 0;
    lexosearch.Result.PageNumber = 1;
    lexosearch.Result.PageSize = 0;
    lexosearch.Result.Ready = false;
        
    lexosearch.Search = _LxSubmitSearch;
    lexosearch.Search2 = _LxSearchPage;
    lexosearch.SearchIframe = _LxQueryIframe;
    lexosearch.SetTimeByDays = _LxSetDays;
    lexosearch.SetSmartTips = _LxSetSmartTips;
    lexosearch.ClickResult = _LxclickResult;
    lexosearch.SetTopics = _LxSetTopics;
    lexosearch.SetPage = _LxSetPages;    
    lexosearch.SetInfo = _LxSetInfo;
    lexosearch.SetRel = function(nRow)
    {
        _LxSetRel(nRow);
    }
    lexosearch.SetResult = function(dispId)
    {
       _LxSetResult(dispId);
    }
    lexosearch.CallBack = function()
    {}
    
    //浏览器类型
    lexosearch.Browse = "";
    if (navigator.appName == "Microsoft Internet Explorer")
    {
        lexosearch.Browse = "IE";
    }
    else if (navigator.appCodeName == "NetScape")
    {
        lexosearch.Browse = "NS";
    }
}
function _LxCallBack()
{
}
function _LxclickResult(did)
{
    var xh;
    try
    {xh = new ActiveXObject("Microsoft.XMLHTTP");}
    catch (ex0)
    {
        try
        {xh = new ActiveXObject("Msxml2.XMLHTTP");}
        catch (ex1)
        {
            try
            {xh = new XMLHttpRequest();}
            catch (ex2)
            {}
        }
    }
    var surl = "http://"+lexosearch.Server+"/LexoPub/click.aspx?did="+did.toString();
    xh.open("get",surl,false);
    xh.send(null);
}

//从URL中提取本次搜索条件
function _LxGetSearchCond()
{
    var p;
    var sUrl = document.location.search;
    var str,s;
    var i;
    var arr;
        
    str = "";
    
    s = _LxGetUrlPara(sUrl,_LxKwId);
    if (s == "" && document.getElementById("_lxKeyPre"))
    {
        s = document.getElementById("_lxKeyPre").innerHTML;
    }    
    if (s != "")
    {        
        lexosearch.Criteria.QueryString = decodeURI(s); 
        str += "&query=" + s;
    }
    
     //设置扩展属性
    for (i = 1; i < 31; i++)
    {
        s = _LxGetUrlPara(sUrl,"_lxs" + i.toString());
        if (s != "")
        {
            eval("lexosearch.Criteria.S" + i.toString() + "=\"" + decodeURI(s) + "\"");
            str += "&s" + i.toString() + "=" + s;
        }
    }
    for (i = 1; i < 5; i++)
    {
        s = _LxGetUrlPara(sUrl,"_lxm" + i.toString() + "l");
        if (s != "")
        {
            eval("lexosearch.Criteria.M" + i.toString() + "L=\"" + decodeURI(s) + "\"");
            str += "&m" + i.toString() + "l=" + s;
        }
        s = _LxGetUrlPara(sUrl,"_lxm" + i.toString() + "u");
        if (s != "")
        {
            eval("lexosearch.Criteria.M" + i.toString() + "U=\"" + decodeURI(s) + "\"");
            str += "&m" + i.toString() + "u=" + s;
        }
    }
    
    if (str == "")
    {
        //关键词及扩展属性为空则忽略其它参数
        return "";
    }
        
    s = _LxGetUrlPara(sUrl,"_lxkwex");
    if (s != "")
    {        
        lexosearch.Criteria.QueryStringEx = decodeURI(s).split("\n");        
        str += "&qex=" + s;
    }
        
    s = _LxGetUrlPara(sUrl,"_lxps");
    if (s != "")
    {
        lexosearch.Options.PageSize = s;  
        str += "&ps=" + s;
    }
    else
    {
        lexosearch.Options.PageSize = 12;
        str += "&ps=12";
    }
    s = _LxGetUrlPara(sUrl,"_lxpg");
    if (s != "")
    {
        lexosearch.Options.PageNumber = s;
        str += "&pg=" + s;
    }
    s = _LxGetUrlPara(sUrl,"_lxsort");
    if (s != "")
    {        
        s = s.toLowerCase();
        lexosearch.Options.SortBy = s;
        switch (s)
        {
            case "relevance":
                s = "s";
                break;
            case "date":
                s = "t";
                break;
        }        
        str += "&s=" + s;        
        s = _LxGetUrlPara(sUrl,"_lxsa");
        if (s != "")
        {
            str += "&o=" + s;
            if (s == "0")
                lexosearch.Options.SortAscending = true;
            else
                lexosearch.Options.SortAscending = false;
        }
    }
    s = _LxGetUrlPara(sUrl,"_lxdate1");
    if (s != "")
    {
        lexosearch.Criteria.TimeBegin = s;
        str += "&tm1=" + _LxSetDateStr(s);
    }
    s = _LxGetUrlPara(sUrl,"_lxdate2");
    if (s != "")
    {
        lexosearch.Criteria.TimeEnd = s;
        str += "&tm2=" + _LxSetDateStr(s);
    }
    s = _LxGetUrlPara(sUrl,"_lxdatelength");
    if (s != "")
    {
        lexosearch.Criteria.TimeLength = s;
        str += "&tmL=" + s;
    }
    else
        str += "&tmL=";
    s = _LxGetUrlPara(sUrl,"_lxlayout");
    if (s != "")
    {
        lexosearch.Options.LayoutId = s;        
    }   
    s = _LxGetUrlPara(sUrl,"_lxmp");   
    if (s != "")
    {
        lexosearch.Criteria.MatchPosition = s;
        str += "&m=" + s;
    }
    s = _LxGetUrlPara(sUrl,"_lxtpc");
    if (s != "")
    {
        lexosearch.Criteria.Topics = s;
        str += "&tl=" + s;       
    }
    else
    {
        //在全部专题中搜索
        s = "1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,22,37,38,39";   //定制代码
        
        lexosearch.Criteria.Topics = s;
        str += "&tl=" + s;
    }
    s = _LxGetUrlPara(sUrl,"_lxtpcc");
    if (s != "")
    {
        lexosearch.Criteria.TopicsToCount = s;
        str += "&tlc=" + s;
    }
    s = _LxGetUrlPara(sUrl,"_lxkwt")
    if (s != "")
    {
        lexosearch.Options.KwTrendsId = s;
        str += "&kwt=" + s;
    }
    s = _LxGetUrlPara(sUrl,"_lxdup")
    if (s != "")
    {
        lexosearch.Options.MarkDuplicates = s;
        str += "&dup=" + s;
    }   
    s = _LxGetUrlPara(sUrl,"_lxbw")
    if (s != "")
    {
        if (s == "0")
            lexosearch.Options.EnableWordBreak = false;
        else
            lexosearch.Options.EnableWordBreak = true;
        str += "&bw=" + s;
    }       
    
    //设置字符集
    if (lexosearch.Browse == "IE")      
        str += "&cp=" + document.charset;
    else
        str += "&cp=" + document.characterSet;
               
    return str;
}

//提交搜索请求
function _LxSubmitSearch()
{
    lexosearch.Options.PageNumber = 1;
    return _LxSearchPage(false);
}
function _LxSubmitSearch(newWindow)
{
    lexosearch.Options.PageNumber = 1;
    return _LxSearchPage(newWindow);
}
function _LxSearchPage(newWindow)
{
    var sUrlPara = "";
    var sp = "";
    var s = "";
    var i;
    var bEx = false;
        
    sUrlPara += _LxKwId + "=" + encodeURI(lexosearch.Criteria.QueryString);
    
    for (i = 0; i < lexosearch.Criteria.QueryStringEx.length; i++)
    {
        if (lexosearch.Criteria.QueryStringEx[i])
        {
            s += lexosearch.Criteria.QueryStringEx[i] + "\n";
            bEx = true;
        }
        else
            s += "\n";
    }
    if (bEx)
        sUrlPara += "&_lxkwex=" + encodeURI(s);
        
    sUrlPara += "&_lxpg=" + lexosearch.Options.PageNumber;
    sUrlPara += "&_lxps=" + lexosearch.Options.PageSize;
    if (lexosearch.Options.SortBy != "")
        sUrlPara += "&_lxsort=" + lexosearch.Options.SortBy;
    if (lexosearch.Options.SortAscending)
        sUrlPara += "&_lxsa=0";
    else
        sUrlPara += "&_lxsa=1";
    if (lexosearch.Criteria.TimeBegin != "")
        sUrlPara += "&_lxdate1=" + lexosearch.Criteria.TimeBegin;
    if (lexosearch.Criteria.TimeEnd != "")
        sUrlPara += "&_lxdate2=" + lexosearch.Criteria.TimeEnd;
    if (lexosearch.Criteria.TimeLength != "")
        sUrlPara += "&_lxdatelength=" + lexosearch.Criteria.TimeLength;
    if (lexosearch.Options.LayoutId != "")
        sUrlPara += "&_lxlayout=" + lexosearch.Options.LayoutId;
    if (lexosearch.Criteria.MatchPosition != "")
        sUrlPara += "&_lxmp=" + lexosearch.Criteria.MatchPosition;
    if (lexosearch.Criteria.Topics != "")
        sUrlPara += "&_lxtpc=" + lexosearch.Criteria.Topics;
    if (lexosearch.Options.KwTrendsId != "")
        sUrlPara += "&_lxkwt=" + lexosearch.Options.KwTrendsId;
    if (lexosearch.Options.MarkDuplicates != "")
        sUrlPara += "&_lxdup=" + lexosearch.Options.MarkDuplicates;
    if (lexosearch.Criteria.TopicsToCount != "")
        sUrlPara += "&_lxtpcc=" + lexosearch.Criteria.TopicsToCount;
    if (lexosearch.Options.EnableWordBreak)    
        sUrlPara += "&_lxbw=1";
    else
        sUrlPara += "&_lxbw=0";
    
    //处理扩展属性
    for (i = 1; i < 31; i++)
    {        
        s = eval("lexosearch.Criteria.S" + i.toString());
        if (s != "")
        {
            sUrlPara += "&_lxs" + i.toString() + "=" + encodeURI(s);
        }
    }
    for (i = 1; i < 5; i++)
    {        
        s = eval("lexosearch.Criteria.M" + i.toString() + "L");
        if (s != "")
        {
            sUrlPara += "&_lxm" + i.toString() + "l=" + encodeURI(s);
        }
        s = eval("lexosearch.Criteria.M" + i.toString() + "U");
        if (s != "")
        {
            sUrlPara += "&_lxm" + i.toString() + "u=" + encodeURI(s);
        }
    }

//    document.location.hash = "";   

    if (lexosearch.Options.SubmitTo != "")
    {
        s = lexosearch.Options.SubmitTo;   
        if (newWindow)
            window.open(s + "?" + sUrlPara);
        else
            document.location.href = s + "?" + sUrlPara;    
    }
    else
    {
        s = document.location.href;
        if (s.charAt(s.length-1) == "javascript:void(0);")   
        { 
            s = s.substring(0,s.length-1-document.location.search.length);
            document.location.href = s + "?" + sUrlPara;
        }
        else
            document.location.search = sUrlPara;
    }   
    
    return false;
}

//根据搜索结果字符串，设置Result对象
function _LxsearchResult(v)
{        
    var p;
    var s;
    var arrInfo;

    lexosearch.Result.RawString = v;
        
    //设置原始统计信息行
    p = v.indexOf("\n");
    if (p >= 0)
    {
        s = v.substring(0,p++);
        lexosearch.Result.RawBasicInfo = s;
        v = v.substring(p);
    }
    
    //忽略文档号列表行
    p = v.indexOf("\n");    
    if (p >= 0)
    {
        v = v.substring(++p);
    }
            
    //设置原始专题信息行
    p = v.indexOf("\n");
    if (p >= 0)
    {
        s = v.substring(0,p++);
        lexosearch.Result.RawTopicString = s;
        v = v.substring(p);
    }
    
    //忽略关键词行
    p = v.indexOf("\n");
    if (p >= 0)
    {
        v = v.substring(++p);
    }
    
    //设置拼音提示行
    p = v.indexOf("\n");
    if (p >= 0)
    {
        s = v.substring(0,p);
        lexosearch.Result.RawPinyinTips = s;
        v = v.substring(++p);
    }
    //设置关联词提示行
    p = v.indexOf("\n");
    if (p >= 0)
    {
        s = v.substring(0,p);
        lexosearch.Result.RawKwcorTips = s;
        v = v.substring(++p);
    }
    
    //设置原始文档列表行
    lexosearch.Result.RawDocList = v;
    
    //初始化原始统计信息
    arrInfo = lexosearch.Result.RawBasicInfo.split(" ");   
    lexosearch.Result.Time = parseInt(arrInfo[0]) / 1000; 
    lexosearch.Result.Count = parseInt(arrInfo[1]);
    lexosearch.Result.CountInSet = parseInt(arrInfo[2]);
    lexosearch.Result.CountInPage = parseInt(arrInfo[3]);
    lexosearch.Result.PageSize = parseInt(arrInfo[4]);
    lexosearch.Result.PageNumber = parseInt(arrInfo[5]);
    
    lexosearch.Result.FirstNum = lexosearch.Result.PageNumber * lexosearch.Result.PageSize - lexosearch.Result.PageSize + 1;
    lexosearch.Result.LastNum = lexosearch.Result.FirstNum + lexosearch.Result.CountInPage - 1;
    lexosearch.Result.Ready = true;

    lexosearch.CallBack();
}

function _LxSetSmartTips()
{
    var arr;
    var i;
    var s;
    var bok = false;
    
    if (lexosearch.Result.Ready && lexosearch.Criteria.QueryString != "")
    {
        dv = document.getElementById("_lxsmarttips");
        s = dv.innerHTML;        
        if (lexosearch.Result.RawPinyinTips != "")
        {
            s = s.replace(/\[\$disp_kws\$\]/g,"style=\"display:inline;\"");
            arr = lexosearch.Result.RawPinyinTips.split("\r");
            for (i = 1; i < 4 && i <= arr.length; i++)
            {
                var rgx = new RegExp("\\[\\$kws"+i.toString()+"\\$\\]","g");
                s = s.replace(rgx,arr[i-1]);
            }
            bok = true;
        }
        else
        {
            s = s.replace(/\[\$disp_kws\$\]/g,"style=\"display:none;\"");
            i = 1;
        }
        while (i < 4)
        {
            var rgx = new RegExp("\\[\\$kws"+i.toString()+"\\$\\]","g");
            s = s.replace(rgx,"");
            i++;
        } 
            
        if (lexosearch.Result.RawKwcorTips != "")
        {     
            arr = lexosearch.Result.RawKwcorTips.split("\r");
            for (i = 1; i < 4 && i <= arr.length; i++)
            {
                var rgx = new RegExp("\\[\\$kwr"+i.toString()+"\\$\\]","g");
                s = s.replace(rgx,arr[i-1]);
            }
            bok = true;
        }
        else
        {
            s = s.replace(/\[\$disp_kwr\$\]/g,"style=\"display:none;\"");
            i = 1;
        }
        while (i < 4)
        {
            var rgx = new RegExp("\\[\\$kwr"+i.toString()+"\\$\\]","g");
            s = s.replace(rgx,"");
            i++;
        }
            
        dv.innerHTML = s;
        if (bok)
            dv.style.display = "block";
    }   
    if (!lexosearch.Result.Ready && lexosearch.Criteria.QueryString != "")
    {
        setTimeout(_LxSetSmartTips,100);
    }
}

function _LxSetTopics()
{
    var st0,sta0,st1,sta1,sTpcs,st,s,sRes;
    var aTpc,at;
    var e;
    var i,n;
        
    if (document.getElementById("_lxtpclist") && document.getElementById("_lxtpcoption") && lexosearch.Result.Ready)
    {
        sTpcs = document.getElementById("_lxtpcoption").value;
        sTpcs = sTpcs.replace(/\n/g,';').replace(/：/g,':').replace(/\r/g,'');
        var oe = document.getElementById("_lxtpclist");
        
        e = _LxFindChildNode1(oe,"_lxtpc0");
        if (e) st0 = e.innerHTML;
        e = _LxFindChildNode1(oe,"_lxtpc1");
        if (e) st1 = e.innerHTML;
        e = _LxFindChildNode1(oe,"_lxtpcall");
        if (e) sta0 = e.innerHTML;
        e = _LxFindChildNode1(oe,"_lxtpcall1");
        if (e) sta1 = e.innerHTML;
               
        aTpc = sTpcs.split(";");
        sRes = "";
        for (i = 0; i < aTpc.length; i++)
        {
            at = aTpc[i].split(":");
            if (at.length == 2)
            {
                n = _LxgetTpcCount(at[1]);
                if (at[1] == lexosearch.Criteria.Topics)
                    st = st1;
                else
                    st = st0;
                s = st.replace(/\[\$tpcname\$\]/g,at[0]);
                s = s.replace(/\[\$tpcid\$\]/g,at[1]);
                s = s.replace(/\[\$tpccount\$\]/g,n);
                sRes += s;
            }
        }
        document.getElementById("_lxtpclist").innerHTML = sRes;
        document.getElementById("_lxtpclist").style.display = "block";
    }
    else 
    {
        setTimeout(_LxSetTopics,100);
    }
}
function _LxgetTpcCount(tids)
{
    var aTpc = lexosearch.Result.RawTopicString.split(' ');
    var n = 0;
    var at = tids.split(",");
    var st;
    var i,j;
    
    for (i = 0; i < at.length; i++)
    {        
        for (j = 0; j < aTpc.length; j++)
        {
            if (at[i] == aTpc[j++])
            {
                n += parseInt(aTpc[j]);
            }
        }
    }
    return n;
}
function _LxreplaceLxStrDup(st,arr,p)
{  
    var sResult = "";
    var s,st,sm,si;
    var i,j;
    var m;
    var bRel = false;
    var rgxQS = new RegExp("related:\\(\\S+\\)","g");
    var rgxHL = new RegExp("</?font[^>]+LeXoTeCh>","g");
    var p;
    var sres = ","
    var aRes = sres.split(',');
    for (i = p; i < arr.length - 60; i++)
    {
        s = st;
        sm = arr[i+5];
        ai = sm.split(' ');
        if (parseInt(ai[2]) >= 0)
            break;
        s = s.replace(/\[\$dupno\$\]/g,ai[3]);
        s = s.replace(/\[\$docid\$\]/g,arr[i++]);
        s = s.replace(/\[\$rank\$\]/g,arr[i++]);
        s = s.replace(/\[\$tid\$\]/g,arr[i++]);
        s = s.replace(/\[\$sid\$\]/g,arr[i++]);
        i++;    //忽略用户编码
        i++;    //跳过指纹码
        s = s.replace(/\[\$timedl\$\]/g,arr[i++]); 
        s = s.replace(/\[\$codepage\$\]/g,arr[i++]);
        s = s.replace(/\[\$langid\$\]/g,arr[i++]);
        s = s.replace(/\[\$fmtid\$\]/g,arr[i++]);
               
        var stm = arr[i++];
        p = stm.indexOf(' ');
        if (p > 0)
            stm = stm.substring(0,p);
        s = s.replace(/\[\$time\$\]/g,stm);
        nLen = arr[i++];
        s = s.replace(/\[\$sizebt\$\]/g,nLen);
        if (nLen == '0')
            s = s.replace(/\[\$disp_sizebt\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_sizebt\$\]/g,'style="display:inline;""');
        //s = (nLen == '0') ? s.replace(/\[\$disp_sizebt\$\]/g,'none') : s.replace(/\[\$disp_sizebt\$\]/g,'block');
        nLen = nLen / 1024 + 0.5;  
        nLen = Math.round(nLen);      
        s = s.replace(/\[\$sizekb\$\]/g,nLen);
        if (nLen == '0')
            s = s.replace(/\[\$disp_sizekb\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_sizekb\$\]/g,'style="display:inline;""');
            
        nLen = nLen / 1024;
        s = s.replace(/\[\$sizemb\$\]/g,nLen.toFixed(1));
        if (nLen == '0')
            s = s.replace(/\[\$disp_sizemb\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_sizemb\$\]/g,'style="display:inline;""');
        
        if (arr[i] == null || arr[i] == '')
            s = s.replace(/\[\$disp_url\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_url\$\]/g,'style="display:inline;""');
                        
        s = s.replace(/\%5B\$url\$\%5D/g,arr[i]);
        s = s.replace(/\[\$url\$\]/g,arr[i++]);
                
        si = arr[i++];
        if (si == null || si == '')
            s = s.replace(/\[\$disp_tags\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_tags\$\]/g,'style="display:inline;""');
        s = s.replace(/\[\$tags\$\]/g,si);
       
        var aTags = si.split(",");
        for (j = 0; j < 20; j++)
        {
            var ri = new RegExp("\\[\\$tag"+j.toString()+"\\$\\]","g");
            if (j <= aTags.length)
                s = s.replace(ri,aTags[j-1]);
            else
                s = s.replace(ri,"");
        }
        
        //设置标题、摘要
        sm = arr[i++];        
        sm = sm.replace(rgxHL,"");
        s = s.replace(/\[\$title\$\]/g,sm);
        if (bRel)
            s = s.replace(/\[\$titlehl\$\]/g,sm);
        else
            s = s.replace(/\[\$titlehl\$\]/g,arr[i-1]);
        sm = arr[i++];        
        sm = sm.replace(/<br>/g,"");        
        sm = sm.replace(rgxHL,"");
        s = s.replace(/\[\$abstract\$\]/g,sm);
        if (bRel)
            s = s.replace(/\[\$abstracthl\$\]/g,sm);
        else
            s = s.replace(/\[\$abstracthl\$\]/g,arr[i-1].replace(/<br>/g,""));
  
        i++;    //忽略文档正文
        
        if (arr[i] == null || arr[i] == '')
            s = s.replace(/\[\$disp_author\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_author\$\]/g,'style="display:inline;""');
        s = s.replace(/\[\$author\$\]/g,arr[i++]);
        
        if (arr[i] == null || arr[i] == '')
            s = s.replace(/\[\$disp_source\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_source\$\]/g,'style="display:inline;""');
        s = s.replace(/\[\$source\$\]/g,arr[i++]);
        
        if (arr[i] == null || arr[i] == '')
            s = s.replace(/\[\$disp_sname\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_sname\$\]/g,'style="display:inline;""');
        s = s.replace(/\[\$sname\$\]/g,arr[i++]);
        
        if (arr[i] == null || arr[i] == '')
            s = s.replace(/\[\$disp_surl\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_surl\$\]/g,'style="display:inline;""');
        s = s.replace(/\[\$surl\$\]/g,arr[i++]);
        
        si = getTpcUrl(arr[i]);
        s = s.replace(/\[\$turl\$\]/g,si);//JOY
        
        s = s.replace(/\[\$tname\$\]/g,arr[i++]);
        s = s.replace(/\[\$hostname\$\]/g,arr[i++]);
        s = s.replace(/\[\$piccount\$\]/g,arr[i++]);
        s = s.replace(/\[\$tabcount\$\]/g,arr[i++]);
                
        for (j = 1; j < 5; j++)
        {
            m = arr[i++];
            var ri = new RegExp("\\[\\$m"+j.toString()+"\\$\\]","g");
            var rid = new RegExp("\\[\\$disp_m"+j.toString()+"\\$\\]","g");
            if (m == null || m == '')
                s = s.replace(rid,'style="display:none;"');
            else
            {
                s = s.replace(rid,'style="display:inline;""');                
            }
            s = s.replace(ri,m.toString());            
        }
        for (j = 1; j < 31; j++)
        {
            si = arr[i++];
            var sis="";
            if (j == 4 && si != null)
            {
                if (si.indexOf('秒') > 0)
                    si = si.substring(0,si.length-1);
                var ms = parseInt(si);
                var m = parseInt(ms/60);
                var ns = ms % 60;
                si = m.toString() + "\'" + ns.toString() + "\'\'";    
                sis = m.toString() + "\\\'" + ns.toString() + "\\\'\\\'";                
            }
            var ris = new RegExp("\\[\\$s"+j.toString()+"_str\\$\\]","g");
            var ri = new RegExp("\\[\\$s"+j.toString()+"\\$\\]","g");
            var rid = new RegExp("\\[\\$disp_s"+j.toString()+"\\$\\]","g");
            if (si == null || si == '')
                s = s.replace(rid,'style="display:none;"');
            else            
                s = s.replace(rid,'style="display:inline;""');            
            s = s.replace(ri,si);
            s = s.replace(ris,sis);
        }
        for (j = 1; j < 3; j++)
        {
            si = arr[i++];
            var ri = new RegExp("\\[\\$burl"+j.toString()+"\\$\\]","g");
            var rif = new RegExp("\\%5B\\$burl"+j.toString()+"\\$\\%5D","g");
            var rid = new RegExp("\\[\\$disp_burl"+j.toString()+"\\$\\]","g");
            if (si == null || si == '')
                s = s.replace(rid,'style="display:none;"');
            else            
                s = s.replace(rid,'style="display:inline;"');            
            s = s.replace(ri,si);
            s = s.replace(rif,si);
        }
        i--;
       
        sResult += s;
        
    }
    aRes[0] = i.toString();
    aRes[1] = sResult;
    return aRes;
}
function _LxreplaceLxStr(stmp0,stmp1)
{
    _LxreplaceLxStr(stmp0,stmp1,"")
}
function _LxreplaceLxStr(stmp0,stmp1,dispId)
{
    var v = lexosearch.Result.RawDocList;   
    var arr = v.toString().split("\n");
    var sResult = "";
    var sResultDup = "";
    var s,st,sm,si,stdup;
    var i,j,dupCount,nDup;
    var m;
    var bRel = false;
    var rgxQS = new RegExp("related:\\(\\S+\\)","g");
    var rgxHL = new RegExp("</?font[^>]+LeXoTeCh>","g");
    var p;
    var commonDid = "";
    var aRes;
    var dt1,dt2;
    var dtSpan,stm2;
        
    rgxQS.ignoreCase = true;    
    if (rgxQS.exec(lexosearch.Criteria.QueryString))
        bRel = true;

    if (st == "" || v == "")
        return "";
//    if (document.getElementById("_lxresdup_[$commondid$]"))
//        stdup = document.getElementById("_lxresdup_[$commondid$]").innerHTML;
//    else 
//        stdup = "";
    if (document.getElementById("_lxresdup"))
        stdup = document.getElementById("_lxresdup").innerHTML;
    else 
        stdup = "";
    for (i = 0; i < arr.length - 60; i++)
    {        
        //排重
        sm = arr[i+5];
        ai = sm.split(' ');
        
        if (parseInt(ai[2]) < 0 && ai[0] != "")        
            st = stmp1;
        else
            st = stmp0;
        s = st.replace(/\[\$dupcount\$\]/g,ai[2]).replace(/\\n/g,'\n');
        s = s.replace(/\[\$dupno\$\]/g,ai[3]);
        //if (ai[2] == '0' || dispId != "disp1" || ai[0] == "")
        if (ai[2] == '0')
            s = s.replace(/\[\$disp_dup\$\]/g,'style="display:none;"');
        //else if (parseInt(ai[2]) > 0 && ai[0] != "")
        else if (parseInt(ai[2]) > 0)
        {
            s = s.replace(/\[\$disp_dup\$\]/g,'style="display:inline;"');
            commonDid = arr[i]; 
            sResultDup = "";
            dupCount = parseInt(ai[2]);               
        }
        //else if (parseInt(ai[2]) < 0 && ai[0] != "")
        else if (parseInt(ai[2]) < 0 && stdup != "")
        {
            nDup = parseInt(ai[3]);
            s.replace(/\[\$commondid\$\]/g,commonDid);
//            if (nDup == 1)
//            {
//                sResultDup = "<div id=\"_lxresdup_"+ commonDid.toString() +"\" style=\"display: none; position:absolute; background-color:white; border:solid 1px black;\">";
//                sResultDup += "<div style=\"float:right;padding:3px 3px 0px 0px; cursor:hand;\" onclick=\"document.getElementById(\'_lxresdup_"+ commonDid.toString() +"\').style.display=\'none\';\">关闭</div>"
//            } 
            if (stdup != "")
            {
                while (nDup <= dupCount)
                {
                    aRes = _LxreplaceLxStrDup(stdup,arr,i);
                    sResultDup += aRes[1];
                    i = parseInt(aRes[0]);                    
                    nDup++;
                }
                sResultDup += "</div>";
                sResult += sResultDup;
            }            
            i--;
            continue;
        }
                
        s = s.replace(/\[\$docid\$\]/g,arr[i++]);
        s = s.replace(/\[\$rank\$\]/g,arr[i++]);
        s = s.replace(/\[\$tid\$\]/g,arr[i++]);
        s = s.replace(/\[\$sid\$\]/g,arr[i++]);
        i++;    //忽略用户编码
        i++;    //跳过指纹码
        s = s.replace(/\[\$timedl\$\]/g,arr[i++]); 
        si = arr[i++];
        var ai = si.split(' ');
        s = s.replace(/\[\$charset\$\]/g,ai[1]);             
        si = arr[i++];
        s = s.replace(/\[\$langid\$\]/g,si); 
        s = s.replace(/\[\$lang\$\]/g,_LxLang[parseInt(si)]); 
        si = arr[i++];
        s = s.replace(/\[\$fmtid\$\]/g,si);
        s = s.replace(/\[\$fmt\$\]/g,_LxFmt[parseInt(si)]); 
        
        var stm = arr[i++];    
        dt = _LxSetDate(stm);
        p = stm.indexOf(' ');
        if (p > 0)
            stm = stm.substring(0,p);
        s = s.replace(/\[\$time\$\]/g,stm);
        
        //第二种时间显示格式：xx天以前        
        dt2 = new Date();
        dtSpan = dt2 - dt;
        if (dtSpan > 1000)        
        {
            dtSpan = parseInt(dtSpan / 1000);            
            if (dtSpan > 60)
            {
                dtSpan = parseInt(dtSpan / 60);
                if (dtSpan > 60)
                {
                    dtSpan = parseInt(dtSpan / 60);
                    if (dtSpan > 24)
                    {
                        dtSpan = parseInt(dtSpan / 24);
                        stm2 = "天";
                    }
                    else
                        stm2 = "小时";
                }
                else
                    stm2 = "分钟";
            }
            else
                stm2 = "秒";
            s = s.replace(/\[\$time2\$\]/g,dtSpan.toString()+stm2+"以前");
        }
        else
        {
            s = s.replace(/\[\$time2\$\]/g,"");
        }
        
        nLen = arr[i++];
        s = s.replace(/\[\$sizebt\$\]/g,nLen);
        if (nLen == '0')
            s = s.replace(/\[\$disp_sizebt\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_sizebt\$\]/g,'style="display:inline;"');
        //s = (nLen == '0') ? s.replace(/\[\$disp_sizebt\$\]/g,'none') : s.replace(/\[\$disp_sizebt\$\]/g,'block');
        nLen = nLen / 1024 + 0.5;  
        nLen = Math.round(nLen);      
        s = s.replace(/\[\$sizekb\$\]/g,nLen);
        if (nLen == '0')
            s = s.replace(/\[\$disp_sizekb\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_sizekb\$\]/g,'style="display:inline;"');
            
        nLen = nLen / 1024;
        s = s.replace(/\[\$sizemb\$\]/g,nLen.toFixed(1));
        if (nLen == '0')
            s = s.replace(/\[\$disp_sizemb\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_sizemb\$\]/g,'style="display:inline;"');
        
        si = arr[i];                
        //si = si.replace(/http:\/\/219.137.11.198:8000/g,"");       
        //si = si.substring(1,si.length);
        s = s.replace(/\[\$fileurl\$\]/g,si);
        p = si.lastIndexOf(".");
        if (p > 0)
        {
            si = si.substring(++p);
            s = s.replace(/\[\$type\$\]/g,si);
        }
        
        if (arr[i] == null || arr[i] == '')
            s = s.replace(/\[\$disp_url\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_url\$\]/g,'style="display:inline;"');
        s = s.replace(/\%5B\$url\$\%5D/g,arr[i]);
        s = s.replace(/\[\$url\$\]/g,arr[i++]);
                
        si = arr[i++];
        if (si == null || si == '')
            s = s.replace(/\[\$disp_tags\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_tags\$\]/g,'style="display:inline;"');
        s = s.replace(/\[\$tags\$\]/g,si);
       
        var aTags = si.split(",");
        for (j = 0; j < 20; j++)
        {
            var ri = new RegExp("\\[\\$tag"+j.toString()+"\\$\\]","g");
            if (j <= aTags.length)
                s = s.replace(ri,aTags[j-1]);
            else
                s = s.replace(ri,"");
        }
        
        //设置标题、摘要
        sm = arr[i++];        
        sm = sm.replace(rgxHL,"");
        sm = sm.replace(/`/,"");
        
        s = s.replace(/\[\$title\$\]/g,sm);
        if (bRel)
            s = s.replace(/\[\$titlehl\$\]/g,sm);
        else
            s = s.replace(/\[\$titlehl\$\]/g,arr[i-1].replace(/<br>/g,"").replace(/&lt;br&gt;/g,""));
        sm = arr[i++];
        sm = sm.replace(/<br>/g,"");    
        sm = sm.replace(/&lt;br&gt;/g,"");    
        sm = sm.replace(/<!--_img_-->/g,"");
        sm = sm.replace(/&lt;!--_img_--&gt;/g,"");
        sm = sm.replace(/<!--_table_-->/g,"");
        sm = sm.replace(/&lt;!--_table_--&gt;/g,"");
        if (!bRel)
            s = s.replace(/\[\$abstracthl\$\]/g,sm);
        sm = sm.replace(rgxHL,"");
        s = s.replace(/\[\$abstract\$\]/g,sm);
        if (bRel)
            s = s.replace(/\[\$abstracthl\$\]/g,sm);
          
        i++;    //忽略文档正文
        
        if (arr[i] == null || arr[i] == '')
        {
            s = s.replace(/\[\$disp_author\$\]/g,'style="display:none;"');
            s = s.replace(/\[\$disp_author_str\$\]/g,'style=\\\'display:none;\\\'');
        }
        else
        {
            s = s.replace(/\[\$disp_author\$\]/g,'style="display:inline;"');
            s = s.replace(/\[\$disp_author_str\$\]/g,'style=\\\'display:inline;\\\'');
        }
        s = s.replace(/\[\$author\$\]/g,arr[i++]);
        
        if (arr[i] == null || arr[i] == '')
            s = s.replace(/\[\$disp_source\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_source\$\]/g,'style="display:inline;"');
        s = s.replace(/\[\$source\$\]/g,arr[i++]);
        
        if (arr[i] == null || arr[i] == '')
            s = s.replace(/\[\$disp_sname\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_sname\$\]/g,'style="display:inline;"');
        s = s.replace(/\[\$sname\$\]/g,arr[i++]);
        
        if (arr[i] == null || arr[i] == '')
            s = s.replace(/\[\$disp_surl\$\]/g,'style="display:none;"');
        else
            s = s.replace(/\[\$disp_surl\$\]/g,'style="display:inline;"');
        s = s.replace(/\[\$surl\$\]/g,arr[i++]);
        
//        si = getTpcUrl(arr[i]);
//        s = s.replace(/\[\$turl\$\]/g,si);//JOY
        
        s = s.replace(/\[\$tname\$\]/g,arr[i++]);
        s = s.replace(/\[\$hostname\$\]/g,arr[i++]);
        s = s.replace(/\[\$piccount\$\]/g,arr[i++]);
        s = s.replace(/\[\$tabcount\$\]/g,arr[i++]);
                
        for (j = 1; j < 5; j++)
        {
            m = arr[i++];
            var ri = new RegExp("\\[\\$m"+j.toString()+"\\$\\]","g");
            var rid = new RegExp("\\[\\$disp_m"+j.toString()+"\\$\\]","g");
            if (m == null || m == '')
                s = s.replace(rid,'style="display:none;"');
            else
            {
                s = s.replace(rid,'style="display:inline;"');                
            }
            s = s.replace(ri,m.toString());
        }
        for (j = 1; j < 31; j++)
        {
            si = arr[i++];
            var sis="";
//            var sip=0
//            if (j == 2 && si != null && si != "")
//            {
//                sip = si.indexOf("(");
//                if (sip > 0)
//                    sis = si.substring(0,sip);
//                si = sis;
//            }            
            var ris = new RegExp("\\[\\$s"+j.toString()+"_str\\$\\]","g");
            var rids = new RegExp("\\[\\$disp_s"+j.toString()+"_str\\$\\]","g");
            var ri = new RegExp("\\[\\$s"+j.toString()+"\\$\\]","g");
            var rid = new RegExp("\\[\\$disp_s"+j.toString()+"\\$\\]","g");
            if (si == null || si == '')
            {
                s = s.replace(rid,'style=\"display:none;\"');
                s = s.replace(rids,'style=\\\"display:none;\\\"');
            }
            else 
            {           
                s = s.replace(rid,'style=\"display:inline;\"');            
                s = s.replace(rids,'style=\\\'display:inline;\\\'');
            }
            s = s.replace(ri,si);
            //s = s.replace(ris,sis);
            
        }
        for (j = 1; j < 3; j++)
        {
            si = arr[i++];
            var ri = new RegExp("\\[\\$burl"+j.toString()+"\\$\\]","g");
            var rif = new RegExp("\\%5B\\$burl"+j.toString()+"\\$\\%5D","g");
            var rid = new RegExp("\\[\\$disp_burl"+j.toString()+"\\$\\]","g");
            if (si == null || si == '')
                s = s.replace(rid,'style="display:none;"');
            else            
                s = s.replace(rid,'style="display:inline;"');            
            s = s.replace(ri,si);
            s = s.replace(rif,si);
        }
        i--;
       
        sResult += s;       
    }    
    
    return sResult;
}

//显示搜索结果
function _LxSetResult(dispId)
{
    var sResult = "";
    var st,st1;   
    var i,j;
    var e; 
               
    //if (lexosearch.Result.Count != 0 && lexosearch.Result.Ready) 
    
    
    if (lexosearch.Options.LayoutId == "")
        lexosearch.Options.LayoutId = dispId;
    if (lexosearch.Result.Ready)
    {       
        //设置文档列表       
        st = "";
        st1 = "";       
        if (document.getElementById("_lxreslist_" + dispId) && (!_LxDisplayOK || !_LxNoRefresh))
        {        
            _LxDisplayOK = true;    
            e = _LxFindChildNode1(document.getElementById("_lxreslist_" + dispId),"_lxres");
            if (e)
                st = e.innerHTML;
            else
                st = "";
            e = _LxFindChildNode1(document.getElementById("_lxreslist_" + dispId),"_lxres_dup");
            if (e)
                st1 = e.innerHTML;
            else 
                st1 = "";
            
            sResult = _LxreplaceLxStr(st,st1,dispId);   
            
            document.getElementById("_lxreslist_" + dispId).innerHTML = sResult;
            /*if (lexosearch.Options.LayoutId == "")
            {
                lexosearch.Options.LayoutId = dispId;
            }*/            
            if (lexosearch.Options.LayoutId == "" || lexosearch.Options.LayoutId == dispId)
            {
                document.getElementById("_lxreslist_" + dispId).style.display = "block";               
            }
            else
            {
                document.getElementById("_lxreslist_" + dispId).style.display = "none";                
            }            
        }
        if (document.getElementById("_lxLoading_"+dispId))
            document.getElementById("_lxLoading_"+dispId).style.display = "none"; 
        else if (document.getElementById("_lxLoading"))
            document.getElementById("_lxLoading").style.display = "none"; 
        if (document.getElementById("_lxNoResult_"+dispId) && lexosearch.Result.Count == 0 && lexosearch.Options.LayoutId == dispId)
            document.getElementById("_lxNoResult_"+dispId).style.display = "block";  
        else if (document.getElementById("_lxNoResult") && lexosearch.Result.Count == 0)      
            document.getElementById("_lxNoResult").style.display = "block";           
        
        lexosearch.CallBack();        
    } 
    
    if (!lexosearch.Result.Ready && (lexosearch.Criteria.QueryString != "" || !_LxDisplayOK))
    {
        if (document.getElementById("_lxNoSearch"))
            document.getElementById("_lxNoSearch").style.display = "none";
        if (document.getElementById("_lxLoading_"+dispId) && lexosearch.Options.LayoutId == dispId)
            document.getElementById("_lxLoading_"+dispId).style.display = "block"; 
        else if (document.getElementById("_lxLoading"))
            document.getElementById("_lxLoading").style.display = "block";
        if (document.getElementById("_lxNoResult_"+dispId) && lexosearch.Options.LayoutId == dispId)
            document.getElementById("_lxNoResult_"+dispId).style.display = "none";  
        else if (document.getElementById("_lxNoResult"))
            document.getElementById("_lxNoResult").style.display = "none";
        setTimeout("_LxSetResult('"+dispId+"')",100);
    }
}

//显示页码
function _LxSetPages()
{
    var i;
    var e;
        
    if (lexosearch.Result.CountInSet != 0 && lexosearch.Result.Ready)
    {
        for (i = 0; i < document.getElementsByTagName("*").length; i++)
        {
            e = document.getElementsByTagName("*")[i];
            if (e.id == "_lxpaging")
            {
                if (e.style.display == "none")
                    _LxsetPage(e);
            }
        }     
        //setFrameHeight();  
        lexosearch.CallBack();    
    }
    if (!lexosearch.Result.Ready)
    {
        setTimeout(_LxSetPages,100);
    }
    else if (!_lxpaging)
    {
        setTimeout(_LxSetPages,300);
    }   
}
function _LxsetPage(e)
{
    var st = "";
    var sResult;
    var i;    
    var pc = Math.ceil(lexosearch.Result.CountInSet / lexosearch.Result.PageSize);  //计算最大页码数
    var p0 = Math.max(1,lexosearch.Result.PageNumber - _LxPAGESTEP);                //可显示的起始页码
    var p1 = Math.min(pc,lexosearch.Result.PageNumber + _LxPAGESTEP);               //可显示的结束页码    
    var st_lxpageprev1,st_lxpageprev0,st_lxpageno0,st_lxpageno1,st_lxpagenext0,st_lxpagenext1;
    
//    if (p1-p0 < _LxPAGESTEP*2)
//        p1 = Math.min(pc,2*_LxPAGESTEP);
    if (p1 == 1)
    {
        return;
    }
    
    oe = _LxFindChildNode1(e,"_lxpageprev1");
    if (oe) st_lxpageprev1 = oe.innerHTML;
    oe = _LxFindChildNode1(e,"_lxpageprev0");
    if (oe) st_lxpageprev0 = oe.innerHTML;
    
    oe = _LxFindChildNode1(e,"_lxpageno0");
    if (oe) st_lxpageno0 = oe.innerHTML;
    oe = _LxFindChildNode1(e,"_lxpageno1");
    if (oe) st_lxpageno1 = oe.innerHTML;
    
    oe = _LxFindChildNode1(e,"_lxpagenext1");
    if (oe) st_lxpagenext1 = oe.innerHTML;
    oe = _LxFindChildNode1(e,"_lxpagenext0");
    if (oe) st_lxpagenext0 = oe.innerHTML;
       
    //设置“上一页”控件
    if (lexosearch.Result.PageNumber > 1)
    {
        st = st_lxpageprev1.replace(/\[\$pageno1\$\]/g,lexosearch.Result.PageNumber);
        sResult = st;
    }
    else
    {
        sResult = st_lxpageprev0;
    }

    //设置页码
    if (st_lxpageno1 != null || st_lxpageno0 != null)
    {
        for (i = p0; i <= p1; i++)
        {
            if (i == lexosearch.Result.PageNumber)
                st = st_lxpageno1.replace(/\[\$pageno1\$\]/g,i);
            else
                st = st_lxpageno0.replace(/\[\$pageno\$\]/g,i);
            sResult += st;
        }
    }
    
    //设置“下一页”控件
    if (st_lxpagenext1 != null || st_lxpagenext0 != null)
    {
        if (lexosearch.Result.PageNumber < pc)
        {
            st = st_lxpagenext1.replace(/\[\$pageno1\$\]/g,lexosearch.Result.PageNumber);
            sResult += st;       
        }
        else
        {
            sResult += st_lxpagenext0;
        }
    }    
    e.innerHTML = sResult;
    e.style.display = "block";      
}

//搜索结果翻页
function _LxPaging(n)
{
    var sUrl = document.location.search;
    
    sUrl = _LxSetUrlPara(sUrl,"_lxpg",n);
    document.location.search = sUrl;
    
    return false;
}

function _LxSetInfo()
{
    var st;
    
    if (document.getElementById("_lxresinfo") && lexosearch.Result.Ready)
    {
        st = document.getElementById("_lxresinfo").innerHTML;
        st = st.replace(/\[\$count\$\]/g,lexosearch.Result.Count);
        st = st.replace(/\[\$querystring\$\]/g,lexosearch.Criteria.QueryString);
        st = st.replace(/\[\$firstnum\$\]/g,lexosearch.Result.FirstNum);
        st = st.replace(/\[\$lastnum\$\]/g,lexosearch.Result.LastNum);
        st = st.replace(/\[\$time\$\]/g,lexosearch.Result.Time);
        
        document.getElementById("_lxresinfo").innerHTML = st;
        document.getElementById("_lxresinfo").style.display = "block";
        
        //setFrameHeight();
    }
    if (!lexosearch.Result.Ready)
    {
        setTimeout(_LxSetInfo,100);
    }
}
function _LxResizeImg(ImgD,iwidth,iheight)
{ 
    var image=new Image(); 
    image.src=ImgD.src; 
    if (image.width>0 && image.height>0)
    { 
        if(image.width/image.height >= iwidth/iheight)
        { 
            if(image.width>iwidth)
            { 
                ImgD.width=iwidth; 
                ImgD.height=(image.height*iwidth)/image.width; 
            }
            else
            { 
                ImgD.width=image.width; 
                ImgD.height=image.height; 
            } 
        } 
        else
        { 
            if(image.height>iheight)
            { 
                ImgD.height=iheight; 
                ImgD.width=(image.width*iheight)/image.height; 
            }
            else
            { 
                ImgD.width=image.width; 
                ImgD.height=image.height; 
            } 
        } 
    }    
}
function _LxResizeImg2(ImgD,iwidth,iheight)//按比例放大/缩小到指定大小
{ 
    var image=new Image(); 
    image.src=ImgD.src; 
    if (image.width>0 && image.height>0)
    { 
        if(image.width/image.height >= iwidth/iheight)
        {
            ImgD.width=iwidth; 
            ImgD.height=(image.height*iwidth)/image.width; 
        } 
        else
        { 
            ImgD.height=iheight; 
            ImgD.width=(image.width*iheight)/image.height;
        } 
    }    
}

//每次加载页面时，如果搜索条件不为空，执行搜索
function _LxSearch()
{
    _LxSearch(false);
}
function _LxAjaxSearch()
{
    _LxSearch(true);
}
function _LxSearch(noRefreshPage)
{
    if (_LxFirstRun)
    {
        _LxDisplayOK = true;
    }
    _LxNoRefresh = noRefreshPage;
    _LxFirstRun = false;
    _LxSearch2(noRefreshPage);
}
function _LxSearch2(noRefreshPage)
{               
    var sCond;      
    
    if (noRefreshPage)
    {
        if (_LxDisplayOK)
        {
            _LxDisplayOK = false;
            lexosearch.Result.Ready = false;
            sCond = "&query=" + lexosearch.Criteria.QueryString;
            sCond += "&tl=" + lexosearch.Criteria.Topics;
            sCond += "&ps=" + lexosearch.Options.PageSize;
            sCond += "&cp=" + lexosearch.Options.Encoding;
            sCond += "&pg=1&dup=3";
        }
        else
        {
            sCond = "";
            setTimeout("_LxSearch2('"+noRefreshPage+"')",100);
        }
    }
    else
    {        
        sCond = _LxGetSearchCond();        
    }
    
    if (sCond != "")
    {        
        var s = document.createElement('SCRIPT');     
       
        s.id = "_lxScript";
        s.type = "text/javascript";
        
        s.src="http://" + lexosearch.Server +"/lexopub/Search.aspx?f=_LxsearchResult" + sCond;

        if (lexosearch.Browse == "IE")
        {
            var o = document.getElementsByTagName("head")[0].appendChild(s);
        }
        else
        {
            //document.body.insertBefore(s,this.firstChild);  
            var o = document.getElementsByTagName("head")[0].appendChild(s);
        }        
    }
}


function _LxTxtKwClick(kwid,key)
{        
    var str;
    
    gd_lxKwId = kwid;
    if (!document.getElementById("_lxlivelist"))
        return;
        
    if (document.getElementById("_lxlivelist").style.display == "none")
    {
        _LxItm = 0;        
        return;
    }
    switch (key)
    {
        case 38:
            //上移键
            _LxStopLiveTips(true);
            if (_LxItm > 0)
                _LxunHighLightResult(document.getElementById("_lxliveitem" + _LxItm.toString()));
            _LxItm -= 1;
            if (!document.getElementById("_lxliveitem" + _LxItm.toString()))
                _LxItm = _LxItmCount;
            _LxHighLightResult(document.getElementById("_lxliveitem" + _LxItm.toString()));
            if (lexosearch.Browse == "IE")
                str = document.getElementById("_lxliveitem" + _LxItm.toString() + "_kw").innerText;
            else
                str = document.getElementById("_lxliveitem" + _LxItm.toString() + "_kw").textContent;
            document.getElementById(kwid).value = str;
            break;
        case 40:
            //下移键
            _LxStopLiveTips(true);
            if (_LxItm > 0)
                _LxunHighLightResult(document.getElementById("_lxliveitem" + _LxItm.toString()));
            _LxItm += 1;
            if (!document.getElementById("_lxliveitem" + _LxItm.toString()))
                _LxItm = 1;
            _LxHighLightResult(document.getElementById("_lxliveitem" + _LxItm.toString()));               
            if (lexosearch.Browse == "IE")
                str = document.getElementById("_lxliveitem" + _LxItm.toString() + "_kw").innerText;
            else
                str = document.getElementById("_lxliveitem" + _LxItm.toString() + "_kw").textContent;
            document.getElementById(kwid).value = str;
            break;
        case 13:
            break;
        default:            
            if (_LxStoped)
                _LxLoadLiveTips();
            break;
    }
}

function _LxLoadLiveTips(kwid)
{
    var sCond;
    
    //_LxKwId = kwid;
    if (!document.getElementById("_lxlivelist"))
        return;
        
    _LxStoped = false;
    if (document.getElementById(kwid))
    {
        if (document.getElementById(kwid).value == "")
        {
            document.getElementById("_lxlivelist").style.display = "none";
            if (document.getElementById("_LxIfrKey"))
                document.getElementById("_LxIfrKey").style.display = "none";
            _LxItm = 0;
        }
        if (_LxKeywords != document.getElementById(kwid).value && document.getElementById(kwid).value != "")
        {
            _LxKeywords = document.getElementById(kwid).value;
            sCond = "&key=" + encodeURI(_LxKeywords);
            _LxLiveTips(sCond);
            clearTimeout(_LxTimeoutProc);
            _LxItm = 0;         
        }        
    }
    _LxTimeoutProc = setTimeout("_LxLoadLiveTips('"+kwid+"')",100);
}
function _LxStopLiveTips()
{
    _LxStopLiveTips(false);
}
function _LxStopLiveTips(bClose)
{
    if (!document.getElementById("_lxlivelist"))
        return;
    clearTimeout(_LxTimeoutProc);
    
    if (!bClose)
    {
        document.getElementById("_lxlivelist").style.display = "none"
        if (document.getElementById("_LxIfrKey"))
            document.getElementById("_LxIfrKey").style.display = "none";   
    }
        
    _LxStoped = true;
}


function _LxLiveTips(sCond)
{       
    if (sCond != "")
    {
        var s = document.createElement('SCRIPT');        
        
        if (lexosearch.Browse == "IE")      
            sCond += "&cp=" + document.charset;
        else
            sCond += "&cp=" + document.characterSet;
        s.id = "_lxLiveTipsScript";
        s.type = "text/javascript";
        s.src="http://" + lexosearch.Server +"/lexopub/LiveTips.aspx?f=_LxtipResult" + sCond;
        
        if (lexosearch.Browse == "IE")
        {
            var o = document.getElementsByTagName("head")[0].appendChild(s);
        }
        else
        {
            document.body.insertBefore(s,this.firstChild);
        }        
    }
}

function _LxtipResult(v)
{    
    _LxResult = v;
    if (v != "")
        _LxsetTipResult();
    else
    {
        document.getElementById("_lxlivelist").style.display = "none";
        if (document.getElementById("_LxIfrKey"))
            document.getElementById("_LxIfrKey").style.display = "none";
    }
}

function _LxsetTipResult()
{
    var arr;
    var ai;
    var i;
    var st,si,sRes,sto;    
    var dv = document.getElementById("_lxlivelist");
    var parent = document.getElementById(_LxKwId);         
    var x = parent.offsetLeft;
    var y = parent.offsetTop + parent.offsetHeight;
    var p;
       
    if (document.getElementById("_lxliveitem"))
    {                  
        arr = _LxResult.split("\n");
        if (_LxTmplStr == "")
            _LxTmplStr = document.getElementById("_lxliveitem").innerHTML; 
        st = _LxTmplStr;       
        sRes = "";
       
        for (i = 0; i < arr.length; i++)
        {
             _LxItmCount = i + 1;
            ai = arr[i].split("\r");
            si = st.replace(/\[\$livekw\$\]/g,ai[0]);
            si = si.replace(/\[\$livecount\$\]/g,ai[1]);
            si = si.replace(/\[\$rank\$\]/g,_LxItmCount.toString());
            
            sRes += si;
        }        
        while (parent.offsetParent)
        {
             parent = parent.offsetParent;
             x += parent.offsetLeft;
             y += parent.offsetTop;
         }
         
        document.getElementById("_lxliveitem").innerHTML = sRes;
        document.getElementById("_lxliveitem").style.display = "block";
        
        dv.style.display = "block";
        dv.style.top = y + "px";
        dv.style.left = x + "px";
        
        //创建一个iframe
        if (lexosearch.Browse == "IE") 
        {
            if (!document.getElementById("_LxIfrKey"))
             {
                ifr = document.createElement("iframe");
                ifr.id = "_LxIfrKey";
                ifr.style.position = "absolute";       
                ifr.scrolling = "no";
                ifr.iframeborder = 0;
                ifr.style.left = x + "px";
                ifr.style.top = y + "px";           
                ifr.style.zIndex = 90;
                ifr.src = "about:blank";
                document.body.appendChild(ifr);
             }
             else
             {
                ifr = document.getElementById("_LxIfrKey");        
             }
             ifr.style.height = dv.offsetHeight;
             ifr.style.width = dv.offsetWidth; 
             ifr.style.display = "block";
             if (lexosearch.Browse != "IE")
             {
                ifr.addEventListener("blur",_LxLiveIfrClose,false);
                //dv.addEventListener("blur",_LxLiveIfrClose,false);
             }
             else
             {
                ifr.onfocusout = _LxLiveIfrClose;
                //dv.onfocusout = _LxLiveIfrClose;
             }
         }
    }
    else
    {
        setTimeout(_LxsetTipResult,100);
    }
}
function _LxLiveIfrClose()
{
    if (document.getElementById("_LxIfrKey"))
        document.getElementById("_LxIfrKey").style.display = "none";
    if (document.getElementById("_lxlivelist"))
        document.getElementById("_lxlivelist").style.display = "none";
}

function _LxHighLightResult(item)
{   
    if (_LxItm > 0)
    {
        _LxunHighLightResult(document.getElementById("_lxliveitem"+_LxItm.toString()));
    }
    item.style.backgroundColor = "#3366CC";
    item.style.color = "white";
    item.style.cursor = "hand";
    document.getElementById(item.id + "_kw").style.color = "white";
    document.getElementById(item.id + "_count").style.color = "white";
    _LxItm = parseInt(item.id.substring(11));    
}
function _LxunHighLightResult(item)
{  
    item.style.backgroundColor = "";
    document.getElementById(item.id + "_kw").style.color = "black";
    document.getElementById(item.id + "_count").style.color = "green";
    item.style.color = "Black";
}
function _LxLiveQuery(item)
{
    _LxLiveQuery(false);
}
function _LxLiveQuery(item,newWindow)
{
    var id = item.id + "_kw";
    var str;
    
    if (lexosearch.Browse == "IE")
        str = document.getElementById(id).innerText;
    else
        str = document.getElementById(id).textContent;

    document.getElementById(_LxKwId).value = str;
    lexosearch.Criteria.QueryString = str;
    
    return lexosearch.Search(newWindow);
}

//相关搜索
function _LxSearchCorrelative()
{
    var sCond;
    var s = document.createElement('SCRIPT'); 
    
    s.id = "_lxRelScript";
    s.type = "text/javascript";
    sCond = "&query=" + encodeURI(lexosearch.Criteria.QueryString);
    
    if (lexosearch.Browse == "IE")      
        sCond += "&cp=" + document.charset;
    else
        sCond += "&cp=" + document.characterSet;
    
    if (lexosearch.Criteria.QueryString != "")
    { 
        s.src="http://" + lexosearch.Server + "/lexopub/SearchCorrelative.aspx?f=corres&n=20" + sCond;
    }
    if (lexosearch.Browse == "IE")
    {
        var o = document.getElementsByTagName("head")[0].appendChild(s);
    }
    else
    {
        document.body.insertBefore(s,this.firstChild);  
    }
}

//接受用\n分隔的关键词列表
function corres(v)
{   
    window.lexosearch.Correlative = v;
}

//显示相关关键词列表
function _LxSetRel(n)
{
    var st,sResult,sk;
    var nr,nc,nct;
    var t=0;
    
    if (window.lexosearch.Correlative)
    {               
        var arr = window.lexosearch.Correlative.split("\n");
        
        if (document.getElementById("_lxrellist"))
        {
            st = document.getElementById("_lxrellist").innerHTML;            
        }
        else
            return;
        sResult = "";
        nr = 0;    
        nc = 1;
        s = st;
        for (i = 0; nr < n; i++,nc++)
        {
            sk = "\[\$relatedkw" + nc.toString() + "\$\]";
            if (s.indexOf(sk) >= 0)
            {           
                sk = "\\[\\$relatedkw" + nc.toString() + "\\$\\]";
                var re = new RegExp(sk,"g"); 
                if (i < arr.length)
                {
                    s = s.replace(re,arr[i]);
                }
                else
                {
                    s = s.replace(re,"");
                }
            }
            else
            {            
                nr++;
                i--;
                nct = nc;
                nc = 0;
                sResult += s;
                s = st;
                sk = "";
            }
        }
        if (sk != "")
            sResult += s;
 
        document.getElementById("_lxrel").style.display = "block";       
        document.getElementById("_lxrellist").innerHTML = sResult;  
        
        //setFrameHeight();      
    }
    else
    {
        setTimeout("_LxSetRel('"+n.toString()+"')",100);
    }
}


//功能函数
function _LxSetDays(d)
{
    var dt = new Date();
    if (d > 0)
    {
        lexosearch.Criteria.TimeEnd = dt.getFullYear() +"-"+ (dt.getMonth()+1).toString() +"-"+dt.getDate();
        dt.setDate(dt.getDate() - d);    
        lexosearch.Criteria.TimeBegin = dt.getFullYear() +"-"+ (dt.getMonth()+1).toString() +"-"+dt.getDate();
    }    
    else
    {
        lexosearch.Criteria.TimeEnd = "";
        lexosearch.Criteria.TimeBegin = "";
    }
}
//读取Url参数值，失败时返回空串
function _LxGetUrlPara(url,name)
{
	var sUrl = url.replace("?","&");    
	var sn = "&" + name + "=";	
	var p = sUrl.indexOf(sn);
	var pe;
	var val;

	if (p < 0)
	{
		return "";
	}
	else
	{
		p += sn.length;		
		pe = sUrl.indexOf("&",p);
		
		if (pe < 0)
			val = sUrl.substring(p);
		else
			val = sUrl.substring(p,pe);		
	}
	return val
}
//设置Url参数值，如果已经存在，则替换，返回新的Url字符串
function _LxSetUrlPara(url,name,val)
{
	var sUrl = url.replace("?","&");
	var sn = "&" + name + "=";
	var p = sUrl.indexOf(sn);
	var pe;
		
	if (p < 0)
	{
		url += "&" + name + "=" + val;
	}
	else
	{
		p += sn.length;		
		pe = sUrl.indexOf("&",p);
		if (pe < 0)
			url = url.substring(0,p) + val;
		else
			url = url.substring(0,p) + val + url.substring(pe);		
	}	
	return url;
}
//将形为“xxxx-xx-xx/xxxx-x-x”的日期字符串转为8位数字形式
function _LxSetDateStr(sdate)
{
    var str;
    var d;
    var arr = sdate.split("-");
        
    if (arr.length < 3)
        return "";
    try
    {
        str = arr[0];
        d = parseInt(arr[1]);
        if ( d < 10)
            str += "0" + d;
        else
            str += d;
        d = parseInt(arr[2]);
        if ( d < 10)
            str += "0" + d;
        else
            str += d;
         return str;
    }
    catch (e)
    {
        return "";
    }
}
function _LxFindChildNode1(pe,cid)
{
    var e,v;
    var i;
   
    if (pe)
    {
        if (pe.id == cid)        
            return pe;
        if (pe.childNodes.length)
        {
            for (i = 0; i < pe.childNodes.length; i++)
            {
                e = pe.childNodes[i];
                v = _LxFindChildNode1(e,cid);
                if (v)
                    return v;
            }
        }
    }
    return null;
}
function _LxGetOuterHTML(id)
{    
    var sHtml;
    var o = document.getElementById(id);    
    if (lexosearch.Browse == "IE")
    {       
        sHtml = o.outerHTML;
    }
    else
    {
        var odv = document.createElement("div");
        odv.appendChild(o);
        sHtml = odv.innerHTML;
    }
    
    return sHtml;
}
function _LxGetPosY(e)
{
    var y = e.offsetTop;
        
    while (e.offsetParent)
    {
        e = e.offsetParent;             
        y += e.offsetTop;
    }
    return y;
}
function _LxGetPosX(e)
{
    var x = e.offsetLeft;
        
    while (e.offsetParent)
    {
        e = e.offsetParent;             
        x += e.offsetLeft;
    }
    return x;
}
function _LxSetDate(str)
{
    var a = str.split(' ');
    var a1,a2;
    var dt;
    
    if (a.length == 2)
    {
        a1 = a[0].split('-');
        a2 = a[1].split(':');
        if (a1.length == 3 && a2.length == 3)
        {
            dt = new Date(a1[0],a1[1]-1,a1[2],a2[0],a2[1],a2[2]);
        }
    }
    return dt;
}

if (!window.lexosearch)
{    
    _LxCreateLexoSearch();    
}

//执行搜索
if (!document.getElementById("_lxScript"))
{
    _LxSearch();        
}
if (!document.getElementById("_lxRelScript"))
{
    _LxSearchCorrelative();
}


//iframe专用
function _LxGetQueryPara(name)
{
    var sUrl = document.location.search;
    var s = _LxGetUrlPara(sUrl,name);
    return s;
}
function _LxQueryIframeCond()
{
    var sUrlPara = "";
    var sp = "";
    var s = "";
    var i;
    
    sUrlPara += _LxKwId + "=" + encodeURI(lexosearch.Criteria.QueryString);
    
    for (i = 0; i < lexosearch.Criteria.QueryStringEx.length; i++)
    {
        s += lexosearch.Criteria.QueryStringEx[i] + "\n";
    }
    sUrlPara += "&_lxkwex=" + encodeURI(s);
    
    sUrlPara += "&_lxpg=" + lexosearch.Options.PageNumber;
    sUrlPara += "&_lxps=" + lexosearch.Options.PageSize;
    sUrlPara += "&_lxsort=" + lexosearch.Options.SortBy;
    if (lexosearch.Options.SortAscending)
        sUrlPara += "&_lxsa=0";
    else
        sUrlPara += "&_lxsa=1";
    sUrlPara += "&_lxdate1=" + lexosearch.Criteria.TimeBegin;
    sUrlPara += "&_lxdate2=" + lexosearch.Criteria.TimeEnd;
    sUrlPara += "&_lxdatelength=" + lexosearch.Criteria.TimeLength;
    sUrlPara += "&_lxlayout=" + lexosearch.Options.LayoutId;
    sUrlPara += "&_lxmp=" + lexosearch.Criteria.MatchPosition;
    sUrlPara += "&_lxtpc=" + lexosearch.Criteria.Topics;
    sUrlPara += "&_lxkwt=" + lexosearch.Options.KwTrendsId;
    sUrlPara += "&_lxdup=" + lexosearch.Options.MarkDuplicates;
    sUrlPara += "&_lxtpcc=" + lexosearch.Criteria.TopicsToCount;
    
    //处理扩展属性
    for (i = 1; i < 31; i++)
    {        
        s = eval("lexosearch.Criteria.S" + i.toString());
        if (s != "")
        {
            sUrlPara += "&_lxs" + i.toString() + "=" + encodeURI(s);
        }
    }
    for (i = 1; i < 5; i++)
    {        
        s = eval("lexosearch.Criteria.M" + i.toString() + "L");
        if (s != "")
        {
            sUrlPara += "&_lxm" + i.toString() + "l=" + encodeURI(s);
        }
        s = eval("lexosearch.Criteria.M" + i.toString() + "U");
        if (s != "")
        {
            sUrlPara += "&_lxm" + i.toString() + "u=" + encodeURI(s);
        }
    }
    if (lexosearch.Options.IframeUrl.indexOf("?") < 0)
        sUrlPara = "?" + sUrlPara;
    else
        sUrlPara = "&" + sUrlPara;
    return lexosearch.Options.IframeUrl + sUrlPara;
}
function _LxQueryIframe()
{    
    document.getElementById("searchFrame").src = _LxQueryIframeCond();
}

