function load_city(where, is_open,is_center) {
	var splitChar = ":,";
	var city_data = "";
	city_data = _init_city[where];
	var dat = city_data.split(splitChar.charAt(1)); // 根据设定分隔符对数据做第一次分隔，获得数据项数组
	var html = []; // 格式化数据存放容器，为了提高效率，使用了数组
	var ss = [];
	if(is_center==1)
	{
			var windowWidth = document.body.clientWidth;
			var windowHeight = document.body.clientHeight;
			var popupHeight = $("#pldd").height();
			var popupWidth = $("#pldd").width();
			//centering
			$("#pldd").addClass("mydiv");
			html.push('<div id="top"><div class="month">你还没有选择送达城市，请选择！</div><div class="btn">');
			html.push('<a href="javascript:closeCity()"><img src="../../imagesnew/city/del.gif" width="30" height="27" /></a></div></div><div class="name">');
			html.push('<a class="" id="citys_0" href="javascript:load_city(0,1,1)">热门</a><a class="" id="citys_1" href="javascript:load_city(1,1,1)">A-G</a><a class=""  id="citys_2" href="javascript:load_city(2,1,1)">H-L</a>');
			html.push('<a class="" id="citys_3" href="javascript:load_city(3,1,1)">M-T</a><a class="" id="citys_4" href="javascript:load_city(4,1,1)">W-Z</a></div><ul class="t1" id="dis_citys">');
			for (i = 0; i < dat.length; i++) 
			{
				var rs = dat[i].split(splitChar.charAt(0))

				html.push('<li><a class="" onMouseOver="javascript:change_city_style()"');
				html.push('href=javascript:change_city_dem("' + rs[0] + '","' + rs[1]
						+ '","' + rs[2] + '","' + rs[3]);
				html.push('")>');
				if(remark_red_citys.indexOf(rs[3])!=-1)
				{
					html.push('<font color="#FF0000">');
					html.push(rs[3]);
					html.push('</font>');
				}
				else
				{
					html.push(rs[3]);
				}
				html.push('</a></li>');
			}
	}
	else
	{
			$("#pldd").removeClass("mydiv"); 
			html.push('<div id="top"><div class="month">请选择送达城市</div><div class="btn">');
			html.push('<a href="javascript:closeCity()"><img src="../../imagesnew/city/del.gif" width="30" height="27" /></a></div></div><div class="name">');
			html.push('<a class="" id="citys_0" href="javascript:load_city(0)">热门</a><a class="" id="citys_1" href="javascript:load_city(1)">A-G</a><a class=""  id="citys_2" href="javascript:load_city(2)">H-L</a>');
			html.push('<a class="" id="citys_3" href="javascript:load_city(3)">M-T</a><a class="" id="citys_4" href="javascript:load_city(4)">W-Z</a></div><ul class="t1" id="dis_citys">');
			for (i = 0; i < dat.length; i++) 
			{
				var rs = dat[i].split(splitChar.charAt(0))

				html.push('<li><a class="" onMouseOver="javascript:change_city_style()"');
				html.push('href=javascript:change_city("' + rs[0] + '","' + rs[1]
						+ '","' + rs[2] + '","' + rs[3]);
				html.push('")>');
				if(remark_red_citys.indexOf(rs[3])!=-1)
				{
					html.push('<font color="#FF0000">');
					html.push(rs[3]);
					html.push('</font>');
				}
				else
				{
					html.push(rs[3]);
				}
				html.push('</a></li>');
			}
	}
	html.push('</ul><div class="cc"></div>');
	$("#pldd").html(html.join(""));

	if (where == 0) {
		$("#citys_0").attr("class", "hot");
		$("#citys_1").attr("class", "");
		$("#citys_2").attr("class", "");
		$("#citys_3").attr("class", "");
		$("#citys_4").attr("class", "");
	} else if (where == 1) {
		$("#citys_0").attr("class", "");
		$("#citys_1").attr("class", "hot");
		$("#citys_2").attr("class", "");
		$("#citys_3").attr("class", "");
		$("#citys_4").attr("class", "");
	} else if (where == 2) {
		$("#citys_0").attr("class", "");
		$("#citys_1").attr("class", "");
		$("#citys_2").attr("class", "hot");
		$("#citys_3").attr("class", "");
		$("#citys_4").attr("class", "");
	} else if (where == 3) {
		$("#citys_0").attr("class", "");
		$("#citys_1").attr("class", "");
		$("#citys_2").attr("class", "");
		$("#citys_3").attr("class", "hot");
		$("#citys_4").attr("class", "");
	} else if (where == 4) {
		$("#citys_0").attr("class", "");
		$("#citys_1").attr("class", "");
		$("#citys_2").attr("class", "");
		$("#citys_3").attr("class", "");
		$("#citys_4").attr("class", "hot");

	}
	if (_city_open == 0 && is_open == 0) {
		_city_open = 1;
		//closeDiv();
		closeDivservice();
		$("#pldd").fadeIn("slow");

	} else if (is_open == 0 && _city_open == 1) {
		closeCity();
	}

}
function change_city_dem(provinceId, provinceName, cityId, cityText) 
{
	if (cityId == "" || cityText == null) {
		provinceId = "3";
		provinceName = "北京";
		cityId = "124";
		cityText = "北京";
	}
	// 使用AJAX处理区域session
	$.ajax( {
				url : "../ajax/locationAjaxAction!addSessionLocationCity.action",
				type : 'post',
				dataType : 'json',
				timeout : 20000,
				data : {
					locationCityId : cityId,
					locationCityName : cityText,
					locationProvinceId : provinceId,
					locationProvinceName : provinceName,
					changeCity : "1"
				},
				error : function() {
				},
				success : function() {
					$("#show_city").html(cityText);
					closeCity();
					showDivservicedem();	
				}
			});

}
function change_city(provinceId, provinceName, cityId, cityText) { // ajax处理选择城市的session

	if (cityId == "" || cityText == null) {
		provinceId = "3";
		provinceName = "北京";
		cityId = "124";
		cityText = "北京";
	}
	// 使用AJAX处理区域session
	$.ajax( {
				url : "../ajax/locationAjaxAction!addSessionLocationCity.action",
				type : 'post',
				dataType : 'json',
				timeout : 20000,
				data : {
					locationCityId : cityId,
					locationCityName : cityText,
					locationProvinceId : provinceId,
					locationProvinceName : provinceName,
					changeCity : "1"
				},
				error : function() {
				},
				success : function() {
					$("#show_city").html(cityText);
					closeCity();
					//showDiv();
					showDivservice();
				}
			});
}

function closeCity() {
	_city_open = 0;
	$("#modal_div").remove();
	$("#pldd").fadeOut("slow");
}
function change_city_style() {
	$(this).attr("class", 'over');

}

function is_exists_city(changeCity) {
	if (changeCity == 0 || changeCity == undefined) {
		load_city(0,0,1);
		var windowWidth = window.screen.width;
		var windowHeight = document.body.clientHeight;
		var modal_div='<div id="modal_div"  style="left:0;top:0;height:'
			+windowHeight+'px;width:'+windowWidth+'px;position:absolute;background:#fff;filter:alpha(opacity=25);opacity:0.50;margin:0 auto"></div>';
		$("body").append(modal_div);
	}
}
