/* マウスオーバー */

function preload() {
	var img01 = new Image();
	var img02 = new Image();
	var img03 = new Image();
	var img04 = new Image();
	var img05 = new Image();
	var img06 = new Image();
	var img07 = new Image();
	var img08 = new Image();
	var img09 = new Image();
	var img10 = new Image();
	var img11 = new Image();
	var img12 = new Image();
	var img13 = new Image();
	var img14 = new Image();
	var img15 = new Image();
	img01.src = "/image/common/nav1lnk12.gif";
	img03.src = "/image/common/nav1lnk22.gif";
	img02.src = "/image/common/nav1lnk32.gif";
	img04.src = "/image/common/nav1lnk42.gif";
	img05.src = "/image/common/nav2lnk12.gif";
	img06.src = "/image/common/nav2lnk22.gif";
	img07.src = "/image/common/nav2lnk32.gif";
	img08.src = "/image/common/nav3lnk12.gif";
	img09.src = "/image/common/nav3lnk22.gif";
	img10.src = "/image/common/nav3lnk32.gif";
	img11.src = "/image/common/nav3lnk42.gif";
	img12.src = "/image/common/nav3lnk52.gif";
	img13.src = "/image/common/nav5lnk12.gif";
	img14.src = "/image/common/nav5lnk22.gif";
	img15.src = "/image/common/nav5lnk32.gif";
	
	
	// 貸金業協会の表記
	var obj = document.getElementById('societty');
	if(obj){
		var source = "株式会社オリエントコーポレーション<br>";
		source += "〒102-8503　東京都千代田区麹町5丁目2番地1<br>";
		source += "登録番号　関東財務局長（10）第00139号<br>";
		source += "<img src=\"/image/common/lgo_jfsa.gif\" align=\"absmiddle\" height=\"20\" width=\"20\">&nbsp;日本貸金業協会会員　第000006号<br>";
		source += "<table style=\"border: 1px solid #CCCCCC; margin-top: 3px; margin-bottom: 15px;\" border=\"0\" cellpadding=\"0\" cellspacing=\"5\">";
		source += "<tbody><tr>";
		source += "<td class=\"main\">";
		source += "【返済等でお困りのときは】<br>";
		source += "日本貸金業協会 貸金業相談・紛争解決センター<br>";
		source += "0570-051-051<br>";
		source += "（受付時間　9:00〜17:30　土、日、祝日、年末年始を除く）</td>";
		source += "</tr></tbody>";
		source += "</table>";
		source += "契約内容をご確認のうえ、計画的なご利用をお願いします。";
		obj.innerHTML = source;
	}

	var str = document.getElementById('card_anounce');
	if(str){
		var source = "<img src=\"/image/common/dot.gif\" width=\"1\" height=\"10\" border=\"0\" alt=\"\">";
		str.innerHTML = source;
	}
	// ここまで
	
}

function ImgChange(imgNum,imgSrc) {
	document.images[imgNum].src = imgSrc;
}


/*地図ウィンドウ*/
function WinOpen1(){
window.open('','sw01','width=800,height=600,left=0,top=0,toolbar=1,location=0,scrollbars=1,resizable=1,status=1,menubar=1');
}

/*採用情報　研修(正社員)*/
function WinOpen3(){
window.open('','sw03','width=620,height=600,left=0,top=0,toolbar=1,location=0,scrollbars=1,resizable=1,status=1,menubar=1');
}

/*採用情報　研修(契約社員)*/
function WinOpen4(){
window.open('','sw04','width=520,height=450,left=0,top=0,toolbar=1,location=0,scrollbars=1,resizable=1,status=1,menubar=1');
}

/*理解度RPG*/
var remote = null;
function subwin() {
	remote = window.open('', 'subwin', 'width=390,height=350,scrollbars=1,resizable=no,scrollbars=no');
	if (remote != null) {
		remote.location.href = '/recruit/about/check/index.html';
		remote.focus()
	}
}

/*ゴールドカード申し込み用*/
function onSubmit()
{
	objFrm = document.frm

	if ((objFrm["A"][0].checked == true) && (objFrm["B"][0].checked == true))
		document.frm.submit();
		//location.href = "https://www2.orico.co.jp/ssl/card/order/common/Initial.asp";		//双方とも「yes」の場合
	else
		alert("ご入会基準外です。\n申し訳ございませんがお申込みできません。");
		//どちらかが「no」の場合
}

/*今すぐ新規登録・今すぐログイン*/

function openLogin() {
	var w = window.open("", "login", "_blank,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes,status=yes");
	if((w == window) || w.closed) { w.focus();} else {w.focus();}
	return(false);
}

/* 知って使ってツアー */
	var subopen = null
	function Winopen2()
		{	if (navigator.userAgent.indexOf("MSIE 4") != -1)
				{	subopen=window.open("","sw02","width=800,height=475,left=0,top=0,toolbar=1,location=0,directories=0,scrollbars=1,resizable=1,menubar=1");
					if (!subopen.opener) subopen.opener=self;	}
			else
				{	subopen=window.open("","sw02","width=800,height=475,left=0,top=0,toolbar=1,location=0,directories=0,scrollbars=1,resizable=1,menubar=1");
					if (!subopen.opener) subopen.opener=self;
					if (window.focus) subopen.focus();	}
	}

/*本人限定受取郵便ウィンドウ*/
function openWin() {
	window.open('','card','toolbar=0,location=0,scrollbars=1,resizable=1,width=800,height=600');
}

/*商品詳細ウィンドウ*/
function WinOpen5(){
window.open('','sw05','width=800,height=570,left=0,top=0,toolbar=1,location=0,scrollbars=1,resizable=1,status=1,menubar=1');
}

/*アプティくんの部屋ウィンドウ*/
function WinOpen6(){
window.open('','sw06','width=835,height=600,left=0,top=0,toolbar=1,location=0,scrollbars=1,resizable=1,status=1,menubar=1');
}

/* 人生相談 */

function WinOpen10(){
window.open('','runrun','width=762,height=643,left=0,top=0,toolbar=0,location=0,scrollbars=0,resizable=1,status=0,menubar=0');
}

/* 惑星サルーン */

function WinOpen11(){
window.open('http://www.wakusei-saloon.jp','','toolbar=0,location=0,status=1,scrollbars=1,resizable=1');
}

/* OricoPayment */

function WinOpen12(){
var w = window.open('','payment','toolbar=1,location=1,status=1,scrollbars=1,resizable=1,status=1,menubar=1');
w.window.focus();
}

/*カードを作る＞キーワードで選ぶプルダウンリスト*/
function navi(obj) {
 url = obj.options[obj.selectedIndex].value;
 if(url != "") {
   location.href = url;
  }
}

/*カードを作る＞カードばなしに花が咲くツアー*/
	function opn1()
	{
		opener.window.location="/school/class/basic/index.html";
		opener.window.focus();
	}

	function opn2()
	{
		opener.window.location="/school/class/bean/plastic_01.html";
		opener.window.focus();
	}

	function opn3()
	{
		opener.window.location="/point/sml/index.html";
		opener.window.focus();
	}

	function opn4()
	{
		opener.window.location="/use/shopping/gather_01.html";
		opener.window.focus();
	}

	function opn5()
	{
		opener.window.location="/use/shopping/cddvd.html";
		opener.window.focus();
	}

	function opn6()
	{
		opener.window.location="/cardorder/index_key.html";
		opener.window.focus();
	}



	function chk()
	{
		if(window.opener.closed){ cl2(); }
	}

	function cl2()
	{
		window.opener="";
		window.close();
	}


/*カードで得する＞暮らスマイル*/
function Jump1() {
 Select = document.f1.Sel1.selectedIndex;
 location.href = document.f1.Sel1.options[Select].value;
}

function Jump2() {
 Select = document.f2.Sel2.selectedIndex;
 location.href = document.f2.Sel2.options[Select].value;
}

/*カードを使う＞国内旅行＞国内パッケージツアーお申込み注意事項*/
function Jump3() {
 Select = document.f3.Sel3.selectedIndex;
 if (Select != '') {
  window.open(document.f3.Sel3.value);
 }
}

function Jump4() {
 Select = document.f4.Sel4.selectedIndex;
 if (Select != '') {
  window.open(document.f4.Sel4.value);
 }
}



/*カードを使う＞eオリコサービス*/

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


/* Newマークの表示 */
function newUp(y, m, d, c) {
  delDay = 7; // 何日後に削除するか
  oldDay = new Date(y + "/" + m + "/" +d);
  newDay = new Date();
  d =(newDay - oldDay) / (1000 * 24 * 3600);
  if(d <= delDay) {
    // Newマーク
    if(c == "new") document.write("<img src='/image/common/ico_new2.gif' alt='NEW' border='0' width='29' height='14' align='absmiddle'>");
  }
}
function newUpalp(y, m, d, c) {
  delDay = 7; // 何日後に削除するか
  oldDay = new Date(y + "/" + m + "/" +d);
  newDay = new Date();
  d =(newDay - oldDay) / (1000 * 24 * 3600);
  if(d <= delDay) {
    // Newマーク
    if(c == "new") document.write("<img src='/image/common/ico_new3.gif' alt='NEW' border='0' width='29' height='14' align='absmiddle'>");
  }
}

/*Newカードを使う 20080904*/
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/* 20080401_トップページNew等テキストマークの表示 */
function txtUp(y, m, d, c) {
  var delDay = 7; // 何日後に削除するか
  var oldDay = new Date(y + "/" + m + "/" +d);
  var newDay = new Date();
  d =(newDay - oldDay) / (1000 * 24 * 3600);
  if(d <= delDay) {
    // TXT_writing
    document.write("<span>"+c+"!</span>");
  }
}

/* 20080917_キャンペーン一覧New等テキストマークの表示 */
function DateLmt(d, c, b) {
	var myD = new Date();
	var myDate = myD.getDate();
	if(d <= myDate){
			document.write("<strong style='color:#"+b+";'>"+c+"!</strong>");
	}
}
function DtxtUp(y,m,d,c){
 	var delDay = -7; // 何日後に消去するか
	var set_y = y;
	var set_m = m;
	var set_d = d;
	var now = new Date(); 
	var spday= new Date(set_y,set_m-1,set_d); 
	var anum = (spday.getTime() - now.getTime())/(24*60*60*1000); 
	anum = Math.ceil(anum);
	if(delDay <= anum){
	document.write("<span>"+c+"!</span>");
	}
}

function Closetxt(y,m,d,c){
 	var delDay = 11; // 何日前に表示するか
	var set_y = y;
	var set_m = m;
	var set_d = d;
	var now = new Date(); 
	var spday= new Date(set_y,set_m-1,set_d); 
	var anum = (spday.getTime() - now.getTime())/(24*60*60*1000); 
	anum= Math.ceil(anum);
	if(anum <= delDay){
	document.write("<span style='font-weight: normal; color: #FF33FF;'>"+c+"!</span>");
	}
}

/* /use/eorico/index.html バナー表示用　*/
function BnrUp(yy,mm,dd,y,m,d){
	var set_yy = yy;
	var set_mm = mm;
	var set_dd = dd;
	var set_y = y;
	var set_m = m;
	var set_d = d;
	var now = new Date(); 
	var startday= new Date(set_yy,set_mm-1,set_dd); 
	var lastday= new Date(set_y,set_m-1,set_d+1); 
	var anum = lastday.getTime(); 
	var bnum = startday.getTime(); 
	var cnum = now.getTime();  
	if(bnum <= cnum){
		if(cnum <= anum){
			document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
			document.write("<tr>");
			document.write("<td><a href=\"/link/eorico/login.html\" onClick=\"openLogin();\" target=\"login\"><img src=\"image/bnr_cinema.jpg\" alt=\"eオリコ限定プレゼント 映画鑑賞券プレゼント eオリコサービスご利用の方限定で毎月当たる 今すぐログイン\" width=\"580\" height=\"76\" border=\"0\"></a></td>");
			document.write("</tr>");
			document.write("</table>");
		}
	}
}

/* 20100729_会社案内トップNew等テキストマークの表示 */
function txtUp30(y, m, d, c) {
  var delDay = 30; // 何日後に削除するか
  var oldDay = new Date(y + "/" + m + "/" +d);
  var newDay = new Date();
  d =(newDay - oldDay) / (1000 * 24 * 3600);
  if(d <= delDay) {
    // TXT_writing
    document.write("<strong style=\"color:#F00000;\">"+c+"!</strong>");
  }
}

/* 20101112_トップページeオリコ上部の更新表示 */
function eoricoUp(fd, ld, hd) {
	var obj = document.getElementById('eorico_update');
  	var newDay = new Date();
	var year = newDay.getFullYear();
	var mon  = newDay.getMonth();
	var monplus  = newDay.getMonth() + 1;
	var date = newDay.getDate();
	var Hour = newDay.getHours();

	var firstDay = new Date(year + "/" + monplus + "/" + fd);
	var nowDay = new Date(year + "/" + mon + "/" + date);
	var lastDay = new Date(year + "/" + monplus + "/" + ld);
  d =(nowDay - firstDay) / (1000 * 24 * 3600);
  if(date <= ld && fd < date) {
		if(obj){
			var source = "<div class=\"element mainte\">\n";
			source += "<div><img src=\"image/top/r_top.gif\" alt=\"\" width=\"165\" height=\"6\" border=\"0\"></div>";
			source += "<p>" + monplus + "月のご利用明細情報を更新しました！</p>";
			//source += "<p><a href=\"/mainte/information_maintenance.html\" onClick='WinOpen1()' target=\"sw01\">メンテナンスのお知らせ</a></p>";
			source += "<div><img src=\"image/top/r_bottom.gif\" alt=\"\" width=\"165\" height=\"6\" border=\"0\"></div>";
			source += "</div>";
			obj.innerHTML = source;
		}
  }
  if(fd == date){
	  if(Hour >= hd){
		if(obj){
			var source = "<div class=\"element mainte\">\n";
			source += "<div><img src=\"image/top/r_top.gif\" alt=\"\" width=\"165\" height=\"6\" border=\"0\"></div>";
			source += "<p>" + monplus + "月のご利用明細情報を更新しました！</p>";
			//source += "<p><a href=\"/mainte/information_maintenance.html\" onClick='WinOpen1()' target=\"sw01\">メンテナンスのお知らせ</a></p>";
			source += "<div><img src=\"image/top/r_bottom.gif\" alt=\"\" width=\"165\" height=\"6\" border=\"0\"></div>";
			source += "</div>";
			obj.innerHTML = source;
		}
	  }
  }
		// ここまで
}

/* 20101112_トップページeオリコ上部の更新表示 */
function scrumUp(fd, ld, hd) {
	var obj = document.getElementById('scrumble');
	var delDay = 10; // 何日後に削除するか
	var newDay = new Date();
	var year = newDay.getFullYear();
	var mon  = newDay.getMonth();
	var monplus  = newDay.getMonth() + 1;
	var date = newDay.getDate();
	var Hour = newDay.getHours();

  var firstDay = new Date(year + "/" + monplus + "/" + fd);
  var nowDay = new Date(year + "/" + monplus + "/" + date);
  var lastDay = new Date(year + "/" + monplus + "/" + ld);
//  var d =(lastDay - nowDay) / (1000 * 24 * 3600);
  if(newDay <= lastDay && firstDay <= newDay && Hour <= hd) {
//  if(d >= 0 && Hour <= hd){
		if(obj){
			var source = "<div class=\"element mainte\">\n";
			source += "<div><img src=\"image/top/r_top.gif\" alt=\"\" width=\"165\" height=\"6\" border=\"0\"></div>";
			source += "<p><a href=\"/mainte/information_20110107.html\" onClick='WinOpen1()' target=\"sw01\">【eオリコサービス】つながりにくい状況について</a></p>\n";
			source += "<div><img src=\"image/top/r_bottom.gif\" alt=\"\" width=\"165\" height=\"6\" border=\"0\"></div>";
			source += "</div>";
			obj.innerHTML = source;
		}
  }
		// ここまで
}


/* 20101117_エコカイロバナーの表示 */
function kairoBnr(y, m, d){
	var obj = document.getElementById('ecokairo');
  var oldDay = new Date(y + "/" + m + "/" +d);
  var newDay = new Date();
  if(oldDay >= newDay){
		if(obj){
			var source = "<a href=\"/point/campaign/20101115_ecokairo.html\">";
			source += "<img src=\"image/bnr_ecokairo.gif\" alt=\"\" width=\"145\" height=\"90\" border=\"0\" style=\"margin-top: 20px;\">";
			source += "</a>";
			obj.innerHTML = source;
		}
  }
}

/* 20110930_マイ月リボキャンペーンバナーの表示 */
function MyBnr(y, m, d){
	var obj = document.getElementById('mybnr');
	var oldDay = new Date(y,m,d);
	var newDay = new Date();
  if(oldDay >= newDay){
		if(obj){
			var source = "<a href=\"/point/campaign/20110929_ptdouble.html\">";
			source += "<img src=\"image/atorevo/bnr_cp_point2.jpg\" alt=\"エントリー＆マイ月リボ ポイント2倍キャンペーン 12月31日まで\" width=\"145\" height=\"200\" border=\"0\" style=\"margin-top:20px;\">";
			source += "</a>";
			source += "<a href=\"/use/basic/atorevo_cashing.html\">";
			source += "<img src=\"image/atorevo/bnr_atorevocash.gif\" alt=\"「キャッシングリボ払い変更」\" width=\"145\" height=\"100\" border=\"0\" style=\"margin-top:20px;\">";
			source += "</a>";
			obj.innerHTML = source;
		}
  }
}

function SwtDev(){
	// iPhone/Android振り分け
	if ((navigator.userAgent.indexOf('iPhone') > 0 && navigator.userAgent.indexOf('iPad') == -1) || navigator.userAgent.indexOf('iPod') > 0 || (navigator.userAgent.indexOf('Android') > 0 && navigator.userAgent.indexOf('Mobile') > 0)) {
		/*
		if(confirm('このサイトにはスマートフォン用のサイトがあります。表示しますか？')) {
			location.href = 'http://m-orico.jp';
		}
		*/
		var obj = document.getElementById('smtBtn');
		if(obj){
			var source = "<a href=\"/link/smp.html\"><img src=\"image/top/btn_smt.jpg\" width=\"738\" height=\"120\" alt=\"スマートフォン用ページ\" border=\"0\"<a>";
			obj.innerHTML = source;
		}
	}else{
		var obj = document.getElementById('smtBtn');
		obj.className = "none";
	}
}
