﻿function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_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_findObj(n, d) { //v4.01
  if(typeof(n)=="object")return n;
  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_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];}
}

/* トップランダムバナー */
function rand_banner(){
	if(rand_banner_arr.length < 3){
		max_n = rand_banner_arr.length;
	}else{
		max_n = 3;
	}

	for(n=0; n<max_n; n++){
		//ランダム
		do{
			i = parseInt(Math.random() * rand_banner_arr.length);
		}while (rand_banner_arr[i] == "");
		
		//li 要素の設定
		var e_Li = document.createElement('li');
		e_Li.setAttribute("id","rand_liid" + i);
		if(n!=2){
			e_Li.setAttribute("class","t_b");
			e_Li.setAttribute("className","t_b");//IE用
		}
		//a 要素の設定
		var e_A = document.createElement('a');
		e_A.setAttribute("href",rand_banner_arr[i][2]);
		e_A.setAttribute("target",rand_banner_arr[i][3]);
		e_A.setAttribute("id","rand_aid" + i);
		//img 要素の設定
		var e_Img = document.createElement('img');
		e_Img.setAttribute("src",rand_banner_arr[i][0]);
		e_Img.setAttribute("alt",rand_banner_arr[i][1]);
		
		//既存HTML内の要素に作成した要素を追加
		setImg_Element = document.getElementById("rand_banner");//ul 要素を指定
		setImg_Element.appendChild(e_Li);//li 要素追加を実行
		setImg_Element = document.getElementById("rand_liid" + i);//li 要素を指定
		setImg_Element.appendChild(e_A);//a 要素追加を実行
		setA_Element = document.getElementById("rand_aid" + i);//a 要素を指定
		setA_Element.appendChild(e_Img);//img 要素追加を実行

		rand_banner_arr[i] = "";//要素を空に		
	}
}

/* キャプチャのキャッシュ対策 */
function reloadCaptchaImg() {
	document.images['captchaimg'].src = '/pc/Captcha.jpg?'+(new Date()).getTime();
}

function fnWinOpen(){ 
 // 横幅780px、縦幅670pxのウインドウを開く 
  window.open("http://dw.daletto.com/help/help_guide_index.html", 'win','width=780,height=670,scrollbars=yes,directories=no,menubar=no,resizable=yes,toolbar=no,location=yes,status=yes'); 
}

function anWinOpen(){ 
 /* 横幅670px、縦幅950pxのウインドウを開く */
  window.open("dw_agreement.html", 'win','width=670,height=200,scrollbars=yes,directories=no,menubar=no,resizable=yes,toolbar=no,location=yes,status=yes'); 
}

 
function bnWinOpen(){ 
 /* 横幅780px、縦幅670pxのウインドウを開く */
  window.open("http://dw.daletto.com/help/help_faq_index.html", 'win','width=780,height=670,scrollbars=yes,directories=no,menubar=no,resizable=yes,toolbar=no,location=yes,status=yes'); 
}


function ruWinOpen(){ 
 /* 横幅780px、縦幅850pxのウインドウを開く */
  window.open("dw_rule.html", 'win','width=780,height=850,scrollbars=yes,directories=no,menubar=no,resizable=yes,toolbar=no,location=yes,status=yes'); 
}

function cgWinOpen(){ 
 // 横幅620px、縦幅720pxのウインドウを開く(for charge) */
  window.open("newmember_chargeguide_01.html", 'win','width=620,height=720,scrollbars=yes,directories=no,menubar=no,resizable=yes,toolbar=no,location=yes,status=yes'); 
}

function dpWinOpen(){ 
 // 横幅620px、縦幅670pxのウインドウを開く(for charge) */
  window.open("/pc/dalepo.html", 'win','width=620,height=620,scrollbars=yes,directories=no,menubar=no,resizable=yes,toolbar=no,location=yes,status=yes'); 
}