 function add(){
	 
 }
 
//$(function(){
////	LoadingProvinceList();
//});
 
function LoadingProvinceList(){
	$.ajax({
		 type:"POST",
		 url:"getProvince.do",
		 data:inputValue,
		 error:function(){
			 alert("获取省份列表失败");
			 return;
		 },
		 success:function(data){
			 $("#provinceContextChoose").empty();
			 for(var i=0;i<data.length;i++){
				 var province = data[i];
				 $("#provinceContextChoose").append("<li id="+province.cityCode+" onclick=\"getProvinceChoosedCode(this)\">"+province.cityName+"</li>");
			 }
			 getSelectContent();
		 }
	 });
}
 
function selpro(obj){
	 var provinceCode = $(obj).attr("code");
	 $("#keyword-province-code").val(provinceCode);
 }
 
 function saveInfo(){
	 //隐藏的input
	 var v3 = $("#hosCityCode").val();
	 var v4 = $("#hosProvince").val();
	 if(v3==""||v3==null){
		 $("#hosCityCode").val($("#divhospCityCode_code").val());
	 }
	 
	 if(v4==""||v4==null){
		 $("#hosProvince").val($("#divhosProvince_code").val());
	 }
	 
	 //获取输入
	 var hospitalName = $("#hospitalName").val();//医院名称
	 var hosProvince = $("#hosProvince").val();
	 var hosCityCode = $("#hosCityCode").val();
	 var hosAddress =  $("#hosAddress").val();//医院地址
	 var hosContactPhone = $("#hosContactPhone").val();//医院联系电话
//	 var hosPostcode = $("#hostPostcode").val();//医院邮编
	 var hospitalAttr=$("#divhospitalAttrCode_code").val();      // 外部属性
//	 var hospitalType=$("#divhospitalCapitalCode_code").val();	 // 外部类型
	 var hospitalLevel=$("#divhospitalLevelCode_code").val();	 // 外部等级
	 var hospitalLevelCode = $("#hospital-level-code").attr("code");    // 医院级别
	 var hospitalEconomicType = $("#hospital-economic-type").attr("code");   // 医院经济类别
	 
	 var headOrBranch = $("#head-or-branch").attr("code");
	 var medicalInsuranceType = $("#medical-insurance-type").attr("code");
	 
//	 var hospitalLevel = $("#hospital-level-code").val();
	 
	 if(hospitalLevel!=undefined){
		 hospitalLevelCode=hospitalLevel;
	 }
	 
	 var hospitalAttrCode = $("#hospitalAttrCode").val();//医院属性
	 if(hospitalAttr!=undefined){
		 hospitalAttrCode=hospitalAttr;
	 }
	 var keyDepartment =  $("#keyDepartment").val();//重点科室
	 var isBlacklistString = $("#isBlacklist").html();//是否黑名单
	 var isSpecialHospitalString = $("#isSpecialHospital").html();//是否定点医院
	 var addBlacklistReason = $("#addBlacklistReason").val();//加入黑名单原因
	  var isBlacklist = null;
	  
	  if(isBlacklistString=="是"){
		  isBlacklist = "Y";
	  }else if(isBlacklistString=="否"){
		  isBlacklist = "N";
	  }else{
		  isBlacklist = "";
	  }
	  
	  var isSpecialHospital = null;
	 
	  if(isSpecialHospitalString=="是"){
		  isSpecialHospital = "Y";
	  }else if(isSpecialHospitalString=="否"){
		  isSpecialHospital = "N";
	  }else{
		  isSpecialHospital = "";
	  }
	 
	  if(hospitalName == "" || hospitalName == null){
		  alert("请输入医院名称");
		  return false;
	  }

	  
/*	 var errorMessage = "";
	 if(hospitalName==""){
		 errorMessage = "医院名称 ";
	 }
	 */
/*	 var provcode = $("#province").attr("provCode");
	 var citycode = $("#citySpan").attr("citycode");*/
	 
/*	 if(hosProvince==""||hosProvince==null){
	     if(provcode==null||provcode==""){
		 errorMessage = errorMessage+"所在省 ";
	     }
	 }
	 
	 if(hosCityCode==""||hosCityCode==null){
	    if(citycode==null||citycode==""){
		 errorMessage = errorMessage + "所在市 ";
	    }
	 }
	 if(hosAddress==""||hosAddress==null){
		 errorMessage = errorMessage + "医院地址 ";
	 }
	 if(hosContactPhone==""||hosContactPhone==null){
		 errorMessage = errorMessage + "联系电话 ";
	 }*/
//	 if(hosPostcode==""||hosPostcode==null){
//		 errorMessage = errorMessage + "邮编 ";
//	 }
//	 
/*	 if(hospitalLevelCode==""||hospitalLevelCode==null){
		 hospitalLevelCode="08";
	 }
	 
	 if(hospitalAttrCode==""||hospitalAttrCode==null){
		 errorMessage = errorMessage + "医院属性 ";
	 }*/
//	 if(hospitalCapitalCode==""||hospitalCapitalCode==null){
//		 errorMessage = errorMessage + "医院性质 ";
//	 }
/*	 if(keyDepartment==""||keyDepartment==null){
		 errorMessage = errorMessage + "重点科室 ";
	 }
	 if(isBlacklist==""||isBlacklist==null){
		 errorMessage = errorMessage + "是否黑名单 ";
	 }
	 if(isSpecialHospital==""||isSpecialHospital==null){
		 errorMessage = errorMessage + "是否定点医院  ";
	 }
	 if(isBlacklist=="Y"&&addBlacklistReason==""){
		 errorMessage = errorMessage + "加入黑名单原因 ";
	 }*/
	 
/*	 if(errorMessage!=""){
		 alert(errorMessage+"不能为空，请输入");
		 return;
	 }*/
	 
	 //验证医院信息表单字段输入是否正确
	 if(strlength(hospitalName)>120){
		 alert("医院名称不能超过60个汉字");
		 return;
	 }
	 if(strlength(hosAddress)>300){
		 alert("地址不能超过150个汉字");
		 return;
	 }
	 if(strlength(hosContactPhone)>30){
		 alert("电话号码不能超过30位");
		 return;
	 }
/*	 if(strlength(hosPostcode)!=6){
		 alert("邮编必须为6位");
		 return;
	 }*/
	 if(strlength(addBlacklistReason)>600){
		 alert("黑名单原因不能超过三百个汉字");
		 return;
	 }
	 if(strlength(keyDepartment)>1000){
		 alert("重点科室不能超过500个汉字");
		 return;
	 }
	 
	 //组装JSON
	 var inputValue = {"hospitalName":hospitalName,
			           "hosProvince":hosProvince,
			           "hosCityCode":hosCityCode,
			           "hosAddress":hosAddress,
			           "hospitalCode":hospitalCode,
			           "hosContactPhone":hosContactPhone,
//			           "hosPostcode":hosPostcode,
			           "hospitalLevelCode":hospitalLevelCode,
			           "hospitalAttrCode":hospitalAttrCode,
//			           "hospitalCapitalCode":hospitalCapitalCode,
			           "keyDepartment":keyDepartment,
			           "isBlacklist":isBlacklist,
			           "isSpecialHospital":isSpecialHospital,
			           "addBlacklistReason":addBlacklistReason,
			           "hospitalEconomicType":hospitalEconomicType,
			           "headOrBranch":headOrBranch,
			           "medicalInsuranceType":medicalInsuranceType
	                   };
	 //AJAX提交
	 $.ajax({
		 type:"POST",
		 url:"saveHospitalInfo.do",
		 data:inputValue,
		 error:function(){
			 alert("保存失败！");
			 return;
		 },
		 success:function(data){
			 if(data.result =='exists'){
				 alert("已存在");
				 return;
			 }else if(data.result =='success'){
				 installToForm();
				 alert("保存成功!");
			 }else{
				 alert(data.result);
				 return;
			 }
		 }
	 });
 }
 
 //医院信息查询
 function queryHosiptal(){
  var params = {};
		if(hospitalName==1){
			params['hospitalName'] = $("#input").val();
		}else if(hospitalName==2){
			params['hosProvince'] = $("#keyword-province-code").val();
		}else{
			alert("请选择查询条件，并输入关键词");
  			return;
		}
		
		if($("#input").val()==""){
			alert("请输入关键词!");
			return;
		}
		$("#keyword-hospital-name").val($("#input").val());
  		$("#content").html("");
		
  		SkipByPost("hospitalinfoquery.do",{"hospitalName":$("#keyword-hospital-name").val(),"hosProvince":$("#keyword-province-code").val()});
  		 
/*		$.ajax({
			type:"POST",
			url:"hospitalinfoquery.do",
			data:params,
			error:function(){
				alert("查询出错");
				return ;
			},
			success:function(data){
				cleanForm();
				for(var i=0;i<data.length;i++){
					var hospital=data[i];
				
					$("#content").append(
							"<tr style=\"cursor:pointer\" id=\""+hospital.hospitalCode+"\" onclick=\"getHospitalCode(this)\">" +
								"<td>"+getIsNull(hospital.hospitalName)+"</td>" +
								"<td>"+getIsNull(hospital.headOrBranch)+"</td>" +
								"<td>"+getIsNull(hospital.medicalInsuranceType)+"</td>" +
								"<td>"+getIsNull(hospital.hospitalLevelString)+"</td>" +
								"<td>"+getIsNull(hospital.hospitalLevelString)+"</td>" +
								"<td>"+getIsNull(hospital.hospitalLevelString)+"</td>" +
								"<td>"+getIsNull(hospital.hosProvinceString)+"</td>" +
								"<td>"+getIsNull(hospital.hosCityString)+"</td>" +
								"<td>"+getIsNull(hospital.hosAddress)+"</td>" +
								"<td>"+getIsNull(hospital.hospitalLevelString)+"</td>" +
								"<td id=\""+hospital.objId+"\">"+specialHospitalSkip(hospital.isSpecialHospital,hospital.objId,hospital.hospitalCode)+"</td>" +
								"<td id=\""+"b"+hospital.objId+"\">"+hospital.isBlacklistChinese+"</td>" +
							"</tr>");
				}
				for(var i=0;i<data.length;i++){
					var hospital=data[i];
					specialHospitalSkip(hospital.isSpecialHospital,hospital.objId,hospital.hospitalCode);
				}
			}
		});*/
 }
 
 //根据选择的查询类型变换输入框,1医院名称输入框.2医院所在省下拉选择框
 var hospitalName=1;
 function selType(o){
	 var path=location.href.substring(0,location.href.lastIndexOf('/'));
		path=path.substring(0,path.lastIndexOf('/'));
	 hospitalName=o.id;
	 if(hospitalName==1){
		 $(".inputSelect").html("<input type=\"text\" class=\"input i_s_240 f float_l\" id=\"input\" onkeydown=\"enterQuery()\"/>");
	 }else{
		 $(".inputSelect").html("<input type=\"hidden\" name=\"hosProvince\" id=\"hosProvinceChoose\"/>"+
                        "<td width=\"30%\"><div id=\"divhosProvinceChoose\" class=\"selectChoose i_s_240 float_l\" "+"style=\"cursor:pointer; padding-right:25px; height:28px; border:1px solid #adadad; " +
                       "border-radius:2px; background:url('"+path+"/resources/img/icon_sel.gif') no-repeat right center;" +
                       		" behavior:url(../../js/PIE.htc)/*CSS3*/;\">"+ 
                        "<span class=\"sel_text\" id=\"provinceChoose\">请选择省份</span>"+
                          "<div class=\"sel_list i_ul_265\" style=\"display:none; height: 300px; overflow: scroll;\" >"+
                           " <ul style=\"\" id=\"provinceContextChoose\"></ul>"+
                         " </div>"+
                        "</div></td>");
		 $.ajax({
				
			 type:"POST",
			 url:"getProvince.do",
			 data:"",
			 error:function(){
				 alert("获取省份失败");
				 return;
			 },
			 success:function(data){
				 
				 for(var i=0;i<data.length;i++){
					 var province = data[i];
					 $("#provinceContextChoose").append("<li id="+province.cityCode+" onclick=\"getProvinceChoosedCode(this)\">"+province.cityName+"</li>");
				 }
				 getSelectContent();
			 }
		 });
	 }
 }
 
 function getSelectContent(){
	 $(".selectChoose").hover( function () {
			$(this).addClass("sel_over");
		},function () {
			$(this).removeClass("sel_over");
		}).on('click',function(){
			var _this = $(this),
				_bthis = $(this).find(".sel_list");
			if ( _this.attr('isopen') ) {
				_bthis.slideUp(0 , function(){
					_this.removeAttr('isopen');
				});			
			} else {
				_bthis.slideDown(0,function(){
					_this.attr('isopen',"1");
				});	
			}
		}).on('mouseleave',function(){
			var _thisa = $(this).find(".sel_list"),
				_this = $(this);
			_thisa.hide();
			_this.removeAttr('isopen');
		}),$(".selectChoose").find(".sel_list li").hover( function (){
			$(this).addClass("sel_hov");		
		},function (){
			$(this).removeClass("sel_hov");	
		}).on('click',function(){
			var _this = $(this).html();
			
			var _thisText = $(this).closest(".selectChoose").find(".sel_text");
			_thisText.html(_this);
			
		});
	 
 }
 
 function getIsNull(val){
	 if(val==null){
		 return "";
	 }
	 return val;
 }
 
 //获取HospitalCode
 var hospitalCode = "";

 function getHospitalCode(obj){
	 
	 $("#current-row-hospitalcode").val(obj.id);
	 $("#current-row-name").val($(obj).children("td:eq(0)").html());
	 //调用选中某行函数
	  choosEd(obj);
	  
      hospitalCode = obj.id;
	 installToForm();

 }
 
 //将选中列的数据扩展到编辑表单
 function installToForm(){
	 //AJAX通过医院代码 hospitalCode 获取所选医院
	 $.ajax({
		 type:"POST",
		 url:"getHospitalObj.do",
		 data:{"hospitalCode":$("#current-row-hospitalcode").val()},
		 error:function(){
			 alert("获取医院信息错误");
			 return;
		 },
		 success:function(data){
			 
		if(data.length>0){
				 
			 var hospital = data[0];
			 //送入信息至输入框
			 $("#head-or-branch").html(hospital.headOrBranchCN);
			 $("#head-or-branch").attr("code",hospital.headOrBranch);
			 $("#hospital-level-code").attr("code",hospital.hospitalLevelCode);
			 
			 //医保类别
			 $("#medical-insurance-type").html(hospital.medicalInsuranceTypeCN);
			 $("#medical-insurance-type").attr("code",hospital.medicalInsuranceType);
			 
			 $("#hospital-level-code").html(hospital.hospitalLevelString);
			 $("#hospital-economic-type").html(hospital.hospitalEconomicTypeCN);
			 $("#hospital-economic-type").attr("code",hospital.hospitalEconomicType);
			 
			 $("#hospitalName").val(hospital.hospitalName);
			 
			 if(hospital.hosProvinceString!=null&&hospital.hosProvinceString!=""){
				 $("#province").html(hospital.hosProvinceString);
			 }else{
				 $("#province").html("请选择");
			 }
			 
			 if(hospital.hosCityString != null && hospital.hosCityString != ""){
				 $("#citySpan").html(hospital.hosCityString);
			 }else{
				 $("#citySpan").html("请选择");
			 }
			 
			 $("#hosProvince").val(hospital.hosProvince);
			 $("#province").attr("provcode",hospital.hosProvince);
			 $("#citySpan").attr("citycode",hospital.hosCityCode);
			 $("#hosCityCode").val(hospital.hosCityCode);
			 $("#hosAddress").val(hospital.hosAddress);
			 $("#hosContactPhone").val(hospital.hosContactPhone);
			 $("#hostPostcode").val(hospital.hosPostcode);
			 $("#hospcode").html(hospital.hospitalLevelString);//医院等级中文
			 $("#hospitalLevelCode").val(hospital.hospitalLevelCode);//医院等级代码
			 $("#hospAttr").html(hospital.hospitalAttrString);//医院属性中文
			 $("#hospitalAttrCode").val(hospital.hospitalAttrCode);//属性代码
			 $("#hospCap").html(hospital.hospitalCapitalString);//医院性质名称
			 $("#hospitalCapitalCode").val(hospital.hospitalCapitalCode);//医院性质code
			 $("#keyDepartment").val(hospital.keyDepartment);//
			 $("#isBlacklist").html(hospital.isBlacklist);
			 $("#isSpecialHospital").html(hospital.isSpecialHospital);
			 $("#addBlacklistReason").val(hospital.addBlacklistReason);
			 
			 //显示操作员
			 
			 //先清空缓存的操作员信息
			 $("#addBlacklistUser").html("");
			 $("#delBlacklistUser").html("");
			 
			 if(hospital.addBlacklistUserName!=""&&hospital.addBlacklistUserName!=null){
				 $("#addBlacklistUser").html(hospital.addBlacklistUser+" "+hospital.addBlacklistUserName);
			 }
			 $("#addBlacklistDate").html(hospital.addBlacklistShowDate);
			 $("#delBlacklistDate").html(hospital.delBlacklistShowDate);
			 
			 if(hospital.delBlacklistUser!=""&&hospital.delBlacklistUser!=null){
			 $("#delBlacklistUser").html(hospital.delBlacklistUser+" "+hospital.delBlacklistUserName);
			 }
			 }		 
		 }
	 });
 }
 
 //删除
 function deleteHospital(){
	 var hospitalCode = $("#current-row-hospitalcode").val();
	 if(hospitalCode == null || hospitalCode ==""){
		 alert("请选择要删除的列!");
		 return;
	 }
	 var name = $("#current-row-name").val();
	 if(confirm("是否删除“"+name+"”")==true){
		 
	 $("#"+hospitalCode).remove();
	 
		$.ajax({
			
			type:"POST",
			url:"deleteHospitalInfo.do",
			data:{"hospitalCode":hospitalCode},
			error:function(){
				alert("删除失败");
			
				return;
			},
			success:function(data){
				$("#current-row-hospitalcode").val("");
				$("#current-row-name").val("");
				hospitalCode = null;
				alert("已删除");
			},
		});
	 }
 }
 
 //添加
 function addHospital(){
	 //获取填写的值
	 var hospitalName = $("#hospitalName").val();
	 var hospitalProvince = $("#hosProvince").val();
	 var hospitalCityCode = $("#hosCityCode").val();
	 var hosAddress = $("#hosAddress").val();
	 var hosContactPhone = $("#hosContactPhone").val();
	 var hostPostcode = $("#hostPostcode").val();
	 var hospitalLevelType = $("#hospitalLevelType").val();
	 var hospitalAttrCode = $("#hospitalAttrCode").val();
	 var keyDepartment = $("#keyDepartment").val();
	 var isBlacklist = $("#isBlacklist").val();
	 var isSpecialHospital = $("#isSpecialHospital").val();
	 var addBlacklistReason = $("#addBlacklistReason").val();
	 
	 var parameters = {"hospitalName":hospitalName,
			           "hospitalProvince":hospitalProvince,
			           "hospitalCityCode":hospitalCityCode,
			           "hosAddress":hosAddress,
			           "hosContactPhone":hosContactPhone,
			           "hostPostcode":hostPostcode,
			           "hospitalLevelType":hospitalLevelType,
			           "hospitalAttrCode":hospitalAttrCode,
			           "keyDepartment":keyDepartment,
			           "isBlacklist":isBlacklist,
			           "isSpecialHospital":isSpecialHospital,
			           "addBlacklistReason":addBlacklistReason
			           };
	 //AJAX提交
	 $.ajax({
		 type:"POST",
		 url:"addHospitalInfo.do",
		 data:parameters,
		 error:function(){
			 alert("保存失败");
			 return;
		 },
		 success:function(data){
			 alert("保存成功");
		 }
		 
	 });
 }
 
 
//选中某行
 var hosp=null;
 function choosEd(flag){
 	
 	hosp=$(flag).attr("id");
 	$(flag).css({"background-color": "#e5e5e5","cursor":"pointer"}).siblings().css("background-color", "#FFFFFF");
 }
 //清空编写表单
 function cleanForm(){
	 hospitalCode="";
	$("#divhospCityCode_code").val("");
	$("#divhosProvince_code").val("");
	$("#hosCityCode").val("");
	$("#hosProvince").val("");
	$("#province").attr("provcode",null);
	$("#citySpan").attr("citycode",null);
	$("#hospitalName").val("");
	$("#province").html("请选择省份");
	$("#citySpan").html("请选择市");
	$("#hosAddress").val("");
	$("#hosContactPhone").val("");
	$("#hostPostcode").val("");
	$("#hospitalLevelCode").val("");
	$("#hospitalAttrCode").val("");
	$("#hospitalCapitalCode").val("");
	$("#hospcode").html("一级甲等");
	$("#hospAttr").html("请选择属性");
	$("#hospCap").html("请选择性质");
	$("#keyDepartment").val("");
	$("#isBlacklist").html("请选择");
	$("#isSpecialHospital").html("请选择");
	$("#addBlacklistReason").val("");
	$("#hospitalName").focus();
	 
 }

//当页面载入完成时获取所有省级地区
 
 $(document).ready(function(){

	 $.ajax({
	
		 type:"POST",
		 url:"getProvince.do",
		 data:"",
		 error:function(){
			 alert("获取省份失败");
			 return;
		 },
		 success:function(data){
			 
			 for(var i=0;i<data.length;i++){
				 var province = data[i];
				 $("#provinceContext").append("<li id="+province.cityCode+" onclick=\"getProvinceCode(this)\">"+province.cityName+"</li>");
			 }
			 $(".select").find(".sel_list li").hover( function (){
					$(this).addClass("sel_hov");		
				},function (){
					$(this).removeClass("sel_hov");	
				}).on('click',function(){
					var _this = $(this).html();
					
					var _thisText = $(this).closest(".select").find(".sel_text");
					_thisText.html(_this);
					
				});
		 }
	 });
 }); 
	 
//根据所选省份获取市
 function findCity(provinceCode){
	 $("#citySpan").html("请选择市");
	 $("#cityContext").html("");
	 $.ajax({
		 type:"POST",
		 url:"findCity.do",
		 data:{"provinceCode":provinceCode},
		 error:function(){
			 alert("获取市级单位失败");
			 return;
		 },
		 success:function(data){
			 for(var i=0;i<data.length;i++){
				 var city = data[i];
				 $("#cityContext").append("<li id=\""+city.cityCode+"\" onclick=\"getCityCode(this)\">"+city.cityName+"</li>");
			 }
			 //选中
			 $(".select").find(".sel_list li").hover( function (){
					$(this).addClass("sel_hov");		
				},function (){
					$(this).removeClass("sel_hov");	
				}).on('click',function(){
					var _this = $(this).html();
					
					var _thisText = $(this).closest(".select").find(".sel_text");
					_thisText.html(_this);
					
				});
		 }
		 
	 });
 }
 
 //获取所选省份
 var provinceName = null;
 var provinceCode = null;
 function getProvinceCode(obj){
	 provinceCode = obj.id;
	 
	 $("#hosCityCode").val("");
	 cityCode = "";
	 $("#hosProvince").val(provinceCode);
	 provinceName = obj.innerHTML;
	 findCity(provinceCode);
 }

//获取所选市的代码
 var cityCode = null;
 function getCityCode(obj){
	 cityCode = obj.id;
	 $("#hosCityCode").val(cityCode);
 }
 
 
 //如果是定点医院，就加跳转链接至定点医院查询页面
 function specialHospitalSkip(value,id,hospitalCode){
	 if(value=="Y"){
		 $("#"+id).html("<a onclick=\"SkipByPost(\'designatedHospitalSearch.do\',{hospitalCode:\'"+hospitalCode+"\'})\" style='color:blue'>是</a>");
	 }else{
		 $("#"+id).html("否");
	 }
 }
 
 //根据是否黑名单,禁用加入黑名单原因
 function autoTextarea(elements){
	 var id = elements.id;
	 if(id=="N"){
		 $("#addBlacklistReason").val("");
		 $("#addBlacklistReason").attr("disabled",true);
		 
	 }else{
		 $("#addBlacklistReason").attr("disabled",false);
	 }
 }
 
//回车查询
 function enterQuery(){
 	 var event = window.event||arguments.callee.caller.arguments[0];
 	 if(event.keyCode==13){
 		queryHosiptal();
 	 }
 }
 
 //获取查询条件选择省份
  var ChoosedProvinceCode = null;
 function getProvinceChoosedCode(element){
	 ChoosedProvinceCode = element.id;
	 $("#keyword-province-code").val(ChoosedProvinceCode);
 }
 
 
 

//翻页
function cur_skip(e){
	var pn = $(e).find("span").html();
	SkipByPost("hospitalinfoquery.do",{"hospitalName":$("#keyword-hospital-name").val(),"hosProvince":$("#keyword-province-code").val(),pageNumber:pn});
	$(".turn_cur").removeAttr("class");
	$(e).find("span").attr("class","turn_cur");
}

//前一页
function pre(e){
	var maxPage = $("#max").val();
	var cur = $("#nav").find(".turn_cur").html();
	if(parseInt(maxPage) == 1) return false;
//	if(parseInt(cur) == parseInt(maxPage)) return false;
	
	if(cur>1){
	var pre = Number(cur)-Number(1);
		SkipByPost("hospitalinfoquery.do",{"hospitalName":$("#keyword-hospital-name").val(),"hosProvince":$("#keyword-province-code").val(),pageNumber:pre});
	}else{
		SkipByPost("hospitalinfoquery.do",{"hospitalName":$("#keyword-hospital-name").val(),"hosProvince":$("#keyword-province-code").val(),pageNumber:maxPage});
	}
}
//下一页
function next(e){
	var cur = $("#nav").find(".turn_cur").html();
	var next = Number(cur)+Number(1);
	var maxPage = $("#max").val();
	if(parseInt(maxPage) == 1) return false;
	if(parseInt(cur) < parseInt(maxPage)){
		SkipByPost("hospitalinfoquery.do",{"hospitalName":$("#keyword-hospital-name").val(),"hosProvince":$("#keyword-province-code").val(),pageNumber:next});
	}else{
		SkipByPost("hospitalinfoquery.do",{"hospitalName":$("#keyword-hospital-name").val(),"hosProvince":$("#keyword-province-code").val(),pageNumber:"1"});
	}
}
//跳转至
function custom(){
	var pn = $.trim($("#turn_inp").val());
	if(pn == "") return;
	SkipByPost("hospitalinfoquery.do",{"hospitalName":$("#keyword-hospital-name").val(),"hosProvince":$("#keyword-province-code").val(),pageNumber:pn});
}

 