/*--------------------
おしえてコ～ルJS
---------------------*/
var fg;
var user_id;
var site_id;
var callURL;
var str;

/*
おしえてコール表示フラグ
1：表示
0：非表示
*/

//表示フラグ
fg = "1"; //表示

/*
	ポップアップ
*/
function oshietecallPopUp(URL,NMODE,MODE,NM,VL,NM2,VL2) { 
//alert(URL+":"+MODE+":"+NM+":"+VL+":"+NM2+":"+VL2);
	var target = "apply";
	
	var POSTURL = URL; 
	var win = window.open("",target,"toolbar=0,location=0,menubar=0,status=0,scrollbars=yes,resizable=yes,width=800");

	if (document.documentMode >= 8) {	//IE8以上なら
		var input1 = document.oshietecallPopUpForm.childNodes[0];
		var input2 = document.oshietecallPopUpForm.childNodes[1];
		var input3 = document.oshietecallPopUpForm.childNodes[2];

		input1.setAttribute("value",MODE);
		input2.setAttribute("value",VL);
		input3.setAttribute("value",VL2);
	}else{
		document.oshietecallPopUpForm.MODE.value = MODE;
		//document.oshietecallPopUpForm.pfm.name = NM;
		document.oshietecallPopUpForm.Scd1.value = VL;
		//document.oshietecallPopUpForm.pfm2.name = NM2;
		document.oshietecallPopUpForm.toiawase_shohin_name.value = VL2;
		//document.oshietecallPopUpForm.pMode.name = NMODE;
	}

	document.oshietecallPopUpForm.target = target;
	document.oshietecallPopUpForm.action = POSTURL;
	document.oshietecallPopUpForm.submit();
	win.focus();

}

///ポップアップ設定動的ページ（パラメータあり）/
function oshietecallPopUpActive(URL,NMODE,MODE,NM,VL,NM2,VL2) { 
//alert(URL+":"+MODE+":"+NM+":"+VL+":"+NM2+":"+VL2);
	var target = "apply";
	
	var POSTURL = URL; 
	var win = window.open("",target,"toolbar=0,location=0,menubar=0,status=0,scrollbars=yes,resizable=yes,width=800");

	if (document.documentMode >= 8) {	//IE8以上なら
		var input1 = document.popUpForm.childNodes[0];
		var input2 = document.popUpForm.childNodes[1];
		var input3 = document.popUpForm.childNodes[2];
		input1.setAttribute("name",NM);
		input1.setAttribute("value",VL);
		input2.setAttribute("name",NM2);
		input2.setAttribute("value",VL2);
		input3.setAttribute("name",NMODE);
		input3.setAttribute("value",MODE);
	}else{
		document.popUpForm.pfm.name = NM;
		document.popUpForm.pfm.value = VL;
		document.popUpForm.pfm2.name = NM2;
		document.popUpForm.pfm2.value = VL2;
		document.popUpForm.pMode.name = NMODE;
		document.popUpForm.pMode.value = MODE;
	}
	document.popUpForm.target = target;
	document.popUpForm.action = POSTURL;
	document.popUpForm.submit();
	win.focus();

}

function oshietecallPopUpForm(){
///ポップアップ設定用フォーム////
	document.writeln('<form name="oshietecallPopUpForm" method="post"><INPUT type="hidden" name="MODE" value=""><INPUT type="hidden" name="Scd1" value=""><INPUT type="hidden" name="toiawase_shohin_name" value="">');
	document.writeln('</FORM>');
}

function oshietecallPopUpFormActive() { 
///ポップアップ設定用フォーム動的ページ////
	document.writeln('<form name="popUpForm" method="post" target="_blank" style="display:none"><INPUT type="hidden" name="pfm" value=""><INPUT type="hidden" name="pfm2" value=""><INPUT type="hidden" name="pMode" value="">');
	document.writeln('</FORM>');
}

function applyOshietecall(URL){
	var target = "apply";
	var win = window.open(URL,target,"toolbar=0,location=0,menubar=0,status=0,scrollbars=yes,resizable=yes,width=800");
}

/*
表示メッセージ
*/

function msg(no){
	switch(no){
		case 1:
			document.write('オペレータがオンラインお申し込みをお手伝いします。<br>ご相談のうえ、お客さまご自身でお申し込みを完了いただければ、オンライン申し込み限定特典の対象となります。');
			break;

		case 2:
			document.write('オペレータがオンラインお申し込みをお手伝いします。<br>ご相談のうえ、お客さまご自身でお申し込みを完了いただければ、オンライン申し込み限定ポイントを獲得できます。');
			break;

		case 3:
			document.write('オペレータがオンラインお申し込みをお手伝いします。');
			break;

		case 4:
			document.write('オペレータへの直通電話(無料)で今すぐお申し込みいただけます。<br>NTTコミュニケーションズの「おしえてコール」で電話をおつなぎします。<br>お客さまが入力する電話番号に、すぐにオペレータから電話がかかってきます。');
			break;
	}
}



/*
	OCN用おしえてコール
*/

function ocn_oshietecall(user_id,site_id){
	if(fg == 1){
		URL = "https://www.v-portal.ocn.ne.jp/Vp/contents/OSCall/OSCall.cgi?user_id=" + user_id + "&site_id=" + site_id;
		callURL = "<a href=javascript:popup('" + URL + "',null,'status=no,toolbar=no,menubar=no,location=no');>";
		
		oshietecallPopUpForm();
		document.write('<div id="oshietecallArea">');
		document.write('<div class="box">');
		document.write('<p class="mark"><img src="/common/img/oshietecall_ocn/mark_tell.gif" alt="無料"></p>');
		document.write('<p class="title"><img src="/common/img/oshietecall_ocn/title.gif" alt="お問い合わせ ～おしえてコール～ 専門の担当者がお答えします"></p>');
		document.write('<p class="txt">営業時間　午前9:00～午後9:00（土日祝含、年末年始は除きます）');
		document.write('<br>');
		document.write('※営業時間外の場合は<a href="javascript:oshietecallPopUp(\'https://apply.506506.ntt.com/Order/CBSOJ_SV03001\',\'MODE\',\'OUTBOUND\');">こちら</a>からご相談の予約ができます。</p>');
		document.write('<p class="button">');
		document.write(callURL);
		document.write('<img src="/common/img/oshietecall_ocn/button.gif" alt="電話番号を入力" border="0"></a></p>');
		document.write('</div>');
		document.write('<!-- /oshietecallArea --></div>');

	}
}