doAlternateRowHighlights = function() {

	//Remove any existing alternate classes
	$('div#content table.alternate tbody tr').removeClass('alternate');

	//Apply alternate class to alternate table rows
	$('div#content table.alternate tbody tr:odd').addClass('alternate');

}//function


$(document).ready(function() {

  //Do table sorter stuff
 if ($('table#productList').length > 0) {
  $('table#productList').tablesorter({ sortList: [[2,0]] });
  $('table#productList').bind('sortEnd', function() {
   doAlternateRowHighlights();
  });
 }//if

 //Do alternate row colours
 doAlternateRowHighlights();

 if (typeof _gaq != 'undefined') {
  $('#ctaPrint a').click( function() { _gaq.push(['_trackEvent', 'Actions', 'Click', 'Print page']); });
 }//if

 //Fix links to bookmarks that aren't preceded with a url
 $('a[href^="#"]').each( function(index) {
  $(this).attr('href', jQuery.url.attr('path') + $(this).attr('href'));
 });

 //Hover images
 if ($('img.hover').length > 0) {
  $('img.hover').hover( function() {
   $(this).attr('src', $(this).attr('src').replace('_off', '_on'));
  }, function() {
   $(this).attr('src', $(this).attr('src').replace('_on', '_off'));
  });
 }//if

 if ($('input.image.hover').length > 0) {
  $('input.image.hover').hover( function() {
   $(this).attr('src', $(this).attr('src').replace('_off', '_on'));
  }, function() {
   $(this).attr('src', $(this).attr('src').replace('_on', '_off'));
  });
 }//if
 
 //Dustbin
 if ($('#form-Basket').length == 1) {
  $('a.dustbin').click( function() {
   return confirm('Are you sure you want to remove this item from your basket?');
  });
 }//if
 

});
