function getprovince(rid,pid) {
	 $.ajax({
		url:'/services/getregion',
		data:'exce=1&parent_id='+rid,
		success:function(json) {
			for(i=0;i<json.length;i++) {
				if(json[i].region_id == pid) {
					var slt;
					slt = document.getElementById('province');
					slt.options.add(new Option(json[i].region_name,json[i].region_id));
					slt.options[slt.options.length-1].selected='selected';
				} else {
					//document.getElementById('province').options.add(new Option(json[i].region_name,json[i].region_id));
					slt = document.getElementById('province');
					slt.options.add(new Option(json[i].region_name,json[i].region_id));
				}
			}
		}
	 });
 }
 
 function getcity(rid,cid) {
	 $.ajax({
		url:'/services/getregion',
		data:'parent_id='+rid,
		success:function(json) {
			document.getElementById('city').options.length = 0;
			document.getElementById('city').options.add(new Option('---请选择城市---',''));
			document.getElementById('town').options.length = 0;
			document.getElementById('town').options.add(new Option('---请选择地区---',''));
			for(i=0;i<json.length;i++) {
				if(json[i].region_id == cid) {
					var slt;
					slt = document.getElementById('city');
					slt.options.add(new Option(json[i].region_name,json[i].region_id));
					slt.options[slt.options.length-1].selected='selected';
				} else {
					//document.getElementById('city').options.add(new Option(json[i].region_name,json[i].region_id));
					slt = document.getElementById('city');
					slt.options.add(new Option(json[i].region_name,json[i].region_id));
				}
			}
		}
	 });
 }
 
 function gettown(rid,tid) {
	 $.ajax({
		url:'/services/getregion',
		data:'parent_id='+rid,
		success:function(json) {
			document.getElementById('town').options.length = 0;
			document.getElementById('town').options.add(new Option('---请选择地区---',''));
			for(i=0;i<json.length;i++) {
				if(json[i].region_id == tid) {
					var slt;
					slt = document.getElementById('town');
					slt.options.add(new Option(json[i].region_name,json[i].region_id));
					slt.options[slt.options.length-1].selected='selected';
				} else {
					//document.getElementById('town').options.add(new Option(json[i].region_name,json[i].region_id));
					slt = document.getElementById('town');
					slt.options.add(new Option(json[i].region_name,json[i].region_id));
				}
			}
		}
	 });
 }