1 // remote scripting library
2 // (c) copyright 2005 modernmethod, inc
10 // Remove the typing barrier to allow call() to complete
11 function Search_doneTyping()
16 // Wait 500ms to run call()
17 function Searching_Go()
19 setTimeout("Searching_Call()", 500);
22 // If the user is typing wait until they are done.
23 function Search_Typing() {
26 window
.status
= "Waiting until you're done typing...";
27 setTimeout("Search_doneTyping()", 500);
29 // I believe these are needed by IE for when the users press return?
32 if (event
.keyCode
== 13)
34 event
.cancelBubble
= true;
35 event
.returnValue
= false;
40 // Set the body div to the results
41 function Searching_SetResult(result
)
43 //body.innerHTML = result;
44 t
= document
.getElementById("searchTarget");
46 oldbody
=body
.innerHTML
;
47 body
.innerHTML
= '<div id="searchTargetContainer"><div id="searchTarget" ></div></div>' ;
48 t
= document
.getElementById("searchTarget");
51 t
.style
.display
='block';
54 function Searching_Hide_Results()
56 t
= document
.getElementById("searchTarget");
57 t
.style
.display
='none';
58 body
.innerHTML
= oldbody
;
62 // This will call the php function that will eventually
63 // return a results table
64 function Searching_Call()
69 //Don't proceed if user is typing
73 x
= document
.getElementById("searchInput").value
;
75 // Don't search again if the query is the same
81 // Don't search for blank or < 3 chars.
82 if ((x
=="") || (x
.length
< 3))
86 x_wfSajaxSearch(x
, Searching_SetResult
);
90 function x_wfSajaxSearch() {
91 sajax_do_call( "wfSajaxSearch", x_wfSajaxSearch
.arguments
);
96 function sajax_onload() {
97 x
= document
.getElementById( 'searchInput' );
98 x
.onkeypress= function() { Search_Typing(); };
100 body
= document
.getElementById("content");