//copyright QiSoftware
var isNav = (navigator.appName == "Netscape") ? true : false
var isFive=(isNav && (navigator.appVersion.charAt(0) >= 5)) ? true : false
var isMac = (navigator.appVersion.indexOf("Mac") != -1) ? true : false
var isSa = (navigator.userAgent.indexOf("Safari") != -1) ? true : false
var isMacIE = ((navigator.appVersion.indexOf("Mac") != -1)&&(navigator.appVersion.indexOf("MSIE") != -1)) ? true : false

function cSpace(str) {
   var newstr=""
   var isLead=true
   for (var i = 0; i < (str.length); i++) {
      var oneChar=str.charAt(i)
      if(oneChar == " " &&  !isLead) {
         newstr += "+"
      } else if (oneChar == " " &&  isLead) {

      } else {
         newstr += oneChar       
         isLead=false
      }
   }
   return newstr
}
function GetGlobalResults(form) {
var nn
var search_global = form.global.options[form.global.selectedIndex].value
   if(search_global == "Dictionary")nn="http://www.dictionary.com/cgi-bin/dict.pl?term="+ cSpace(form.gsearch.value)
   if(search_global == "prounce")nn="http://encarta.msn.com/encnet/features/dictionary/DictionaryResults.aspx?search="+ cSpace(form.gsearch.value)
   if(search_global == "Law")nn="http://dictionary.law.com/default2.asp?typed="+ cSpace(form.gsearch.value)
   if(search_global == "Thesaurus")nn="http://www.thesaurus.com/cgi-bin/search?config=roget&words="+ cSpace(form.gsearch.value)
   if(search_global == "Macron")nn="http://www.janes.com/cgi-bin/glossary.cgi?acronym="+ cSpace(form.gsearch.value)
   if(search_global == "Mterms")nn="http://www.janes.com/cgi-bin/glossary.cgi?term="+ cSpace(form.gsearch.value)
   if(search_global == "Webopedia")nn="http://www.webopedia.com/TERM/"+(cSpace(form.gsearch.value)).charAt(0)+"/"+cSpace(form.gsearch.value)+".html"
   if(search_global == "GoogleBlog")nn="http://www.google.com/search?q=site:blog.qisoftware.com "+ cSpace(form.gsearch.value)
   if(search_global == "alta")nn="http://www.altavista.com/cgi-bin/query?q="+ cSpace(form.gsearch.value)
   if(search_global == "AOL")nn="http://aolsearch.aol.com/dirsearch.adp?query="+cSpace(form.gsearch.value)
   if(search_global == "Excite")nn="http://search.excite.com/search.gw?search="+ cSpace(form.gsearch.value)
   if(search_global == "Garden")nn="http://hortiplex.gardenweb.com/plants/nph-ind.cgi?name="+ cSpace(form.gsearch.value)
   if(search_global == "Google")nn="http://www.google.com/search?q="+ cSpace(form.gsearch.value)
   if(search_global == "GovSites")nn="http://www.firstgov.gov/fedsearch2/index.jsp?db=www&mt=all&fr=0&mw="+ cSpace(form.gsearch.value)
   if(search_global == "Lycos")nn="http://search.lycos.com/default.asp?loc=searchbox&query="+ cSpace(form.gsearch.value)
   if(search_global == "MSN")nn="http://search.msn.com/results.asp?q="+ cSpace(form.gsearch.value)
   if(search_global == "Yahoo")nn="http://search.yahoo.com/bin/search?p="+cSpace(form.gsearch.value)
   if(search_global == "invest")nn="http://www.investopedia.com/terms/"+(cSpace(form.gsearch.value)).charAt(0)+"/"+cSpace(form.gsearch.value)+".asp"
   if(search_global == "Dogpile")nn="http://www.dogpile.com/info.dogpl/search/web/"+cSpace(form.gsearch.value)
   if(search_global == "qisoft")nn="http://www.google.com/search?q=site:qisoftware.com "+cSpace(form.gsearch.value)
   if(search_global == "clusty")nn="http://clusty.com/search?query="+cSpace(form.gsearch.value)
   if(search_global == "Ask")nn="http://www.ask.com/web?q="+cSpace(form.gsearch.value)
window.open(nn,"")
}
function GetGlobalKey (e,form) {
var keycode;
if(isFive){
   if(e.which != 13) return false
   else {
      if(form.name=="se")GetGlobalResults(form)
      return false
   }
}
if (window.event) keycode = window.event.keyCode;
else if (isNav) keycode = e.which;
if (keycode == 13) {
      if(form.name=="se")GetGlobalResults(form)
   return false
}
}
function select_text(form) {
   form.gsearch.select()
   form.gsearch.value=""
}
document.write('<table border="0" align="right" cellpadding="11" cellspacing="0"> <td>')
document.write('<form name="se" style="font-size:90%" onSubmit="return GetGlobalKey(event,this.form)">')
if(isMacIE)document.write('<input type="text" name="gsearch" value="search..." size="15"  onKeyPress="if(window.event.keyCode == 13){return GetGlobalKey(event,this.form)}" onFocus="select_text(this.form)">')
else if(!isNav)document.write('<input type="text" name="gsearch" value="search..." size="15"  onKeyPress="if(window.event.keyCode == 13){return GetGlobalKey(event,this.form)}" onFocus="select_text(this.form)">')
else if(isFive&&isMac)document.write('<input type="text" name="gsearch" value="search..." size="10" style="font-size: 10pt" onKeyPress="if(event.which == 13){return GetGlobalKey(event,this.form)}" onFocus="select_text(this.form)">')
else if(isFive)document.write('<input type="text" name="gsearch" value="search..." size="15" style="font-size: 10pt" onKeyPress="if(event.which == 13){return GetGlobalKey(event,this.form)}" onFocus="select_text(this.form)">')
else document.write('<small><input type="text" name="gsearch" value="search..." size="10" style="font size: 10pt" onKeyPress="if(event.which == 13){return GetGlobalKey(event,this.form)}" onFocus="select_text(this.form)"></small>')

var ie4=document.all
if(ie4){
 if(navigator.appVersion.charAt(22)>=6)var ie6=document.getElementById&&document.all
}
document.write('<SELECT NAME="global" style="font-family: Arial,Helvetica">')
//document.write('<OPTION  value="GoogleBlog">This Blog')
document.write('<OPTION  value="alta">Alta Vista')
document.write('<OPTION value="AOL">AOL')
document.write('<OPTION value="Ask">Ask.com')
document.write('<OPTION  value="clusty">Clusty')
document.write('<OPTION  value="Dogpile">Dogpile')
//document.write('<OPTION value="Excite">eXcite')
document.write('<OPTION value="Google">Google')
document.write('<OPTION value="Lycos">Lycos')
document.write('<OPTION value="MSN">MSN')
document.write('<OPTION value="Yahoo">Yahoo!')
document.write('<OPTION value="GovSites">FirstGov')
document.write('<OPTION SELECTED value="qisoft">QiSoftware')
document.write('</SELECT>')
document.write('<input type="button" value="Go" onClick="GetGlobalResults(this.form)">')
document.write('</form>')
document.write('</td>')
document.write('</table>')
//if(isMacIE)document.write('<br>')
