home *** CD-ROM | disk | FTP | other *** search
- function search()
- {
- var varSearchValue = trim(document.frmSearch.txtSearch.value);
- var objSearchOption = document.frmSearch.searchoption;
- var varSearchOptionVal = objSearchOption[1].value;
-
- if(IsStartKeyword(varSearchValue))
- {
- alert("Search text should precede search expressions");
- document.frmSearch.txtSearch.focus();
- return false;
- }
- else
- {
- if(varSearchValue.length==0)
- {
- alert("Please enter a valid search term");
- document.frmSearch.txtSearch.focus();
- return false;
- }
- else
- {
- //if(IsSplChar(varSearchValue))
- //{
- // document.frmSearch.txtSearch.value="";
- // document.frmSearch.txtSearch.focus();
- //}
- //else
- //{
- if(objSearchOption[0] && objSearchOption[0].checked)
- {
- parent.document.location.href="/webaroo/e29f1fe6/searchresult?main=1&txtSearch="+escape(document.frmSearch.txtSearch.value)+"&searcherid="+varSearchOptionVal+"&all=true";
- }
- else
- {
- parent.document.location.href="/webaroo/e29f1fe6/searchresult?main=1&txtSearch="+escape(document.frmSearch.txtSearch.value)+"&searcherid="+varSearchOptionVal+"&all=false";
- }
- //}
- }
- }
- }
-
- function searchTopic(cityname, topic)
- {
- document.location.href = "/webaroo/e29f1fe6/browseui?main=1&txtBrowseui="+cityname+" " + topic;
- }
-
- function searchEditorPick(cityname)
- {
- document.frmEP.action="/webaroo/e29f1fe6/search";
- document.frmEP.txtEditorPick.value=cityname;
- document.frmEP.submit();
- }
-
- function IsStartKeyword(strText)
- {
- arrKeyword = new Array('*','~','AND','OR')
- for (intLoop = 0;intLoop < arrKeyword.length;intLoop++)
- {
- if(strText.indexOf(arrKeyword[intLoop])==0)
- {
- return true;
- break;
- }
- }
- return false;
- }
-
- function trim(str)
- {
- return((""+str).replace(/^\\s*([\\s\\S]*\\S+)\\s*$|^\\s*$/,'$1') );
- }
-
- function SetSearchText()
- {
- var done=0;
- var arrQueryString = (location.search).split('&');
- for(var i = 0; i<arrQueryString.length; i++)
- {
- if(arrQueryString[i].indexOf("txtSearch=") < 0)
- {
- continue;
- }
- document.frmSearch.txtSearch.value = unescape((arrQueryString[i].split('='))[1]).replace(/\\+/g, " ");
- done=1;
- break;
- }
- if(done==0)
- {
- for(i = 0; i<arrQueryString.length; i++)
- {
- if(arrQueryString[i].indexOf("txtBrowseui=") < 0)
- {
- continue;
- }
- document.frmSearch.txtSearch.value = unescape((arrQueryString[i].split('='))[1]).replace(/\\+/g, " ");
- done=1;
- break;
- }
- }
- }
-
- function SetEmptyText()
- {
- var arrQueryString = (location.search).split('&');
- for(i = 0; i<arrQueryString.length; i++)
- {
- if(arrQueryString[i].indexOf("txtBrowseui=") < 0)
- {
- continue;
- }
- document.frmSearch.txtSearch.value = " ";
- break;
- }
- }
- function paginate(pageurl){
- parent.document.location.href=pageurl;
- }
-
- function AddMoreResults(url)
- {
- if (window.ActiveXObject)
- {
- var xmlDoc=new ActiveXObject("Microsoft.XMLHTTP");
- if (xmlDoc)
- {
- //Need this if this is to be done asynchronously
- //xmlDoc.onreadystatechange=loadXMLData;
- xmlDoc.open("GET",url,false);
- xmlDoc.send();
- // Once Data is Downloaded...
- if (xmlDoc.readyState==4)
- {
- // if "OK"
- if (xmlDoc.status==200)
- {
- var htmlContent = xmlDoc.responseText;
- document.MoreResults.innerHTML = htmlContent;
- }
- }
- }
- }
- }
-