window.addEvent('domready', function(){	
	var lis = $$('ul.left_menu li');	// get all LI's within the UL with class 'left_menu'
	
	$each(lis, function (item, index){	// loop though all LI's
		if(item.hasClass('level3_sub')){	// check if this LI has the class name 'level3_sub'
			lis[index-1].addClass('level3Parent');	// add the class name 'level3Parent' to the previous LI
			item.dispose().inject(lis[index-1], 'bottom');	// move the content of this LI into the previous LI after other content and delete this LI
		}
	});
	
	$each(lis, function (item, index){	// same again but look for "level2_sub". This means that level3's are already inside level2's
		if(item.hasClass('level2_sub')){
			lis[index-1].addClass('level2Parent');
			item.dispose().inject(lis[index-1], 'bottom');
		}
	});
});