$(function(){

	$("#submitBtn").click(function(){

		var boardId = $("#boardId").val();
		var prop = $("#prop").val();
		var name = $("#name").val();
		var sign = $("#sign").val();
		var rank = $("#rank").val();
		var status =$("#status").val();
		var nav  =$("#nav").val();
		var spend = $("#spend").val();
		var path = $("#path").val();
		if(prop=='1'){
			path='';
		}
		var params = {
				boardId:boardId,
				prop:prop,
				name:name,
				sign:sign,
				rank:rank,
				status:status,
				nav:nav,
				spend:spend,
				path:path
		};

		var _httpURL = "";
		if(boardId==''){
			_httpURL = HttpRest+"board/create.shtml";
		}else{
			_httpURL = HttpRest+"board/save.shtml";
		}
		$.ajax({
			url: _httpURL, 
			type: "post", 
			dataType: "json",
			data:$.toJSON(params),   
			contentType:"application/json",
			success: function(data) { 
				if(data.code=='01'){
					layer.confirm('保存成功！是否关闭窗口?', function(index) {
						parent.grid.loadData();
						parent.layer.close(parent.pageii);
						return false;
					});
				}else{
					layer.msg('保存失败！',{icon: 5});
				}
			}
		});
	});

	onloadurl();
});