﻿/// <reference path="../../jQuery-vsdoc.js" />
function vod(){}

//encodeURIComponent可以还处理utf-8编码
function EncodeURL(str){
	return encodeURIComponent(str).replace(/\+/g,"%2b");
}
function escape2(str){
	return escape(str).replace(/\+/g,"%2b");
}

//获取地区
function getSubAreas(provinces, citys) {
	$("#"+citys).get(0).length = 1;
	if($("#"+provinces).get(0).selectedIndex==0 || $("#"+provinces).val()==""){
		//当一级菜单未选中时，二级菜单仅保留提示项
		return;
	}
	$.ajax({
	    url: "/common/ajax.aspx",
	    type: "GET",
	    cache: false,
	    dataType: "text",
	    data: { action: "getSubAreas", prid: EncodeURL($("#"+provinces).val()) },
	    success: function(transport) {
	        if (transport != "0") {//获取成功后，将数据填充到二级下拉框
	            var _arr = eval("(" + transport + ")");
	            for (var i = 0; i < _arr.length - 1; i += 2)
	            {
	                with ($("#"+citys).get(0))
	                {
	                    options[options.length] = new Option(_arr[i], _arr[i + 1]);
	                }
	            }
	        }
	    }
	});

}
