// JavaScript Document

var a = new Array();

a[0] = new Array(
	 0,"-- ทั้งหมด/All --",
   	101,"บ้านเดี่ยว/บ้านแฝด",
   	102,"คอนโดมิเนียม/ห้องชุด",
   	103,"ทาวน์เฮ้าส์",
   	104,"อพาร์ทเมนต์"
);
a[1] = new Array(
	 0,"-- ทั้งหมด/All --",
   	201,"อาคารพาณิชย์",
   	202,"โฮมออฟฟิต/ทาวน์โฮม",
   	203,"โกดัง/คลังสินค้า",
   	204,"โรงงาน"
);
a[2] = new Array(
 	0,"-- ทั้งหมด/All --",			 
   	"LCH","ที่ดินสร้างบ้าน",
   	"LCC","ที่ดินพาณิชย์",
   	"LST","ที่ดินทำคอนโดฯ,หอพัก, ห้องเช่า",
   	"LCP","ที่ดินทำโครงการ",
   	"LCR","ที่ดินริมทะเล/ภูเขา",
   	"LCG","ที่ดินไร่/สวน/พืช/การเกษตร",
   	"LFR","ที่ดินให้เช่า",
   	"LOT","ที่ดินลงทุนอื่นๆ"
);

function clearcombo(elem){
var i;
for (i = elem.options.length - 1; i >= 0; i--) elem.options[i] = null;
elem.selectedIndex = -1;
}

function populatelist2(elem, index){
for (var i = 0; i < a[index].length; i= i + 2){
  elem.options[elem.options.length] = new Option(a[index][i + 1], a[index][i]);
}
}
function clicklist(elem){
clearcombo(document.frmSearch.sub_type)
populatelist2(document.frmSearch.sub_type, elem.selectedIndex);
return true;
}

