$(document).ready(function() {
  var alternatable = ['pp-alternating-rows', 'pp-alternating-rows-2'];

  if( !$().isIE() ) return false; // Abort if we're not using IE

  function childTypeFor(element) {
    switch(element.type()) {
      case 'table':
        return 'tr';
        break;
      case 'ul':
        return 'li';
        break;
    }
  }

  for(index in alternatable) {
    var klass    = alternatable[index],
        elements = $("." + klass);

    elements.each(function(element) {
      if( $().isBlank(element) ) return false;

      var element = $(element),
          count   = 0;

      element.find( childTypeFor(element) ).each(function(child) {
        if( $().isOdd(count) ) {
          $(child).addClass('pp-odd');
        } else {
          $(child).addClass('pp-even');
        }
        count++;
      });
    });
  }

});


