//ウインドウオープン
function openWin(url,name,property) {
	newwin =window.open(url,name,property);
	newwin.focus();
}

//ヘルプウインドウオープン
function helpWin(url) {
	newwin =window.open(url,'help','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=520,height=420,left=0,top=0');
	newwin.focus();
}

//各社オープン
function comWin(url) {
	newwin =window.open(url,'com','toolbar=yes,location=yes,resizable=yes,status=yes,scrollbars=yes,width=600,height=450,left=0,top=0');
	newwin.focus();
}

//ご意見＆ご質問オープン
function cntWin() {
	newwin =window.open("https://www.hikkoshi-o.com/step/hikkoshi-o/contact.htm",'cnt','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=520,height=500,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 infoWin(url) {
	newwin =window.open(url,'information','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=520,height=450,left=0,top=0');
	newwin.focus();
}

//ブラウザオープン
function brwsWin(url) {
	newwin =window.open(url,'brws','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=550,height=400,left=0,top=0');
	newwin.focus();
}

//mapオープン
function mapWin() {
	newwin =window.open('http://www.hikkoshihikaku.com/info/map.html','map','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=450,height=620,left=0,top=0');
	newwin.focus();
}

//life Card
function lifeWin() {
	newwin = window.open('/','life','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=760,height=600,left=0,top=0');
	newwin.focus();
}

//コンテンツオープン
function contentsWin(url) {
	newwin =window.open(url,'contents','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=700,height=600,left=0,top=0');
	newwin.focus();
}

//アンケート結果
function satisfactionWin(url) {
	newwin =window.open(url,'satisfaction','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=630,height=600,left=0,top=0');
	newwin.focus();
}
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 msWin() {
	newwin =window.open('/help/msc/','ms','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=480,height=220,left=0,top=0');
	newwin.focus();
}

//おそうじ本舗
function osoujiWin(url) {
	newwin =window.open(url,'com','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=690,height=600,left=0,top=0');
	newwin.focus();
}

///// for promoページ/////

//コピーライト
function wCopy(){
	document.write("copyright &copy; 2010 Hikkoshihi-o.com Inc. All rights reserved.&nbsp;")
}


///// for StepEngine /////

//フォーム背景色
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;
		}
	}
}

// onload時にフォーム背景色設定を実行
window.onload = function() {
   var formColor = new colorChange;
   formColor.set();
}

//print
function ticketPrint() {
	window.print();
}

// ID引継ぎ  
function pageRedirect(strSiteUrl) {		
	var strlocationUrl = document.location.search;
	
	if( strlocationUrl == "" || strlocationUrl == null ) {	
	} else {
		var strParam = strlocationUrl.split('?')[1];
		var params = strParam.split('&');
		
		for( var i=0; i < params.length; i++ ) {
			var strKV = params[i].split('=');
			
			if( strKV[0] == "ID" || strKV[0] == "id" ) {
				strSiteUrl += "?ID=" + strKV[1];
			}
		}
	}
	window.open(strSiteUrl);
}