// JavaScript Document

jQuery(function() {
	jQuery('#contentType li a').click(function() {
		setCookie(jQuery(this).attr('title'));
		document.location.reload();
		return false;
	});
	
	jQuery('#contentType li a').each(function() {
		if(jQuery.cookie('contentType') == jQuery(this).attr('title')) {
			jQuery(this).addClass('current');
		}
		if (!jQuery(this).hasClass('current')) {
			jQuery(this).data('originalWidth', jQuery(this).width()).width('7px');
			jQuery(this).mouseenter(function() {
				jQuery(this).stop(false, false).animate({
					backgroundColor: "#ee3b33",
					borderRightColor: "#ee3b33",
					color: "#ffffff",
					width: jQuery(this).data('originalWidth')
				}, 350);
				return false;
			});
			jQuery(this).mouseleave(function() {
				jQuery(this).stop(false, false).animate({
					backgroundColor: "#ffffff",
					borderRightColor: "#ffffff",
					color: "#000000",
					width: '7px'
				}, 350);
				return false;
			});
		}
	});
});

function setCookie(cookieValue) {
	jQuery.cookie('contentType', cookieValue, { expires: 365 });
}
