$(document).ready(function(){

	/*** Sliders ***/
	
	/* Header Text */
	$('.HomeTemplate .TitleWrap .HeaderImageSidePanel').cycle({  
	    fx: 'fade', 
	    speed: 1500,
		pause: true,
		timeout: 8000,
		slideExpr: '.EnhanceContentElementWrap'
	 });
	 
	 
	 /* Header Image */
	 $('.HomeTemplate .TitleWrap .HeaderImageWrap .Enhance2ContentElement1').cycle({  
	    fx: 'fade', 
	    speed: 1500,
		pause: true,
		timeout: 8000,
		slideExpr: 'img:not(.EnhanceTwoGenericStyleOne img)'
	 });
	 
	 
	 /* News */
	 $('.HomeTemplate .FooterPanel1 .Enhance2NewsFeedArticles').cycle({  
	    fx: 'fade', 
	    speed: 1000,
		pause: true,
		timeout: 8000,
		slideExpr: '.Enhance2NewsFeedArticle'
	 });
	 
	 /* Events */
	 $('.HomeTemplate .FooterPanel2 .Enhance2EventFeedArticles').cycle({  
	    fx: 'fade', 
	    speed: 700,
		pause: true,
		timeout: 8000,
		slideExpr: '.Enhance2EventFeedArticle'
	 });
	 
	/*** Main Menu ***/
	
	/* Mark every 3rd item in main menu dropout */
	$('.HeaderMainMenuWrap ul ul').each(function(){
		$(this).find('li').each(function(index){
			if(index % 3 == 0){
				$(this).addClass('RowFirst');
			}
		});
	});
	/* Make whole dropout li clickable */
	$('.HeaderMainMenuWrap li li').click(function(){
		var link = $(this).find('a').attr('href');
		window.location = link;
	});
	
	/*** Other Menus ***/
	
	/* Remove duplicate menu items */
	$('.LeftContentWrap li.Enhance2FirstMenuItem').not('.LeftContentWrap li:first-child').remove();
	$('.RightFooter li.Enhance2FirstMenuItem').not('.RightFooter li:first-child').remove();

	/* 2 columned footer menu */
	$('.RightFooter ul').makeacolumnlists({cols:2,colWidth:0,equalHeight:true,startN:1});
	$('.LeftFooter ul').makeacolumnlists({cols:3,colWidth:0,equalHeight:true,startN:1});

	/*** Home page pop outs ***/
	var tweets = $('.Home .FooterPanel3 h4');
	tweets.each(function(){
		var tweet = $(this);
		tweet.nextUntil('h4').wrapAll('<div class="Container"><div class="ContainerInner"></div></div>');
		tweet.add(tweet.next('.Container')).wrapAll('<div class="ExtraInfoWrap"></div>');
	});
	$('.Container').css({'width': 0});
	tweets.mouseover(function() {
		var tweet = $(this);
		$('.Container').not(tweet.next()).css({'width': 0});
		tweet.next().animate({'width': '326px'});
	});
	$('.Home .FooterPanel3').mouseout(function(){
		$('.Container').stop().css({'width': 0});
	});

});
