module.htm
21.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
{eval
function tpl_cloudsearch_index_top($recwords, $searchparams, $srchotquery, $position = 'hotopicf') {
global $_G;
if($recwords) {
$recwords_tmp = $recwords;
$recwords = array();
foreach ($recwords_tmp as $k => $v) {
$recwords[$k+1] = $v;
}{eval }}{eval }}
<!--{block return}-->
<!--{if is_array($recwords) && count($recwords) > 0 && !empty($searchparams[url])}-->
<div class="fl bm">
<div class="bm bmw hottopic cl">
<div class="bm_h cl">
<span class="y"></span>
<h2>{if $_G['fid']}{lang cloudsearch:current}{/if}{lang cloudsearch:hottopic}</h2>
</div>
<style>
.filter { padding: 10px; border-bottom: none; font-size: 12px; color: #999; }
.filter ul {}
.filter li { float: left; margin-right: 16px; height: 22px; line-height: 22px; white-space:nowrap; width:12.5%; }
.filter li a { margin-right: 2px; text-decoration: none; color: #369; }
.filter li.clewcolor a { background:url(source/plugin/cloudsearch/template/keyword_hot.gif) no-repeat 100% 2px; margin-right: 2px; text-decoration: none; color: #F00; padding-right:18px; }
.filter li a:hover { text-decoration: underline; }
.filter li a:visited { text-decoration: none; color: #666; }
.filter li.clewcolor a:visited { text-decoration: none; color: #F00; }
.filter .number { color: #666; }
.filter li.clewcolor .number { color:#F00; }
</style>
<div class="filter">
<ul class="cl">
<!--{loop $recwords $key $recword}-->
<!--{if $encodeWord=rawurlencode(trim($recword[word]))}-->
<!--{if empty($recword[inc_num])}-->
<li><a href="$searchparams[url]?q=$encodeWord&source=word.$position.$key$srchotquery&num=$recword[result_num]" sc="1" target="_blank">$recword[word]<span class="number">($recword[result_num])</span></a></li>
<!--{else}-->
<li class="clewcolor"><a href="$searchparams[url]?q=$encodeWord&source=word.$position.$key$srchotquery&num=$recword[result_num]" sc="1" target="_blank">$recword[word]<span class="number">($recword[result_num])</span></a></li>
<!--{/if}-->
<!--{/if}-->
<!--{/loop}-->
</ul>
</div>
</div>
</div>
<!--{/if}-->
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
function tpl_cloudsearch_global_footer_formula_output() {
global $_G;
$formHash = FORMHASH;
$cookie = $_G['cookie']['ffids' . $_G['uid']];
}
<!--{block return}-->
<!--{if !$cookie}-->
<script type="text/javascript">
_attachEvent(window, 'load', getForbiddenFormula, document);
function getForbiddenFormula() {
var toGetForbiddenFormulaFIds = function () {
ajaxget('plugin.php?id=cloudsearch&formhash={$formHash}');
};
var a = document.body.getElementsByTagName('a');
for(var i = 0;i < a.length;i++){
if(a[i].getAttribute('sc')) {
a[i].setAttribute('mid', hash(a[i].href));
a[i].onmousedown = function() {toGetForbiddenFormulaFIds();};
}
}
var btn = document.body.getElementsByTagName('button');
for(var i = 0;i < btn.length;i++){
if(btn[i].getAttribute('sc')) {
btn[i].setAttribute('mid', hash(btn[i].id));
btn[i].onmousedown = function() {toGetForbiddenFormulaFIds();};
}
}
}
</script>
<!--{/if}-->
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
function tpl_cloudsearch_viewthread_postbottom_output() {
}
<!--{block return}-->
<div id="relate_subject"></div>
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
function tpl_cloudsearch_forumdisplay_threadtype_extra_output($recwords) {
global $_G;
}
<!--{block return}-->
<style>
.sort_ttp { padding-top: 0;margin-bottom:5px;}
.sort_tit { padding:4px 8px 3px 0; color:#999; }
.loadingCloud { text-align:center;line-height:50px; }
</style>
<script>
var currentKeyword = '';
var currentOrder = '';
function switchkeyword(keyword, order, page) {
page = page ? page : 1;
order = order ? order : '';
if (currentKeyword == keyword && order == '' && page == 1) {
window.location = 'forum.php?mod=forumdisplay&fid={$_G[fid]}';
return true;
}
if (currentKeyword != '') {
$("ckw_"+currentKeyword).className = '';
}
$("ckw_"+keyword).className = 'xw1 a';
currentKeyword = keyword;
currentOrder = order;
getclouddata(keyword, order, page);
}
function switchPage(page) {
getclouddata(currentKeyword, currentOrder, page);
}
function switchOrder(order) {
currentOrder = order;
getclouddata(currentKeyword, order, 1);
}
function getclouddata(keyword, order, page) {
$("threadlist").innerHTML = '<div class="loadingCloud"><img src="{IMGDIR}/loading.gif" alt="loading..." class="vm" /> {lang cloudsearch:loading}</div>';
ajaxget('forum.php?mod=forumdisplay&fid={$_G[fid]}&cloudop=relatedthread&page='+page+'&of='+order+'&keyword='+keyword);
}
function succeedhandle_getRelatedData(url, msg, data) {
if(data['threaddiv']) {
$("threadlist").innerHTML = data['threaddiv'];
$("fd_page_top").innerHTML = $("fd_page_bottom").innerHTML = data['page'];
}
}
function errorhandle_getRelatedData(msg, data) {
showError(msg);
}
</script>
<ul class="ttp cl" id="thread_types2" style="padding-top:0px;">
<li class="sort_tit">{lang cloudsearch:hottopic}</li>
<!--{loop $recwords $keyword}-->
<li id="ckw_$keyword[0]"><a href="javascript:void(0);return false;" onclick="switchkeyword('$keyword[0]');">$keyword[0]</a></li>
<!--{/loop}-->
</ul>
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
function tpl_cloudsearch_forumdisplay_threadtype_inner_output() {
global $_G;
}
<!--{block return}-->
<style>
.sort_tit { padding:4px 8px 3px 0; color:#999; }
</style>
<li class="sort_tit">{lang cloudsearch:thread_class}</li>
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
function tpl_cloudsearch_collection_viewoptions_output() {
global $_G;
}
<!--{block return}-->
<a href="forum.php?mod=collection&action=view&ctid={$_G['collection']['ctid']}&op=related" class="xi2">{lang cloudsearch:realtedthread}</a>
<span class="pipe">|</span>
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
function tpl_cloudsearch_collection_relatedop_output($threadlist, $multipage) {
global $_G;
}
<!--{block return}-->
<ul class="ttp bm cl cttp">
<li{if !$_GET['keyword']} class="xw1 a"{/if}>
<a href="forum.php?mod=collection&action=view&ctid={$_G['collection']['ctid']}&op=related" class="xi2">{$_G['collection']['name']}</a>
</li>
<!--{loop $_G['collection']['arraykeyword'] $kid $unique_keyword}-->
<li{if $unique_keyword == $_GET['keyword']} class="xw1 a"{/if}>
<a href="forum.php?mod=collection&action=view&ctid={$_G['collection']['ctid']}&op=related&keyword={$_G['collection']['urlkeyword'][$kid]}" class="xi2">$unique_keyword</a>
</li>
<!--{/loop}-->
</ul>
<div class="tl bm">
<!--{if $threadlist}-->
<form action="forum.php?mod=collection&action=edit&op=addthread" method="POST">
<div class="th">
<table cellspacing="0" cellpadding="0">
<tr>
<td class="icn"></td>
<td class="o"><label class="z" onclick="checkall(this.form, 'tids')"><input class="pc" type="checkbox" name="chkall" title="{lang checkall}" /></label></td>
<td class="common">{lang thread}</td>
<td class="forum">{lang cloudsearch:forum}</td>
<td class="by">{lang author}</td>
</tr>
</table>
</div>
<div class="bm_c">
<table cellspacing="0" cellpadding="0">
<!--{loop $threadlist $thread}-->
<tr>
<td class="icn">
<!--{if $thread[icon]}-->
<img src="{$thread[icon]}" />
<!--{else}-->
<img src="{IMGDIR}/folder_common.gif" />
<!--{/if}-->
</td>
<td class="o">
<!--{if !isset($thread[icon])}-->
<input type="checkbox" value="$thread[tThreadId]" name="tids[]" />
<!--{/if}-->
</td>
<th>
<!--{if !isset($thread[icon])}-->
<a href="forum.php?mod=viewthread&tid=$thread[tThreadId]" target="_blank" class="xst">$thread['pSubject']</a>
<!--{else}-->
<a href="$thread['mTargetUrl']" target="_blank" class="xst">$thread['mTitle']</a>
<!--{/if}-->
</th>
<td class="forum">
<!--{if !isset($thread[icon])}-->
<a href="forum.php?mod=forumdisplay&fid=$thread[pForumId]">$thread[pForumName]</a>
<!--{else}-->
$thread[mShowUrl]
<!--{/if}-->
</td>
<td class="by">
<cite>
<!--{if $thread['pAuthorId'] && $thread['pAuthorName']}-->
<a href="home.php?mod=space&uid=$thread[pAuthorId]">$thread[pAuthorName]</a>
<!--{else}-->
{lang anonymous}
<!--{/if}-->
</cite>
<!--{if !isset($thread[icon])}-->
<em class="xi1">$thread[dateline]</em>
<!--{/if}-->
</td>
</tr>
<!--{/loop}-->
</table>
</div>
<div class="bm_c cl">
<input type="hidden" value="{$_G['collection']['ctid']}" name="ctid" />
<input type="hidden" name="formhash" id="formhash" value="{FORMHASH}" />
<input type="hidden" name="addthread" id="addthread" value="1" />
<button type="submit" class="pn pnc"><span>{lang cloudsearch:addtocollection}</span></button>
</div>
</form>
<!--{else}-->
<p class="emp">
{lang cloudsearch:no_content}
</p>
<!--{/if}-->
</div>
<!--{if $multipage}--><div class="pgs mtm cl">$multipage</div><!--{/if}-->
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
function tpl_cloudsearch_relate_threadlist_output($kw) {
global $_G;
}
<!--{block return}-->
<div id="cloudsearch_relate"><img src="{IMGDIR}/loading.gif" alt="loading..." class="vm" /> {lang cloudsearch:loading}</div>
<script>
ajaxget('plugin.php?id=cloudsearch:forumdisplay&cloudop=relatelist&fid={$_G['fid']}&keyword={$kw}&page={$_G['page']}', 'cloudsearch_relate');
</script>
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
function tpl_cloudsearch_relate_threadlist_js_output($relatethreadlist, $urlkw, $searchparams, $srchotquery) {
global $_G;
}
<!--{block return}-->
<!--{if $relatethreadlist}-->
<div class="th">
<table cellspacing="0" cellpadding="0">
<tr>
<td class="icn"></td>
<td class="common">{lang cloudsearch:relate}</td>
<td class="by">{lang cloudsearch:forum}</td>
<td class="by">{lang author}</td>
</tr>
</table>
</div>
<div class="bm_c">
<table cellspacing="0" cellpadding="0">
<!--{loop $relatethreadlist $thread}-->
<tbody id="$thread[id]">
<tr>
<td class="icn">
<!--{if $thread[icon]}-->
<img src="{$thread[icon]}" />
<!--{else}-->
<img src="{IMGDIR}/folder_common.gif" />
<!--{/if}-->
</td>
<th>
<!--{if !isset($thread[icon])}-->
<a href="forum.php?mod=viewthread&tid=$thread[tThreadId]" target="_blank" class="xst">$thread['pSubject']</a>
<!--{else}-->
<a href="$thread['mTargetUrl']" target="_blank" class="xst">$thread['mTitle']</a>
<!--{/if}-->
</th>
<td class="by">
<!--{if !isset($thread[icon])}-->
<a href="forum.php?mod=forumdisplay&fid=$thread[pForumId]">$thread[pForumName]</a>
<!--{else}-->
$thread[mShowUrl]
<!--{/if}-->
</td>
<td class="by">
<cite>
<!--{if $thread['pAuthorId'] && $thread['pAuthorName']}-->
<a href="home.php?mod=space&uid=$thread[pAuthorId]">$thread[pAuthorName]</a>
<!--{else}-->
{lang anonymous}
<!--{/if}-->
</cite>
<!--{if !isset($thread[icon])}-->
<em class="xi1">$thread[dateline]</em>
<!--{/if}-->
</td>
</tr>
</tbody>
<!--{/loop}-->
<tr>
<td colspan="4" align="center" style="line-height:25px;">
<a href="$searchparams[url]?q={$urlkw}&source=word.tao_more.a$srchotquery">{lang cloudsearch:viewmore}</a>
</td>
</tr>
</table>
</div>
<!--{/if}-->
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
function tpl_cloudsearch_global_footer_related() {
global $_G;
$rel_title = urlencode($_G['forum_thread']['subject']);
$widthauto = widthauto();
$get_reltid = dintval($_GET[reltid]);
$get_pre_pos = dhtmlspecialchars(trim($_GET[pre_pos]));
}
<!--{block return}-->
<!--{if empty($_G['inajax'])}-->
<script type="text/javascript">
var rel_tid = "$_G['tid']";
var rel_title = "$rel_title";
var rel_reltid = "$get_reltid";
var rel_prepos = "$get_pre_pos";
var my_siteid = "$_G['setting']['my_siteid']";
var rel_uid = "$_G['uid']";
var rel_views = "$_G['forum_thread']['views']";
var rel_replies = "$_G['forum_thread']['replies']";
var rel_page = "$_G['page']";
var rel_show = "$widthauto";
</script>
<script type="text/javascript" src="http://cache.soso.com/30d/js/discuz/relate_subject.js" charset="GBK"></script>
<!--{/if}-->
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
function tpl_cloudsearch_global_footer_mini() {
global $_G;
$utilService = Cloud::loadClass('Service_Util');
$params = array(
's_site_gid' => $_G['groupid'],
'response_type' => 'JSONP',
);
$params = $utilService->generateSiteSignUrl($params, false, true);
$signUrlParams = json_encode($params);
$discuz_mini_js_url = 'http://discuz.gtimg.cn/search/scripts/discuz_mini.js';
$referer = htmlspecialchars($_SERVER['HTTP_REFERER']);
}
<!--{block return}-->
<!--{if empty($_GET['inajax'])}-->
<script type="text/javascript" charset="utf-8" src="$discuz_mini_js_url"></script>
<script type="text/javascript" charset="utf-8">
if (typeof DiscuzMini != 'undefined' && typeof DiscuzMini == 'object') {
DiscuzMini.showMini('$referer', $signUrlParams);
}
</script>
<!--{/if}-->
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
function tpl_index_forum_extra_output($forum_recwords) {
global $_G;
}
<!--{block return}-->
<!--{if $forum_recwords}-->
<dd class="fl_g_hot">
<strong>{lang cloudsearch:forumhottopic}: </strong>
<!--{loop $forum_recwords $k $frecword}--><a class="xi2" href="$frecword[url]" target="_blank">$frecword[word]</a><!--{/loop}-->
</dd>
<!--{/if}-->
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
function tpl_cloudsearch_global_footer_suggest($queryString) {
global $_G;
}
<!--{block return}-->
<script type="text/javascript">
var cloudsearch_suggest = {};
cloudsearch_suggest.cache = {}; // 缓存
cloudsearch_suggest.sId = "$_G['setting']['my_siteid']";
cloudsearch_suggest.keyInterval = null; // 按住上下键时的setTimeout时间值
cloudsearch_suggest.requestTimeout = null; // 发送jsonp请求时的setTimeout时间值
cloudsearch_suggest.responseTimeout = null; // jsonp请求超时时的setTimeout时间值
cloudsearch_suggest.slideSpeed = 700; // 按住上下键时的滚动速度
cloudsearch_suggest.linenow = 0; // 当前所在行
cloudsearch_suggest.queryString = "$queryString"; // 当前所在行
function cloudsearch_suggest_preventEnter(oEvent) {
var code = oEvent.keyCode;
var lines = $('sg').getElementsByTagName('li');
if ((38 == code || 40 == code) && !cloudsearch_suggest.keyInterval) {
cloudsearch_suggest_moveOneStep(code, lines);
}
}
function cloudsearch_suggest_moveOneStep(code, lines) {
if (38 == code || 40 == code) {
var panel = $('sg');
if ('block' == panel.style.display) {
cloudsearch_suggest_clearStyle(); // 清掉所有li的选中状态
var suggestNum = lines.length;
if (38 == code) {
if (cloudsearch_suggest.linenow > 1) {
cloudsearch_suggest.linenow--;
} else {
cloudsearch_suggest.linenow = suggestNum;
}
}
if (40 == code) {
cloudsearch_suggest.linenow = (cloudsearch_suggest.linenow == suggestNum) ? 1 : (cloudsearch_suggest.linenow + 1);
}
lines[cloudsearch_suggest.linenow - 1].className = 'smo';
}
cloudsearch_suggest.keyInterval = setTimeout(function() {cloudsearch_suggest_moveOneStep(code, lines);}, cloudsearch_suggest.slideSpeed);
cloudsearch_suggest.slideSpeed = 80;
}
}
function cloudsearch_suggest_suggest(oEvent) {
var q = trim($('scbar_txt').value); // 输入框的输入
var code = oEvent.keyCode; // 键盘按键值
var lines = $('sg').getElementsByTagName('li');
if (38 == code || 40 == code) { // up down
if (null != cloudsearch_suggest.keyInterval) {
clearTimeout(cloudsearch_suggest.keyInterval);
cloudsearch_suggest.keyInterval = null;
cloudsearch_suggest.slideSpeed = 700;
}
// 把所选值放入输入框(去除html标签)
$('scbar_txt').value = lines[cloudsearch_suggest.linenow - 1].innerHTML.replace(/<\s*(\/)?\s*[0-9a-zA-Z]+\s*>/g, '');
} else if (27 == code) { // ESC
if (null != cloudsearch_suggest.requestTimeout) {
clearTimeout(cloudsearch_suggest.requestTimeout);
}
cloudsearch_suggest_hide();
} else {
if ('' != q) {
var data = cloudsearch_suggest_getCache(q);
if (data) {
cloudsearch_suggest_menuMaker(data);
} else {
if (null != cloudsearch_suggest.requestTimeout) {
clearTimeout(cloudsearch_suggest.requestTimeout);
}
// 请求延时0.3秒执行,因为有可能用户是在持续输入
cloudsearch_suggest.requestTimeout = setTimeout(function() {cloudsearch_suggest_sendRequest(q);}, 500);
}
} else {
if (null != cloudsearch_suggest.requestTimeout) {
clearTimeout(cloudsearch_suggest.requestTimeout);
}
cloudsearch_suggest_hide();
}
}
}
function cloudsearch_suggest_sendRequest(q) {
// 删掉之前的请求(包括超时处理)
if ($('cloudsearch_suggest') != null) {
document.getElementsByTagName('head')[0].removeChild($('cloudsearch_suggest'));
if (null != cloudsearch_suggest.responseTimeout) {
clearTimeout(cloudsearch_suggest.responseTimeout);
}
}
var script = document.createElement('script');
with (script) {
src = 'http://search.discuz.qq.com/api/suggest?q=' + encodeURIComponent(q) + '&' + cloudsearch_suggest.queryString;
id = 'cloudsearch_suggest';
charset = 'utf-8';
}
document.getElementsByTagName('head')[0].appendChild(script); // jsonp加载外域接口数据
cloudsearch_suggest.responseTimeout = setTimeout(function() {cloudsearch_suggest_clearRequest();}, 1000); // 0.5秒后没返回就抛弃
}
function cloudsearch_suggest_clearRequest() {
// 删掉之前的请求(包括超时处理)
if ($('cloudsearch_suggest') != null) {
document.getElementsByTagName('head')[0].removeChild($('cloudsearch_suggest'));
}
}
function cloudsearch_suggest_callback(data) {
if (typeof data != undefined && 0 == data.status) {
cloudsearch_suggest_menuMaker(data.result);
cloudsearch_suggest_setCache(data.q, data.result);
}
}
function cloudsearch_suggest_menuMaker(data) {
if (data.length > 0) {
var list = '<ul>';
for (var i = 0; i < data.length; i++) {
list += '<li class="sml" onmouseover="cloudsearch_suggest_mouseOver(this);" onclick="cloudsearch_suggest_mouseClick(this);">' + data[i] + '</li>';
}
list += '</ul>';
$('st_box').innerHTML = list;
cloudsearch_suggest_show();
}
}
function cloudsearch_suggest_mouseClick(obj) {
$('scbar_txt').value = obj.innerHTML.replace(/<\s*(\/)?\s*[0-9a-zA-Z]+\s*>/g, '');
$('scbar_btn').click();
}
function cloudsearch_suggest_mouseOver(obj) {
cloudsearch_suggest_clearStyle(); // 清掉之前的选中状态
obj.className = "smo"; // 当前的li设置为选中状态
// 把linenow设置为当前悬停的值
var lis = $('st_box').getElementsByTagName('li');
if (typeof lis != undefined && lis.length > 0) {
for (var i = 0; i < lis.length; i++) {
if (lis[i] == obj) {
cloudsearch_suggest.linenow = i + 1;
break;
}
}
}
}
function cloudsearch_suggest_show(oEvent) {
cloudsearch_suggest.linenow = 0;
cloudsearch_suggest.slideSpeed = 700;
$('sg').style.display = 'block';
$('scbar_txt').focus();
}
function cloudsearch_suggest_hide() {
$('sg').style.display = 'none';
}
function cloudsearch_suggest_setCache(key, data) {
cloudsearch_suggest.cache[key] = data;
}
function cloudsearch_suggest_getCache(key) {
return cloudsearch_suggest.cache[key];
}
function cloudsearch_suggest_clearStyle() {
var lis = $('st_box').getElementsByTagName('li');
if (typeof lis != undefined && lis.length > 0) {
for (var i = 0; i < lis.length; i++) {
lis[i].className = 'sml';
}
}
}
function cloudsearch_suggest_sgMouseOver() {
$('scbar_txt').focus();
_detachEvent($('scbar_txt'), 'blur', cloudsearch_suggest_hide);
}
function cloudsearch_suggest_sgMouseOut() {
cloudsearch_suggest_clearStyle();
_attachEvent($('scbar_txt'), 'blur', cloudsearch_suggest_hide);
}
if (!BROWSER.ie || BROWSER.ie > 6) {
// 输入框绑定onkeydown和onkeyup事件
_attachEvent($('scbar_txt'), 'keydown', cloudsearch_suggest_preventEnter);
_attachEvent($('scbar_txt'), 'keyup', cloudsearch_suggest_suggest);
_attachEvent($('scbar_txt'), 'blur', cloudsearch_suggest_hide);
_attachEvent($('sg'), 'mouseover', cloudsearch_suggest_sgMouseOver);
_attachEvent($('sg'), 'mouseout', cloudsearch_suggest_sgMouseOut);
}
</script>
<!--{/block}-->
<!--{eval return $return;}-->
{eval
}
}