/*================================================
	CORNER MENU ON
================================================*/
Event.observe(window, "load", setGlobalMenu);
Event.observe(window, "load", setCorpMenu);
Event.observe(window, "load", setCategoryMenu);

function setGlobalMenu()
{
	if (!$$("div#globalMenu li")){
		return ;
	}
	$A($$("div#globalMenu li")).each(function(li){

		if (li.firstChild.tagName=="A" &&
			((function(loc, href){
			
				if (loc == href) return true;
				var href = href.replace(/index\.html$/,'');
				
				if (loc.substr(0, href.length)==href) return true;
				
				return false;
				
			})(location.href,li.firstChild.href))){
			Element.addClassName(li,"on");
		}
	});
}
function setCorpMenu()
{
	if (!$$("div.side div.corp li")){
		return ;
	}
	$A($$("div.side div.corp li")).each(function(li){

		if (li.firstChild.tagName=="A" &&
			((function(loc, href){
			
				if (loc == href) return true;
				//var href = href.replace(/index\.html$/,'');
				
				if (loc.substr(0, href.length)==href) return true;
				
				return false;
				
			})(location.href,li.firstChild.href))){
			Element.addClassName(li,"on");
		}
	});
}
function setCategoryMenu()
{
	if (!$$("div.side div.category li")){
		return ;
	}
	$A($$("div.side div.category li")).each(function(li){

		if (li.firstChild.tagName=="A" &&
			((function(loc, href){
			
				if (loc == href) return true;
				var href = href.replace(/index\.html$/,'');
				
				if (loc.substr(0, href.length)==href) return true;
				
				return false;
				
			})(location.href,li.firstChild.href))){
			Element.addClassName(li,"on");
		}
	});
}
