$(document).ready(function() {
	// Modify breadcrumbs to goto real page instead of going to category page
	for (var i = 0; i < $(".breadcrumbs a").length; i++) {
		var el = $(".breadcrumbs a").eq(i);
		el.attr('title',el.attr('title').replace('Go to the ','Go to '));
		el.attr('title',el.attr('title').replace(' category archives.','.'));
		el.attr('href',el.attr('href').replace('/category/','/'));
	}
	
	// Modify .categoryMeta to goto real page instead of going to category page
	for (var i = 0; i < $(".categoryMeta a").length; i++) {
		var el = $(".categoryMeta a").eq(i);
		el.attr('href',el.attr('href').replace('/category/','/'));
	}
	
	// Remove other meta boxes
	if (window.location.href.indexOf('/intranet/') == -1) {
		// Other than Intranet page
		$(".authorMeta").remove();
	}
	
	$(".commentMeta").remove();
	
	if (window.location.href.indexOf('/about-us/careers/') == -1) {
		// Other than careers page
		$(".dateMeta").remove();
	}
	
	// Open Download PDF in new window
	$("a.smallbutton").has("div:contains('Download PDF')").attr('target','_blank');
	
	// Dropcap
	var s1 = [".dc1", ".dc2", ".dc3"];
	var s2 = ["dropcap1", "dropcap2", "dropcap3"];
	for (var i = 0; i < s1.length; i++) {
		for (var j = 0; j < $(s1[i]).length; j++) {
			var thePara = $(s1[i]).eq(j).html();
			$(s1[i]).eq(j).removeClass(s1[i].substr(1)).html('<span class="' + s2[i] + '">' + thePara.substr(0,1) + '</span>' + thePara.substr(1));
		}
	}
	
	// If there's only one slide, do not show the dots and no slideshow
	if (($(".nivoSlider img").length > 0) && ($(".nivoSlider img").length < 2)) {
		$(".nivoSlider .nivo-controlNav").hide();
		$(".nivoSlider").data('nivoslider').stop();
	}
});

$(function() {
});

