
BLUEBOY.searchEngine={getHeaders:function(xmldoc){if($("selectType").value!="Select All"){if(BLUEBOY.global.submenus.join().indexOf($("selectType").value)!=-1){var cApps=xmldoc.getElementsByTagName("item");var iAppsLength=cApps.length;for(var i=0;i<iAppsLength;i++){if(cApps[i].getAttribute("app")==$("selectType").value){BLUEBOY.global.HEAD.getHeaders(cApps[i],true);}}}else{var cTechnology=xmldoc.getElementsByTagName("technology");var iTechnologyLength=cTechnology.length;for(var i=0;i<iTechnologyLength;i++){if(cTechnology[i].getAttribute("type")==$("selectType").value){BLUEBOY.global.HEAD.getHeaders(cTechnology[i]);}}}}else{var cDocuments=xmldoc.getElementsByTagName("technologies")[0].getElementsByTagName("document");var iDocumentsLength=cDocuments.length;for(var k=0;k<iDocumentsLength;k++){BLUEBOY.global.HEAD.getHeaders(cDocuments[k]);}}},phraseEntered:function(){if(BLUEBOY.global.HEAD.links.length>0&&$("phrase").value!=""){var iHEADLinksLength=BLUEBOY.global.HEAD.links.length;var aTemp=[];for(var i=0;i<iHEADLinksLength;i++){var sTheLink=BLUEBOY.global.HEAD.links[i];var sLocation=BLUEBOY.global.HEAD.links[i][0];var sDescription=BLUEBOY.global.HEAD.links[i][1];var sLastModified=BLUEBOY.global.HEAD.links[i][2];var sContent=BLUEBOY.global.HEAD.links[i][3];BLUEBOY.xhr.ajax({url:sLocation,data:"html",customObj:{location:sLocation,description:sDescription,lastModified:sLastModified,content:sContent},onSuccess:function(oResponse){try{var rePattern=new RegExp($("phrase").value,"i");if(oResponse.responseText.match(rePattern)){$("header").innerHTML=$("selectType").value+" :: "+rePattern;var oTemp={location:oResponse.options.location,description:oResponse.options.description,lastModified:oResponse.options.lastModified,content:oResponse.options.content,iTotal:iHEADLinksLength};aTemp.push(oTemp);BLUEBOY.events.setSearchEngine.call(this);this.buildListItems(aTemp);aTemp.length=0;}
if($("results").innerHTML==""){$("sortable").style.display="none";$("header").innerHTML="No results found for <span>"+$("phrase").value+"</span>";}}catch(e){$("sortable").style.display="none";$("header").innerHTML=e;}}});}}else if(BLUEBOY.global.HEAD.links.length>0&&$("phrase").value==""){if(BLUEBOY.global.HEAD.links.length>0){$("header").innerHTML=$("selectType").value;var iHEADLinksLength=BLUEBOY.global.HEAD.links.length;var aTemp=[];for(var i=0;i<iHEADLinksLength;i++){var sTheLink=BLUEBOY.global.HEAD.links[i];var oTemp={location:BLUEBOY.global.HEAD.links[i][0],description:BLUEBOY.global.HEAD.links[i][1],lastModified:BLUEBOY.global.HEAD.links[i][2],content:BLUEBOY.global.HEAD.links[i][3],iTotal:iHEADLinksLength};aTemp.push(oTemp);}
BLUEBOY.events.setSearchEngine.call(this);this.buildListItems(aTemp);}else{$("sortable").style.display="none";$("header").innerHTML="No results found.";}}
$("sortable").style.display="block";}};
