// Description of Java script contents <<<<<
//
// There is one main table ( sengine[] ) whose contents corresponds to the selected combination of
// the "info" and "source" selections.
// Each entry in the table has three comma seperated parts:  Menu Text, Type, Template
// The Menu text is what will show on the pull down list
// Among the various search engines, the formatting of search strings falls into a couple
// of types.  The template string is used to query the selected engine.
//
// There are eight subroutines:
// goURL() prepairs search string, gets the engine template string, gets the engine type, calls subUR() open window
// goRSS() prepairs search string, gets the engine template string, gets the engine type, calls subUR() with submit
// subURL() formats search string according to type, inserts search string into template, and opens new window if cmd=1
// sform() returns the search sting (from the Form controls) formatted according to the engine"type".
// fillselect() populates the sengine[] array according to selection
// fillselect2() populates the sdomain[] array according to override selection of focus sub catagories
// fillfocusarry() populates the focus[] array according to the "id" string in the focus select form item
// id="0" selects the original list, id="1" is the alt energy, alphabetically up to id="15" which is wind.
// If the user has 'fiddled'with the domain select item, the server generated id is ignored when fillFocusArray
// called, and the domain selection determines the "id".
//
// wolton 5/06

    var en;      //engine number
    var etype;       //engine type
    var ts;         //template string
    var i=-1;    //aux
    var ss;      //original search string
    var le;        //length of list
    var wc=0;    //window counter
    var override=0; //user focus selection
    var ix="0";    //user

     var sengine = new Array();  //main array
     var rengine = new Array();  //main array
     var sfocus = new Array();  // focus list
     var sdomain = new Array(); // domain list

    sfocus[0] ="";
    sdomain[0] ="";

    //init the rss template/mode array  note: the text name element is not used, but it is included...
            rengine[0] = "Google News,0,http://news.google.com/news?hl=en&ned=us&q=###&ie=UTF-8&output=rss,";
            rengine[1] = "Yahoo News,0,http://news.search.yahoo.com/news/rss?p=###&rssSrchButton=Search&ei=UTF-8&fl=0&eo=UTF-8,";
            rengine[2] = "MSN News,0,http://search.msn.com/news/results.aspx?q=###&format=rss&FORM=RSNR,";
            rengine[3] = "Wired News,2,http://search.wired.com/wnews/default.asp?query=###&format=rss,";
            rengine[4] = "HighBeam News,2,http://services.highbeam.com/rss/rss.aspx?Q=###&SORT=RK&SORTDIR=A&type=1 ,";
            rengine[5] = "IceRocket News,0,http://www.icerocket.com/search?tab=news&q=###&rss=1,";
            rengine[6] = "Feedster Blogs,2,http://www.feedster.com/search/type/rss/###,";
            rengine[7] = "Blogpulse ,0,http://www.blogpulse.com/rss?query=###&sort=date&operator=and,";
            rengine[8] = "Yahoo Blog Search ,2,http://api.search.yahoo.com/NewsSearchService/rss/blogSearch.xml?appid=YahooRSSSearch&query=###&start=1&results=10&sort=relevance,";
            rengine[9] = "BlogDigger,0,http://blogdigger.com/search?q=###&sortby=date&type=rss,";
            rengine[10] = "Google Blogger,0,http:/search.blogger.com/blogsearch_feeds?q=###&hl=en&ui=blg&ie=utf-8&num=10&output=rss,";
            rengine[11] = "Ice Rocket Blogs,0,http://www.icerocket.com/search?tab=blog&q=###&rss=1,";
            rengine[12] = "IceRocket Web,0,http://www.icerocket.com/search?tab=web&q=###&rss=1,";
            rengine[13] = "MSN Web,0,http://search.msn.com/results.aspx?q=###+%7bfrsh%3d100%7d&format=rss&FORM=RSRE,";


    //init the main template/type array
        sengine[0] = "Google,0,http://www.google.com/search?hl=en&q=###&btnG=Google+Search,";
        sengine[1] = "MSN,0,http://search.msn.com/results.aspx?q=###&FORM=QBRE,";
        sengine[2] = "Yahoo,0,http://search.yahoo.com/search?p=###&sm=Yahoo%21+Search&fr=FP-tab-web-t&toggle=1&cop=&ei=UTF-8,";
        sengine[3] = "Ask,0,http://www.ask.com/web?q=###&qsrc=0&o=0,";
        sengine[4] = "Clusty,0,http://clusty.com/search?query=###,";
        sengine[5] = "A9,2,http://a9.com/###,";
        sengine[6] = "Jux2,0,http://www.jux2.com/best.php?e=0&q=###&Submit=search,";
        sengine[7] = "Grokker,2,http://www.grokker.com/grokker.html?query=###&Yahoo=true&ACM=true&numResults=250,";
        sengine[8] = "Answers.com,2,http://www.answers.com/###,";
        sengine[9]= "Seek It All,0,http://www.seekitall.com/search/heat.seek?query=###&l=en,";
        sengine[10]= "All the web,0,http://www.alltheweb.com/search?cat=news&cs=iso88591&q=###&rys=0&itag=crv&_sb_lang=pref,";
        sengine[11]= "Kosmix Political,0,http://www.kosmix.com/search?q=###&x=0&y=0&t=vpolitics.any&out=politics,";
        sengine[12]= "Dogpile,4,http://www.dogpile.com/info.dogpl/search/web/###/1/-/1/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/417/top,";
        sengine[13]= "Windows Live,2,http://search.live.com/#q=###&offset=1";
        sengine[14]= "Accoona Web,0,http://accoona.com/search.jsp?aOnly=null&campaign=null&control=null&affTrack=null&col=wc&charset=utf-8&la=en&order=&supertarget=&qt=###,";


////////////////////////////////////////////////
// Subroutines
//

////////////////////////////////////////////////
// populates array strings with search topic/focus words according to the focus id string
//
//
function fillfocusarray()
{
   sfocus.length=0; //reset array
   ix=document.engines.focus.id;
   i= ix*1;// string to int
 if(override != 0) i=(override);

   switch(i)    // select group
   {
     case 0: //focus
    sfocus[0] ="";
    sfocus[1] ="hybrid cars";
    sfocus[2] ="biomass power";
    sfocus[3] ="coal power emissions clean";
    sfocus[4] ="energy crosscutters";
    sfocus[5] ="smart electric energy grid";
    sfocus[6] ="geothermal energy power";
    sfocus[7] ="hydroelectric power";
    sfocus[8] ="hydrogen energy fuel cell";
    sfocus[9] ="nanotechnology";
    sfocus[10]="natural gas energy";
    sfocus[11]="nuclear energy power";
    sfocus[12]="tidal energy ocean";
    sfocus[13]="oil petroleum energy";
    sfocus[14]="solar power energy";
    sfocus[15]="wind energy power";
    sfocus[16]="energy storage";
    sfocus[17]="biopharma alliances";

    break;

     case 1: //hybridcars
    sfocus[0] ="";
    sfocus[1] ="";
    sfocus[2] ="hybrid renewable transportation";
    sfocus[3] ="hybrid markets car price";
    sfocus[4] ="hybrid vehicles car alternative fuels";
    sfocus[5] ="hybrid vehicle projects";
    sfocus[6] ="hybrid vehicle statistic energy policy";
    sfocus[7] ="hybrid research development";
    sfocus[8] ="hybrid vehicle technology laboratory engineering";
    sfocus[9] ="hybrid vehicle systems";
    sfocus[10]="hybrid fuels data efficiency";
    sfocus[11]="hybrid vehicle electric";
    sfocus[12]="hybrid vehicle energy resources";
    sfocus[13]="hybrid vehicle association alliance group";
    sfocus[14]="hybrid vehicle venture capital invest";
    sfocus[15]="hybrid vehicle companies";
    sfocus[16]="hybrid vehicle consulting";
    sfocus[17]="hybrid vehicle biodiesel fuel";
    sfocus[18]="hybrid vehicle ethanol fuel";
    sfocus[19]="hybrid vehicle hydrogen fuel";
    break;

     case 2: //biomass
    sfocus[0] ="";
    sfocus[1] ="";
    sfocus[2] ="biomass energy";
    sfocus[3] ="biomass energy markets price";
    sfocus[4] ="biofuel research projects";
    sfocus[5] ="biomass feedstock production";
    sfocus[6] ="biomass pretreatment";
    sfocus[7] ="biomass sugars utilize";
    sfocus[8] ="biomass corn future ethanol";
    sfocus[9] ="biomass lignin enzyme cellulase recombinant";
    sfocus[10]="biomass gasification hydrolysis enzyme";
    sfocus[11]="bio-gas digestion bacteria metabolic";
    sfocus[12]="biomass bio-oil";
    sfocus[13]="biomass carbon rich chains";
    sfocus[14]="biomass aqueous catalysis";
    sfocus[15]="biomass plant products";
    sfocus[16]="biomass heating wood";
    sfocus[17]="bio-hydrogen";
    sfocus[18]="biomass bio-diesel";
    sfocus[19]="energy bio-ethanol";
    sfocus[20]="biomass electric power";
    break;

     case 3: //coal
    sfocus[0] ="";
    sfocus[1] ="";
    sfocus[2] ="coal fossil fuel energy power";
    sfocus[3] ="coal fired power plant";
    sfocus[4] ="coal power combustion burning";
    sfocus[5] ="coal power clean emissions control";
    sfocus[6] ="coal power energy policy sequestration";
    sfocus[7] ="coal power development laboratory";
    sfocus[8] ="coal power technology";
    sfocus[9] ="coal power engineering";
    sfocus[10]="coal power mining";
    sfocus[11]="coal power pollution environment";
    sfocus[12]="coal power association alliance group";
    sfocus[13]="coal power venture capital invest";
    sfocus[14]="coal natural resources";
    break;

     case 4: //crosscutters
    sfocus[0] ="";
    sfocus[1] ="";
    sfocus[2] ="extreme materials science discover develop";
    sfocus[3] ="nanotechnology materials";
    sfocus[4] ="control method transport energy";
    sfocus[5] ="designer catalyst";
    sfocus[6] ="designer membrane";
    sfocus[7] ="interfacial";
    sfocus[8] ="bio materials nano";
    sfocus[9] ="energy biochemical interfaces nano";
    sfocus[10] ="energy wetware research";
    sfocus[11]="energy recombinant bio-power";
    sfocus[12]="atomic nano scale spatial characterization in situ tool";
    sfocus[13]="time evolution characterization process tool";
    sfocus[14]="computation theory new tools";
    sfocus[15]="venture capital invest";
    sfocus[16]="energy technology gaps";
    break;

     case 5: //elecgrid
    sfocus[0] ="";
    sfocus[1] ="";
    sfocus[2] ="intelligent grid network energy conservation";
    sfocus[3] ="intelligent grid network market deploy system";
    sfocus[4] ="intelligent grid electricity network gridwise";
    sfocus[5] ="intelligent grid project program";
    sfocus[6] ="intelligent grid network energy policy";
    sfocus[7] ="intelligent grid research development engineering";
    sfocus[8] ="intelligent grid technology design";
    sfocus[9] ="intelligent grid systems adaptive infrastructure";
    sfocus[10]="intelligent grid distributed energy generation";
    sfocus[11]="intelligent grid automated building";
    sfocus[12]="intelligent grid node smart adaptive distributed future design";
    sfocus[13]="intelligent grid association alliance group";
    sfocus[14]="intelligent grid venture capital invest";
    sfocus[15]="intelligent grid companies";
    sfocus[16]="intelligent grid consulting";
    break;


     case 6: //geothrm
    sfocus[0] ="";
    sfocus[1] ="";
    sfocus[2] ="geothermal power plant plants";
    sfocus[3] ="geothermal power natural resources";
    sfocus[4] ="geothermal power deep";
    sfocus[5] ="geothermal power operations systems";
    sfocus[6] ="geothermal power energy policy";
    sfocus[7] ="geothermal power research development lab";
    sfocus[8] ="geothermal power technologies";
    sfocus[9] ="geothermal power systems";
    sfocus[10]="geothermal power rock hot dry";
    sfocus[11]="geothermal power water";
    sfocus[12]="geothermal power renewable energy";
    sfocus[13]="geothermal power association alliance group";
    sfocus[14]="geothermal power venture capital invest";
    sfocus[15]="geothermal power Idaho National Laboratory";
    sfocus[16]="geothermal power green sustainable renewable";
    break;

     case 7: //hydroelec
    sfocus[0] ="";
    sfocus[1] ="";
    sfocus[2] ="hydroelectric power plant";
    sfocus[3] ="hydroelectric power hydropower";
    sfocus[4] ="hydroelectric power small scale";
    sfocus[5] ="hydroelectric power generation";
    sfocus[6] ="hydroelectric power energy policy";
    sfocus[7] ="hydroelectric power development";
    sfocus[8] ="hydroelectric power technology";
    sfocus[9] ="hydroelectric power systems";
    sfocus[10]="hydroelectric power operations";
    sfocus[11]="hydroelectric power water kinetic energy";
    sfocus[12]="hydroelectric power renewable energy";
    sfocus[13]="hydroelectric power association alliance group";
    sfocus[14]="hydroelectric power venture capital invest";
    break;

     case 8://hydroFC
    sfocus[0] ="";
    sfocus[1] ="";
    sfocus[2] ="hydrogen fuel cell clean energy";
    sfocus[3] ="hydrogen fuel cell vehicle";
    sfocus[4] ="hydrogen fuel cell";
    sfocus[5] ="hydrogen fuel cell project program";
    sfocus[6] ="hydrogen fuel cell energy policy";
    sfocus[7] ="hydrogen fuel cell research development engineering";
    sfocus[8] ="hydrogen fuel cell technology design test";
    sfocus[9] ="hydrogen fuel cell systems";
    sfocus[10]="hydrogen generation proton exchange membrane";
    sfocus[11]="hydrogen fuel cell future design";
    sfocus[12]="hydrogen fuel cell association alliance group";
    sfocus[13]="hydrogen fuel cell venture capital invest";
    sfocus[14]="hydrogen fuel cell companies";
    sfocus[15]="hydrogen fuel cell consulting engineering";
    break;

     case 9: //nano
    sfocus[0] ="";
    sfocus[1] ="";
    sfocus[2] ="nanotechnology science";
    sfocus[3] ="nanotechnology nanowire";
    sfocus[4] ="nanotechnology nanotube";
    sfocus[5] ="nanotechnology nanobot";
    sfocus[6] ="nanotechnology fullerenes";
    sfocus[7] ="nanotechnology regulatory policy";
    sfocus[8] ="nanotechnology science research development";
    sfocus[9] ="nanotechnology engineering technology";
    sfocus[10]="nanotechnology nanoscale";
    sfocus[11]="nanotechnology electricity";
    sfocus[12]="nanotechnology materials";
    sfocus[13]="nanotechnology physics";
    sfocus[14]="nanotechnology association alliance group institute";
    sfocus[15]="nanotechnology venture capital invest";
    sfocus[16]="nanotechnology future economy";
    break;

     case 10: //natgas
    sfocus[0] ="";
    sfocus[1] ="";
    sfocus[2] ="natural gas power distribution";
    sfocus[3] ="natural gas power markets";
    sfocus[4] ="natural gas power gas fired plant";
    sfocus[5] ="natural gas power projects";
    sfocus[6] ="natural gas power energy policy";
    sfocus[7] ="natural gas power research development";
    sfocus[8] ="natural gas power technologies technology";
    sfocus[9] ="natural gas power systems";
    sfocus[10]="natural gas power fossil fuel";
    sfocus[11]="natural gas power methane hydrate deposit";
    sfocus[12]="natural gas power asset management";
    sfocus[13]="natural gas power association alliance group";
    sfocus[14]="natural gas power venture capital invest";
    sfocus[15]="natural gas power companies";
    sfocus[16]="natural gas power consulting engineering";
    break;



     case 11: //nuxe
     sfocus[0] ="";
     sfocus[1] ="";
     sfocus[2] ="nuclear Department of Energy DOE";
     sfocus[3] ="nuclear reactor";
     sfocus[4] ="nuclear uranium";
     sfocus[5] ="nuclear power safety regulatory NRC";
     sfocus[6] ="nuclear power statistic energy policy";
     sfocus[7] ="nuclear science research development";
     sfocus[8] ="nuclear power new old technology";
     sfocus[9] ="nuclear fusion power";
     sfocus[10]="nuclear plant future adopt";
     sfocus[11]="nuclear power competitor renewable";
     sfocus[12]="nuclear power breeder";
     sfocus[13]="nuclear power association alliance institute";
     sfocus[14]="nuclear health hazards";
     sfocus[15]="nuclear power companies";
     sfocus[16]="nuclear consulting engineering";
     break;

     case 12://ocean
     sfocus[0] ="";
     sfocus[1] ="";
     sfocus[2] ="harnessing ocean energy";
     sfocus[3] ="electricity generation ocean power plant";
     sfocus[4] ="wave power electricity generation";
     sfocus[5] ="tidal power electricity ocean lunar";
     sfocus[6] ="tidal power energy policy";
     sfocus[7] ="tidal science research development";
     sfocus[8] ="tidal power new old technology turbine";
     sfocus[9] ="tidal power plant engineering";
     sfocus[10]="ocean energy plant future adopt";
     sfocus[11]="ocean electrical power market competitor renewable";
     sfocus[12]="ocean power association alliance institute";
     sfocus[13]="ocean energy power plant venture capital invest";
     sfocus[14]="tidal power companies";
     sfocus[15]="tidal consulting engineering";
     break;

     case 13://oil
     sfocus[0] ="";
     sfocus[1] ="";
     sfocus[2] ="petroleum distribution transportation";
     sfocus[3] ="petroleum markets price barrel";
     sfocus[4] ="petroleum discovery field exploration";
     sfocus[5] ="petroleum power projects initiative";
     sfocus[6] ="petroleum power statistic energy policy";
     sfocus[7] ="petroleum oil research development";
     sfocus[8] ="petroleum power technology";
     sfocus[9] ="petroleum power systems";
     sfocus[10]="petroleum oil production";
     sfocus[11]="petroleum plant refinery";
     sfocus[12]="petroleum crude oil";
     sfocus[13]="oil shale";
     sfocus[14]="tar sands";
     sfocus[15]="petroleum oil power companies";
     sfocus[16]="petroleum oil consulting engineering";
     break;

     case 14://solar
     sfocus[0] ="";
     sfocus[1] ="";
     sfocus[2] ="solar power photovoltaic cell";
     sfocus[3] ="solar power companies";
     sfocus[4] ="solar power efficiency measure best";
     sfocus[5] ="solar power energy systems design";
     sfocus[6] ="solar power energy policy";
     sfocus[7] ="solar power cell research";
     sfocus[8] ="solar cell three-junction concentrator";
     sfocus[9] ="solar cell two-junction concentrator";
     sfocus[10]="solar cell single crystal si cell";
     sfocus[11]="solar cell thin film Cu";
     sfocus[12]="solar cell thin film CdTe";
     sfocus[13]="solar cell amorphous Si";
     sfocus[14]="solar power venture capital invest";
     sfocus[15]="solar power economic incentive program";
     sfocus[16]="solar power green sustainable renewable";
     break;


     case 15: //wind
     sfocus[0] ="";
     sfocus[1] ="";
     sfocus[2] ="wind power turbine";
     sfocus[3] ="wind power generation generator";
     sfocus[4] ="wind power hydropower";
     sfocus[5] ="wind power projects";
     sfocus[6] ="wind power energy policy";
     sfocus[7] ="wind power research development engineering";
     sfocus[8] ="wind power technologies technology";
     sfocus[9] ="wind power systems";
     sfocus[10]="wind power micro";
     sfocus[11]="wind power water";
     sfocus[12]="wind power kinetic energy";
     sfocus[13]="wind power association alliance group";
     sfocus[14]="wind power venture capital invest";
     sfocus[15]="wind power companies";
     sfocus[16]="wind power resources potential";
     break;

     case 16: //storage
     sfocus[0] ="";
     sfocus[1] ="";
     sfocus[2] ="VRB flow battery industrial advances";
     sfocus[3] ="sodium sulphur battery industrial advances";
     sfocus[4] ="zinc chromate battery industrial advances";
     sfocus[5]="zinc bromine battery industrial advances large-scale";
     sfocus[6] ="nickel metal hydride battery industrial advances";
     sfocus[7] ="nickel cadmium battery industrial advances";
     sfocus[8] ="lithium ion battery industrial advances";
     sfocus[9] ="nuclear battery large scale industrial advances";
     sfocus[10] ="lead acid battery large scale industrial advances engineering";
     sfocus[11]="solid oxide fuel cell industrial advances large scale application";
     sfocus[12]="pem membrane industrial advances";
     sfocus[13]="ultracapacitors large scale nano";
     sfocus[14]="caes energy storage advances";
     sfocus[15]="flywheels energy storage advances";
     sfocus[16]="advanced metering infrastructure adoption";
     sfocus[17]="microturbine CHP industrial advances";
     break;

     case 17: //biopharma
     sfocus[0] ="";
     sfocus[1] ="";
     sfocus[2] ="biopharma strategic alliance";
     sfocus[3] ="biopharma alliance";
     sfocus[4] ="biopharma biotech partnership agreement";
     sfocus[5] ="biotech alliance";
     sfocus[6] ="biotech strategic alliance";
     sfocus[7] ="biopharma merger acquisition";
     sfocus[8] ="biopharma research development";
     sfocus[9] ="biopharma regulatory policy";
     sfocus[10]="biomedical deal agreement";
     sfocus[11]="biopharma licensing";
     sfocus[12]="biopharma clinical trial";
     sfocus[13]="biopharma patent";
     sfocus[14]="biopharma business technology";
     sfocus[15]="biopharma trade association";
     break;

   }

    return;
}


///////////////////////////////////////////////////////////
// populates array with sub-topic catagory name list for the form control: focus
//
//

function fillselect2()
{
    sdomain.length=0; //reset array
      i=document.engines.domain.options.selectedIndex;
    override=i; //save
       switch(document.engines.domain.options.selectedIndex)    // select group
           { //fill array with names

      case 0:      // none
         sdomain[0]="";
         sdomain[1]="None";
         break;

      case 1:
       sdomain[0]="";
       sdomain[1]="None";
       sdomain[2]="Renewable";
       sdomain[3]="Markets";
       sdomain[4]="Hybrid Cars";
       sdomain[5]="Projects";
       sdomain[6]="Policy";
       sdomain[7]="Research";
       sdomain[8]="Technology";
       sdomain[9]="Systems";
       sdomain[10]="Fuels Data";
       sdomain[11]="Electric Car";
       sdomain[12]="Resources";
       sdomain[13]="Associations";
       sdomain[14]="Venture Capital";
       sdomain[15]="Companies";
       sdomain[16]="Consulting";
       sdomain[17]="Biodiesel";
       sdomain[18]="Ethanol";
       sdomain[19]="Hydrogen";
      break;

       case 2:
         sdomain[0]="";
         sdomain[1]="None";
         sdomain[2]="Renewable";
         sdomain[3]="Markets";
         sdomain[4]="Projects";
         sdomain[5]="Feedstock";
         sdomain[6]="Pretreatment";
         sdomain[7]="Sugars";
         sdomain[8]="Corn Future";
         sdomain[9]="Cellulose Watch";
         sdomain[10]="SynGas Watch";
         sdomain[11]="Bio-Gas Watch";
         sdomain[12]="Bio-Oil Watch";
         sdomain[13]="Carbon Rich";
         sdomain[14]="Aq Catalysis";
         sdomain[15]="Plant Products";
         sdomain[16]="Wood & Heat";
         sdomain[17]="Bio-Hydrogen";
         sdomain[18]="Bio-Diesel";
         sdomain[19]="Bio-Ethanol";
         sdomain[20]="Electric Power";
         break;

        case 3:  //coal
         sdomain[0]="";
         sdomain[1]="None";
         sdomain[2]="Coal Power";
         sdomain[3]="Coal Fired";
         sdomain[4]="Combustion";
         sdomain[5]="Clean Coal";
         sdomain[6]="CO2 Policy";
         sdomain[7]="Research";
         sdomain[8]="Technology";
         sdomain[9]="Engineering";
         sdomain[10]="Mining";
         sdomain[11]="Environment";
         sdomain[12]="Associations";
         sdomain[13]="Venture Capital";
         sdomain[14]="Natural resources";
        break;

        case 4:  //energy pol
          sdomain[0]="";
          sdomain[1]="None";
          sdomain[2]="Extreme Materials";
          sdomain[3]="Nano Materials";
          sdomain[4]="Energy Materials";
          sdomain[5]="Designer Catalysts";
          sdomain[6]="Membranes";
          sdomain[7]="Interfacial Sci";
          sdomain[8]="Bio-Materials";
          sdomain[9]="Biochem Interfaces";
          sdomain[10]="Wetware Research";
          sdomain[11]="Recombinant Sci";
          sdomain[12]="Atomic Tools";
          sdomain[13]="Evolution Tools";
          sdomain[14]="Computation Tools";
          sdomain[15]="Venture Capital";
          sdomain[16]="Technology Gaps";
         break;

        case 5:  //smart grid
           sdomain[0]="";
           sdomain[1]="None";
           sdomain[2]="Conservation";
           sdomain[3]="Deployment";
           sdomain[4]="Grid Wise";
           sdomain[5]="Projects";
           sdomain[6]="Policy";
           sdomain[7]="Research";
           sdomain[8]="Technology";
           sdomain[9]="Systems";
           sdomain[10]="Distributed";
           sdomain[11]="Smart Buildings";
           sdomain[12]="Future Design";
           sdomain[13]="Associations";
           sdomain[14]="Venture Capital";
           sdomain[15]="Companies";
           sdomain[16]="Consulting";
         break;

        case 6:  //geo therm
         sdomain[0]="";
         sdomain[1]="None";
         sdomain[2]="Plants";
         sdomain[3]="Resources";
         sdomain[4]="Deep";
         sdomain[5]="Operations";
         sdomain[6]="Policy";
         sdomain[7]="Research";
         sdomain[8]="Technologies";
         sdomain[9]="Systems";
         sdomain[10]="Rock Hot Dry";
         sdomain[11]="Water";
         sdomain[12]="Renewable";
         sdomain[13]="Associations";
         sdomain[14]="Venture Capital";
         sdomain[15]="Idaho Nat Lab";
         sdomain[16]="Green Sustainable";
        break;

        case 7:  //hydro elec
          sdomain[0]="";
          sdomain[1]="None";
          sdomain[2]="Plants";
          sdomain[3]="Hydropower";
          sdomain[4]="Small Scale";
          sdomain[5]="Generation";
          sdomain[6]="Policy";
          sdomain[7]="Research";
          sdomain[8]="Technology";
          sdomain[9]="Systems";
          sdomain[10]="Operations";
          sdomain[11]="Water Energy";
          sdomain[12]="Renewable";
          sdomain[13]="Associations";
          sdomain[14]="Venture Capital";
           break;

      case 8:  //hydrog FC
       sdomain[0]="";
       sdomain[1]="None";
       sdomain[2]="Clean";
       sdomain[3]="Vehicles";
       sdomain[4]="Fuel Cells";
       sdomain[5]="Projects";
       sdomain[6]="Policy";
       sdomain[7]="Research";
       sdomain[8]="Technology";
       sdomain[9]="Systems";
       sdomain[10]="Proton Exchange";
       sdomain[11]="Future Design";
       sdomain[12]="Associations";
       sdomain[13]="Venture Capital";
       sdomain[14]="Companies";
       sdomain[15]="Consulting";
      break;

      case 9: //nano
       sdomain[0]="";
       sdomain[1]="None";
       sdomain[2]="Nanotechnology";
       sdomain[3]="Nanowire";
       sdomain[4]="Nanotube";
       sdomain[5]="Nanobot";
       sdomain[6]="Fullerenes";
       sdomain[7]="Policy";
       sdomain[8]="Research";
       sdomain[9]="Technologies";
       sdomain[10]="Nanoscale";
       sdomain[11]="Nanoelectricity";
       sdomain[12]="Materials";
       sdomain[13]="Physics";
       sdomain[14]="Associations";
       sdomain[15]="Venture Capital";
       sdomain[16]="Future Economy";
      break;

      case 10:  //gas
       sdomain[0]="";
       sdomain[1]="None";
       sdomain[2]="Distribution";
       sdomain[3]="Markets";
       sdomain[4]="Gas Fired";
       sdomain[5]="Projects";
       sdomain[6]="Policy";
       sdomain[7]="Research";
       sdomain[8]="Technology";
       sdomain[9]="Systems";
       sdomain[10]="Fossil Fuel";
       sdomain[11]="Methane";
       sdomain[12]="Asset Management";
       sdomain[13]="Associations";
       sdomain[14]="Venture Capital";
       sdomain[15]="Companies";
       sdomain[16]="Consulting";
      break;


       case 11:  //nuxe
        sdomain[0]="";
        sdomain[1]="None";
        sdomain[2]="DOE";
        sdomain[3]="Reactors";
        sdomain[4]="Uranium";
        sdomain[5]="Regulatory";
        sdomain[6]="Policy";
        sdomain[7]="Science";
        sdomain[8]="Technology";
        sdomain[9]="Fusion";
        sdomain[10]="Future";
        sdomain[11]="Competitor";
        sdomain[12]="Breeder";
        sdomain[13]="Associations";
        sdomain[14]="Health";
        sdomain[15]="Companies";
        sdomain[16]="Consulting";
       break;

    case 12:  //ocean
           sdomain[0]="";
           sdomain[1]="None";
           sdomain[2]="Harnessing";
           sdomain[3]="Power Plant";
           sdomain[4]="Wave Power";
           sdomain[5]="Tidal Power";
           sdomain[6]="Policy";
           sdomain[7]="Science";
            sdomain[8]="Technology";
           sdomain[9]="Engineering";
           sdomain[10]="The Future";
           sdomain[11]="Competitors";
           sdomain[12]="Associations";
           sdomain[13]="Financing";
           sdomain[14]="Companies";
           sdomain[15]="Consulting";
    break;

    case 13: //oil
          sdomain[0]="";
          sdomain[1]="None";
          sdomain[2]="Distribution";
          sdomain[3]="Markets";
          sdomain[4]="Exploration";
          sdomain[5]="Projects";
          sdomain[6]="Policy";
          sdomain[7]="Research";
          sdomain[8]="Technology";
          sdomain[9]="Systems";
          sdomain[10]="Production";
          sdomain[11]="Refinery";
          sdomain[12]="Crude Oil";
          sdomain[13]="Oil Shale";
          sdomain[14]="Tar Sands";
          sdomain[15]="Companies";
          sdomain[16]="Consulting";
           break;

    case 14://solar
           sdomain[0]="";
           sdomain[1]="None";
           sdomain[2]="Photovoltaic";
           sdomain[3]="Companies";
           sdomain[4]="Efficiency";
           sdomain[5]="Systems Design";
           sdomain[6]="Policy";
           sdomain[7]="Research";
           sdomain[8]="Three Junction";
           sdomain[9]="Two Junction";
           sdomain[10]="Crystal Si";
           sdomain[11]="Thin Film Cu";
           sdomain[12]="Thin Film CdTe";
           sdomain[13]="Thin Film Amorph";
           sdomain[14]="Venture Capital";
           sdomain[15]="Economic Incentive";
           sdomain[16]="Green Sustainable";
       break;

    case 15: //wind
          sdomain[0]="";
          sdomain[1]="None";
          sdomain[2]="Turbine";
          sdomain[3]="Generation";
          sdomain[4]="Hydropower";
          sdomain[5]="Projects";
          sdomain[6]="Policy";
          sdomain[7]="Research";
          sdomain[8]="Technology";
          sdomain[9]="Systems";
          sdomain[10]="Micro Wind";
          sdomain[11]="Water";
          sdomain[12]="Kinetic";
          sdomain[13]="Associations";
          sdomain[14]="Venture Capital";
          sdomain[15]="Companies";
          sdomain[16]="Resources Sustainable";
      break;

    case 16: //storage
          sdomain[0]="";
          sdomain[1]="None";
          sdomain[2]="VRB Battery";
          sdomain[3]="NAS Battery";
          sdomain[4]="Chromate Battery";
          sdomain[5]="Bromine Battery";
          sdomain[6]="Metal Battery";
          sdomain[7]="Cadmium Battery";
          sdomain[8]="Lithium Battery";
          sdomain[9]="Nuclear Battery";
          sdomain[10]="Lead Battery";
          sdomain[11]="SO Fuel Cell";
          sdomain[12]="PEM Advances";
          sdomain[13]="Ultracapacitors";
          sdomain[14]="CAES";
          sdomain[15]="Flywheels";
          sdomain[16]="AMI Meters";
          sdomain[17]="Microturbines";
      break;

          case 17: //biopharma
          sdomain[0] ="";
          sdomain[1] ="None";
          sdomain[2] ="Strategic Alliances";
          sdomain[3] ="Business Alliances";
          sdomain[4] ="Partner Agreement";
          sdomain[5] ="Biotech Alliance";
          sdomain[6] ="Biotech StratAlliance";
          sdomain[7] ="Mergers Acquisition";
          sdomain[8] ="R & D";
          sdomain[9] ="Regulatory Policy";
          sdomain[10]="Deal Flow";
          sdomain[11]="Licensing";
          sdomain[12]="Clinical Trials";
          sdomain[13]="Patents";
          sdomain[14]="Business Tech";
          sdomain[15]="Trade Association";
     break;


    }

            document.engines.focus.options.length = 0;// clears list

             for(i=0;i<sdomain.length;i++) // populates the select control
                {
                    document.engines.focus.options.length ++;
                    document.engines.focus.options[i].value = i+1;
                    document.engines.focus.options[i].text = sdomain[i];
                }

    return;
}



///////////////////////////////////////////////////////////
// populates array with comma delimited: Menu,Type,template
// The templates are used by replacing the ### with the 'formatted' search term.
//

function fillselect()
{

        sengine.length=0; //reset array
           switch(document.engines.info.options.selectedIndex)    // select group
            {
            case 0:  //web
            sengine[0] = "Google,0,http://www.google.com/search?hl=en&q=###&btnG=Google+Search,";
            sengine[1] = "MS Live,0,http://search.msn.com/results.aspx?q=###&FORM=QBRE,";
            sengine[2] = "Yahoo,0,http://search.yahoo.com/search?p=###&sm=Yahoo%21+Search&fr=FP-tab-web-t&toggle=1&cop=&ei=UTF-8,";
            sengine[3] = "Ask,0,http://www.ask.com/web?q=###&qsrc=0&o=0,";
            sengine[4] = "Clusty,0,http://clusty.com/search?query=###,";
            sengine[5] = "A9,2,http://a9.com/###,";
            sengine[6] = "Jux2,0,http://www.jux2.com/best.php?e=0&q=###&Submit=search,";
            sengine[7] = "Grokker,2,http://www.grokker.com/grokker.html?query=###&Yahoo=true&ACM=true&numResults=250,";
            sengine[8] = "Answers.com,2,http://www.answers.com/###,";
            sengine[9]= "Seek It All,0,http://www.seekitall.com/search/heat.seek?query=###&l=en,";
            sengine[10]= "All The Web,0,http://www.alltheweb.com/search?cat=news&cs=iso88591&q=###&rys=0&itag=crv&_sb_lang=pref,";
            sengine[11]= "Kosmix Political,0,http://www.kosmix.com/search?q=###&x=0&y=0&t=vpolitics.any&out=politics,";
            sengine[12]= "Dogpile,4,http://www.dogpile.com/info.dogpl/search/web/###/1/-/1/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/417/top,";
            sengine[13]= "Windows Live,2,http://search.live.com/#q=###&offset=1,";
            sengine[14]= "Accoona Web,0,http://accoona.com/search.jsp?aOnly=null&campaign=null&control=null&affTrack=null&col=wc&charset=utf-8&la=en&order=&supertarget=&qt=###,";
            break;

            case 1:  //sci-tech
            sengine[0] = "Scirus Science,1,http://www.scirus.com/srsapp/search?q=###&ds=jnl&ds=nom&ds=web&g=s&t=all,";
            sengine[1] = "Global Spec,2,http://search.globalspec.com/Search?query=###&show=total&frmtrk=topnav,";
            sengine[2] = "Google Scholar,0,http://scholar.google.com/scholar?q=###&ie=UTF-8&oe=UTF-8&hl=en&btnG=Search,";
            sengine[3] = "FindTech,0,http://www.findtech.com/search.htm?keyword=###&x=0&y=0,";
            sengine[4] = "SciSeek,0,http://www.sciseek.com/search/search.php?Terms=###,";
            sengine[5] = "Berkeley Labs,0,http://google.lbl.gov/search?q=###&restrict=&btnG=Google+Search&ie=&site=lbl&output=xml_no_dtd&client=lbl&lr=&proxystylesheet=lbl&oe=,";
            sengine[6] = "CiteSeer,0,http://citeseer.ist.psu.edu/cis?q=###&submit=Search+Documents&cs=1,";
            sengine[7] = "NERSC,0,http://google.lbl.gov/search?q=###&restrict=NERSC&btnG=Google+Search&ie=&site=lbl&output=xml_no_dtd&client=lbl&lr=&btnG.y=10&btnG.x=13&proxystylesheet=lbl&oe=,";
            sengine[8] = "NASA,0,http://search.nasa.gov/nasasearch/search/advSearch.jsp?nasaInclude=###&qt=all&qx=&qm=anywhere&dct=Any+Type&dn=&dt=at&recPerPg=20&displayFormat=detail&sortBy=Scoredesc,";
            sengine[9] = "FirstGov,2,http://www.firstgov.gov/fgsearch/index.jsp?dep=t&nr=10&rs=1&de=detailed&mw0=###&mt0=all&ms0=should&in0=any&dom0=&db=www-fed-all&rn=2&parsed=true,";
            sengine[10] = "US Gov Google,0,http://www.google.com/unclesam?hl=en&lr=&q=###&btnG=Search,";
            sengine[11]= "US Patents,98,http://patft.uspto.gov/netahtml/PTO/search-bool.html,";
            sengine[12]= "NIST,0,http://externalsearch.nist.gov/search?q=###&btnG=Google+Search&sort=date%3AD%3AL%3Ad1&output=xml_no_dtd&site=default_collection&ie=UTF-8&oe=UTF-8&client=default_frontend&proxystylesheet=default_frontend,";
            sengine[13]= "Thomas Global,1,http://www.thomasglobal.com/search/heading.asp?new=Y&t=&keywords=###&country=NAME&hid=224700,";
            sengine[14]= "HighBeam,0,http://www.highbeam.com/library/search.asp?ctrlInfo=Round18%3AMode18c%3ASR%3ASearch&FN=SS&search_newspapers=on&search_magazines=on&search_books=on&search_transcripts=on&search_maps=on&search_images=on&search_encyclopedias=on&search_dictionaries=on&search_almanacs=on&q=###&submit.x=0&submit.y=0&submit=submit,";
            sengine[15]= "BrainBoost,0,http://www.brainboost.com/search.asp?Q=###&Submit=Ask,";
            break;

            case 2:
            sengine[0] = "Reuters,3,http://today.reuters.com/news/newssearchresults.aspx?srch=###&searchtype=a,";
            sengine[1] = "UPI,0,http://search.upi.com/vivisimo/cgi-bin/search?input-form=simple&v%3Asources=upi-database&v%3Aproject=upi&query=###,";
            sengine[2] = "BBC,0,http://www.bbc.co.uk/cgi-bin/search/results.pl?tab=news&go=homepage&q=###&x=0&y=0,";
            sengine[3] = "CNN,3,http://search.cnn.com/pages/search.jsp?query=###,";
            sengine[4] = "Business Week,0,http://search.businessweek.com/Search?searchTerm=###&collection=all&sortBy=relevance&skin=BusinessWeek&x=0&y=0,";
            sengine[5] = "Business,0,http://www.business.com/search/rslt_default.asp?type=news&query=###&search=Search,";
            sengine[6] = "NY Times,0,http://query.nytimes.com/search/query?frow=0&n=10&srcht=s&query=###&srchst=nyt&hdlquery=&bylquery=&daterange=full&mon1=01&day1=01&year1=1981&mon2=02&day2=14&year2=2009&submit.x=28&submit.y=12,";
            sengine[7] = "Wash Post,0,http://www.washingtonpost.com/ac2/wp-dyn/Search?keywords=###,";
            sengine[8] = "WSJ,98,http://online.wsj.com/public/page/3_0466.html?KEYWORDS=&x=8&y=8,";
            sengine[9] = "SJ Mercury,0,http://www.mercurynews.com/mld/mercurynews/search/search_results.htm?pubName=mercurynews&orderBy=date&pageStart=1&sitesToSearch=mercurynews%2Crealcities&pageSize=10&fieldsToSearch=HEADLINE%2CFORSEARCH%2CLEAD%2CBYLINE&queryType=all&searchSelect=article&query=###,";
            sengine[10]= "SF Chronicle,0,http://www.sfgate.com/cgi-bin/qws/ff/qr?term=###&Submit=S&Go.x=0&Go.y=0&Go=Search&st=s,";
            sengine[11]= "Guardian,0,http://browse.guardian.co.uk/search?search=###,";
            sengine[12]= "IH Tribune,0,http://www.iht.com/cgi-bin/search.cgi?query=###&sort=swishrank&submit=Search,";
            sengine[13]= "Wired,2,http://search.wired.com/wnews/default.asp?query=###,";
            sengine[14]= "Energy Bulletin,0,http://www.energybulletin.net/news.php?author=&keywords=###&cat=0&action=search,";
            sengine[15]= "Xinhua,0,http://search.xinhuanet.com/search/xhse.jsp?sw=###,";
            break;


            case 3:
            sengine[0] = "Google,0,http://news.google.com/news?hl=en&ned=us&q=###&btnG=Search+News,";
            sengine[1] = "MSN,0,http://search.msn.com/news/results.aspx?q=###&FORM=MSNH,";
            sengine[2] = "Yahoo All News,0,http://news.search.yahoo.com/search/news?p=###&btn=Yahoo%21+Search&tab=News&fr=my-vert-news-top,";
            sengine[3] = "Highbeam,0,http://www.highbeam.com/web/web_search.asp?FN=WS&q=###&submit.x=23&submit.y=12&submit=submit&chn=3,";
            sengine[4] = "Yahoo News,0,http://news.search.yahoo.com/news/search?p=###+source%3Ayahoo&ei=UTF-8&fr=my-vert-news-top&fl=0&x=wrt,";
            sengine[5] = "Clusty,2,http://clusty.com/search?v%3aproject=clusty-news&query=###,";
            sengine[6] = "Ask,0,http://news.ask.com/news?qsrc=1&o=0&q=###&news=true,";
            sengine[7] = "Mamma,0,http://www.mamma.com/MammaNews?qtype=4&action=doSearch&sort=date&removeDuplicates=on&removeSimilar=on&category=g&query=###,";
            sengine[8] = "Topix,0,http://www.topix.net/search/?q=###&x=27&y=13,";
            sengine[9] = "Dogpile,4,http://www.dogpile.com/info.dogpl/search/news/###/1/-/1/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/411/top,";
            sengine[10] = "Windows Live,2,http://search.live.com/#q=###&scope=news&offset=1,";
            sengine[11]= "Accoona,0,http://accoona.com/search.jsp?qt=###&col=mc&charset=utf-8&la=en,";
            break;

            case 4:
            sengine[0] = "Clusty,0,http://clusty.com/search?v%3Aproject=clusty-blogs&query=###,";
            sengine[1] = "Google,0,http://blogsearch.google.com/blogsearch?hl=en&q=###&btnG=Search+Blogs,";
            sengine[2] = "Feedster,2,http://www.feedster.com/search/###,";
            sengine[3] = "BlogPulse,0,http://www.blogpulse.com/search?query=###&image22.x=0&image22.y=0,";
            sengine[4] = "Technorati,2,http://www.technorati.com/search/###,";
            sengine[5] = "IceRocket,0,http://blogs.icerocket.com/search?q=###,";
            sengine[6] = "DayPop,0,http://www.daypop.com/search?q=###&search=Search&t=w,";
            sengine[7] = "Blogger,0,http://search.blogger.com/?q=###&btnG=Search+Blogs&hl=en&ui=blg,";
            sengine[8] = "Blog SE,0,http://www.blogsearchengine.com/search.php?q=###&tab=blog,";
            sengine[9] = "Bloogz,0,http://www.bloogz.com/cerca2.php?q=###&found_in=blog&submit=Search&n_ricerca=1&tipo=1&lingua_sel2=EN&lingua_sel=ALL&option_sel=score,";
            sengine[10]= "BlogHub,0,http://www.bloghub.com/cgi-bin/search.cgi?query=###&catid=All+Categories&submit=Search%21,";
            break;

            case 5:
            sengine[0] = "DMOZ,0,http://search.dmoz.org/cgi-bin/search?search=###,";
            sengine[1] = "Wikipedia,0,http://en.wikipedia.org/wiki/Special:Search?search=###&fulltext=Search,";
            sengine[2] = "Google,0,http://www.google.com/search?q=###&btnG=Search+Directory&hl=en&cat=gwd%2FTop,";
            sengine[3] = "Search.com,0,http://www.search.com/dir?q=###&tag=se.dir.box.main.search&pathname=Top,";
            sengine[4] = "Yahoo,0,http://search.yahoo.com/search/dir?p=###&sm=Yahoo%21+Search&fr=FP-tab-dir-t&toggle=1&cop=&ei=UTF-8,";
            sengine[5] = "SourceGuide,0,http://www.google.com/custom?hl=en&lr=&ie=ISO-8859-1&oe=ISO-8859-1&client=pub-0596800834414887&cof=FORID%3A1%3BL%3Ahttp%3A%2F%2Fenergy.sourceguides.com%2Fimages%2FtheSource.gif%3BLH%3A33%3BLW%3A609%3BGL%3A1%3BBGC%3AFFFFFF%3BT%3A%23000000%3BLC%3A%230000ff%3BVLC%3A%23663399%3BALC%3A%230000ff%3BGALT%3A%23008000%3BGFNT%3A%230000ff%3BGIMP%3A%230000ff%3BDIV%3A%230000ff%3BLBGC%3AFFFFFF%3BAH%3Acenter%3BS %3Ahttp%3A%2F%2Fwww.sourceguides.com%3B&domains=SourceGuides.com&q=###&btnG=Search&sitesearch=SourceGuides.com,";
            sengine[6] = "Export Bureau,0,http://www.exportbureau.com/search.html?searchstring=###&country=all&submit=Search,";
            sengine[7] = "Jayde,0,http://directory.jayde.com/search?a=0&query=###&search=search,";
            sengine[8] = "PES Wiki,0,http://peswiki.com/index.php/Special:Search?search=###&go=Go,";
            sengine[9] = "Accoona Bus.,0,http://accoona.com/search.jsp?aOnly=null&campaign=null&control=null&affTrack=null&col=bc&charset=utf-8&la=en&order=&supertarget=&qt=###,";
            break;

            case 6:
            sengine[0] = "Google News,0,http://news.google.com/news?hl=en&ned=us&q=###&btnG=Search+News,";
            sengine[1] = "Yahoo News,0,http://news.search.yahoo.com/search/news?p=###&sm=Yahoo%21+Search&fr=FP-tab-news-t&toggle=1&cop=&ei=UTF-8,";
            sengine[2] = "MSN News,0,http://search.msn.com/news/results.aspx?q=###&FORM=QBNR3,";
            sengine[3] = "Wired News,2,http://www.wired.com/support/search.html?query=###,";
            sengine[4] = "HighBeam News,0,http://www.highbeam.com/library/search.asp?FN=HP&ctrlInfo=Round20%3AMode20c%3AHP%3ASearch&q=###&submit.x=0&submit.y=0&submit=submit&search_documents=on&search_images=on&search_reference=on,";
            sengine[5] = "IceRocket News,2,http://www.icerocket.com/search?tab=news&q=###,";
            sengine[6] = "Feedster Blogs,2,http://www.feedster.com/search/###,";
            sengine[7] = "Blogpulse ,0,http://www.blogpulse.com/search?query=###&image22.x=14&image22.y=9,";
            sengine[8] = "Yahoo Blog Search ,0,http://blog.news.search.yahoo.com/blog/search?&ei=UTF-8&p=###&fr=moreblog,";
            sengine[9] = "BlogDigger,0,http://www.blogdigger.com/search.jsp?q=###&sortby=date,";
            sengine[10] = "Google Blogger,0,http://search.blogger.com/?ui=blg&q=###,";
            sengine[11] = "Ice Rocket Blogs,0,http://blogs.icerocket.com/search?q=###,";
            sengine[12] = "Ice Rocket Web,0,http://www.icerocket.com/search?tab=web&q=###,";
            sengine[13] = "MSN Web,0,http://search.msn.com/results.aspx?q=###+%7Bfrsh%3D100%7D&FORM=QBRE,";
            break;
            }

            document.engines.sWeb1.options.length = 0;// clears list
            i=sengine.length;

             for(i=0;i<sengine.length;i++) // populates the select control
                {
                    document.engines.sWeb1.options.length ++;
                    document.engines.sWeb1.options[i].value = i+1;
                    document.engines.sWeb1.options[i].text = sengine[i].split(",")[0];
                }

    return;
}

//////////////////////////////////////
function goRSS()
{
     fillfocusarray();

      i=document.engines.focus.options.selectedIndex; // get selected focus
      ss= sfocus[i]; //get focus words
      if(i>1) ss+=" ";
      ss= ss+document.engines.query.value;     //add to the original search string
      i=document.engines.info.options.selectedIndex;  // get selected type
  
     if(i==6)// valid rss 
     {
      i=document.engines.sWeb1.options.selectedIndex;  // get selected engine
      ts = rengine[i].split(",")[2];     //get its template string
      etype = rengine[i].split(",")[1];     //get its type
      }
     else
     {
      i=document.engines.sWeb1.options.selectedIndex;  // get selected engine
      ts = sengine[i].split(",")[2];     //get its template string
      etype = sengine[i].split(",")[1];     //get its type
     }

      if (etype==99) return; // skip type 99
      subURL(etype,ts,0);  //no open window
    return;
}

//////////////////////////////////////
function goURL()
{
      fillfocusarray();

      i=document.engines.focus.options.selectedIndex; // get selected focus
       ss= sfocus[i]; //get focus words
      if(i>1) ss+=" ";
      ss= ss+document.engines.query.value;     //add to the original search string
      i=document.engines.sWeb1.options.selectedIndex;  // get selected engine
      ts = sengine[i].split(",")[2];     //get its template string
      etype = sengine[i].split(",")[1];     //get its type
      if (etype==99) return; // skip type 99
      subURL(etype,ts,1);  //open window
    return;
}

///////////////////////////////////////////////////////////////////

function subURL(etype,ts,cmd) // type & template string input, open window output
{
    var uu;                 // new url string
    var ux=ts;            //copy template string
    var ow=cmd;            //copy mode
    var cw="nav";             //window base name

    var term = sform(etype,ss);     // format the search string


    var csi = new RegExp("###");    //setup the regexp string
    uu = (ux.replace(csi,term));    //replace 'tag' with search term
    cw=cw+wc;             //append # to base name

//   document.write( uu );//debug

    // uu now holds the new URL

    document.engines.rss.value=uu;
    if (ow==1) childWin=open(uu,cw,"titlebar,toolbar,scrollbars,menubar,status,resizable,directories,location"); //open window
    wc=wc+1; //window counter
    return;
}

//////////////////////////////////////////////////////////////////



function sform(etype,ss) // process the input string and format it
{
    var c;         //regexp string
    var f;         //replacement string
    var s1;         //replace 1
    var s="";         //replace
    if(etype==0)
    {
    // type 0 -- quotes are replaced with %22  AND  spaces become + signs
        c = new RegExp('"','g');         //setup the regexp string
        f = "%22";                 //setup the replacement string
        s1= (ss.replace(c,f));             //replace

        c = new RegExp(' ','g');         //setup the regexp string
        f = "+";                 //setup the replacement string
        s=(s1.replace(c,f));             //replace
    }
    else if (etype==1) //type 1 -- quotes are eliminated  AND  spaces become + signs
    {
        c = new RegExp('"','g');         //setup the regexp string
        f = "";                     //setup the replacement string
        s1= (ss.replace(c,f));             //replace

        c = new RegExp(' ','g');         //setup the regexp string
        f = "+";                 //setup the replacement string
        s=(s1.replace(c,f));             //replace
    }
    else if (etype==2) //type 2 -- quotes are replaced with %22  AND  spaces are replaced with %20
    {
        c = new RegExp('"','g');         //setup the regexp string
        f = "%22";                 //setup the replacement string
        s1= (ss.replace(c,f));             //replace

        c = new RegExp(' ','g');         //setup the regexp string
        f = "%20";                 //setup the replacement string
        s=(s1.replace(c,f));             //replace
    }
    else if (etype==3) //type 3 -- spaces are replaced with %20 (quotes remain!)
    {
        c = new RegExp(' ','g');         //setup the regexp string
        f = "%20";                 //setup the replacement string
        s=(ss.replace(c,f));             //replace
    }
    else if (etype==4) //type 4 -- quotes are replaced with %2522  AND  spaces are replaced with %2B
    {
        c = new RegExp('"','g');         //setup the regexp string
        f = "%2522";                 //setup the replacement string
        s1= (ss.replace(c,f));             //replace

        c = new RegExp(' ','g');         //setup the regexp string
        f = "%2B";                 //setup the replacement string
        s=(s1.replace(c,f));             //replace
    }

    return s;  //return the formatted search string
}

