$dr(document).ready(function(){
	
	$dr('.inner-menu-slide a').click(function(el){
		el.preventDefault();
		var container = $dr(this).closest('div.inner-menu');
		var menuLevel3 = container.find('.inner-menu-level3');
		var menuLevel4 = container.find('.inner-menu-level4');
		
		if ($dr(this).hasClass('close') && !container.hasClass('closed')) {
			// close
			document.cookie="innerMenuClosed=1; path=/";
			if (menuLevel3.length && !menuLevel4.length) {
				menuLevel3.slideUp('normal', function(){
					container.addClass('closed');
				});
			} else if (!menuLevel3.length && menuLevel4.length) {
				menuLevel4.slideUp('normal', function(){
					container.addClass('closed');
				});
			} else if (menuLevel3.length && menuLevel4.length) {
				menuLevel3.slideUp('normal');
				menuLevel4.slideUp('normal', function(){
					container.addClass('closed');
				});
			}
		}
		
		if ($dr(this).hasClass('open') && container.hasClass('closed')) {
			// open
			document.cookie="innerMenuClosed=; path=/";
			if (menuLevel3.length && !menuLevel4.length) {
				menuLevel3.slideDown('normal', function(){
					container.removeClass('closed');
				});
			} else if (!menuLevel3.length && menuLevel4.length) {
				menuLevel4.slideDown('normal', function(){
					container.removeClass('closed');
				});
			} else if (menuLevel3.length && menuLevel4.length) {
				menuLevel3.slideDown('normal');
				menuLevel4.slideDown('normal', function(){
					container.removeClass('closed');
				});
			}
		}
		
		/*
		var cont = $dr(this);
		$dr(this).find('.credit-hidden-link').children('a').click(function(el){
			el.preventDefault();
			if (cont.hasClass('active')) {
				cont.find('.credit-hidden-text').slideUp('normal', function() {
					cont.removeClass('active')
				});
			} else {
				cont.find('.credit-hidden-text').slideDown('normal', function() {
					cont.addClass('active')
				});
			}
		});*/
	});
	
});