var FrontMessage_showRemarkForm={	
	/**
	 * 表单验证
	 *
	 * @param form 页面提交的表单
	 * @return
	 */
	checkForm:function(form){
		   	form.mail.value = form.mail.value.replace(/^\s+|\s+$/g, "");
		 	if (/^\s*$/.test(form.mail.value)) {
				alert(i18n_FrontMessage_showRemarkForm_mail_not_null);
				form.mail.focus();
				return false;
		 	}
	 	
		 	 if(!isEmail(form.mail.value)){
				alert(i18n_FrontMessage_showRemarkForm_mail_error);
				form.mail.focus();
				return false;
			}
	 
		 	  form.author.value = form.author.value.replace(/^\s+|\s+$/g, "");
		 	  if(specialCharactersCheck(form.author.value)){
		 	     alert(i18n_FrontMessage_showRemarkForm_author_error);
				   form.author.focus();
				   return false;
		 	    }
		 	  
		 	  form.address.value = form.address.value.replace(/^\s+|\s+$/g,"");
		 	  var netStr =/^((http|https|ftp):(\/\/|\\\\))?((\w)+[.]){1,}/;
		 	  if(form.address.value!="" && form.address.value!="http://"){
		 	  	  if(!netStr.test(form.address.value)){
			 	  	   alert(i18n_FrontMessage_showRemarkForm_web_error);
					   form.address.focus();
					   return false;
			 	  }
		 	  }
		 	  
	    
		    if (/^\s*$/.test(form.content.value)) {
				alert(i18n_FrontMessage_showRemarkForm_content_not_null);
				form.content.focus();
				return false;
		       }else if(form.content.value.length >5000){
		          alert(i18n_FrontMessage_showRemarkForm_content_over);
				form.content.focus();
				return false;
		    }
	    
			return true;
		},
	/**
	 * 当提交失败后返回提交时的页面，页面中初始化已经填写的表单。
	 *
	 * @param data 已经填写好的表单的数据
	 * @return
	 */
	callback:function(data)
	{
		arrsp=data.split("***");
	 	authorarr=arrsp[0].split(":");
	 	authorarr[1]=authorarr[1].substr(1, authorarr[1].length-2); 
		$("#mail").attr("value",authorarr[1]==null?'': authorarr[1]);
		if(authorarr[1] != null)
		{
			$('#mail').attr("readonly","true");
		}
		authorarr=arrsp[1].split(":");
		authorarr[1]=authorarr[1].substr(1, authorarr[1].length-2); 
		$("#author").attr("value",authorarr[1]==null?'': authorarr[1]);

	
	
	},
	/**
	 * 添加评论的时候选择表情。
	 *
	 * @param e 被选择的表情
	 * @return
	 */
	selectEmotion:function(e){
		var eleEmotion = document.getElementById("emotion");
		var imageId = document.getElementById("imageId");
//		var imgStr = e.innerHTML;
//		//获取图像SRC
//		imgStr = imgStr.substring(imgStr.indexOf("src=")+5);
//		imgStr = imgStr.substring(0,imgStr.indexOf('"'));
//		//获取图像对象
//		var imgObj = imgStr.substring(imgStr.indexOf("id=")+4);
//		imgObj = imgObj.substring(0,imgObj.indexOf('"'));
//		imgObj = document.getElementById(imgObj);
		//先将以前选中的图片效果清除
		if(imageId.value !=null && imageId.value !=""){
			var oldimg = document.getElementById(imageId.value);
			oldimg.className="imgstyle1";
			
		}
		
		//将当前选中的图片加样式效果
		e.className="imgstyle2";
		//获取图片SRC
		var imgSrc = e.src;
		imgSrc = imgSrc.substring(imgSrc.lastIndexOf("/")+1);
		eleEmotion.value = imgSrc;
		document.getElementById("imageId").value = e.id;
	}	
}