/*window.addEvent('domready', function() {
	
	//reverse styling set at page load to crazy flicker
	$('vertical-slide').style.display = 'block';
	
	// add slide element
	var myVerticalSlide = new Fx.Slide('vertical-slide').hide();
	// function that triggers the slide
	var startSlide = function() {
		myVerticalSlide.slideIn();
	}

	// this sets the dealy before the slide occurs
	startSlide.delay(1000);
	
	// add event to close element / cross 
	$('close-banner').addEvent('click', function(e){
		e.stop();
		myVerticalSlide.slideOut();
		// create a cookie
		createCookie("hideBFRBannerAd", "true", 365);
	});	

	// function creates a cookie
	function createCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else expires = ""; {
			document.cookie = name+"="+value+expires+"; path=/";
		}
	}
});*/


$(document).ready(function(){
	if ($('#vertical-slide')) {	
		$('#vertical-slide').hide();
		
		setTimeout(function () {$('#vertical-slide').slideDown("slow", function () {$('#vertical-slide').css('height', '0.01%')})}, 1500);	

		$('#close-banner').bind('click', function (e) {
			e.preventDefault();
			$('#vertical-slide').slideUp("slow");
			createCookie("hideBFRBannerAd", "true", 365);
		});

		// function creates a cookie
		function createCookie(name,value,days) {
			if (days) {
				var date = new Date();
				date.setTime(date.getTime()+(days*24*60*60*1000));
				var expires = "; expires="+date.toGMTString();
			}
			else expires = ""; {
				document.cookie = name+"="+value+expires+"; path=/";
			}
		}
	}

	// horizontal accoridon
	$("#inner-main-content ul:first").attr('id', 'ha');
    $("ul#ha li:first").attr('id', 'first-ha');
	$("ul#ha li:first").attr('class', 'selected');
	$("ul#ha li:last").attr('class', 'last-ha');

	$("ul#ha li").contents().filter(function(){ return this.nodeType != 1; }).wrap("<span/>");


	lastBlock = $("#first-ha");
	maxWidth = 369;
	minWidth = 70;	                            
				
	$("ul#ha li").hover(
		function(){
			 $(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:300});
			 $(lastBlock).removeClass('selected');
			 $(this).animate({width: maxWidth+"px"}, { queue:false, duration:300});
			 $(this).addClass('selected');
			 lastBlock = this;
		});
});