function confirmMsg(msg,ok,url){
	$.prompt(msg,{buttons:[{title: ok,value:true},{title: '取消',value:false}], submit: function(v,m,f){if (v){window.location.href=url}} });
	return false;
}
function alertMsg(msg){
	$.prompt(msg);
	return false;
}
function ajaxdo(msg,func){
	$.prompt(msg,{
		submit: func,
		buttons: { '确定':true }
	});
}
function getCity(obj,city,selid,type,did,sd){
	$.getJSON('http://www.nicezu.com/json/jsoncity?id=' + $(obj).val() + '&parm=' + new Date() + '&callback=?',function(json){
		if (json){
			var sed;
			var cityStr = '';
			for (var i in json){
				sed = '';
				if (selid == i){
					sed = ' selected="selected"';
				}
				if (type == 'checkbox'){
					cityStr += '<label><input type="checkbox" name="open[]" value="'+i+'"'+sed+' /> '+json[i]+'</label> ';
				}else {
					cityStr += '<option value="'+i+'"'+sed+'>'+json[i]+'</option>';
				}
				if (i == '0'){
					break;
				}
			}
			$(city).html(cityStr);
			if (did){
				getDistrict(city,did,sd);
			}
		}else {
			if (open){
				$(city).html('当前省份没有未开通的城市');
			}
		}
	});
}
function getDistrict(obj,district,selid,type){
	$.getJSON('http://www.nicezu.com/json/jsondistrict?id=' + $(obj).val() + '&parm=' + new Date() + '&callback=?',function(json){
		if (json){
			var sed;
			var cityStr = '<option value="">全部</option>';
			for (var i in json){
				sed = '';
				if (selid == i){
					sed = 'selected="selected"';
				}
				if (type == 'checkbox'){
					cityStr += '<label><input type="checkbox" name="open[]" value="'+i+'"'+sed+' /> '+json[i]+'</label> ';
				}else {
					cityStr += '<option value="'+i+'"'+sed+'>'+json[i]+'</option>';
				}
				if (i == '0'){
					break;
				}
			}
			$(district).html(cityStr);
		}
	});
}
function showcity(){
	$("#showcity").css('display','block');
}
function getTab(id,obj,self,classname){
	$(obj).addClass('hidden');
	$(obj[id]).removeClass('hidden');
	$(self).removeClass(classname);
	$(self[id]).addClass(classname);
}
