$(document).ready(function() {

	// image overlay
	$("a.fancybox").fancybox();
	
	// new window
	$('a[rel="external"]').attr('target', '_blank');
	
	// equal height columns inside the content area
	if($('#content-area-main').height() > $('#content-area-secondary').height()){
		$('#content-area-secondary').css({height:$('#content-area-main').height()});
	}

	// equal height columns in the for the 2 main columns
	if($('#content-area').height() > $('#sidebar').height()){
		$('#sidebar').css({height:$('#content-area').height()+20});
	} else {
		$('#content-area').css({height:$('#sidebar').height()-50});
		$('#content-area-secondary').css({height:$('#content-area').height()});
		$('#content-area-main').css({height:$('#content-area').height()});
	}
	
	$('#hp-slideshow').cycle({timeout:6000,speed:500});
	
	$('#eventsFlip').cycle({timeout:6000,speed:500});
	
	// header promo panel
	$('.slideshow-wrapper').each(function(){
		var temp_id = $(this).children('div.slideshow').attr('id');
		$('#'+temp_id).after('<ul id="'+temp_id+'-nav" class="slideshow-nav">').cycle({ 
			fx:     'fade', 
			speed:  1000, 
			timeout: 7000, 
			pager:  '#'+temp_id+'-nav',
			pause: 1 
		});
	});

});
