/******************************************************** Set of Global JavaScript functions for the CodeStore.net DomBlog template Jake Howlett, v2.1, 15/12/02 16:14 ********************************************************/ /*doSearch is called from the button below simple query box on all forms */ function doSearch ( s ) { var regExp1 = /\bfield\b/i; //used to test for reserved word field in query string var regExp2 = /[(,),<,>,\[,\]]/; //used to test for reserved char(s) in the query string var str = s.value; if ( trim(str) == "" ){ alert("Zadejte prosím nějaký výraz - Please fill any keyword"); s.focus(); return false; } else { if ( typeof regExp1.source != 'undefined' ) //supports regular expression testing if ( regExp1.test( str ) || regExp2.test( str ) ){ var alrt = "Omlouváme se ale následující znaky a výrazy nejsou pro vyhledávání povolené:"; alrt += "\n\nRezervovane slovo 'field'\nZnaky [, ], (, ), < or >"; alert( alrt ); s.focus(); return false; } location.href = "/web/www_a.nsf/srch?SearchView&Query=" + escape( str ) + "&start=1&count=25&SearchFuzzy=True"; } } //Remove leading and trailing spaces from a string //Originally written by Jim Fricker function trim(aStr) { return aStr.replace(/^\s{1,}/, "").replace(/\s{1,}$/, "") }