$(document).ready(function(){
	$('body').addClass('js');
	$('.sub:not(:first)').hide();
	$('.content h2').click(function(){
		if($(this).next('.sub').is(':visible')) return false; 
          $(".sub:visible").animate({ "width": "toggle"}, { duration: "medium" }, showMe($(this)));
	$('.sub h3').next('div').hide();
	$('.sub h3').next('dl').hide();
	$('.sub h3').click(function(){
		if($(this).next('div').length > 0){
			if($(this).next('div').is(':visible')) return false;
			$('h3.on').removeClass('on');
			$(this).addClass('on');
			var container = $(this).parent();
			$('div:visible', $(container)).slideUp('slow');
			$(this).next('div').slideDown('slow');
		}
		else if($(this).next('dl').length > 0){
				if($(this).next('dl').is(':visible')) return false;
				$('h3.on').removeClass('on');
				$(this).addClass('on');
				var container = $(this).parent();
				$('dl:visible', $(container)).slideUp('slow');
				$(this).next('dl').slideDown('slow');
			}
	});
});
if (!$.browser.safari) {
   transitMe();
}

});
function showMe(e){
	$(e).next('.sub').animate({
        "width": "toggle"
      }, { duration: "slow" });
	$('.on').removeClass('on');
	$(e).addClass('on');
}
function transitMe(){
	$('.extra a').mouseover(function(){
		$(this).animate({opacity: 1, duration: 1000});
	}).mouseout(function(){
		$(this).animate({opacity: .5, duration: 1000});
	});
	$('.content h2[class!="on"] ').mouseover(function(){
		$(this).animate({opacity: 1, duration: 1000});
	}).mouseout(function(){
		$(this).animate({opacity: .5, duration: 1000});
	});
	$('h3[class!="on"]').mouseover(function(){
		$(this).animate({opacity: 1, duration: 1000});
	}).mouseout(function(){
		$(this).animate({opacity: .7, duration: 1000});
	});
	
}
