-
Notifications
You must be signed in to change notification settings - Fork 0
/
search_box.php
44 lines (30 loc) · 1.1 KB
/
search_box.php
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
<?
include("connect.php");
?>
<input class="search_box" type="text" name="q" id="tags" value="Search for a Tag" style="color:gray;" onfocus="if(this.value=='Search for a Tag'){this.value='';this.style.color='black'} javascript:close_everything_but('')" onclick="javascript:close_everything_but('')" onkeydown="if (event.keyCode==13) { javascript:close_everything_but('');search_query(document.getElementById('tags').value); }" size="15"/>
<?
$all_tags=optimized_tags();
$list_of_tags=implode(",",array_keys($all_tags));
?>
<script type="text/javascript">
//<![CDATA[
var a1;
// function InitMonths() {
// a2.setOptions({lookup: '<?php echo $list_of_tags; ?>'.split(',') });
// }
a1 = $('#tags').autocomplete({
width: 132,
delimiter: /(,|;|:)\s*/,
lookup: '<?php echo $list_of_tags; ?>'.split(',')
});
jQuery(function() {
$('#navigation a').each(function() {
$(this).click(function(e) {
var element = $(this).attr('href');
$('html').animate({ scrollTop: $(element).offset().top }, 300, null, function() { document.location = element; });
e.preventDefault();
});
});
});
//]]>
</script>