// JavaScript Document
//刪除選取與取消
function ProductDel()
{
  var ob=document.orderlist;
  if(ob.ok.checked)
  {
     for(i=1;i<=parseInt(ob.counts.value);i++)
	 {
	    ob.all("o_del"+i).checked=true;
	 }
  }
  else
  {
     for(i=1;i<=parseInt(ob.counts.value);i++)
	 {
	    ob.all("o_del"+i).checked=false;
	 }
  }
}

//使勾選無效
function chkCheckBox()
{
	var ob=document.orderlist;  
	if(parseInt(ob.counts.value)<=0)
	{
	   ob.ok.disabled=true;
	   ob.delData_up.disabled=true;
	   ob.delData_down.disabled=true;	   
	}
}


//判斷有無勾選並刪除資料
function chkSelect(response)
{
	var ob=document.orderlist;
	var counts=0;

	
	YN=confirm(response);
	if(YN)
	{
		for(i=1;i<=parseInt(ob.counts.value);i++)
		{
			if(ob.all("o_del"+i).checked)
				counts++;
		}
		
		if(counts==0)
		{
			alert("您沒勾選訂單資料，無法刪除!");
			return false;
		}
	}
	else
		return false;

}