/* SUB NAV  BAR LINKS ON RESOURES  */
 $(function () {
    var textBlocks = $('div.content_block > div');
	$('div#suspect_block').hide();
    $('div.subnav_side ul a').click(function () {
		$('div#block_info').removeClass('content_block_hide');
        textBlocks.hide().filter(this.hash).fadeIn(300);    
        $('div.subnav_side ul a').removeClass('selected');
        $(this).addClass('selected');     
        return false;
    }).filter(':first').click();
}); 
 
 /* SUB NAV LABEL PAGE TOP NAV  */
 $(function () {
    var textBlocks = $('div.content_block > div');
	$('div#suspect_block').hide();
    $('div#subnav_side ul a').click(function () {
        textBlocks.hide().filter(this.hash).fadeIn(300);    
        $('div#subnav_side ul a').removeClass('selected');
        $(this).addClass('selected');     
        return false;
    }).filter(':first').click();
}); 



 
  /* LABELS.PHP PAGE TABING FOR SECTION How and Why to Read Food Labels  */
  $(function () {
    var textBlocks = $('div.suspect_block1 > div');
	$('div#option1').hide();
    $('div.subnav_labels ul a').click(function () {
        textBlocks.hide().filter(this.hash).fadeIn(300);    
        $('div.subnav_labels ul a').removeClass('selected_sub');
        $(this).addClass('selected_sub');     
        return false;
    }).filter(':first').click();
}); 
  
    /* LABELS.PHP PAGE TABING FOR SECTION Warnings to the Allergic Consumer  */
  
  $(function () {
    var textBlocks = $('div.suspect_block2 > div');
	$('div#warning_ingedients').hide();
    $('div#subnav_labels2 ul a').click(function () {											 
        textBlocks.hide().filter(this.hash).fadeIn(300);  
        $('div#subnav_labels2 ul a').removeClass('selected_sub');
        $(this).addClass('selected_sub');     
        return false;
    }).filter(':first').click();
}); 
  
  
/* RESOURCES PAGE DROPDOWNS HOVER CLASS  */
$(document).ready(function() {
	$("h4.drop_down").mouseover(function(){
		$(this).addClass("active");}).mouseout(function(){
		$(this).removeClass("active");});
	});

/* ROLLOVER ON PRODUCTS PAGE  */
$(document).ready(function() {
	 $("input.inputCart").mouseover(function(){
		$(this).addClass("over");}).mouseout(function(){
		$(this).removeClass("over");});
	  });


// Give classes to even and odd table rows for zebra striping.
$(document).ready(function() {
  $('.sort_list_content:even').css("background-color", "#f2fdd6");
});



/* END ROLLOVER ON PRODUCTS PAGE  */	  
$(document).ready(function() {
	$('div.table_block').hide();
	$('h4.drop_down').click(function() {
          $(this).next().slideToggle(300);
		  return false;
        });
      }); 
	  
/* RESOURCE PAGE ALLERGY DROPDOWNS  */
 

/* ************ PRODUCT PAGE AND INDEX PAGE LIMIT PRODUCT NUMBERS ***************** */

$(document).ready(function() {
	var hiddenBoxes = $('#products div.product_box').slice(6, 28);
	  $('#products div.product_box:eq(5)').addClass('show_more');
	  $('#products div.show_more').append('<div class="show_content">Show All Product Catagories</div>');
	  hiddenBoxes.hide();
		$('#products div.show_content').click(function () {
			var hideMoreLinks = $('#products div.show_content');
			hideMoreLinks.hide();
			hiddenBoxes.show(800, function () {
	        // use callee so don't have to name the function
	        $(this).next().show(3000, arguments.callee); 
	      });
		});
	});
	
/* ************END PRODUCT PAGE AND INDEX PAGE LIMIT PRODUCT NUMBERS ***************** */

/* ************FORM PHONE AND ZIP FIELDS FOR MANUFACTURER.PHP & MANUFACTURE.PHP ***************** */
$(document).ready(function() {
	  $('#zip').mask('99999');
  	  $('#phone').mask('(999) 999-9999');
	  $('#form1').validate({
		  rules: {	  
			first_name: {
				required: true,
				minlength: 2
			},			
			last_name: {
				required: true,
				minlength: 2
			},
		    email: {
		      required: true,
		      email: true
		    },			
			phone: {
		      required: true
		    }		
		}
	});
 });

/* ************ADD TARGET BLANK TO PDF FILES ***************** */

$(document).ready(function() {
  $('a[@href$=".pdf"]').attr("target", "_blank");  ;
});


