window.onload = function(){
	initRollovers();
}


// ============= userAgent =============
var uAgent = navigator.userAgent;
//alert(uAgent);
if((uAgent.indexOf('Windows') !== -1)){
	if((uAgent.indexOf('MSIE') !== -1)){
		if((uAgent.indexOf('MSIE 6') !== -1)){
			// Win MSIE 6
		}else if((uAgent.indexOf('MSIE 7') !== -1)){
			// Win MSIE 7
		}else if((uAgent.indexOf('MSIE 8') !== -1)){
			// Win MSIE 8
		}
	}else if((uAgent.indexOf('Firefox') !== -1)){
		if((uAgent.indexOf('Firefox/2') !== -1)){
			// Win Firefox 2
		}else if((uAgent.indexOf('Firefox/3') !== -1)){
			// Win Firefox 3
		}
	}else if((uAgent.indexOf('Chrome') !== -1)){
		// Win Chrome
	}
}else if((uAgent.indexOf('Macintosh') !== -1)){
	if((uAgent.indexOf('Firefox') !== -1)){
		if((uAgent.indexOf('Firefox/2') !== -1)){
			// Mac Firefox 2
		}else if((uAgent.indexOf('Firefox/3') !== -1)){
			// Mac Firefox 3
		}
	}else if((uAgent.indexOf('Safari') !== -1)){
		// Mac Safari
	}
}



// ============= New Window =============
var winURL;
var winWidth;
var winHeight;
function newWin01(winURL,winWidth,winHeight){
	var newWin01;
	newWin01 = window.open(winURL,"newWin01","status=0,resizable=1,scrollbars=1,toolbar=0,directories=0,scrolling=1,menubar=1,location=0,width="+winWidth+",height="+winHeight+",");
	newWin01.focus();
}

// ------------- resize Window -------------
function resizeWin(winWidth,winHeight){
	window.resizeTo(winWidth,winHeight);
}

// ------------- close Window -------------
function closeWin(){
	window.close();
}

// ============= Change Image =============
function initRollovers() {
	if (!document.getElementById) return
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');
	var iImages = document.getElementsByTagName('input');

	for (var i = 0; i < aImages.length; i++) {
		if (aImages[i].className.indexOf('imgover') != -1) {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_on'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;

			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}				

			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}

	for (var i = 0; i < iImages.length; i++) {	
		if (iImages[i].className.indexOf('imgover') != -1) {
			var src = iImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_on'+ftype);

			iImages[i].setAttribute('hsrc', hsrc);	
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;		

			iImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	

			iImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}
initRollovers();

// ============= Set Cookie =============
var _name;
var _value;
var _expires;
var _domain;
var _path;
function setCookie(_name,_value,_expires,_domain,_path){
	var nowtime = new Date().getTime();
	var clear_time = new Date(nowtime + (60 * 60 * 24 * 1000 * _expires));
	var expires = clear_time.toGMTString();
	var _str=_name+'='+_value;
	_str+='; expires=' + expires;
//	_str+='; expires=' + expires +'; domain=; path=/';
//	if(_domain) str+=';domain='+_domain;
//	if(_path) str+=';path='+_path;

	document.cookie=_str;
}
// ============= Read Cookie =============
var cookieStr = document.cookie;

function ReadCookie(key) {
     var sCookie = document.cookie;    // Cookie文字列
     var aData = sCookie.split(";");       // ";"で区切って"キー=値"の配列にする
     var oExp = new RegExp(" ", "g");   // すべての半角スペースを表す正規表現
     key = key.replace(oExp, "");          // 引数keyから半角スペースを除去

     var i = 0;
     while (aData[i]) {                           /* 語句ごとの処理 : マッチする要素を探す */
          var aWord = aData[i].split("=");                         // さらに"="で区切る
          aWord[0] = aWord[0].replace(oExp, "");              // 半角スペース除去
          if (key == aWord[0]) return unescape(aWord[1]); // マッチしたら値を返す
          if (++i >= aData.length) break;                          // 要素数を超えたら抜ける
     }
     return "";                                   // 見つからない時は空文字を返す
}

// ============= pulldown =============
var pdList;
function overPDList(pdList){
	document.getElementById(pdList).style.top = "39px";
}

function outPDList(pdList){
	document.getElementById(pdList).style.top = "-9999px";
}


// ============= Select Change =============
options = new Array;
function selChange(sel) {
	if(sel.options[sel.selectedIndex].value) {
		location.href = sel.options[sel.selectedIndex].value;
	}
}


// ============= Select Change =============
var showMonth01;
var hideMonth01;
var hideMonth02;
function meetInfoTab(showMonth01,hideMonth01,hideMonth02){
	document.getElementById(showMonth01 + '_month').style.display = "block";
	document.getElementById(hideMonth01 + '_month').style.display = "none";
	document.getElementById(hideMonth02 + '_month').style.display = "none";
	document.getElementById('tab_' + showMonth01 + '_month_01').src = "/img/tab_" + showMonth01 + "_month_01_act.gif";
	document.getElementById('tab_' + hideMonth01 + '_month_01').src = "/img/tab_" + hideMonth01 + "_month_01.gif";
	document.getElementById('tab_' + hideMonth02 + '_month_01').src = "/img/tab_" + hideMonth02 + "_month_01.gif";
}
