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
  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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function subWin1(){
window.open("1003/rec01.html","window1","resizable=yes,menubar=no,status=no,location=no,scrollbars=yes,width=540,height=650");
}
function subWin2(){
window.open("1003/rec02.html","window1","resizable=yes,menubar=no,status=no,location=no,scrollbars=yes,width=540,height=650");
}
function subWin3(){
window.open("1003/rec03.html","window1","resizable=yes,menubar=no,status=no,location=no,scrollbars=yes,width=540,height=650");
}
function subWin4(){
window.open("1003/rec04.html","window1","resizable=yes,menubar=no,status=no,location=no,scrollbars=yes,width=540,height=650");
}
function subWin5(){
window.open("1003/rec05.html","window1","resizable=yes,menubar=no,status=no,location=no,scrollbars=yes,width=540,height=650");
}
function subWin6(){
window.open("1003/rec06.html","window1","resizable=yes,menubar=no,status=no,location=no,scrollbars=yes,width=540,height=650");
}
function subWin7(){
window.open("kyubo.html","window1","resizable=yes,menubar=no,status=no,location=no,scrollbars=yes,width=600,height=770");
}
function subWin8(){
window.open("aomori_hanbai_10.html","window1","resizable=yes,menubar=no,status=no,location=no,scrollbars=yes,width=600,height=880");
}
function subWin9(){
window.open("0912/rec07.html","window1","resizable=yes,menubar=no,status=no,location=no,scrollbars=yes,width=540,height=650");
}

var delay = 500; //同じドメインならもっと短くてよい
var topPage = "https://www.nakaya.jp/nakayashop/Top.do";
var targetPage;
var timerId;
var sub;

function subWindowOpen(){
	//別画面を開いてTOPページへアクセスする
	sub=window.open(topPage,"subwindow");

	//インターバルタイマをセットして、定期的にTOPがロードされたかチェックする
	timerId = setInterval("subWindowCheck()", delay);
}

function subWindowCheck(){

	//別画面が閉じられていないかチェック
	if(sub.closed){

		//すでに閉じられたら、インターバルタイマをクリア
		clearInterval(timerId);

	} else {

		try{
			//同じドメイン内ならロード完了をチェック
			if(sub && sub.document && sub.document.body && sub.document.getElementById){
				//ロードが完了したので別画面のページを遷移させる
				subWindowChange();
			}
		}
		catch(e){
			//別ドメインならエラーをキャッチした時点でロードできていると判断
			//別画面のページを遷移させる
			subWindowChange();
		}
	}
}

function subWindowChange(){

	//履歴が残らないようにreplaceでページを変更
	sub.location.replace(targetPage);

	//インターバルタイマをクリア
	clearInterval(timerId);
}

function setTargetPage(page){

	//ターゲットページを設定
	targetPage = page;
}

var msg = '本店営業時間　10:00〜18:30（夏期は〜19:00まで）／仲見世店営業時間　9:00〜18:30　※土日・祝は9:00〜20:00（夏期は〜20:00まで）'; // スクロールさせるメッセージ記入
var speed = 500; // スクロールのスピード（数値が小さい程速くなる） 
var move = 3; // スクロールのなめらかさ（数値が小さい程なめらかになる） 

function bar_scroll(){ 
msg = msg.substring(move, msg.length) + msg.substring(0, move); 
window.status = msg; 
setTimeout("bar_scroll()", speed); 
}