function addPhoto(form) {
   var reg1=/^\s*$/;
   if (form.photoname.value =='') {
       alert("照片标题不能为空");
       return false;
   }                       		      	      
   if (reg1.test(form.photoname.value)) {
       alert('照片标题不能全为空格');
       return false;
   }
   if ((form.story.value!='')&&(form.story.value.length>2000)) {
       alert("照片故事不能大于2000");
       return false;
   }
   
   if (form.content.value=='') {
       alert('必须选择附件');
       return false;
   }
   form.submit();
   return true;
}

function editPhoto(form) {
   var reg1=/^\s*$/;
   if (form.photoname.value =='') {
       alert("照片标题不能为空");
       return false;
   }        
   if (reg1.test(form.photoname.value)) {
       alert('照片标题不能全为空格');
       return false;
   }               		      	      
   if ((form.story.value!='')&&(form.story.value.length>2000)) {
       alert("照片故事不能大于2000");
       return false;
   } 
   form.submit();
   return true;
}

function deleteAssess(form, assessId) {
	if (!confirm('该评论将被删除，确认吗？')) {
		return false;
	}
	form.action='/PhotoAssessDel.do';
	form.assessId.value=assessId;
	form.submit();
}

function checkAssess(form) {
   var reg1=/^\s*$/;
	var flag=0;
	for(i=0;i<form.rating.length;i++)
		if(form.rating[i].checked==true){
		//alert(form.skinId[i].value);
			flag=1;
			break;
		}
	if(flag == 0) {
         alert('请选择评论等级');
         return false;
	}
	if (form.content.value == '') {
		alert('评论内容不能为空');
		return false;
	}
	if (reg1.test(form.content.value)) {
		alert('评论内容不能全为空格');
		return false;
	}   
	if (form.content.value.length > 2000) {
		alert('评论内容不能超过2000');
		return false;
	}
	if (form.content.value == '输入评论内容..') {
		alert('请输入评论内容');
		return false;
	}
	form.content.value = form.content.value.replace(/\<[^\>]*\>/g,"");
	form.action='/PhotoAssessAdd.do';
	form.submit();
}


function checkContentValue(form) {
	if (form.content.value == '输入评论内容..') {
		form.content.value='';
	}
}

