MJL.event.add(window, "load", function(event) {
    // MJL に関係するコードはこの中に記述
    MJL.enable.rollover("roll");
}, false);

// MJL と無関係なコードはこの先に記述




//* カテゴリごとにメニュー画像をハイライト *//

$(document).ready(function(){
　　
　　path = location.pathname

　　	if(path.match("/special/wcs0910/about/"))
		{
		$("#str-nav li.about a img").attr("src", "/special/wcs0910/shared/images/nav/site_nav-01_o.png");
		$("#str-nav > li").addClass("roll");
		$("#str-nav li.about").removeClass("roll");
　　	}

		if(path.match("/special/wcs0910/present/"))
		{
		$("#str-nav li.present a img").attr("src", "/special/wcs0910/shared/images/nav/site_nav-02_o.png");
		$("#str-nav > li").addClass("roll");
		$("#str-nav li.present").removeClass("roll");
　　	}

		if(path.match("/special/wcs0910/application/"))
		{
		$("#str-nav li.application a img").attr("src", "/special/wcs0910/shared/images/nav/site_nav-03_o.png");
		$("#str-nav > li").addClass("roll");
		$("#str-nav li.application").removeClass("roll");
　　	}

		if(path.match("/special/wcs0910/game/"))
		{			
		$("#str-nav li.game a img").attr("src", "/special/wcs0910/shared/images/nav/site_nav-04_o.png");
		$("#str-nav > li").addClass("roll");
		$("#str-nav li.game").removeClass("roll");
　　	}

		if(path.match("/special/wcs0910/card/"))
		{
		$("#str-nav li.card a img").attr("src", "/special/wcs0910/shared/images/nav/site_nav-05_o.png");
		$("#str-nav > li").addClass("roll");
		$("#str-nav li.card").removeClass("roll");
　　	}

		if(path.match("/special/wcs0910/site/"))
		{	
		$("#str-nav li.site a img").attr("src", "/special/wcs0910/shared/images/nav/site_nav-06_o.png");
		$("#str-nav > li").addClass("roll");
		$("#str-nav li.site").removeClass("roll");
　　	}

		if(path.match("/special/wcs0910/faq/"))
		{
		$("#str-nav li.faq a img").attr("src", "/special/wcs0910/shared/images/nav/site_nav-07_o.png");
		$("#str-nav > li").addClass("roll");
		$("#str-nav li.faq").removeClass("roll");
　　	}

		if(path.match("/special/wcs0910/note/"))
		{
		$("#str-nav li.note a img").attr("src", "/special/wcs0910/shared/images/nav/site_nav-08_o.png");
		$("#str-nav > li").addClass("roll");
		$("#str-nav li.note").removeClass("roll");
　　	}

		if(path.match("/special/wcs0910/battle/"))
		{
		$("#str-nav > li").addClass("roll");
　　	}

		if(path.match("/special/wcs0910/challenge/"))
		{
		$("#str-nav li.challenge a img").attr("src", "/special/wcs0910/shared/images/nav/site_nav-09_o.png");
		$("#str-nav > li").addClass("roll");
		$("#str-nav li.challenge").removeClass("roll");
　　	}

		if(path.match("/special/wcs0910/report/"))
		{
		$("#str-nav li.report a img").attr("src", "/special/wcs0910/shared/images/nav/site_nav-10_o.png");
		$("#str-nav > li").addClass("roll");
		$("#str-nav li.report").removeClass("roll");
　　	}

		if(path.match("/special/wcs0910/online/"))
		{
		$("#str-nav li.online a img").attr("src", "/special/wcs0910/shared/images/nav/site_nav-11_o.png");
		$("#str-nav > li").addClass("roll");
		$("#str-nav li.online").removeClass("roll");
　　	}

})



// 日本地図のクリッカブルマップのロールオーバー //

$(document).ready(function(){
    $('a>img').hover();
		var area = $('#japanMap p img');
		$('.map_hokkaido').mouseover(function(){
				area.attr('src',area.attr('src').replace('area01.gif','area02.gif'));
		});
		$('.map_hokkaido').mouseout(function(){
				area.attr('src',area.attr('src').replace('area02.gif','area01.gif'));
		});
		$('.map_touhoku').mouseover(function(){
				area.attr('src',area.attr('src').replace('area01.gif','area03.gif'));
		});
		$('.map_touhoku').mouseout(function(){
				area.attr('src',area.attr('src').replace('area03.gif','area01.gif'));
		});
		$('.map_hokushinnetsu').mouseover(function(){
				area.attr('src',area.attr('src').replace('area01.gif','area04.gif'));
		});
		$('.map_hokushinnetsu').mouseout(function(){
				area.attr('src',area.attr('src').replace('area04.gif','area01.gif'));
		});
		$('.map_kantou').mouseover(function(){
				area.attr('src',area.attr('src').replace('area01.gif','area05.gif'));
		});
		$('.map_kantou').mouseout(function(){
				area.attr('src',area.attr('src').replace('area05.gif','area01.gif'));
		});
		$('.map_chubu').mouseover(function(){
				area.attr('src',area.attr('src').replace('area01.gif','area06.gif'));
		});
		$('.map_chubu').mouseout(function(){
				area.attr('src',area.attr('src').replace('area06.gif','area01.gif'));
		});
		$('.map_kansai').mouseover(function(){
				area.attr('src',area.attr('src').replace('area01.gif','area07.gif'));
		});
		$('.map_kansai').mouseout(function(){
				area.attr('src',area.attr('src').replace('area07.gif','area01.gif'));
		});
		$('.map_chugoku').mouseover(function(){
				area.attr('src',area.attr('src').replace('area01.gif','area08.gif'));
		});
		$('.map_chugoku').mouseout(function(){
				area.attr('src',area.attr('src').replace('area08.gif','area01.gif'));
		});
		$('.map_kyusyu').mouseover(function(){
				area.attr('src',area.attr('src').replace('area01.gif','area09.gif'));
		});
		$('.map_kyusyu').mouseout(function(){
				area.attr('src',area.attr('src').replace('area09.gif','area01.gif'));
		});
});


//* カレンダーをポップアップ *//

$(function(){
	$("#calender-btn").click(function(){
		$("#calender-block").css("display", "block");
	})
	$(".close").click(function(){
		$("#calender-block").css("display", "none");
	})
})


//* PNG FIX *//

DD_belatedPNG.fix( '.pngfix');


//* IEで右クリックを禁止 *//

function notes(eve){
if(document.all){
  if(event.button == 2){
  alert("右クリック禁止になっています。画像のコピーはしないでね！");
  return false;
  }
}
if(document.layers){
  if(eve.which == 3){
  alert("右クリック禁止になっています。画像のコピーはしないでね！");
  return false;
  }
}
}

if(document.layers)document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=notes;



//* 右カラムと左カラムを高さ揃え *//


/*--------------------------------------------------------------------------*
 *  
 *  heightLine JavaScript Library beta4
 *  
 *  MIT-style license. 
 *  
 *  2007 Kazuma Nishihata 
 *  http://www.webcreativepark.net
 *  
 *--------------------------------------------------------------------------*/

new function(){
	
	function equalize(){
	
		this.className="equalize";
		this.parentClassName="equalizeParent"
		reg = new RegExp(this.className+"-([a-zA-Z0-9-_]+)", "i");
		objCN =new Array();
		var objAll = document.getElementsByTagName ? document.getElementsByTagName("*") : document.all;
		for(var i = 0; i < objAll.length; i++) {
			var eltClass = objAll[i].className.split(/\s+/);
			for(var j = 0; j < eltClass.length; j++) {
				if(eltClass[j] == this.className) {
					if(!objCN["main CN"]) objCN["main CN"] = new Array();
					objCN["main CN"].push(objAll[i]);
					break;
				}else if(eltClass[j] == this.parentClassName){
					if(!objCN["parent CN"]) objCN["parent CN"] = new Array();
					objCN["parent CN"].push(objAll[i]);
					break;
				}else if(eltClass[j].match(reg)){
					var OCN = eltClass[j].match(reg)
					if(!objCN[OCN]) objCN[OCN]=new Array();
					objCN[OCN].push(objAll[i]);
					break;
				}
			}
		}
		
		//check font size
		var e = document.createElement("div");
		var s = document.createTextNode("S");
		e.appendChild(s);
		e.style.visibility="hidden"
		e.style.position="absolute"
		e.style.top="0"
		document.body.appendChild(e);
		var defHeight = e.offsetHeight;
		
		changeBoxSize = function(){
			for(var key in objCN){
				if (objCN.hasOwnProperty(key)) {
					//parent type
					if(key == "parent CN"){
						for(var i=0 ; i<objCN[key].length ; i++){
							var max_height=0;
							var CCN = objCN[key][i].childNodes;
							for(var j=0 ; j<CCN.length ; j++){
								if(CCN[j] && CCN[j].nodeType == 1){
									CCN[j].style.height="auto";
									max_height = max_height>CCN[j].offsetHeight?max_height:CCN[j].offsetHeight;
								}
							}
							for(var j=0 ; j<CCN.length ; j++){
								if(CCN[j].style){
									var stylea = CCN[j].currentStyle || document.defaultView.getComputedStyle(CCN[j], '');
									var newheight = max_height;
									if(stylea.paddingTop)newheight -= stylea.paddingTop.replace("px","");
									if(stylea.paddingBottom)newheight -= stylea.paddingBottom.replace("px","");
									if(stylea.borderTopWidth && stylea.borderTopWidth != "medium")newheight-= stylea.borderTopWidth.replace("px","");
									if(stylea.borderBottomWidth && stylea.borderBottomWidth != "medium")newheight-= stylea.borderBottomWidth.replace("px","");
									CCN[j].style.height =newheight+"px";
								}
							}
						}
					}else{
						var max_height=0;
						for(var i=0 ; i<objCN[key].length ; i++){
							objCN[key][i].style.height="auto";
							max_height = max_height>objCN[key][i].offsetHeight?max_height:objCN[key][i].offsetHeight;
						}
						for(var i=0 ; i<objCN[key].length ; i++){
							if(objCN[key][i].style){
								var stylea = objCN[key][i].currentStyle || document.defaultView.getComputedStyle(objCN[key][i], '');
									var newheight = max_height;
									if(stylea.paddingTop)newheight-= stylea.paddingTop.replace("px","");
									if(stylea.paddingBottom)newheight-= stylea.paddingBottom.replace("px","");
									if(stylea.borderTopWidth && stylea.borderTopWidth != "medium")newheight-= stylea.borderTopWidth.replace("px","")
									if(stylea.borderBottomWidth && stylea.borderBottomWidth != "medium")newheight-= stylea.borderBottomWidth.replace("px","");
									objCN[key][i].style.height =newheight+"px";
							}
						}
					}
				}
			}
		}
		
		checkBoxSize = function(){
			if(defHeight != e.offsetHeight){
				changeBoxSize();
				defHeight= e.offsetHeight;
			}
		}
		changeBoxSize();
		setInterval(checkBoxSize,1000)
		window.onresize=changeBoxSize;
	}
	
	function addEvent(elm,listener,fn){
		try{
			elm.addEventListener(listener,fn,false);
		}catch(e){
			elm.attachEvent("on"+listener,fn);
		}
	}
	addEvent(window,"load",equalize);
}
