function submitsave(submiturl,fromurl,logintype) {	
		$(".msg").each(function(i){
			if (this.innerHTML!="*")
			     this.innerHTML = "";
		});		
		//判断标题
		if ($("input[name='title']").val().length <1) {
			$("#title_msg")[0].innerHTML = "* 标题不能为空！"; 			
            return false; 
		}
		if ($("textarea[name='detail']").val().length <1) {
			$("#detail_msg")[0].innerHTML = "* 作品内容不能为空！"; 			
            return false; 
		}		
		 //判断联系人
		if ($("input[name='contactman']").val().length <1) {
			$("#contactman_msg")[0].innerHTML = "* 请输入您的真实姓名！";
			return false;
		}	
		 //判断邮箱
		if ($("input[name='email']").val().length <1) {
			$("#email_msg")[0].innerHTML = "* 请输入您的邮箱！";
			return false;
		}
        if (logintype == 0) {
            $("#submit").attr("disabled", true);
			
        }	
		
		//表单组合字符串，如下格式
		/*
		 username: $("input[name='username']").val(), 
		 userpass: $("input[name='userpass']").val(),
         class_depths:$("input[name='class_depths']").val(),
         area_depths:$("input[name='area_depths']").val(),*/
        var evaltxt = "";
        $(".txt input").each(function(i){    
			if (this.name!= undefined && this.name!=null && this.name!=''){
			  if (evaltxt!="")
				  evaltxt += "," + this.name + ":escape($(\"input[name='" + this.name + "']\").val())";
			  else
				  evaltxt += this.name + ":escape($(\"input[name='" + this.name + "']\").val())";
			}
        });
       //select表单
      $(".txt select").each(function (j) {
		  if (this.name!= undefined && this.name!=null && this.name!='')
		  {
              if (evaltxt != "")
                  evaltxt += "," + this.name + ":escape($(\"select[name='" + this.name + "']\").val())";
              else
                  evaltxt += this.name + ":escape($(\"select[name='" + this.name + "']\").val())";
		  }
      });
      var reg = new RegExp("\n", "g");
	  //textarea表单
      $(".txt textarea").each(function (j) {
		  if (this.name!= undefined && this.name!=null && this.name!=''){
			  if (evaltxt != "")
				  evaltxt += "," + this.name + ":escape($(\"textarea[name='" + this.name + "']\").val().replace(reg, \"chr(13)\"))";
			  else
				  evaltxt += this.name + ":escape($(\"textarea[name='" + this.name + "']\").val().replace(reg, \"chr(13)\"))";
		  }
      });
      evaltxt = "{" + evaltxt + "}";
	  
         //开始提交
         evaltxt = "$.post(submiturl," + evaltxt + ",function(userdata){proreg(userdata,fromurl,logintype);},\"text\");";
         //开始处理js;
         eval(evaltxt);
		
    }

    /*返回提交成功函数*/
    function proreg(userdata, fromurl, logintype) {
            //函数开始			
            switch (userdata) {
                case "success":
                    //提交成功
                    alert("提交成功!");
                    $("#sucmsg")[0].innerHTML = "您的作品已成功提交！"; 	
                    //window.location.href = fromurl;
                    //return;
                    break;
                case "empty title":
                        alert("标题不能为空!");
                    break;
                case "empty con":
                        alert("内容不能为空!");
                    break;
                case "empty email":
                        alert("邮箱不能为空!");
                    break;
				case "have save":
                        alert("对不起，请不要重复提交!");
                    break;
					
            }
            if (logintype == 0)
                $("#submit").attr("disabled", false);
 }