cmsjm = {};

/**
 * Selects the menu item(s) containing the current page as their link.
 */
cmsjm.menu_item_select = function(){
	var jump_items = getElementsByTagAndClassName('div', 'cms_jump_menu_item');
	forEach(jump_items, function(item){
		var anchor = getFirstElementByTagAndClassName('a', null, item);
		var current_url = document.location.href;
		
		if(anchor != null){
			connect(item, 'onclick', function(){window.location = anchor.href;});
			if(anchor.href == current_url){
				addElementClass(item, 'cms_jump_menu_item_selected');			
			}
		}
	});
} 

addLoadEvent(cmsjm.menu_item_select);

