
function setform()
{
    query = document.getElementById('where').options[document.getElementById('where').selectedIndex].value;

    document.getElementById('search').action = query;

    document.getElementById('search').submit();
}


document.write(
'<form id="search" method="get" action="search.php" style="display:inline;" target="_blank">'+
'<input type="text" id="word" name="q" style="width: 200px;" /> '+
'<select id="where" onchange="document.getElementById(\'word\').name = this.options[this.selectedIndex].label;">'+
'<option label="q" value="http://www.google.pl/search">Google.pl</option>'+
'<option label="qt" value="http://szukaj.onet.pl/query.html">Onet.pl</option>'+
'<option label="szukaj" value="http://szukaj.wp.pl/szukaj.html">WP.pl</option>'+
'<option label="q" value="http://www.google.interia.pl/szukaj">Interia.pl</option>'+
'</select> <input type="button" onclick="setform();" value="Search" />'+
'</form>');
