//↓スワップイメージ
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_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_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 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; }
}
//
//↓指定サイズのウインドウをモニタの中心に出す
//
//toolbar=ツールバー=バック、ネクスト、プリンタボタンなど
//location=ロケーション=アドレス
//status=ステイト=下の情報バー
//menubar=メニューバー=ファイル、編集、お気に入りなど
//scrollbars=スクロールバー=右スクロールバー
//resizable=リサイザブル=サイズ変更OK
//
//width=ワイド
//height=高さ
//top=y値
//left=x値
//
function jpgWindow(theURL) { //v2.0
  w = 440;
  h = 325;
  x = 0;
  y = 0;
  winName = "intheroom";
  features = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+w+",height="+h+",top="+y+",left="+x;
  win = window.open(theURL, winName, features);
  win.focus();
}
function designerWindow(theURL, winName, value) { //v2.0
  //w = 440;
  //h = 325;
  x = 0;
  y = 0;
  features = "toolbar=no,location=no,status=no,menubar=no,"+value+",top="+y+",left="+x;
  win = window.open(theURL, "winName", features);
  win.focus();
}
function designerWindow2(theURL, winName2, value) { //v2.0
  //w = 440;
  //h = 325;
  x = 0;
  y = 0;
  features = "toolbar=no,location=no,status=no,menubar=no,"+value+",top="+y+",left="+x;
  win = window.open(theURL, "winName2", features);
  win.focus();
}
function designerWindow3(theURL, winName3, value) { //v2.0
  //w = 440;
  //h = 325;
  x = 0;
  y = 0;
  features = "toolbar=no,location=no,status=no,menubar=no,"+value+",top="+y+",left="+x;
  win = window.open(theURL, "winName3", features);
  win.focus();
}
function designerWindow4(theURL, winName4, value) { //v2.0
  //w = 440;
  //h = 325;
  x = 0;
  y = 0;
  features = "toolbar=no,location=no,status=no,menubar=no,"+value+",top="+y+",left="+x;
  win = window.open(theURL, "winName4", features);
  win.focus();
}
////////////////////////////////////////////////////////////////////////

//↓お問い合わせポップアップ（試し）
function openInquiryWindow_2(formName) {
 inqwin = window.open("http://www.rakuten.ne.jp/gold/aflat/system/deliverydate.html",'InquiryWindow','scrollbars=no,resizable=no,width=560,height=514');
 inqwin.focus();
 f = document.forms[formName];
 f.target="InquiryWindow";
 f.submit();
}

//↓その他
function openWindow(theURL, winName) { //v2.0
  w = 680;
  h = 480;
  x = (screen.availWidth / 2) - (w / 2);
  y = (screen.availHeight / 2) - (h / 2);
  features = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+w+",height="+h+",top="+y+",left="+x;
  winName = window.open(theURL, winName, features);
}
//↓フルスクリーンを(ｘ:0,ｙ:0)に出す
function openWindowAll(theURL, winName) { //v2.0
  var w=screen.availWidth;
  var h=screen.availHeight;
  x = 0;
  y = 0;
  features = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+w+",height="+h+",top="+y+",left="+x;
  winName = window.open(theURL, winName, features);
}
//↓pumaharajyukuスクリプト
function afOpen(){
	var w=screen.availWidth;
	var h=screen.availHeight;
	strAppVer = navigator.appVersion;
	if(strAppVer.indexOf("Win")>=0){ //OS--Windows
		newWin = window.open("shop/harajuku/harajuku.html","harajuku","scrollbars=no,width="+w+",height="+h+",left=0,top=0,status=no,fullscreen=yes,resizable=no,directories=no,location=no");
		newWin.moveTo(0,0);
		//subWin = window.open("shop/harajuku/info.html","Info","scrollbars=no,width=300,height=200,left=0,top=0,status=no,resizable=yes,directories=no,location=no");
		//subWin.focus();
	}else{//OS--Mac
		newWin = window.open("shop/harajuku/check.html","","width=1,height=1,left=1,top=1,resizable=no,scrollbars=no,menubar=no,toolbar=no,directories=no,location=no,status=no");
		newWin.moveTo(0,0);
		//subWin = window.open("shop/harajuku/info.html","Info","scrollbars=no,width=300,height=200,left=0,top=0,status=no,resizable=yes,directories=no,location=no");
		//subWin.focus();
	}
	//newWin.blur();
}
//↓closeスクリプト、★.close();、★=閉じるウィンドウ名
function f_close(){
	window.close();
}
//↓納期確認用
function openAtpWindow(p_item_id) {
 newwin = window.open('about:blank','atpWin','scrollbars=yes,resizable=no,width=300,height=50');
 newwin.moveTo(500,200);
 newwin.focus();
 atpForm.target = 'atpWin';
 atpForm.item_id.value = p_item_id;
 atpForm.quantity.value = atpForm.elements["quantity_" + p_item_id].value;
 atpForm.submit();
}

////////////////////////////////////////////////////////////////////////
//↓TOPバナーランダム
function bannerclass(url,src,alt,target){
this.url = url;
this.src = src;
this.alt = alt;
this.target = target;
}

function getBannerAddress(){
var i = 0;	
var tempAddressList = new Array();
while(document.getElementById('r_banner' + i)){
tempAddressList[i] = new bannerclass(
document.getElementById('r_banner' + i).parentNode.href,
document.getElementById('r_banner' + i).src,
document.getElementById('r_banner' + i).alt,
document.getElementById('r_banner' + i).parentNode.target
);
i++;
}
return tempAddressList;
}

function setBannerAddress(tempBannerData){
var bannernum = tempBannerData.length;
var i;
for (i = 0; i < bannernum; i++){
var rndNum = Math.floor(Math.random() * bannernum);
var tempData = tempBannerData[rndNum];
tempBannerData[rndNum] = tempBannerData[i];
tempBannerData[i] = tempData;
}
for (i = 0; i < bannernum; i++){
document.getElementById('r_banner' + i).parentNode.href = tempBannerData[i].url;
document.getElementById('r_banner' + i).src = tempBannerData[i].src;
document.getElementById('r_banner' + i).alt = tempBannerData[i].alt;
document.getElementById('r_banner' + i).parentNode.target = tempBannerData[i].target;
}
}

function setBanner(){
var tempdata = getBannerAddress();

setBannerAddress(tempdata);
}			

if (window.addEventListener) window.addEventListener("load", setBanner, false);
else if (window.attachEvent) window.attachEvent("onload", setBanner);
else window.onload = setBanner;
//

////////////////////////////////////////////////////////////////////////
//↓ thickbox　popupの読み込み用

//document.write("<script type='text/javascript' src='/global-script/jquery.js'></script>");
document.write("<script type='text/javascript' src='/global-script/jquery.ui.draggable.js'></script>");
document.write("<script type='text/javascript' src='/global-script/thickbox.js'></script>");

//

//↓ Linkbox　の読み込み用

document.write("<script type='text/javascript' src='/global-script/LinkBox.js'></script>");


//


