// swap img ///////////////////////////////////////////////////////////////////////////
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

// active page ///////////////////////////////////////////////////////////////////////////
function setActive() {
	// ----
	var divIdName = 'submenu';
	var activeClassName = 'active';
	var parentFlag = 0;
	// -----
	var url = document.URL.split("#");
	if (url[0].match(/\/$/)) {
		url[0] += 'index.html';
	}
	if(document.getElementsByTagName && document.getElementById(divIdName)) {
		aObj = document.getElementById(divIdName).getElementsByTagName('a');
		for (i = 0; i < aObj.length; i++) {
			if(url[0] == aObj[i].href || url[0] == aObj[i].href + 'index.html') {
				if (parentFlag) {
					aObj[i].parentNode.className = activeClassName;
				} else {
					aObj[i].className = activeClassName;
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", setActive, false);
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", setActive);
	window.attachEvent("onload", smartRollover);
}

// window open ///////////////////////////////////////////////////////////////////////////

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


