// makes the li's equal height for grid view

//$.fn.equalHeights = function(px) {
// $(this).each(function(){
//   var currentTallest = 0;
//   $(this).children().each(function(i){
//     if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
//   });
   //if (!px || !Number.prototype.pxToEm) currentTallest = currentTallest.pxToEm(); //use ems unless px is specified
   // for ie6, set height since min-height isn't supported
//   if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); }
//   $(this).children().css({'min-height': currentTallest}); 
// });
// return this;
//};

$(document).ready(function(){
  // adds the browser name and js to the homepage
  if($.browser.mozilla) {
      $("html").addClass("js mozilla");
  } else if($.browser.safari) {
      $("html").addClass("js webkit");
  } else if($.browser.msie) {
      $("html").addClass("js msie");
  } else if ($.browser.chrome) {
    $("html").addClass("js chrome");
  } else {
      $("html").addClass("js");
  };
  
	// adds the extra span to the nav for the tabbed appearance
	$('<span></span>').appendTo('#nav a');

	// adds corners to the colored box header
	$('<span class="cornerTopLeft"></span><span class="cornerBottomLeft"></span>').appendTo('#content .column1 .sidebar h2');
	$('<span class="cornerTopLeft"></span><span class="cornerTopRight"></span>').appendTo('#content .coloredBox h4');

	// adds forth classes to grid views for the categories
	$('#category .grid li:nth-child(4n)').addClass('fourth');
	$('#specialDeals .grid li:nth-child(3n)').addClass('third');

	// makes sure the grid view li's have equal heights
	//$('#content .column2 .grid').equalHeights();

	// adds extra classes for IE for first and last child
	$('#breadcrumbs li:first').addClass('first-child');
	$('#breadcrumbs li:last').addClass('last-child');
});
