codice:
<form name="test"> 
<input type="text" name="query" value=""/> 
<input type="button" value="cerca" onclick="search("google");"/> 
<input type="button" value="cerca con googleimmagini" onclick="search("googleimmagini");"/> 
<input type="radio" name="checkgroup" value="stessa scheda" checked="checked" id="samePage"  /> 
<input type="radio" name="checkgroup" value="nuova scheda" /> 
</form>  
<script type="text/javascript"> 
function search(a){
var link;
if(a=="google"){
link = "https://www.google.it/search?q=" + document.test.query.value;
}else{
link = "http://images.google.it/search?tbm=isch&hl=it&source=hp&biw=1920&bih=859&q=" + document.test.query.value;
}
if(document.getElementById('samePage').checked){
document.location.href=link;   
}else{
window.open(link); 
}  
</script>