var quantity = $("#0_quantity").val();
   
   $(document).ready(function(){
   
       //alert(quantity);
       $("#1_personalization").change(function(){
           var opt = this.options[this.selectedIndex].value;
		    $("#3_text1").val('');
			 $("#4_text2").val('');
           if (opt == "no") {
               $("#0_quantity").val(150);
			   $("input#0_quantity").siblings("span.note").html("(min. of 150 pieces)");
			   $('#3_text1div').hide();
			    $('#4_text2div').hide();
           }
           if (opt == "yes") {
               $("#0_quantity").val(200);
			   $("input#0_quantity").siblings("span.note").html("(min. of 200 pieces)");
			    $('#3_text1div').show();
			    $('#4_text2div').show();
           }
           
       })
	    $('#1_personalization').trigger("change");
	   
   });
   /*
   function validateQ(selector, item){
       var quantity = $("#0_quantity").val();
       var opt = $("#1_personalization").val();
	   if (opt == "no"){
	   	var min = 150;
	   }     
	   if(opt == "yes")
	   {var min = 200;
	   }
       if (quantity < min) {
           $(selector).val(min);
           alert("The minimum order for this item is " + min + " " + item + ". Your quantity has been updated.");
           return false;
       }
       else 
           return true;
   }
   */
   function validateQuantityChocolate() {
       if ($("#1_personalization").val() == "no") return validateQuan('#0_quantity', 150, 'pieces');    
       if ($("#1_personalization").val() == "yes") return validateQuan('#0_quantity', 200, 'pieces');
}
