
 
 

jQuery.noConflict();




jQuery(document).ready(function() {
	
	
	/*jQuery(".options-Flavors").hide();*/
	
	
	
	//boardwalk fudge
	
	jQuery(".product-james-boardwalk-fudge #attribute123").change(function() {
		varietyValue =jQuery(this).val();
//		alert (varietyValue);
		if (varietyValue == 21) {
			jQuery(".options-Flavors").show();
			jQuery("#options-3-list input:checkbox").each(function(){
					jQuery(this).addClass("validate-four-required-by-name");
					});
			}
		else {
			jQuery(".options-Flavors").hide();
			jQuery("#options-3-list input:checkbox").each(function(){
					jQuery(this).removeClass("validate-four-required-by-name");
					});
			}
			
			
	});





	jQuery(".product-james-boardwalk-fudge #select_19").change(function() {
		fudgeSize =jQuery(this).val();													//	

//		alert (varietyValue);
		if (fudgeSize == 58) {
			//alert("8 total");
			


			jQuery ("#product-options-wrapper input").each(function () {
				//	alert(jQuery(this).attr("id"));																	 
					jQuery(this).addClass("validate-items total-items-8");
			
			});
			
			
  
  
																	  
		
			}
		else {
			//alert("4 total");
			/*
			this will allow 4 total
			*/
			jQuery ("#product-options-wrapper input").each(function () {
				//	 alert(jQuery(this).attr("id"));	
					jQuery(this).addClass("validate-items total-items-4");
			
			});	
			}
			
			
	});








	//james seasonal tin
	
	jQuery(".product-james-seasonal-tin-of-salt-water-taffy #attribute135").change(function() {
		varietyValue =jQuery(this).val();
//		alert (varietyValue);
		if (varietyValue == 63) {
			jQuery(".options-Flavors").show();
			jQuery("#options-5-list input:checkbox").each(function(){
					jQuery(this).addClass("validate-four-required-by-name");
					});
			}
		else {
			jQuery(".options-Flavors").hide();
			jQuery("#options-5-list input:checkbox").each(function(){
					jQuery(this).removeClass("validate-four-required-by-name");
					});
			}
			
			
	});








 /*
 
 jQuery("#product_addtocart_form").validate({
									   
	rules: {		
		"options[3]": {
				required: true,
				minlength: 4,
				maxlength:4}
			}
	 });
 
 */


/*
    function countChecked() {
      var n = jQuery("input:checked").length;
	  alert(n + (n <= 1 ? " is" : " are") + " checked!");
	  
//      jQuery("div").text(n + (n <= 1 ? " is" : " are") + " checked!");
    }
  // countChecked();
//    jQuery(":checkbox").click(countChecked);



	  
jQuery(":checkbox").click(function() {
 //  countChecked();

																	   
  });
	  
	*/  
	  
	  
	  
	  
//remove category links

jQuery("#left-navigation > li.parent > a").attr("href","#");
	  
	  
	  
	  

	  
	  
	  
//change name of shipping 

//jQuery("#label_ups_2DA .shipping-rate-title").each(function(){
//															var blah = jQuery(this).html();
//															alert (blah);
//															jQuery(this).empty();
															
															
															
															
//															})
	  
	  
});  //end doc ready
 
 
 
 
 
 /*
old prototype code
document.observe('dom:loaded', function() {
 //$("bayards-logo").observe("click", function() { alert('Clicked!'); });
  $("attribute123").observe("change", function() { 
											   
											   
											//  $('product-options-wrapper dl') 
											   alert('change!'); 
											   
											   
											   });
 
	   // $("myclicker").observe("click", function() { alert('Clicked!'); });
	 
	});
*/
