function menu () {
	$('.fs_navigation li').hover(function() {
		$(this).children('a').addClass('active_element');
		$(this).children('ul:has(li)').toggle();
	}, function() {
		$(this).children('a').removeClass();
		$(this).children('ul:has(li)').toggle();
	});
};
function truncate(className, length, closure) {
	$('.' + className).each(function() {
		if($(this).text().length > length) {
			var value = $(this).text().slice(0, length);
			if(value.substring(length - 1, length) == ' ')
				value = value.substring(0, length - 1);
			if(closure)
				value += closure;
		};
		$(this).html(value);
	});
};
var shorten = {
	byId : function(id, length, closure) {
		shorten.truncate($('#' + id), length, closure);
	},
	byClass : function(className, length, closure) {
		$('.' + className).each(function() {
			shorten.truncate($(this), length, closure);
		});
	},
	truncate : function(obj, length, closure) {
		if(obj.text().length > length) {
			var value = obj.text().slice(0, length);
			if(value.substring(length - 1, length) == ' ')
				value = value.substring(0, length - 1);
			if(closure)
				value += closure;
		};
		obj.html(value);
	}
};

$(function(){
	menu();	
});

