//汎用ウィンドウオープン
function openWin(url,name,property) {
	newwin =window.open(url,name,property);
	newwin.focus();
}

//ブックマーク
function bookmark(url,title) {
	if(navigator.userAgent.indexOf("MSIE") > -1){
		window.external.AddFavorite(url,title);
	} else if(navigator.userAgent.indexOf("Firefox") > -1){
		window.sidebar.addPanel(title,url,'');
	}
}

//ご意見＆ご質問オープン
function cntWin() {
	newwin =window.open("https://www.bang.co.jp/spp/index_life.html",'cnt','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=500,height=440,left=0,top=0');
	newwin.focus();
}

//プライバシーポリシーオープン
function privacyWin() {
    newwin
=window.open('http://www.webcrew.co.jp/info/privacy_pop.html','privacy','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=500,height=500,left=0,top=0');
    newwin.focus();
}

//利用規約
function termWin() {
	newwin =window.open('http://www.webcrew.co.jp/info/terms_pop.html','terms','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=500,height=500,left=0,top=0');
	newwin.focus();
}

//ウェブクルーID規約
function memberWin() {
	newwin =window.open('http://www.webcrew.co.jp/info/member_pop.html','member','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=500,height=500,left=0,top=0');
	newwin.focus();
}


//基礎知識の用語
function wordWin(url) {
	newwin =window.open(url,'help','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=450,height=350,left=0,top=0');
	newwin.focus();
}


///// for PointPage /////
//cookie設定
function cookieWin() {
	newwin =window.open('http://www.bang.co.jp/cookie/','cookie','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=520,height=500,left=0,top=0');
	newwin.focus();
}

//cookieチェック
function cookieCheckWin() {
	newwin =window.open('http://www.bang.co.jp/cgi-bin/cookie/cookie_check.pl','cookie','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=520,height=500,left=0,top=0');
	newwin.focus();
}


///// for StepEngine /////
//ヘルプウインドウオープン
function helpWin(url) {
    newwin = window.open(url, "help", "toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=680,height=500,left=0,top=0");
    newwin.focus();
}

function openwin(url) {
    w = window.open(url, "WIN", "width=520,height=500,status=no,scrollbars=yes,directories=no,menubar=no,resizable=no,toolbar=no");
}

/*
//各社オープン
function comWin(url) {
	newwin =window.open(url,'com','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=600,height=550,left=0,top=0');
	newwin.focus();
}
*/

//フォーム背景色
/*
function colorChange() {
	this.skip  = ['submit', 'button', 'radio', 'checkbox', 'select-one', 'select-multiple'];
	this.color = { 'blur': '', 'focus': '#DFF5FF' };

	this.set = function() {
		for (var i = 0; i < document.forms.length; i++) {
			for (var f = 0; f < document.forms[i].length; f++) {
				var elm = document.forms[i][f];
				if(!this.checkSkip(elm)) continue;
				this.setColor(elm, 'focus');
				this.setColor(elm, 'blur');
			}      
		}
	}

	this.checkSkip = function(elm) {
		for(var i in this.skip) {
			if(elm.type == this.skip[i]) return false;
		}
		return true;
	}

	this.setColor = function(elm, type) { 
		var color = this.color[type];
		var event = function() { elm.style.backgroundColor = color; };

		if(elm.addEventListener) {
			elm.addEventListener(type, event, false); 
		} else if(elm.attachEvent) {
			elm.attachEvent('on'+type, event); 
		} else {
			elm['on'+type] = event;
		}
	}
}
*/

//stepShow0.htm
/*
function getLabel(){
	var lbs = document.getElementsByTagName('label');
	for(var i=0;i<lbs.length;i++){
		var cimgs = lbs[i].getElementsByTagName('img');
		for(var j=0;j<cimgs.length;j++){
			cimgs[j].formCtrlId = lbs[i].htmlFor;
			cimgs[j].onclick = function(){document.getElementById(this.formCtrlId).click()};
		}
	}
}
*/

// onload時に実行する
window.onload = function() {	
	currentPath = location.pathname.split( "/" );
	currentPath = currentPath.slice( 1,2 );
/*	var formColor = new colorChange;
	formColor.set();
	getLabel();*/
}



// page move
function move_page(page) {
    var upper;
    var lower;
    for (var i = 1; i <= 6; i++) {
        if(parent.upper.document.getElementById("page" + i)){
            upper = i;
        }
        if(parent.lower.document.getElementById("page" + i)){
            lower = i;
        }
        if (upper && lower) {
            break;
        }
    }
    if (upper && lower) {
        parent.upper.document.getElementById("page" + upper).id = "page" + page;
        parent.lower.document.getElementById("page" + lower).id = "page" + page;
    } else {
        return;
    }
    var fm = parent.upper.document.StepForm;
    fm.page.value = page;
    fm.action = "./Move.do";
    fm.target = "lower";
    fm.submit();
}

function btnBack(fm, action_val) {
    fm.command.value = "back";
    fm.action = action_val;
    fm.target = "_top";
    fm.submit();
}