window.onload = function(){
	windowClose();
	windowPrint();
	txtAttr();
	floatingBnr();
}
//閉 
function windowClose() {
	var cls = document.getElementById('close');
	if(cls){
		cls.onclick = function() {
			self.close();
		}
	}
}
function windowPrint() {
	var prt = document.getElementById('print');
	if(prt) {
		prt.onclick = function() {
			self.print();
		}
	}
}
function Winopen(url,windowname,width,height) {
	var features="location=no, menubar=no, status=no, scrollbars=yes, resizable=yes, toolbar=no";
	var isWin = (navigator.appVersion.indexOf("Win") != -1);
	if (width){
		if (window.screen.width > width){
			features+=", left="+(window.screen.width-width)/2;
		}else{
			width=window.screen.width;
		}
		if(isWin){
				features+=", width="+(width+17);
		}else{
		features+=", width="+(width+17);
		}
	}
	if (height) {
		if (window.screen.height > height){
			if (isWin){
				features+=", top="+((window.screen.height-70)-height)/2;
			}else{
				features+=", top="+(window.screen.height-height)/2;
			}
		}else{
			if (isWin){
			height=window.screen.height-70;
			}else{
			height=window.screen.height;
			}
		}
		features+=", height="+height;
	}
	window.open(url,windowname,features);
}
function txtAttr() {
	var node = document.getElementById('wrapFooterNavi');
	if(node){
		var a = node.getElementsByTagName('a');
		for (var i=0, af=a.length; i<af; i++){
			var h = a[i];
			var prevClass = h.className;
			if(i < af-1){
				h.className = prevClass + ' ' + 'txtBarX';
			}else{
				h.className = prevClass + ' ' + 'txtBarXend';
			}
		}
	}
}

function floatingBnr(){
	
/*	//基準となる値を取得＆定義
	var scrollAmount = (document.body.scrollTop  || document.documentElement.scrollTop);
	var sclHeight = document.documentElement.clientHeight;
	var offset = 0.3;
	var scrollChk = false;
	
	//ボタンを生成
	var wrapAll = document.getElementById("wrapAll");
	var createDiv = document.createElement("div");
	createDiv.setAttribute("id","flt-bnr");
	wrapAll.appendChild(createDiv);
	
	fltBnr.innerHTML = '<span id="flt-bg"></span><div id="bt-contaner"><p id="flt-bt-01"><a href="https://krs.bz/sumitomo/m?f=146"><img alt="来場予約" class="btn" src="img/common/flt_bnr_bt_01.png" /></a></p><p id="flt-bt-02"><a href="member.html"><img alt="会員登録" class="btn" src="img/common/flt_bnr_bt_02.png" /></a></p><p id="flt-close"><img alt="" src="img/common/flt_bnr_close.gif"/></p></div>';
	
*/		var fltBnr = document.getElementById("flt-bnr");
		var fltBt01 = document.getElementById("flt-bt-01");
	var fltBt02 = document.getElementById("flt-bt-02");
	var fltClose = document.getElementById("flt-close");
/*
	//位置設定
	function setPosition(){
		//fltBnr.style.position = "fixed";
		//fltBnr.style.top = Math.ceil(sclHeight / 2 + scrollAmount - fltBnr.offsetHeight/2 + 300) + "px";
		//fltBnr.style.top = 500 + "px";
		//fltBnr.style.right = "-" + fltBnr.offsetWidth/2 + "px";
		fltBnr.style.right = 20 + "px";
		fltBnr.style.bottom = 20 + "px";
	}
	
	//初期位置設定
	setPosition();
	
	//ウインドウサイズとスクロール量を監視
	function chkSize(){
		scrollChk = true;
		var chkScroll = (document.body.scrollTop  || document.documentElement.scrollTop);
		var chkScleen = document.documentElement.clientHeight;
		if(scrollAmount != chkScroll){
			var chkScroll = (document.body.scrollTop  || document.documentElement.scrollTop);
			var moveAmount = eval(fltBnr.style.top.replace(/px/,""))-(((sclHeight)/2)+chkScroll-Math.ceil(fltBnr.offsetHeight/2));
			var goalPosition = Math.ceil(sclHeight/2) + chkScroll-fltBnr.offsetHeight/2;
			if(moveAmount < 0){
				scrollAmount = chkScroll;
				reSetPosition_plus(moveAmount,goalPosition);
			}else if(moveAmount > 0){
				scrollAmount = chkScroll;
				reSetPosition_minus(moveAmount,goalPosition);
			}
		}
		if (sclHeight != chkScleen) {
			sclHeight = chkScleen;
			setPosition();
		}
	}

	//プラス方向へ移動
	function reSetPosition_plus(amount,goal){
		clearInterval(floating);
			posPlus = setInterval(function(){
			if(eval(fltBnr.style.top.replace(/px/,"")) < goal){
				fltBnr.style.top = eval(fltBnr.style.top.replace(/px/,""))+Math.ceil((goal - eval(fltBnr.style.top.replace(/px/,"")))* offset) + "px";
			}
			else
			if(eval(fltBnr.style.top.replace(/px/,"")) > goal){
				fltBnr.style.top = eval(fltBnr.style.top.replace(/px/,""))-Math.ceil((eval(fltBnr.style.top.replace(/px/,""))-goal)* offset) + "px";
			}
			if(eval(fltBnr.style.top.replace(/px/,"")) == goal){
				floating = setInterval(chkSize, 1000);
				clearInterval(posPlus);
				scrollChk = false;
			}
		}, 10);
	};
	
	//マイナス方向へ移動
	function reSetPosition_minus(amount,goal){
		clearInterval(floating);
			posPlus = setInterval(function(){
			if(eval(fltBnr.style.top.replace(/px/,"")) > goal){
				fltBnr.style.top = eval(fltBnr.style.top.replace(/px/,""))-Math.ceil((eval(fltBnr.style.top.replace(/px/,"")) - goal)* offset) + "px";
			}
			else
			if(eval(fltBnr.style.top.replace(/px/,"")) < goal){
				fltBnr.style.top = eval(fltBnr.style.top.replace(/px/,""))+Math.ceil((goal-eval(fltBnr.style.top.replace(/px/,"")))* offset) + "px";
			}
			if(eval(fltBnr.style.top.replace(/px/,"")) == goal){
				floating = setInterval(chkSize, 1000);
				clearInterval(posPlus);
				scrollChk = false;
			}
		}, 10);
	};
	
	//chkSizeを起動
	onscroll = function(){
		if (!scrollChk) {
			clearInterval(floating);
			floating = setInterval(chkSize, 500);
		}
		else 
			if (scrollChk) {
			}
	}
	
	floating = setInterval(chkSize, 500);
	
	*/
	//透明度を下げボタンを削除
	function alphaDecrement(obj,bt_close,bt_01,bt_02){
		count = 10;
		alphaControl = setInterval(function(){
			count--;
			if (count >= 0) {
				obj.style.filter = 'alpha(opacity=' + (count * 10) + ')';
				obj.style.opacity = count / 10;
				obj.style.MozOpacity = count / 10;
				bt_close.style.filter = 'alpha(opacity=' + (count * 10) + ')';
				bt_close.style.opacity = count / 10;
				bt_close.style.MozOpacity = count / 10;
				bt_01.style.filter = 'alpha(opacity=' + (count * 10) + ')';
				bt_01.style.opacity = count / 10;
				bt_01.style.MozOpacity = count / 10;
				bt_02.style.filter = 'alpha(opacity=' + (count * 10) + ')';
				bt_02.style.opacity = count / 10;
				bt_02.style.MozOpacity = count / 10;
			}
			else
				if (count < 0) {
					//wrapAll.removeChild(fltBnr);
					clearInterval(alphaControl);
				}
			}, 10)
	};
	//closeボタン押下時
	fltClose.onclick = function(){
		alphaDecrement(fltBnr,this,fltBt01,fltBt02);
	}
	//オンマウス時のロールオーバー処理
	var chgImg_on = function(obj){
		var btnImg = obj.getElementsByTagName("IMG");
		var ImgExtension1 = btnImg[0].src.match(/\.[^.]*$/);
		var ImgExtension2 = btnImg[0].src.match(/.....\.[^.]*$/);
		if (String(ImgExtension2).match("_over") == null) {
			btnImg[0].setAttribute("src", btnImg[0].src.replace(/\.[^.]*$/, ("_over") + ImgExtension1));
		}
	}
	
	//マウスアウト時のロールオーバー処理
	var chgImg_out = function(obj){
		var btnImg = obj.getElementsByTagName("IMG");
		var ImgExtension = btnImg[0].src.match(/.....\.[^.]*$/);		
		if (String(ImgExtension).match("_over") != null) {
			btnImg[0].setAttribute("src", btnImg[0].src.replace(/_over/, ""));
		}
	}
	
	//ボタンのロールオーバー処理実行
	fltBt01.onmouseover = function(){chgImg_on(this)};
	fltBt01.onmouseout = function(){chgImg_out(this)};
	fltBt02.onmouseover = function(){chgImg_on(this)};
	fltBt02.onmouseout = function(){chgImg_out(this)};
}

function mainmenu(){
$(" #globalNavi li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(500);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

 
 
 $(document).ready(function(){					
	mainmenu();
});