$(function ($sub) {
	$sub("div.container_menu li").parents('div.container_menu ul li').append('<span, class="with_submenu"><span>');
	$sub('ul.sub-menu').each(function () { 	
		$sub(this).parent().eq(0).hover(function () {
			$sub('ul.sub-menu:eq(0)', this).stop(true, true).animate({left: '+=40', height: 'toggle'},250);
			}, function () {
			$sub('ul.sub-menu:eq(0)', this).stop(true, true).animate({left: '+=-40', height: 'toggle'});
		});
	});
	$sub('div.container_menu ul.children').each(function () { 	
		$sub(this).parent().eq(0).hover(function () {
			
			$sub('ul.children:eq(0)', this).stop(true, true).animate({left: '+=40', height: 'toggle'},250);
			}, function () {
			$sub('ul.children:eq(0)', this).stop(true, true).animate({left: '+=-40', height: 'toggle'});
		});
	});
});

jQuery(function($elem) {
	$elem('div.container_menu > li.current-menu-ancestor a').css("text-decoration", "underline");
    var url = location.href;
    $elem("div.container_menu li a").each(function(i){
	    var bus = this.href;
       	if(url==bus){
		    $elem("div.container_menu a:eq("+i+")").addClass("current").add().css('text-decoration', 'underline');
       	}
    })
	$elem(".current").parents('div.container_menu ul li').addClass('current_activated')
});
