

		function newImage(arg) {

			if (document.images) {

				rslt = new Image();

				rslt.src = arg;

				return rslt;

			}

		}

		

		function changeImages() {

			if (document.images && (preloadFlag == true)) {

				for (var i=0; i<changeImages.arguments.length; i+=2) {

					document[changeImages.arguments[i]].src = changeImages.arguments[i+1];

				}

			}

		}

		

		var preloadFlag = false;

		function preloadImages() {

			if (document.images) {

				read_more1_over = newImage("images/read_more2.gif");

				preloadFlag = true;

			}

		}

	//Image definitions for search engine icons
if (parseInt(navigator.appVersion.substring(0,1))>=3) {

  gothere = new Image(90,25);
  gothere.src = "images/go.gif";

  googleoff = new Image(90,25);
  googleoff.src = "images/google.gif";

  alltheweboff = new Image(90,25);
  alltheweboff.src = "images/alltheweb.gif";

  teomaoff = new Image(90,25);
  teomaoff.src = "images/teoma.gif";
 
  msnoff = new Image(90,25);
  msnoff.src = "images/msn.gif";

  wisenutoff = new Image(90,25);
  wisenutoff.src = "images/wisenut.gif";

  scirusoff = new Image(90,25);
  scirusoff.src = "images/scirus.gif";

  overtureoff = new Image(90,25);
  overtureoff.src = "images/overture.gif";

  yahoooff = new Image(90,25);
  yahoooff.src = "images/yahoo.gif";

  altavistaoff = new Image(90,25);
  altavistaoff.src = "images/altavista.gif";

  askjeevesoff = new Image(90,25);
  askjeevesoff.src = "images/askjeeves.gif";

  lycosoff = new Image(90,25);
  lycosoff.src = "images/lycos.gif";

  looksmartoff = new Image(90,25);
  looksmartoff.src = "images/looksmart.gif";
}


function start(enginename) {
  var searchvalue= escape(document.search.keyword.value);
  var keyword= "";

   if(enginename=="") enginename="Google";
  //replace blanks with + sign
  for (var i=0; i< searchvalue.length; i++) {
    var extendedkey= searchvalue.substring(i, i+1);
    if (extendedkey==" ") keyword+= "+"
    else if (extendedkey=="+") keyword+= "%2B"
    else keyword+= extendedkey;
  }
  
  // Store value used in a cookie
  setCookie("keyword",document.search.keyword.value)

 //Use if and elseif rather than switch statement in order to support Nav 3   
   if(enginename=="Google") 
   		 if (searchvalue.length==0)
      		top.location.href="http://www.google.com"
         else
      		top.location.href="http://www.google.com/search?q="+keyword
   else if(enginename=="AllTheWeb")
          if (searchvalue.length==0)
      		top.location.href="http://www.alltheweb.com"
         else
      		top.location.href="http://www.alltheweb.com/search?cat=web&type=all&q="+keyword 
	       		

   else if(enginename=="Teoma")
         if (searchvalue.length==0)
      			top.location.href="http://www.teoma.com"
         else
		      	top.location.href="http://www.teoma.com/search.asp?t="+keyword
        
   else if(enginename=="WiseNut")
         if (searchvalue.length==0)
      			top.location.href="http://www.wisenut.com"
         else
		      	top.location.href="http://www.wisenut.com/search/query.dll?q="+keyword
 
   else if(enginename=="MSN")
         if (searchvalue.length==0)
      			top.location.href="http://search.msn.com"
         else
       			top.location.href="http://search.msn.com/results.asp?q="+keyword
        
   else if(enginename=="scirus")
         if (searchvalue.length==0)
      			top.location.href="http://www.scirus.com"
         else
      			top.location.href="http://www.scirus.com/search_simple/?frm=simple&query_1="+keyword

   else if(enginename=="Lycos")
          if (searchvalue.length==0)
      			top.location.href="http://search.lycos.com"
         else
      		top.location.href="http://search.lycos.com/default.asp?query="+keyword
            
   else if(enginename=="Altavista") 
          if (searchvalue.length==0)
      			top.location.href="http://www.altavista.com"
         else
       			top.location.href ="http://www.altavista.com/sites/search/web?q="+keyword

  else if(enginename=="Overture")    
          if (searchvalue.length==0)
      			top.location.href="http://www.overture.com"
         else
       			top.location.href="http://www.overture.com/d/search/?Keywords="+keyword

  else if(enginename=="Yahoo")
          if (searchvalue.length==0)
      			top.location.href="http://search.yahoo.com"
         else
       			top.location.href="http://search.yahoo.com/bin/search?p="+keyword

  else if(enginename=="AskJeeves")    
          if (searchvalue.length==0)
      			top.location.href="http://www.ask.com"
         else
       			top.location.href="http://web.ask.com/web?q="+keyword 

  else if(enginename=="LookSmart")   
           if (searchvalue.length==0)
      			top.location.href="http://www.looksmart.com"
         else
       			top.location.href="http://www.looksmart.com/r_search?key="+keyword
  else
      alert("Engine name error!!")

return false;
}


//This cookie function retrieves the search keyword used in previous query
function getCookie (name) {
         var dcookie = document.cookie; 
         var cname = name + "=";
         var clen = dcookie.length;
         var cbegin = 0;
             while (cbegin < clen) {
             var vbegin = cbegin + cname.length;
                 if (dcookie.substring(cbegin, vbegin) == cname) { 
                 var vend = dcookie.indexOf (";", vbegin);
                     if (vend == -1) vend = clen;
                 document.search.keyword.value= unescape(dcookie.substring(vbegin, vend));
                 return;
                 }
             cbegin = dcookie.indexOf(" ", cbegin) + 1;
                 if (cbegin == 0) break;
             }
         return;
 }

// Save the keyword used in a cookie
 function setCookie(name, value) {
          document.cookie = name + "=" + escape(value) + "; path=/";                      
         }     



function switchto(name, on) {
if (parseInt(navigator.appVersion.substring(0,1))>=3) {
    image = eval( (on == 1 ?  "gothere.src" : name + "off.src"));
    document[name].src = image;
  }
}
	



