$(document).ready(function() {
	$('.small-banner').hover(function() {
		$(this).children('p.more').slideDown(150);
	}, function() {
		$(this).children('p.more').slideUp(150);
	});
	
	$('.right-banner').hover(function() {
		$(this).children('p.more').slideDown(150);
	}, function() {
		$(this).children('p.more').slideUp(150);
	});
	
	$('.footer-banner').hover(function() {
		$(this).children('p.more').slideDown(150);
	}, function() {
		$(this).children('p.more').slideUp(150);
	});	
	
	$("#nav li").hover(function(event) {
		$(this).find('ul:first').show();
		$(this).find('ul:first').parent().addClass("sel");
	}, function(event) {
		$(this).find('ul:first').hide();
		$(this).find('ul:first').parent().removeClass("sel");
	});
	
	$('.bubble-title').click(function() {
		$(this).children("#bubble-toggle").toggleClass("active");
		$(this).parent().children(".panel").slideToggle();
	});

	$('#bubble-close').click(function() {
		$(this).parent().parent().children(".bubble-title").children('#bubble-toggle').removeClass("active");
		$(this).parent(".panel").slideUp();
	});
	
	$('.bubble .text input').focus(function() {
		var labelText = $(this).siblings('label').text();
		if ($(this).val() == labelText) {
			$(this).val("");
		}
	});
	
	$('.bubble .text input').blur(function() {
		var labelText = $(this).siblings('label').text();
		if ($(this).val() == "") {
			$(this).val(labelText);
		}
	});

	$('.glossary dt').wrapInner('<a href="#" />');

	$('.glossary').click(function(e) {
		var $target = $(e.target);
		if($target.is('a')) {
			$target.parent().toggleClass('selected').next().toggle();
		}
		return false;
	});

});
