$(document).ready(function(){
	$(function(){
	 $('#orderStatusDate').daterangepicker({arrows: false});
	 });
$("#searchBusiness").multiselectCustom({
   noneSelectedText: lblSelectBusiness,
   selected:"business"
});
$("#searchProductTypes").multiselectCustom({
   noneSelectedText: lblSelectProductType,
   selected:"dtypes"
});
		  //check box validation to update status
 $("#submitSearchInvoice").click(function(){	
          if( jQuery.trim($('#orderNumber').val())=="" && jQuery.trim($('#orderStatusDate').val())==""  && $('#searchBusiness :selected').length==0 && jQuery.trim($('#orderStatus').val())=="" && jQuery.trim($('#productKey').val())=="" && jQuery.trim($('#certificateName').val())=="" && jQuery.trim($('#paymentStatus').val())=="" && jQuery.trim($('#orderType').val())=="" && jQuery.trim($('#searchPayment').val())=="") {
			   jAlert(msgSelectSearchCriteria);
                           return false;
		   }
		 
		   return true;  
});
$("#submitSearch").click(function(){	
          if( jQuery.trim($('#orderNumber').val())=="" 
                  && jQuery.trim($('#orderStatusDate').val())==""  
                  && jQuery.trim($('#orderCreatedDate').val())=="" 
                  && jQuery.trim($('#brandID').val())=="" 
                  && $('#searchBusiness :selected').length==0 
                  && jQuery.trim($('#orderStatus').val())=="" 
                  && jQuery.trim($('#searchShowroom').val())=="" 
                  && jQuery.trim($('#productKey').val())=="" 
                  && jQuery.trim($('#certificateName').val())=="" 
                  && jQuery.trim($('#paymentStatus').val())==""  
                  && jQuery.trim($('#orderSource').val())=="" && jQuery.trim($('#searchPayment').val())==""
                  && jQuery.trim($('#orderType').val())=="") {
			   jAlert(msgSelectSearchCriteria);
                           return false;
		   }
		 
		   return true;  
});
$("#submitSearchInvoices").click(function(){	
          if( jQuery.trim($('#orderStatusDate').val())==""  && $('#searchBusiness :selected').length==0 ) {
			   jAlert(msgSelectSearchCriteria);
                           return false;
		   }
		 
		   return true;  
         });
	
	$(".multi").click(function(){
		$(this).next(".ShipIDlst").toggle("slow");
	});

});
$("#submitProcess,#schedulePickup").click(function()
{
	if($(".checkbox01:checked").size()==0)
	{
		jAlert(lblSelectItem);
		return false;
	}
});
$("#bulkOrderSubmit").click(function()
{
	if($(".checkbox01:checked").size()==0)
	{
		jAlert(lblSelectItem);
		return false;
	}
        if($("#bulkOrderStatus").val()=='' && $("#bulkPaymentStatus").val()=='')
	{
		jAlert("Select order/payment status to proceed");
		return false;
	}
});