jQuery(document).ready(function($) {
	var path = document.location.pathname;
	var on = (path.split('/')[1]!= 'news') ? path.split('/')[1] : path.split('/')[2];

 	jQuery('div#globalnavi ul#menu li').each( function() {
 		if (this.className == on) {
			if (this.parentNode.className == 'sub') {
				this.id = 'onsub';
				this.parentNode.parentNode.id = 'current';
			} else {
				this.id = 'current';
			}
		}
	});
	
 	jQuery('div#globalnavi ul#menu li ul.sub').each( function() {
		var li_id = this.parentNode.id;
		var li_class = this.parentNode.className;
		
		if (li_class == 'artists') {
			this.style.display = '';
		} else if (li_id == 'current') {
			this.style.display = '';
		} else {
			this.style.display = 'none';
		}
	});

	jQuery('div#globalnavi ul#menu li span a').click(function () {
		li = this.parentNode.parentNode;
	
		if (li.className != 'artist') {
			var ul = li.parentNode;
			
			if (ul.className != 'sub') {
	
				if (li.childNodes.length > '2'){
					li.childNodes[2].style.display = (li.childNodes[2].style.display == 'none') ? '' : 'none';
					return false;
				}
			} 
		} else {
			return false;
		}	
	});
})

