$(function() {
											
				$("ul.sf-menu").supersubs({ 
								
            minWidth:    12,   // minimum width of sub-menus in em units 
            maxWidth:    27,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        }).superfish();  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason. 


	
	if($('#slideshow').length) {

		$('#slideshow').after('<div id="pager">').cycle({
			fx:     'fade',
			speed:  'slow',
			timeout: 6000,
			prev:    '#prev',
			next:    '#next',
			pager:  '#pager',
			before: function() { if (window.console) console.log(this.src); }
			});
	}		
	
	if($('#pager').length) {
		$("#pager a:nth-child(1)").addClass('thumb-1');
			$("#pager a:nth-child(2)").addClass('thumb-2');
$("#pager a:nth-child(3)").addClass('thumb-3');
	 }
	
	if($('.promo').length) {
		$(".promo").equalHeights(160);
	}	
	
	//email spam protection
	$('.email').each(function() {
		var $email = $(this);
		var address = $email.text()
		.replace(/\s*\[at\]\s*/, '@')
		.replace(/\s*\[dot\]\s*/g, '.');
		$email.html('<a href="mailto:' + address + '">'
		+ address +'</a>');
	});
	
	if($('#sub-nav').length) {
$("#sub-nav a").filter(function() {
	var currentURL = window.location.toString().split("/");
	return $(this).attr("href") == currentURL[currentURL.length-1];
	}).addClass("active");
	}
		


});