// JavaScript Document
/*
表示・非表示を切り替える
*/
function showid(param) {
	// if the ids are the month, close all the event first...
	if(param.substr(0, 3)=="eid") {
		for( i = 1; i < 13; i ++ ) {
			var mnt = "eid" + i;
			hideid(mnt);
			var mid = "m" + i;
			colorf(mid);
		}
	}
	var pvalue = document.getElementById(param);
	if(pvalue != null) {
        pvalue.style.visibility = "visible";
        pvalue.style.position = "";
        pvalue.style.height = "";
		var mvalue = document.getElementById(param.replace("eid","m"));
		mvalue.style.backgroundColor  = "#ffffff";
  	  }
}
function hideid(param){
	var pvalue = document.getElementById(param);
	if(pvalue != null) {
        pvalue.style.visibility = "hidden";
        pvalue.style.position = "absolute";
        pvalue.style.height = 0;
	 }
}
function colorf(param) {
	var mvalue = document.getElementById(param);
	if(mvalue != null) {
		mvalue.style.backgroundColor  = "";
	}
}

function goNext(id, strsrc, obthis, imax) {
	var len = strsrc.length;
	var num = strsrc.substring(len-6, (len-6)+2);
	var nextNum = parseInt(num)+1;
	if(nextNum > imax) {
		nextNum = 1;
	}
	if(nextNum.length = 1) {
		nextNum = "0" + nextNum;
	}
	obthis.src = strsrc.substring(0, len-6) + nextNum + ".jpg";
}

function onMenu(strMenu, strImage) {
	document.images(strMenu).src = strImage;
}

