function buildText(){
   var parent = document.getElementById("placeholder");
   var form = document.createElement("form");
   form.setAttribute("method","get");
   form.setAttribute("action","http://bookweb.northoftheyarra.com.au/bookweb/catalog.cgi");
   /*create search button*/
   var search = document.createElement("button");
   search.id = "search";
   var buttonText = document.createTextNode("Search");
   search.appendChild(buttonText);
   if(isIE){
      search.attachEvent('onclick',submitForm);
   }
   form.appendChild(search);

   /*create input for search*/

   var stext = document.createElement("input");
   stext.setAttribute("type","hidden");
   stext.id = "STEXT";
   stext.name = "STEXT";
   form.appendChild(stext);

   var stype = document.createElement("input");
   stype.setAttribute("type","hidden");
   stype.id = "STYPE";
   stype.name = "STYPE";
   stype.value = "SU";
   form.appendChild(stype);

   /*create subject search selector*/
   var selector = document.createElement("select");
   selector.id = "select1";

   for(var i=0;i<SubjectMenu.length;i++){
      if(SubjectMenu[i][indexPC]=="SG"){
         var option = document.createElement("OPTION");
         var text = document.createTextNode(DropDownText[1]);
         option.selected = true;
         option.value = SubjectMenu[i][indexPC];
         option.appendChild(text);
         option.selected=true;
         selector.appendChild(option);
      }
   } 
   for(var i=0;i<SubjectMenu.length;i++){
      if(SubjectMenu[i][indexStudyGuide]!=""){
         var option = document.createElement("OPTION");
         var text = document.createTextNode(SubjectMenu[i][1]);
         option.value = SubjectMenu[i][indexStudyGuide];
         option.appendChild(text);
         selector.appendChild(option);
      }
   }   
   if(isIE){
      selector.attachEvent('onchange',updateInputs);
   }
   else{
      selector.onchange = updateInputs;
   }
   form.appendChild(selector);
   parent.appendChild(form);
   updateInputs();
}

function updateInputs(){
   document.getElementById("STEXT").value= document.getElementById("select1").value;
}

function submitForm(){
   
   document.forms[0].submit();
}
