// JavaScript Document

<!-- Display -->
function ajaxFunction(Source)
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
      document.getElementById('comment').innerHTML = xmlHttp.responseText;
      }
    }
  xmlHttp.open("GET",Source+"?"+(new Date).getTime(),true);
  xmlHttp.send(null);
  }


<!-- Submit -->
function xmlhttpPost(strURL) {
    var xmlHttpReq = false;
    var self = this;

try
  {
  // Firefox, Opera 8.0+, Safari
   self.xmlHttpReq = new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
     self.xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
       self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }

    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText);
            //alert('Submitted. Please click R button.');
        }
    }
    self.xmlHttpReq.send(getquerystring());
}

function getquerystring() {
    var form     = document.forms['f1'];
    var word = form.word.value;
    qstr = 'w=' + encodeURIComponent(word);  // escape(word) NOTE: no '?' before querystring
    return qstr;
}

function updatepage(str){
    document.getElementById("comment").innerHTML = str;
}




<!-- Graphic Button -->
function RollOver (obj,val) {
  obj.src = val;
}

<!--CalcButtons -->
function calc(ch){
	if (ch == "C"){
		document.form1.text1.value= "";
	}else{
		document.form1.text1.value += ch;
	}
}
			
<!-- SearchEngines-->
function startSearch()
{
	searchString = document.searchForm.searchText.value;
	if(searchString != "")
	{
		searchEngine = document.searchForm.whichEngine.selectedIndex + 1;
		finalSearchString = "";
		if(searchEngine == 2){
			finalSearchString = "http://search.yahoo.com/search?p=" + searchString;
		}
		if(searchEngine == 3){
			finalSearchString = "http://www.google.com/search?hl=en&q=" + searchString;
		}
		if(searchEngine == 4){
			finalSearchString = "http://www.ncbi.nlm.nih.gov:80/entrez/query.fcgi?term=" + searchString + "&DB=pubmed";
		}
		if(searchEngine == 5){
			finalSearchString = "http://scholar.google.com/scholar?q=" + searchString;
		}
		if(searchEngine == 6){
			finalSearchString = "http://dictionary.reference.com/search?db=mwmed&q=" + searchString;
		}
		if(searchEngine == 7){
			finalSearchString = "http://www.scirus.com/srsapp/search?q=" + searchString;
		}
		if(searchEngine == 8){
			finalSearchString = "http://www.biocompare.com/search.asp?option=all&groupID=1&maxrecords=115&search=" + searchString;
		}
		if(searchEngine == 9){
			finalSearchString = "http://www.sciseek.com/search/search.php?Terms=" + searchString;
		}
		if(searchEngine == 10){
			finalSearchString = "http://www.scinet.cc/cgi-bin/s/smartsearch.cgi?username=&keywords=" + searchString, target="_blank";
		}
		if(searchEngine == 11){
			finalSearchString = "http://directory.utk.edu/search.jsp?query=" + searchString, target="_blank";
		}
		if(searchEngine == 12){
			finalSearchString = "http://search.tennessee.edu/query.html?col=utk+utia+utips&qt=" + searchString, target="_blank";
		}
		window.open (finalSearchString) ;
	}
}

