var txt='';
txt+='<form name="searchForm" onSubmit="return checkFields()">Find: <input name="searchText" type="text" size="50" /> with: <select name="whichEngine" onchange="checkFields()">';
txt+='<option selected="selected">Google</option><option>Altavista</option><option>Mamma</option><option>Lycos</option>';
txt+='</select> <input type="Submit" value="GO"></form>';
document.write(txt);
var message = "";

function checkFields() {
    var searchString = document.searchForm.searchText.value;
    var searchEngine = document.searchForm.whichEngine.selectedIndex;

    if (searchString == "") {
        message = "Enter your search term here";
        document.searchForm.searchText.value = message;
        document.searchForm.searchText.focus();
        document.searchForm.searchText.select();
    }
    else {
        startSearch(searchString, searchEngine);
    }
return false;
}

function startSearch(searchString, searchEngine) {
    if(searchEngine == 0){finalSearchString = "http://www.google.com/search?q=" + searchString + "&btnG=Google+Search";window.open(finalSearchString);}
    if(searchEngine == 1){finalSearchString = "http://www.altavista.com/web/results?q=" + searchString;window.open(finalSearchString);}
    if(searchEngine == 2){finalSearchString = "http://search.mamma.com/Mamma?query=" + searchString;window.open(finalSearchString);}
    if(searchEngine == 3){finalSearchString = "http://www.lycos.com/cgi-bin/pursuit?query=" + searchString + "&backlink=639";window.open(finalSearchString);}
}