function changeval(obj) {
/* written by Aidan Thomson, 2005 for Zeta-Commerce */
   var type = obj[obj.selectedIndex].value;
   var objid = obj.id;var types; var ids;var changeid;
   if (objid == "searchPageCountry" || objid == "searchFPageCountry") {
      var typesA = new Array(3);
      var idsA = new Array(3);
      var changeidA = new Array(3);
      if (type==-1) {
         typesA[0] = 'type01';
         idsA[0] = 'ida01';
         typesA[2] = 'typed';
         idsA[2] = 'idtd';
         typesA[1] = 'type01';
         idsA[1] = 'idt01';
      }
      else {
         typesA[0] = "area"+type;
         idsA[0] = 'ida'+type;
         typesA[2] = 'type'+type;
         idsA[2] = 'idc'+type;
         typesA[1] = 'type01';
         idsA[1] = 'idt0';
      }
      changeidA[0] = 'searchArea';
      changeidA[2] = 'searchPageType';
      changeidA[1] = 'searchLocation';
      var y=0;
      if (objid == "searchFPageCountry") y=2;
      else y=3;
      var x=0;
      for (x=0; x<y; x++) {
         changeobject(objid, changeidA[x], typesA[x], idsA[x]);
      }
   }

   if (objid == "searchCountry") {
      if (type==-1) {
         types = 'typed';
         ids = 'idtd';
      }
      else {
         types= 'type'+type;
         ids = 'idc'+type;
      }
      changeid = 'searchType';
      changeobject(objid, changeid, types, ids);
   }

   if (objid == "searchArea") {
      if (type==-1) {
         types = 'type01';
         ids = 'idt0';
      }
      else {
         types= 'town'+type;
         ids = 'idt'+type;
      }
      changeid = 'searchLocation';
      changeobject(objid, changeid, types, ids);
   }
//   if (objid == "searchArea") {
//      var types= 'type'+type;
 //     var ids = 'idc'+type;
//      var changeid = 'searchLocation';

 //  }


}

function changeobject(objid, changeid, types, ids) {
   var valueArray = eval(ids);
   var optionArray = eval(types);

   for(var i=0; i<optionArray.length; i++) {
      var st = document.getElementById(changeid);
      st.options.length = 0;
      for(var j=0; j<optionArray.length; j++) {
         var val = optionArray[j];
         var val2 = valueArray[j];
         st.options[j] = new Option(val2,val);
      }
   }
}