//ベリサインオープン
function secWin() {
	newwin =window.open('https://digitalid.verisign.com/vsj/d9fac6d3a3779e93a8b9ca29344e2632','verisighn','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=500,height=450,left=0,top=0');
	newwin.focus();
}

///// for Static Page /////

//ご意見＆ご質問オープン
function cntWin() {
	newwin =window.open("https://www.sateiomakase.com/step/sateiomakase/contact.htm",'cnt','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=500,height=440,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,'exp','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=550,height=400,left=0,top=0');
	newwin.focus();
}

//ウインドウオープン
function openWin(url,name,property) {
	newwin =window.open(url,name,property);
	newwin.focus();
}

//topicsオープン
function tpcsWin() {
	newwin =window.open('http://www.webcrew.co.jp/info/topics_mitsumori.html','topics','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=450,height=400,left=0,top=0');
	newwin.focus();
}

//ランクオープン
function ratingWin(url) {
	newwin =window.open('/contents/rank_pop.html','rank','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=520,height=500,left=0,top=0');
	newwin.focus();
}

//ランクオープン(top用)
function topRankingWin(url) {
	newwin =window.open('/contents/top_rank_pop.html','rank','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=540,height=575,left=0,top=0');
	newwin.focus();
}

//ブックマーク
function bookmark() {
	if(navigator.userAgent.indexOf("MSIE") > -1){
		window.external.AddFavorite('http://www.sateiomakase.com/','車買取比較.com');
	} else if(navigator.userAgent.indexOf("Firefox") > -1){
		window.sidebar.addPanel('車買取比較.com','http://www.sateiomakase.com/','');
	}
}

///// for promoページ /////

//各社オープン
function comPromoWin(url) {
	newwin =window.open(url,'com','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=630,height=550,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=520,height=420,left=0,top=0');
	newwin.focus();
}

//各社オープン
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 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 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 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 helpWin_01(url){
helpwin = window.open(url,"help01","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,left=0,top=0,width=450,height=400");
helpwin.focus();
}


//Step車種グレードチェックボックス
function ansWin()
{
    if (document.answerForm.answer_Q_grade_flg_A_a.checked == true)
    {
        document.answerForm.answer_Q_grade.value = '不明';
    }
    else
    {
        document.answerForm.answer_Q_grade.value = '';
    }
}
//Step排気量チェックボックス
function gasWin()
{
    if (document.answerForm.answer_Q_engine_cc_flg_A_a.checked == true)
    {
        document.answerForm.answer_Q_engine_cc.value = 0;
    }
    else
    {
      document.answerForm.answer_Q_engine_cc.value = '';
    }
}

//Step車種表示
function toCarSearch(){
	var maker = document.answerForm.answer_Q_maker_name[answerForm.answer_Q_maker_name.selectedIndex].value;
	if ( maker != "" ){
	    document.answerForm.action = 'answerStep11.htm'; 
		document.answerForm.submit();
		
	}
  }

//フォーム背景色
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();
}

