$(document).ready(function(){
	// 
	$(".section").find("p.title").addClass("strong");
	$(".section").find("div.red").addClass("strong");
	$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
	$(".hikesList").find(":last").css("margin-bottom", "9px");
	$("ul.skin2").tabs("div.skin2 > div");
	$("ul.css-tabs > li:eq(2)").css("margin-right", 0);
	$(".hikesList tr").not(".hikesList tr td.difficulty").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
   	//$("#hikesList tr:even").addClass("odd");
	$("a[rel='imgGroup']").colorbox(); 
	$('a.one').bind('click', function() {
		$('a[rel=imgGroup]').eq(0).trigger('click');
	});
	/**/
  	$("img.hidden").css("display", "none");

	      //define a parser
      $.tablesorter.addParser ({
           id: "commaDigit",
  			is: function(s, table) {
    		var c = table.config;
    		return $.tablesorter.isDigit(s.replace(/[(+),.]/g, ""), c);
  			},
  			format: function(s) {
   			 return $.tablesorter.formatFloat(s.replace(/[(+),.]/g, ""));
  			},
  			type: "numeric"
      });
	   /*
	 $.tablesorter.addParser({  
  		id: "formattedMonths",  
		 is: function(s) { 
		  return /[Mid-][Late-][Early-]/.test($.trim(s));   
  		return false;  
  		},  
  		format: function(s) {  
			//return s.replace(/Mid-/g, '');

			return s.toLowerCase().replace(/[Mid-]/g,'').replace(/[Late-]/g,'').replace(/[Early-]/g,''); 
  			//return s.replace(/[Mid-, Late-, Early-]/g,'');  
  		},  
 		type: "type"  
 	}); /*/

	$(".hikesList").tablesorter({

		sortList: [[0,0]],
		headers: {
			1: {sorter:'digit'}, 
			2: {sorter:'digit'}, 
			3: {sorter:'commaDigit'},
			4: {sorter:'formattedMonths'} 
		},  
		widgets: ['zebra']
	});   
	 //$("#hikesList").tablesorter(); 
		
	//to change More to Close
	$("#toggleSection").hide();
	
	$("a.toggleLink").toggle(function(){
		 $('#toggleSection').slideDown();  
		$(this).html('Close'); 
	},function(){
		 $('#toggleSection').slideUp(); 
		$(this).html('More...');
	}); 
});	


