$(document).ready(function(){

	$('.date').each(function(){
		var sDate = $(this).text().replace(/\-+/gi,' ');
		$(this).text(sDate);
	});	
	
	$('.webform,.form').find('label').each(function(){
		var oBr = $(this).next();
		if($(oBr).is('br')) $(oBr).remove();	
	});
	
	
	$('.post .date').each(function(){
		var sDate = $(this).text();
		switch(true)
		{
			case sDate.indexOf('Monday') != -1:
				$(this).text(sDate.replace('Monday','Mon'));
				break;
			case sDate.indexOf('Tuesday') != -1:
				$(this).text(sDate.replace('Tuesday','Tue'));
				break;
			case sDate.indexOf('Wednesday') != -1:
				$(this).text(sDate.replace('Wednesday','Wed'));
				break;
			case sDate.indexOf('Thursday') != -1:
				$(this).text(sDate.replace('Thursday','Thu'));
				break;
			case sDate.indexOf('Friday') != -1:
				$(this).text(sDate.replace('Friday','Fri'));
				break;
			case sDate.indexOf('Saturday') != -1:
				$(this).text(sDate.replace('Saturday','Sat'));
				break;
			case sDate.indexOf('Sunday') != -1:
				$(this).text(sDate.replace('Sunday','Sun'));
				break;
			default:	
		}
	});
	
	//Google analytics tracking
	
	$('a').click(function(){
		pageTracker._link(($(this).attr('href') && typeof $(this).attr('href') == 'string') ? $(this).attr('href') : ''); 	
	});
	
	
	//Remove breadcrumbs from certain pages
	
	
	//From launch course page
	var launchPageBreadcrumbs = null;
	
	$('.breadcrumbs a').each(function(){
		if($(this).text() && $.trim($(this).text().toLowerCase()) == 'launch demo course')
		{
			launchPageBreadcrumbs = true;		
		}
	});
	if(launchPageBreadcrumbs)
	{
			$('.breadcrumbs').css('visibility','hidden');
	}
	
});
