 function checkMaincat()
  {if(document.searchform.mainsearchcat.value == 0)
     {alert("Please select a category to search."); 
      return false;
     }
   return true;
  }
   function showSubcat(show)
{if(show==1)
 {
 switch(document.searchform.mainsearchcat.value)
 {
  case "10":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("Sports",1);
   document.searchform.subcat[2]=new Option("Theater",2);
   document.searchform.subcat.length=3;
   break;
  
  case "20":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("Pre 19th Century",1);
   document.searchform.subcat.length=2;
   break;
   
  case "60":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("Cycling",1);
   document.searchform.subcat[2]=new Option("Golf",2);
   document.searchform.subcat[3]=new Option("Hunting&Fishing",3);
   document.searchform.subcat[4]=new Option("Indoor Sports",4);
   document.searchform.subcat[5]=new Option("Racquet Sports",5);
   document.searchform.subcat[6]=new Option("Shooting",6);
   document.searchform.subcat[7]=new Option("Water Sports",7);
   document.searchform.subcat.length=8;
   break; 
   case "90":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("Stamps",1);
   document.searchform.subcat[2]=new Option("Coins",2);
   document.searchform.subcat[3]=new Option("Trading Cards",3);
   document.searchform.subcat.length=4;
   break;
   
   case "100":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("Video Equip.",1);
   document.searchform.subcat[2]=new Option("Audio Equip.",2);
   document.searchform.subcat[3]=new Option("Radio",3);
   document.searchform.subcat[4]=new Option("Cameras",4);
   document.searchform.subcat[5]=new Option("Phones",5);
   document.searchform.subcat[6]=new Option("MP3",6);
   document.searchform.subcat.length=7;
   break; 
   
   case "110":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("Dogs",1);
   document.searchform.subcat[2]=new Option("Cats",2);
   document.searchform.subcat.length=3;
   break;
   
   case "120":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("RC",1);
   document.searchform.subcat[2]=new Option("Model Trains",2);
   document.searchform.subcat[3]=new Option("Model Cars",3);
   document.searchform.subcat[4]=new Option("Military",4);
   document.searchform.subcat.length=5;
   break;
   
   case "130":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("New",1);
   document.searchform.subcat[2]=new Option("Used",2);
   document.searchform.subcat[3]=new Option("Parts",3);
   document.searchform.subcat.length=4;
   break;
   
   case "160":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("PC",1);
   document.searchform.subcat[2]=new Option("Apple",2);
   document.searchform.subcat[3]=new Option("Other",3);
   document.searchform.subcat.length=4;
   break;
   
   case "170":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("New",1);
   document.searchform.subcat[2]=new Option("Used",2);
   document.searchform.subcat[3]=new Option("Antique",3);
   document.searchform.subcat.length=4;
   break;
   
   case "180":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("Jewelry",1);
   document.searchform.subcat[2]=new Option("Accessories",2);
   document.searchform.subcat.length=3;
   break;
   
   case "190":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("Buy",1);
   document.searchform.subcat[2]=new Option("Rent",2);
   document.searchform.subcat.length=3;
   break;
   
   case "210":
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="1";
   subcatStyle.visibility="visible";
   document.searchform.subcat[0]=new Option("All",0,true);
   document.searchform.subcat[1]=new Option("Homeowner",1);
   document.searchform.subcat[2]=new Option("Contractor",2);
   document.searchform.subcat[3]=new Option("Commercial",3);
   document.searchform.subcat.length=4;
   break;
   
  default:
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="-1";
   subcatStyle.visibility="hidden";
   document.searchform.subcat[0]=new Option(" ",0,true);
   document.searchform.subcat.length=1;
   return true;
   break;
  }
  }
  if(show==0)
  {
   subcatStyle=document.getElementById("Subcat1").style;
   subcatStyle.zIndex="-1";
   subcatStyle.visibility="hidden";
   document.searchform.subcat[0]=new Option(" ",0,true);
   document.searchform.subcat.length=1;
   return true;
  } 
 }
 //For this function to work the form field to focus on must have id="focusOnStart"
 function formFocus()
 {
  if(!document.getElementById('focusOnStart')){alert('Javascript Error. Click OK to ignore.');}
  document.getElementById('focusOnStart').focus();
 }
