Solo una traccia
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento senza titolo</title>
<script language="javascript" type="text/javascript">
//icon; action; searchfield name;
var formParameters = [
["images/google.gif", "http://www.google.it/search", "q"],
["images/yahoo.gif", "http://search.yahoo.com/search", "p"],
["images/wikipedia.gif", "http://....", "r"]
];
function showMenu(ids) {
document.getElementById(ids).style.display = "block";
}
function updateform(dstimg,elem) {
document.getElementById(elem).getElementsByTagName('img')[0].src = formParameters[dstimg][0];
document.getElementById('menu').style.display = "none";
document.getElementById(elem).getElementsByTagName('input')[0].value = "";
document.getElementById(elem).getElementsByTagName('input')[0].focus();
document.multisearch.action = formParameters[dstimg][1];
document.getElementById('searchfield').name = formParameters[dstimg][2];
}
</script>
</head>
<body>
<form name="multisearch" action="http://www.google.it/search" method="get">
<div id="textsearch">
<span style="height:18px;border:1px solid #0099FF;">
[img]images/google.gif[/img]
<input id="searchfield" type="text" style="border:0px solid #FFF;height:18px;" name="q" value="Cerca..." />
</span><input type="submit" value="Cerca..." />
</div>
<div id="menu" style="position:absolute;display:none;border:1px solid #CCC;">
<span class="highlight">[img]images/google.gif[/img] Google</span>
<span class="highlight">[img]images/yahoo.gif[/img]Yahoo!</span>
<span class="highlight">[img]images/wikipedia.gif[/img]Wikipedia</span>
</div>
</form>
</body>
</html>
nella cartella "images" ci metti le iconcine dei motori di ricerca (i nomi dei file devono corrispondere nell'array formParameters).