// _HpbScrollStatus: ステータス行にスクロールメッセージを表示します
var _hsstmrID = null;
var _hsstmrON = false;
var _hsspos   = 80;

function _HpbScrollStatus(msg, delay)
{
  if (dBsftUaCheck() != 0)
  {
    window.status = msg;
    return true;
  }
  if (_hsstmrON)
  {
    window.clearTimeout(_hsstmrID);
    _hsstmrON = false;
  }

  var statmsg = "";

  if (_hsspos >= 0)
  {
    for (s = 0; s < _hsspos; s++)
    {
      statmsg += " ";
    }

    statmsg += msg;
  }
  else
  {
    statmsg = msg.substring(-_hsspos, msg.length);
  }

  for ( s=statmsg.length+1 ; s<80 ; s++ ) 
  {
    statmsg += " ";
  }

  window.status = statmsg;
  
  _hsspos = (-_hsspos > msg.length) ? 80 : _hsspos - 1;  

  fname = "_HpbScrollStatus('" + msg + "', " + delay + ")";
  _hsstmrID = window.setTimeout(fname, delay);
  _hsstmrON = true;
}

function _HpbStopScrollStatus()
{
  if (_hsstmrON)
  {
    window.clearTimeout(_hsstmrID);
    window.status = window.defaultStatus;
    _hsstmrID = null;
    _hsstmrON = false;
  }
}

function dBsftGoUrl(url) {
    if ( url != '') 
        window.location = url;
}

function dBsftStatusMessage(msg) {
    window.status = msg;
    return true;
}

function BrStatusMessage(msg) {
    _HpbStopScrollStatus();
    window.status = msg;
    return true;
}

function dBsftUaCheck() {
    if(navigator.appName == "Netscape" && eval(navigator.appVersion.charAt(0)) >=4 )
        return 1;
    if (navigator.appName == "Microsoft Internet Explorer" && eval(navigator.appVersion.charAt(0)) >=4 )
        return 0;
    return -1;
}

function dBsftBackgroundStyle(target, clr, srcPath) {
    if (dBsftUaCheck() != 0 )
        return;
    var obj;
    if (typeof(target) == 'object')
        obj = target;
    else if (target == 'body')
        obj = window.document.body;
    else
        obj = document.all[target];
    if (obj == null)
        return;
    with (obj) {
        if (clr != '*dBNotApply*') {
            if (clr == 'null')
                style.backgroundColor = '';
            else
                style.backgroundColor = clr;
        }
        if (srcPath != '*dBNotApply*') {
            if (srcPath == '')
                style.backgroundImage = 'none';
            else 
                style.backgroundImage = 'url(' + srcPath + ')';
        }
    }
}

// HpbImgPreload: 画像のプリロードを行ないます
//
function HpbImgPreload()
{
  var appVer=parseInt(navigator.appVersion);
  var isNC=(document.layers && (appVer >= 4)); // Netscape Navigator 4.0 or later
  var isIE=(document.all    && (appVer >= 4)); // Internet Explorer  4.0 or later
  if (isNC || isIE)
  {
    if (document.images)
    {
      var imgName = HpbImgPreload.arguments[0];
      var cnt;
      swImg[imgName] = new Array;
      for (cnt = 1; cnt < HpbImgPreload.arguments.length; cnt++)
      {
        swImg[imgName][HpbImgPreload.arguments[cnt]] = new Image();
        swImg[imgName][HpbImgPreload.arguments[cnt]].src = HpbImgPreload.arguments[cnt];
      }
    }
  }
}
// HpbImgFind: Imageオブジェクトを探します
//
function HpbImgFind(doc, imgName)
{
  for (var i=0; i < doc.layers.length; i++)
  {
    var img = doc.layers[i].document.images[imgName];
    if (!img) img = HpbImgFind(doc.layers[i], imgName);
    if (img) return img;
  }
  return null;
}
// HpbImgSwap: 画像を入れ換えます
//
function HpbImgSwap(imgName, imgSrc)
{
  var appVer=parseInt(navigator.appVersion);
  var isNC=(document.layers && (appVer >= 4)); // Netscape Navigator 4.0 or later
  var isIE=(document.all    && (appVer >= 4)); // Internet Explorer  4.0 or later
  if (isNC || isIE)
  {
    if (document.images)
    {
      var img = document.images[imgName];
      if (!img) img = HpbImgFind(document, imgName);
      if (img) img.src = imgSrc;
    }
  }
}
var swImg; swImg=new Array;

function BrGetLastUpdate()
{
	date = new Date(document.lastModified);
	
	year = date.getYear();
	
	if ( year < 2000 ) {
		if ( year >= 100 ) {
			year = year + 1900;
		}
		if ( year < 10 ) {
			year = "200" + year;
		}
		else if ( year < 100 ) {
			year = "20" + year;
		}
		else if ( year < 1000 ) {
			year = "2" + year;
		}
	}
	
	month = date.getMonth()+1;
	if ( month < 10 ) {
		month = "0" + month;
	}

	day = date.getDate();
	if ( day < 10 ) {
		day = "0" + day;
	}
	
	update = year + "/" + month + "/" + day;
	
	return update;
}

function BrMenuDsp(dir)
{
	if ( frames.parent.length == 0 ) {
		HpbImgPreload('_HPB_ROLLOVER1', dir+'logo/menu/top.gif', dir+'logo/menu/top1.gif');
		HpbImgPreload('_HPB_ROLLOVER2', dir+'logo/menu/padi.gif', dir+'logo/menu/padi1.gif');
		HpbImgPreload('_HPB_ROLLOVER3', dir+'logo/menu/br.gif', dir+'logo/menu/br1.gif');
		HpbImgPreload('_HPB_ROLLOVER4', dir+'logo/menu/course.gif', dir+'logo/menu/course1.gif');
		HpbImgPreload('_HPB_ROLLOVER5', dir+'logo/menu/tour.gif', dir+'logo/menu/tour1.gif');
		HpbImgPreload('_HPB_ROLLOVER6', dir+'logo/menu/photo.gif', dir+'logo/menu/photo1.gif');
		HpbImgPreload('_HPB_ROLLOVER7', dir+'logo/menu/link.gif', dir+'logo/menu/link1.gif');

		document.write("<DIV ALIGN=CENTER><TABLE CELLSPACING=0 CELLPADDING=0 HEIGHT=0>");
		document.write("    <TR>");
		document.write("      <TD ALIGN=LEFT VALIGN=TOP>");
		document.write("        <A href=\""+dir+"index.html\" id=\"_HPB_ROLLOVER1\" onmouseout=\"HpbImgSwap('_HPB_ROLLOVER1','"+dir+"logo/menu/top.gif');_HpbScrollStatus(status_msg, 100);\" onmouseover=\"HpbImgSwap('_HPB_ROLLOVER1','"+dir+"logo/menu/top1.gif'); return BrStatusMessage('トップページへ移動');\" >");
		document.write("<IMG src=\""+dir+"logo/menu/top.gif\" alt=\"ﾄｯﾌﾟ･ﾍﾟｰｼﾞ\" align=\"TOP\" width=\"100\" height=\"30\" vspace=\"0\" hspace=\"0\" border=\"0\" title=\"Top Page\" name=\"_HPB_ROLLOVER1\">");
		document.write("        </A>");
		document.write("      </TD>");

		document.write("      <TD ALIGN=LEFT VALIGN=TOP>");
		document.write("        <A href=\""+dir+"whatpadi.html\" id=\"_HPB_ROLLOVER2\" onmouseout=\"HpbImgSwap('_HPB_ROLLOVER2','"+dir+"logo/menu/padi.gif');_HpbScrollStatus(status_msg, 100);\" onmouseover=\"HpbImgSwap('_HPB_ROLLOVER2','"+dir+"logo/menu/padi1.gif'); return BrStatusMessage('Ｗｈａｔ’ｓ ＰＡＤＩのページへ移動');\" >");
		document.write("<IMG src=\""+dir+"logo/menu/padi.gif\" alt=\"What's PADI\" align=\"TOP\" width=\"100\" height=\"30\" vspace=\"0\" hspace=\"0\" border=\"0\" title=\"What's PADI\" name=\"_HPB_ROLLOVER2\"></A>");
		document.write("      </TD>");

		document.write("      <TD ALIGN=LEFT VALIGN=TOP>");
		document.write("	<A href=\""+dir+"whatbr.html\" id=\"_HPB_ROLLOVER3\" onmouseout=\"HpbImgSwap('_HPB_ROLLOVER3','"+dir+"logo/menu/br.gif');_HpbScrollStatus(status_msg, 100);\" onmouseover=\"HpbImgSwap('_HPB_ROLLOVER3','"+dir+"logo/menu/br1.gif'); return BrStatusMessage('Ｗｈａｔ’ｓＢｕｄｄｙＲｏｐｅのページへ移動');\" >");
		document.write("<IMG src=\""+dir+"logo/menu/br.gif\" alt=\"What's Buddy Rope\" align=\"TOP\" width=\"100\" height=\"30\" vspace=\"0\" hspace=\"0\" border=\"0\" title=\"What's Buddy Rope\" name=\"_HPB_ROLLOVER3\"></A>");
		document.write("      </TD>");

		document.write("      <TD ALIGN=LEFT VALIGN=TOP>");
		document.write("	<A href=\""+dir+"course.html\" id=\"_HPB_ROLLOVER4\" onmouseout=\"HpbImgSwap('_HPB_ROLLOVER4','"+dir+"logo/menu/course.gif');_HpbScrollStatus(status_msg, 100);\" onmouseover=\"HpbImgSwap('_HPB_ROLLOVER4','"+dir+"logo/menu/course1.gif'); return BrStatusMessage('コース情報へ移動');\" >");
		document.write("<IMG src=\""+dir+"logo/menu/course.gif\" alt=\"Course Information\" align=\"TOP\" width=\"100\" height=\"30\" vspace=\"0\" hspace=\"0\" border=\"0\" title=\"講習コース情報\" name=\"_HPB_ROLLOVER4\"></A>");
		document.write("      </TD>");

		document.write("      <TD ALIGN=LEFT VALIGN=TOP>");
		document.write("	<A href=\""+dir+"tour/tour2012/tourevent.html\" id=\"_HPB_ROLLOVER5\" ");
		document.write("onmouseout=\"HpbImgSwap('_HPB_ROLLOVER5','"+dir+"logo/menu/tour.gif');_HpbScrollStatus(status_msg, 100);\"  ");
		document.write("onmouseover=\"HpbImgSwap('_HPB_ROLLOVER5','"+dir+"logo/menu/tour1.gif'); return BrStatusMessage('ツアー＆イベント予定へ移動');\" >");
		document.write("<IMG src=\""+dir+"logo/menu/tour.gif\" alt=\"Tour &amp; Event\" align=\"TOP\" width=\"100\" height=\"30\" vspace=\"0\" hspace=\"0\" border=\"0\" title=\"ツアー＆イベント 予定\" name=\"_HPB_ROLLOVER5\"></A>");
		document.write("      </TD>");

		document.write("      <TD ALIGN=LEFT VALIGN=TOP>");
		document.write("	<A href=\""+dir+"photo_con/photo_con2012/copy_photo_con.html\" id=\"_HPB_ROLLOVER6\" onmouseout=\"HpbImgSwap('_HPB_ROLLOVER6','"+dir+"logo/menu/photo.gif');_HpbScrollStatus(status_msg, 100);\" onmouseover=\"HpbImgSwap('_HPB_ROLLOVER6','"+dir+"logo/menu/photo1.gif'); return BrStatusMessage('フォトコンテストへ移動');\" >");
		document.write("<IMG src=\""+dir+"logo/menu/photo.gif\" alt=\"Photo Contest\" align=\"TOP\" width=\"100\" height=\"30\" vspace=\"0\" hspace=\"0\" border=\"0\" title=\"フォトコンテスト\" name=\"_HPB_ROLLOVER6\"></A>");
		document.write("      </TD>");

		document.write("      <TD ALIGN=LEFT VALIGN=TOP>");
		document.write("	<A href=\""+dir+"framelink.html\" id=\"_HPB_ROLLOVER7\" onmouseout=\"HpbImgSwap('_HPB_ROLLOVER7','"+dir+"logo/menu/link.gif');_HpbScrollStatus(status_msg, 100);\" onmouseover=\"HpbImgSwap('_HPB_ROLLOVER7','"+dir+"logo/menu/link1.gif'); return BrStatusMessage('リンクインデックスへ移動');\" >");
		document.write("<IMG src=\""+dir+"logo/menu/link.gif\" alt=\"Link Index\" align=\"TOP\" width=\"100\" height=\"30\" vspace=\"0\" hspace=\"0\" border=\"0\" title=\"リンク インデックス\" name=\"_HPB_ROLLOVER7\"></A>");
		document.write("    </TD>");
		document.write("    </TR>");
		document.write("<TR>");
		document.write("<TD COLSPAN=6 ROWSPAN=2><DIV ALIGN=CENTER>");
		document.write("<IMG SRC=\""+dir+"logo/home/welcome.gif\" ALT=\"\" WIDTH=615 HEIGHT=88></DIV></TD>");
		document.write("<TD ALIGN=CENTER VALIGN=TOP><B>Click Menu</B></TD>");
		document.write("</TR>");
		document.write("<TR>");
//		document.write("      <TD ALIGN=CENTER VALIGN=TOP><BR></TD>");
		document.write("      <TD ALIGN=CENTER VALIGN=TOP><img src=\"./counter/wwwcount.cgi?gif\" width=96 height=18 alt=\"Counter\"><BR></TD>");
		document.write("</TR>");
		document.write("</TABLE></DIV>");
	}
	else {
		document.write("<DIV ALIGN=center>");
		document.write("<IMG SRC=\""+dir+"logo/home/welcome.gif\" ALT=\"\">");
		document.write("</DIV>");
	}
}
function BrEndDsp(color,dir)
{
	if ( frames.parent.length == 0 ) {
		document.write("<FONT COLOR=\""+color+"\" FACE=\"Times New Roman\"><B><A HREF=\"http://www.buddy-rope.com/framehome.html\"><IMG src=\""+dir+"logo/home/b_ani012.gif\" width=\"49\" height=\"19\" border=\"0\"></B></FONT><P>");
	}
	else {
		document.write("<FONT COLOR=\""+color+"\" FACE=\"Times New Roman\"><B><A HREF=\"http://www.buddy-rope.com/home.html\" target=\"brmain\"><IMG src=\""+dir+"logo/home/b_ani012.gif\" width=\"49\" height=\"19\" border=\"0\"></B></FONT><P>");
	}
	document.write("<A HREF=\"mailto:dive@buddy-rope.com\"><FONT COLOR=\""+color+"\" FACE=\"Times New Roman\"><B><IMG src=\""+dir+"logo/menu/an_mail2.gif\" width=\"49\" height=\"19\" border=\"0\"></B></FONT></A>");
	document.write("<A HREF=\"mailto:dive@buddy-rope.com\"><FONT COLOR=\""+color+"\" FACE=\"Times New Roman\"><B>dive@buddy-rope.com</B></FONT></A><BR>");
	document.write("<FONT COLOR=\""+color+"\" FACE=\"Times New Roman\"><B>copyright(C)2012 by BUDDY ROPE. All Rights Reserved.</B></FONT><BR>");
	document.write("<DIV ALIGN=RIGHT><FONT COLOR=\""+color+"\" FACE=\"Times New Roman\"><B>Last Update " + BrGetLastUpdate() + "</B></FONT><BR></DIV>");
}
function dBsftGoHistory(count, isForward) {
    if (isForward == 0) {
        history.go(-(count));
        return;
    }
    if (isForward == 1) {
        history.go(count);
        return;
    }
}

function BrShopDsp(color,bgcolor)
{
	document.write("<CENTER>");
	document.write("<TABLE ALIGN=CENTER BORDER BGCOLOR=\""+bgcolor+"\">");
	document.write("    <TR>");
	document.write("      <TD><FONT SIZE=4 COLOR=\""+color+"\"><B>〒806-0059</B></FONT><BR>");
	document.write("      <FONT SIZE=4 COLOR=\""+color+"\"><B>福岡県北九州市八幡西区萩原１丁目３−３１</B></FONT><BR>");
	document.write("      <FONT SIZE=4 COLOR=\""+color+"\"><B>TEL:093-631-7447 FAX:093-631-7448</B></FONT><BR>");
	document.write("      <FONT SIZE=4 COLOR=\""+color+"\"><B>E-mail:dive@buddy-rope.com</B></FONT><BR>");
	document.write("      <FONT SIZE=4 COLOR=\""+color+"\"><B>URL:http://www.buddy-rope.com/</B></FONT><BR>");
	document.write("      <FONT SIZE=4 COLOR=\""+color+"\"><B>The Diving Leaders </B></FONT><FONT SIZE=5 COLOR=\""+color+"\"><B>BUDDY ROPE</B></FONT><BR>");
	document.write("      <DIV ALIGN=CENTER><FONT SIZE=3 COLOR=\""+color+"\"><B>定休日：毎週火曜日</B></FONT><BR></DIV>");
	document.write("      <DIV ALIGN=RIGHT><FONT SIZE=3 COLOR=\""+color+"\"><B>営業時間 10月〜3月 12:00-19:00</B></FONT><BR>");
	document.write("      <FONT SIZE=3 COLOR=\""+color+"\"><B>4月〜9月 10:00-19:00</B></FONT></DIV>");
	document.write("      </TD>");
	document.write("    </TR>  ");
	document.write("</TABLE>");
	document.write("</CENTER>");
	document.write("<BR>");
}

