$(function() {
		var t = null;
		setTimeout(function() {
				$('.heroBanner').bind('begintransition', function() {
						if(t) clearTimeout(t);
						var $this = $(this);
						$this.find('.active .popup').stop().animate({
								'opacity': '0.0'
							}, 450, 'swing', function() {
									$(this).css({
											display: 'none'
										});
								});
						$this.find('li').removeClass('active');
						$this.find('.current').closest('li').addClass('active');
					}).bind('endtransition', function() {
							var $this = $(this);
							t = setTimeout(function() {
									$this.find('.active .popup').stop().css({
											'opacity': '0.0',
											'display': 'block'
										}).animate({
												'opacity': '1.0'
											}, 450, 'swing');
								}, 450);
						}).bind('ready', function() {
								var $this = $(this);
								$this.find('li').removeClass('active');
								$this.find('.current').closest('li').addClass('active');
								$this.find('.current .popup').stop().css({
										display: 'block',
										'opacity': '0.0'
									}).animate({
											'opacity': '1.0'
										}, 450, 'swing');
							}).geeFader({
									effect: 'fade',
									delay: 6000,
									duration: 500,
									easing: 'swing',
									bookmarks: '.bannerControls a'
								});
			}, 1500);
		if($.browser.msie && parseInt($.browser.version, 10) < 9) {
			$('.heroBanner .popup').remove();
			$('.heroBanner img').each(function() {
					$(this).attr('src', $(this).attr('src').replace(/(\.[^.]+)$/, '-flat$1'));
				});
		}
	});
