document.getElementById('searchBox').focus();

function checker()
{

if(document.f.list.value=="Amazon")
{document.f.q.name="field-keywords";document.f.action="http://www.amazon.co.uk/s";} 
if(document.f.list.value=="Answers")
{document.f.q.name="p";document.f.action="http://answers.yahoo.com/search/search_result";} 
if(document.f.list.value=="Ask")
{document.f.q.name="q";document.f.action="http://uk.ask.com/web?";} 
if(document.f.list.value=="Bing")
{document.f.q.name="q";document.f.action="http://www.bing.com/search";} 
if(document.f.list.value=="BBC")
{document.f.q.name="q";document.f.action="http://www.bbc.co.uk/cgi-bin/search/results.pl";} 
if(document.f.list.value=="Ebay")
{document.f.q.name="satitle";document.f.action="http://search.ebay.co.uk/search/search.dll";} 
if(document.f.list.value=="eHow")
{document.f.q.name="s";document.f.action="http://www.ehow.com/Search.aspx";} 
if(document.f.list.value=="Facebook")
{document.f.q.name="nm";document.f.action="http://www.facebook.com/srch.php";} 
if(document.f.list.value=="Google")
{document.f.q.name="q";document.f.action="http://www.google.co.uk/search";} 
if(document.f.list.value=="News")
{document.f.q.name="q";document.f.action="http://www.google.com/news";} 
if(document.f.list.value=="IMDb")
{document.f.q.name="q";document.f.action="http://imdb.com/find";} 
if(document.f.list.value=="Images")
{document.f.q.name="q";document.f.action="http://images.google.co.uk/images";} 
if(document.f.list.value=="iPlayer")
{document.f.q.name="q";document.f.action="http://www.bbc.co.uk/iplayer/search/";}
if(document.f.list.value=="Maps")
{document.f.q.name="q";document.f.action="http://maps.google.com/maps";} 
if(document.f.list.value=="Metacritic")
{document.f.method="post"; document.f.q.name="search_term";document.f.action="http://www.metacritic.com/search/all";} 
if(document.f.list.value=="Shop")
{document.f.q.name="q";document.f.action="http://www.Froogle.co.uk/products";}  
if(document.f.list.value=="Twitter")
{document.f.q.name="q";document.f.action="http://search.twitter.com/search";} 
if(document.f.list.value=="Thesaurus")
{document.f.q.name="q";document.f.action="http://thesaurus.reference.com/search";} 
if(document.f.list.value=="Wikipedia")
{document.f.q.name="search";document.f.action="http://en.wikipedia.org/wiki/";} 
if(document.f.list.value=="Yahoo!")
{document.f.q.name="p";document.f.action="http://uk.search.yahoo.com/search";} 
if(document.f.list.value=="YouTube")
{document.f.q.name="search_query";document.f.action="http://www.youtube.com/results";} 

}

function checkData(tid) {
	var x = document.getElementById("searchBox").value;
	
   switch(tid) {
      case "am":
		if (document.getElementById("ama").value == ""){
			document.getElementById("ama").value = x;}
         break;
      case "fb":
        if (document.getElementById("face").value == ""){
			document.getElementById("face").value = x;}
         break;
		       case "as":
        if (document.getElementById("ask").value == ""){
			document.getElementById("ask").value = x;}
         break;
		 		       case "an":
        if (document.getElementById("answ").value == ""){
			document.getElementById("answ").value = x;}
         break;
		 		 		       case "an":
        if (document.getElementById("answ").value == ""){
			document.getElementById("answ").value = x;}
         break;
		 		 		 		       case "eb":
        if (document.getElementById("eba").value == ""){
			document.getElementById("eba").value = x;}
         break;
		 		 		 		       case "ip":
        if (document.getElementById("ipl").value == ""){
			document.getElementById("ipl").value = x;}
         break;
		 		 		 		       case "bi":
        if (document.getElementById("bin").value == ""){
			document.getElementById("bin").value = x;}
         break;
		 		 		 		       case "bb":
        if (document.getElementById("bbc").value == ""){
			document.getElementById("bbc").value = x;}
         break;
		 		 		 		       case "fr":
        if (document.getElementById("fro").value == ""){
			document.getElementById("fro").value = x;}
         break;
		 		 		 		       case "yt":
        if (document.getElementById("ytu").value == ""){
			document.getElementById("ytu").value = x;}
         break;
		 		 		 		 		       case "go":
        if (document.getElementById("goo").value == ""){
			document.getElementById("goo").value = x;}
         break;
		 		 		 		 		       case "eh":
        if (document.getElementById("eho").value == ""){
			document.getElementById("eho").value = x;}
         break;
		 		 		 		 		       case "tw":
        if (document.getElementById("twi").value == ""){
			document.getElementById("twi").value = x;}
         break;
		 		 		 		 		       case "im":
        if (document.getElementById("ima").value == ""){
			document.getElementById("ima").value = x;}
         break;
		 		 		 		 		       case "th":
        if (document.getElementById("the").value == ""){
			document.getElementById("the").value = x;}
         break;
		 		 		 		 		 		       case "ma":
        if (document.getElementById("map").value == ""){
			document.getElementById("map").value = x;}
         break;
		 		 		 		 		 		       case "ya":
        if (document.getElementById("yah").value == ""){
			document.getElementById("yah").value = x;}
         break;
		 		 		 		 		 		 		       case "ne":
        if (document.getElementById("new").value == ""){
			document.getElementById("new").value = x;}
         break;
		 		 		 		 		 		 		 		       case "wi":
        if (document.getElementById("wik").value == ""){
			document.getElementById("wik").value = x;}
         break;
		 		 		 		 		 		 		 		 		       case "me":
        if (document.getElementById("masthead_search_term").value == ""){
			document.getElementById("masthead_search_term").value = x;}
         break;
      }
   }
   

