  function checkemail(str) {
		var filter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,7}|\d+)$/i;
	    return (filter.test(str));
  }
  function f_status_change(path_move){
	  	  x=$("#f_status").val();
		  window.location=path_move+"&f_status="+x;
  }

  function delchk(frm)
  {
	var arr = new Array();
	$("[name=CB[]]").each(function(){
		if(this.checked) arr.push(this.value)
	});
	if(arr.length==0){
		alert("คุณต้องทำเครื่องหมาย หน้ารายการก่อน");
		return;
	}
	if(!confirm("ท่านต้องการลบข้อมูลนี้จริงหรือไม่?")) return;
	frm.submit();	
  }

  function delRow(id,path_move){
	if(confirm("do you want to delete?")){
		window.location=path_move+"&delid="+id;		
	}
}

  function delRow2(id,smod,path_move){
	if(confirm("do you want to delete?")){
		window.location=path_move+"&smod="+smod+"&delid="+id;		
	}
}

  function updatestatus(frm)
  {
	var arr = new Array();
	$("[name=CB[]]").each(function(){
		if(this.checked) arr.push(this.value)
	});
	if(arr.length==0){
		alert("คุณต้องทำเครื่องหมาย หน้ารายการก่อน");
		return;
	}
	if(!confirm("ท่านได้ส่งของรางวัลชิ้นนี้ จริงหรือไม่?")) return;
	frm.submit();	
  }

function checkall(obj)
{
  var theForm = obj.form;
  var i;
  if(obj.checked){
   for(i=1;i<theForm.length; i++)
   {
     theForm[i].checked = true;
   }
  }else if(!obj.checked){
   for(i=1;i<theForm.length; i++)
   {
     theForm[i].checked = false;
   }
  }
}
