function SetInitR(idx, obj_name) {
	if (idx != 0) {
		show_r_atz_R(obj_name, 'p_city_', 'p_city_index_', idx,'โปรดเลือก (จังหวัด)');
	}
	else {
		noshow_r_atz('selProvince');
	}
}
function SetInitAdvanceSearch(idx, obj_name) {
	if (idx != 0) {
		show_r_atz_R(obj_name, 'p_city_', 'p_city_index_', idx,'ทุกจังหวัดในภาค');
	}
	else {
		noshow_r_atz('selProvince');
	}
}
function noshow_r_atz(obj_name) {
	var temp = eval("document.form." + obj_name + ";");
	var len = temp.options.length;
	for (i=1; i<len; i++) {
		temp.options.remove(1)
	}
	temp.options[0].text = '------------------------------------------';temp.options[0].value = 0; temp.options[0].selected = true;
}
function show_r_atz(obj_name, str_name, index, titlesl) {
	var str = eval( str_name + index + ".split(', ');" );
	var temp = eval( "document.form." + obj_name + ";" );
	for ( var m=temp.options.length-1; m>0; m-- ) temp.options[m] = null;
	var new_obj = new Array( str.length ); 
	for ( var i=0; i<str.length; i++ ) new_obj[i] = new Option( str[i], i+1 );
	for ( var i=1; i<str.length+1; i++ ) {temp.options[i] = new Option( new_obj[i-1].text );temp.options[i].value = temp.options[i].text;}
	temp.options[0].text= titlesl;temp.options[0].value= 0;temp.options[0].selected = true;
}
function show_r_atz_R(obj_name, str_name, str_name_value, index, titlesl) {
	var str = eval( str_name + index + ".split(', ');" );
	var str_value = eval( str_name_value + index + ".split(', ');" );
	var temp = eval( "document.form." + obj_name + ";" );
	for ( var m=temp.options.length-1; m>0; m-- ) temp.options[m] = null;
	var new_obj = new Array( str.length );
	var new_obj_value = new Array( str_value.length );
	for ( var i=0; i<str.length; i++ ) new_obj[i] = new Option( str[i], i+1 );
	for ( var i=1; i<str.length+1; i++ ) {temp.options[i] = new Option( new_obj[i-1].text ); temp.options[i].value = str_value[i-1];}
	temp.options[0].text= titlesl;temp.options[0].value= 0;temp.options[0].selected = true;
}

today = 2547;
p_city_index_01 = "01, 02, 03, 04";
p_city_index_02 = "05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22";
p_city_index_03 = "23, 24, 25, 26";
p_city_index_04 = "27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43";
p_city_index_05 = "44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57";
p_city_index_06 = "58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76";

p_city_01 = "กรุงเทพมหานคร, ปทุมธานี, นนทบุรี, สมุทรปราการ";
p_city_02 = "กาญจนบุรี, ฉะเชิงเทรา, ชัยนาท, นครนายก, นครปฐม, ประจวบคีรีขันธ์, ปราจีนบุรี, พระนครศรีอยุธยา, เพชรบุรี, ราชบุรี, ลพบุรี, สมุทรสงคราม, สมุทรสาคร, สระแก้ว, สระบุรี, สิงห์บุรี, สุพรรณบุรี, อ่างทอง";
p_city_03 = "จันทบุรี, ชลบุรี, ตราด, ระยอง";
p_city_04 = "กำแพงเพชร, เชียงราย, เชียงใหม่, ตาก, นครสวรรค์, น่าน, พะเยา, พิจิตร, พิษณุโลก, เพชรบูรณ์, แพร่, แม่ฮ่องสอน, ลำปาง, ลำพูน, สุโขทัย, อุตรดิตถ์, อุทัยธานี";
p_city_05 = "กระบี่, ชุมพร, ตรัง, นครศรีธรรมราช, นราธิวาส, ปัตตานี, พังงา, พัทลุง, ภูเก็ต, ยะลา, ระนอง, สงขลา, สตูล, สุราษฎร์ธานี";
p_city_06 = "กาฬสินธุ์, ขอนแก่น, ชัยภูมิ, นครพนม, นครราชสีมา, บุรีรัมย์, มหาสารคาม, มุกดาหาร, ยโสธร, ร้อยเอ็ด, เลย, ศรีสะเกษ, สกลนคร, สุรินทร์, หนองคาย, หนองบัวลำภู, อำนาจเจริญ, อุดรธานี, อุบลราชธานี"