function checkregtel(regtel){
	var str=regtel;
	var Expression=/^[0-9]*[0-9]$|^[0-9]*[0-9]$/; 
	var objExp=new RegExp(Expression);
	if(objExp.test(str)==true){
		return true;
	}else{
		return false;
	}
}





function checkregtels(regtels){
	var str=regtels;
	var Expression=/^[0-9]*[0-9]$|^[0-9]*[0-9]$|^[0-9]{1,}[.][0-9]{1,}$/; 
	var objExp=new RegExp(Expression);
	if(objExp.test(str)==true){
		return true;
	}else{
		return false;
	}
}


function chkreginfo(form,mark,edit){
 

  if(mark==0 || mark=="all"){
   	 if(form.tb_commodity_name.value==""){
	   chknew_tb_commodity_name.innerHTML="请输入商品名称！";
	   form.tb_commodity_name.style.backgroundColor="#FF0000";
	   return false;
   	 }else{
   	   chknew_tb_commodity_name.innerHTML="";
	   form.tb_commodity_name.style.backgroundColor="#FFFFFF";
   	 }
   }
   
if(mark==1 || mark=="all"){
   	 if(form.tb_commodity_counts.value==""){
	   chknew_tb_commodity_counts.innerHTML="请输入商品数量！";
	   form.tb_commodity_counts.style.backgroundColor="#FF0000";
	   return false;
   	 }else if(isNaN(form.tb_commodity_counts.value)){
   	   chknew_tb_commodity_counts.innerHTML="商品数量由数字组成！";
	   form.tb_commodity_counts.style.backgroundColor="#FF0000";
	   return false;
	 }else if(!checkregtel(form.tb_commodity_counts.value)){
   	   chknew_tb_commodity_counts.innerHTML="商品数量为正数！";
	   form.tb_commodity_counts.style.backgroundColor="#FF0000";
	   return false;
   	 }else{	
   	   chknew_tb_commodity_counts.innerHTML="";
	   form.tb_commodity_counts.style.backgroundColor="#FFFFFF";
   	 }
   }

if(mark==2 || mark=="all"){
   	 if(form.tb_commodity_price.value==""){
	   chknew_tb_commodity_price.innerHTML="请输入商品价格！";
	   form.tb_commodity_price.style.backgroundColor="#FF0000";
	   return false;
   	 }else if(isNaN(form.tb_commodity_price.value)){
   	   chknew_tb_commodity_price.innerHTML="商品价格由数字组成！";
	   form.tb_commodity_price.style.backgroundColor="#FF0000";
	   return false;
	 }else if(!checkregtels(form.tb_commodity_price.value)){
   	   chknew_tb_commodity_price.innerHTML="商品价格的格式不正确！";
	   form.tb_commodity_price.style.backgroundColor="#FF0000";
	   return false;
   	 }else{	
   	   chknew_tb_commodity_price.innerHTML="";
	   form.tb_commodity_price.style.backgroundColor="#FFFFFF";
   	 }
   }




  if(mark==3 || mark=="all"){
   	 if(form.tb_commodity_address.value==""){
	   chknew_tb_commodity_address.innerHTML="请输入地址！";
	   form.tb_commodity_address.style.backgroundColor="#FF0000";
	   return false;
   	 }else{
   	   chknew_tb_commodity_address.innerHTML="";
	   form.tb_commodity_address.style.backgroundColor="#FFFFFF";
   	 }
   }


 


  if(mark==4 || mark=="all"){
   	 if(form.tb_commodity_explain.value==""){
	   chknew_tb_commodity_explain.innerHTML="请输入说明！";
	   form.tb_commodity_explain.style.backgroundColor="#FF0000";
	   return false;
   	 }else{
   	   chknew_tb_commodity_explain.innerHTML="";
	   form.tb_commodity_explain.style.backgroundColor="#FFFFFF";
   	 }
   }

   }


