//=============================================
// TOP DIRECTORY PATH SEARCH
//=============================================
if(document.domain.indexOf("birdman") >= 0 ){
	var docRootlng = location.href.split("eastdive/")[1].split("/");
}
else if(document.domain.indexOf("eastdive") >= 0 ){
	var docRootlng = location.href.split("eastdive.com/")[1].split("/");
}
else {
	var docRootlng = location.href.split("html/")[1].split("/");
}

var docRoot = "";
	for(var i=0;i<(docRootlng.length)-1;i++){
		docRoot += "../";
	}

	

//=============================================
// SmartRollOver()
//=============================================
function initRollovers() {
	if (!document.getElementById) return

	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {	
		if (aImages[i].className == 'ov') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_on'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);

			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;

			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	

			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}


//=============================================
// BlWin2()
//=============================================
function BLinks() {
	if (!document.getElementsByTagName) return;

	var anchors = document.getElementsByTagName("a");

	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") &&
		anchor.getAttribute("rel") == "bl")
		anchor.target = "_blank";
		if(anchor.parentNode.className == "photo"){
			anchor.target = "photowin";
		}
	}

}


//=============================================
// currentMenuCheck
//=============================================
function curCheck(){
	var myurl = location.href;
	var val =  myurl.split("/");
		val.pop();
		val = val.join("/");
	if(document.getElementById("menu01")){var myobjg= document.getElementById("menu01").getElementsByTagName("a");}
	
	var myobjgFisrt = new Array();//1階層目のカレント
	myobjgFisrt[0] = myobjg[1];//ABOUT
	myobjgFisrt[1] = myobjg[7];//COURSE
	myobjgFisrt[2] = myobjg[12];//SERVICE
	myobjgFisrt[3] = myobjg[18];//MATERIAL
	myobjgFisrt[4] = myobjg[19];//RESERVE_DIVE
	myobjgFisrt[5] = myobjg[20];//RESERVE_TOUR
	myobjgFisrt[6] = myobjg[21];//CONTACT
	if(myobjgFisrt){
		for( var i = 0; i < myobjgFisrt.length; i ++ ){
			myobjgFisrt[i].getElementsByTagName("img")[0].setAttribute("className","ov");
			myobjgFisrt[i].getElementsByTagName("img")[0].setAttribute("class","ov");
		}
	}
	if(myobjgFisrt){
		if( val.indexOf("about") >= 0 ){
			myobjgFisrt[0].getElementsByTagName("img")[0].src = myobjgFisrt[0].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgFisrt[0].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgFisrt[0].getElementsByTagName("img")[0].setAttribute("class","");
		}
		else if( val.indexOf("course") >= 0 ){
			myobjgFisrt[1].getElementsByTagName("img")[0].src = myobjgFisrt[1].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgFisrt[1].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgFisrt[1].getElementsByTagName("img")[0].setAttribute("class","");
		}
		else if( val.indexOf("service") >= 0 ){
			myobjgFisrt[2].getElementsByTagName("img")[0].src = myobjgFisrt[2].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgFisrt[2].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgFisrt[2].getElementsByTagName("img")[0].setAttribute("class","");
		}
		else if( val.indexOf("material") >= 0 ){
			myobjgFisrt[3].getElementsByTagName("img")[0].src = myobjgFisrt[3].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgFisrt[3].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgFisrt[3].getElementsByTagName("img")[0].setAttribute("class","");
		}
		else if( val.indexOf("reserve_dive") >= 0 ){
			myobjgFisrt[4].getElementsByTagName("img")[0].src = myobjgFisrt[4].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgFisrt[4].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgFisrt[4].getElementsByTagName("img")[0].setAttribute("class","");
		}
		else if( val.indexOf("reserve_tour") >= 0 ){
			myobjgFisrt[5].getElementsByTagName("img")[0].src = myobjgFisrt[5].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgFisrt[5].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgFisrt[5].getElementsByTagName("img")[0].setAttribute("class","");
		}
		else if( val.indexOf("contact") >= 0 ){
			myobjgFisrt[6].getElementsByTagName("img")[0].src = myobjgFisrt[6].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgFisrt[6].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgFisrt[6].getElementsByTagName("img")[0].setAttribute("class","");
		}
	}
	var myobjgSecond = new Array();//2階層目のカレント
	myobjgSecond[0] = myobjg[2];
	myobjgSecond[1] = myobjg[3];
	myobjgSecond[2] = myobjg[4];
	myobjgSecond[3] = myobjg[5];
	myobjgSecond[4] = myobjg[6];
	myobjgSecond[5] = myobjg[8];
	myobjgSecond[6] = myobjg[9];
	myobjgSecond[7] = myobjg[10];
	myobjgSecond[8] = myobjg[11];
	myobjgSecond[9] = myobjg[13];
	myobjgSecond[10] = myobjg[14];
	myobjgSecond[11] = myobjg[17];
	if(myobjgSecond){
		for( var i = 0; i < myobjgSecond.length; i ++ ){
			myobjgSecond[i].getElementsByTagName("img")[0].setAttribute("className","ov");
			myobjgSecond[i].getElementsByTagName("img")[0].setAttribute("class","ov");
		}
	}
	if(myobjgSecond){
		if( myurl.indexOf("about/") >= 0 ){
			myobjgSecond[0].getElementsByTagName("img")[0].src = myobjgSecond[0].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgSecond[0].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgSecond[0].getElementsByTagName("img")[0].setAttribute("class","");
		}else if( myurl.indexOf("about/ecoproject.html") >= 0 ){
			myobjgSecond[1].getElementsByTagName("img")[0].src = myobjgSecond[1].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgSecond[1].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgSecond[1].getElementsByTagName("img")[0].setAttribute("class","");
		}else if( myurl.indexOf("about/presentation.html") >= 0 ){
			myobjgSecond[2].getElementsByTagName("img")[0].src = myobjgSecond[2].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgSecond[2].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgSecond[2].getElementsByTagName("img")[0].setAttribute("class","");
		}
		else if( myurl.indexOf("about/shop.html") >= 0 ){
			myobjgSecond[3].getElementsByTagName("img")[0].src = myobjgSecond[3].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgSecond[3].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgSecond[3].getElementsByTagName("img")[0].setAttribute("class","");
		}else if( myurl.indexOf("about/staff.html") >= 0 ){
			myobjgSecond[4].getElementsByTagName("img")[0].src = myobjgSecond[4].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgSecond[4].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgSecond[4].getElementsByTagName("img")[0].setAttribute("class","");
		}else if( myurl.indexOf("course/beginner") >= 0 ){
			myobjgSecond[5].getElementsByTagName("img")[0].src = myobjgSecond[5].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgSecond[5].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgSecond[5].getElementsByTagName("img")[0].setAttribute("class","");
		}else if( myurl.indexOf("course/license") >= 0 ){
			myobjgSecond[6].getElementsByTagName("img")[0].src = myobjgSecond[6].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgSecond[6].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgSecond[6].getElementsByTagName("img")[0].setAttribute("class","");
		}
		else if( myurl.indexOf("course/pro") >= 0 ){
			myobjgSecond[7].getElementsByTagName("img")[0].src = myobjgSecond[7].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgSecond[7].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgSecond[7].getElementsByTagName("img")[0].setAttribute("class","");
		}
		else if( myurl.indexOf("course/tour") >= 0 ){
			myobjgSecond[8].getElementsByTagName("img")[0].src = myobjgSecond[8].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgSecond[8].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgSecond[8].getElementsByTagName("img")[0].setAttribute("class","");
		}
		else if( myurl.indexOf("service/") >= 0 ){
			myobjgSecond[9].getElementsByTagName("img")[0].src = myobjgSecond[9].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgSecond[9].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgSecond[9].getElementsByTagName("img")[0].setAttribute("class","");
		}
		else if( myurl.indexOf("service/english") >= 0 ){
			myobjgSecond[10].getElementsByTagName("img")[0].src = myobjgSecond[10].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgSecond[10].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgSecond[10].getElementsByTagName("img")[0].setAttribute("class","");
		}
		else if( myurl.indexOf("service/mobile") >= 0 ){
			myobjgSecond[11].getElementsByTagName("img")[0].src = myobjgSecond[11].getElementsByTagName("img")[0].src.split(".gif").join("_c.gif");
			myobjgSecond[11].getElementsByTagName("img")[0].setAttribute("className","");
			myobjgSecond[11].getElementsByTagName("img")[0].setAttribute("class","");
		}
	}
}


//=============================================
// setBgWaku(VOICE)
//=============================================
function setBgWaku(){
	if(document.getElementById("voiceArea")){var targetWaku= document.getElementById("voiceArea").getElementsByTagName("p");}
	if(targetWaku){
	for(i=0; i<targetWaku.length; i++){
		var bgWakuImage = (i%2) ? "ph01" : "ph02";
		targetWaku[i].setAttribute("className",bgWakuImage);
		targetWaku[i].setAttribute("class",bgWakuImage);
	}
	}
}


//=============================================
// setScrollInfo
//=============================================
function setScrollInfo(){
	if(document.getElementById("scrollArea")){
		var scroller  = null;
		var scrollbar = null;
		scroller  = new jsScroller(document.getElementById("Scroller-1"), 612, 99);
		scrollbar = new jsScrollbar (document.getElementById("Scrollbar-Container"), scroller, false);
	}
}


//=============================================
// init()
//=============================================

function init() {
	curCheck();
	BLinks();
	initRollovers();
	setBgWaku();
	setScrollInfo();
}


window.onload=init;


//=============================================
// closewin
//=============================================
function closewin() {
	window.close();
}


//=============================================
// openPopup
//=============================================
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//=============================================
// setglobalMenu01
//=============================================
function setglobalMenu01(){
	var _str = ""
		_str += '<div id="menu01">';
		_str += '<div class="inner">';
		if(document.getElementById("indexHeader")){
			_str += '<h1><a href="'+docRoot+'"><img src="'+docRoot+'images/logo_eastdive.gif" width="178" height="64" alt="East Dive" /></a></h1>';
			_str += '<p><img src="'+docRoot+'images/tel.gif" width="178" height="17" alt="Tel 03-5385-1126" /></p>';
		}
		else{
			_str += '<h1><a href="'+docRoot+'"><img src="'+docRoot+'common/images/logo_eastdive.gif" width="156" height="57" alt="East Dive" /></a></h1>';
			_str += '<p><img src="'+docRoot+'common/images/tel.gif" width="159" height="16" alt="Tel 03-5385-1126" /></p>';
		}
		_str += '<ul>';
		_str += '<li><a href="'+docRoot+'about/"><img src="'+docRoot+'common/images/gmenu01.gif" width="178" height="28" alt="イーストダイブ紹介" /></a>';
		_str += '<ul id="subAbout">';
		_str += '<li><a href="'+docRoot+'about/"><img src="'+docRoot+'common/images/smenu01.gif" width="168" height="24" alt="会社概要" /></a></li>';
		_str += '<li><a href="'+docRoot+'about/ecoproject.html"><img src="'+docRoot+'common/images/smenu02.gif" width="168" height="24" alt="エコ・プロジェクト" /></a></li>';
		_str += '<li><a href="'+docRoot+'about/presentation.html"><img src="'+docRoot+'common/images/smenu03.gif" width="168" height="24" alt="説明会の案内" /></a></li>';
		_str += '<li><a href="'+docRoot+'about/shop.html"><img src="'+docRoot+'common/images/smenu04.gif" width="168" height="24" alt="ダイブ・ショップの案内" /></a></li>';
		_str += '<li><a href="'+docRoot+'about/staff.html"><img src="'+docRoot+'common/images/smenu05.gif" width="168" height="24" alt="スタッフ紹介&amp;求人案内" /></a></li>';
		_str += '</ul>';
		_str += '</li>';
		_str += '<li><a href="'+docRoot+'course/beginner/"><img src="'+docRoot+'common/images/gmenu02.gif" width="178" height="28" alt="コース&amp;ツアー紹介" /></a>';
		_str += '<ul id="subCourse">';
		_str += '<li><a href="'+docRoot+'course/beginner/"><img src="'+docRoot+'common/images/smenu06.gif" width="168" height="24" alt="初心者Cカード取得" class="ov" /></a></li>';
		_str += '<li><a href="'+docRoot+'course/license/"><img src="'+docRoot+'common/images/smenu07.gif" width="168" height="24" alt="各種ライセンス取得" class="ov" /></a></li>';
		_str += '<li><a href="'+docRoot+'course/pro/"><img src="'+docRoot+'common/images/smenu08.gif" width="168" height="24" alt="プロコース" class="ov" /></a></li>';
		_str += '<li><a href="'+docRoot+'course/tour/"><img src="'+docRoot+'common/images/smenu09.gif" width="168" height="24" alt="ダイビングツアー" class="ov" /></a></li>';
		_str += '</ul>';
		_str += '</li>';
		_str += '<li><a href="'+docRoot+'service/"><img src="'+docRoot+'common/images/gmenu03.gif" width="178" height="28" alt="サービス" /></a>';
		_str += '<ul id="subService">';
		_str += '<li><a href="'+docRoot+'service/"><img src="'+docRoot+'common/images/smenu10.gif" width="168" height="24" alt="v" class="ov" /></a></li>';
		_str += '<li><a href="'+docRoot+'service/english.html"><img src="'+docRoot+'common/images/smenu11.gif" width="168" height="24" alt="English Corese" class="ov" /></a></li>';
		_str += '<li><a href="http://eastdive.com/blog/" rel="bl"><img src="'+docRoot+'common/images/smenu12.gif" width="168" height="24" alt="Blog East" class="ov" /></a></li>';
		_str += '<li><a href="https://www.padi.com/elearning-scuba-registration/default.aspx?LanguageType=ja&CourseType=ow&CourseLang=ja&irra=8860" rel="bl"><img src="'+docRoot+'common/images/smenu13.gif" width="168" height="24" alt="eleaning" class="ov" /></a></li>';
		_str += '<li><a href="'+docRoot+'service/mobile.html"><img src="'+docRoot+'common/images/smenu14.gif" width="168" height="24" alt="Mobile East" class="ov" /></a></li>';
		_str += '</ul>';
		_str += '</li>';
		_str += '<li><a href="https://secure990.sakura.ne.jp/eastdive.com/material/"><img src="'+docRoot+'common/images/gmenu04.gif" width="178" height="28" alt="資料請求お申込" /></a></li>';
		_str += '<li><a href="https://secure990.sakura.ne.jp/eastdive.com/reserve_dive/"><img src="'+docRoot+'common/images/gmenu05.gif" width="178" height="28" alt="ダイブの予約" /></a></li>';
		_str += '<li><a href="https://secure990.sakura.ne.jp/eastdive.com/reserve_tour/"><img src="'+docRoot+'common/images/gmenu06.gif" width="178" height="28" alt="ダイビングツアーの予約" /></a></li>';
		_str += '<li><a href="https://secure990.sakura.ne.jp/eastdive.com/contact/"><img src="'+docRoot+'common/images/gmenu07.gif" width="178" height="28" alt="お問い合わせ" /></a></li>';
		_str += '</ul>';
		_str += '</div>';
		_str += '</div>';
	document.write(_str);
	showsubMenu();
}


//=============================================
// setglobalMenu02
//=============================================
function setglobalMenu02(){
	var _str = ""
		_str += '<div id="menu02">';
		_str += '<div class="inner">';
		_str += '<h2><img src="'+docRoot+'common/images/gmenu_voice.gif" width="117" height="36" alt="みんなの声" /></h2>';
		_str += '<p class="btn"><a href="'+docRoot+'voice/"><img src="'+docRoot+'common/images/btn_voice_more.gif" width="24" height="25" alt="もっと読む" class="ov" /></a></p>';
		_str += '<ul class="cf">';
		_str += '<li class="prev"><a href="javascript:void(0)" onclick="changeVoice(\'prev\')"><img src="'+docRoot+'common/images/btn_voice_prev.png" width="23" height="25" alt="prev" class="ov pfix" /></a></li>';
		_str += '<li class="next"><a href="javascript:void(0)" onclick="changeVoice(\'next\')"><img src="'+docRoot+'common/images/btn_voice_next.png" width="24" height="25" alt="next" class="ov pfix" /></a></li>';
		_str += '<li class="message">';
		_str += '<div id="voicebox2" class="cf pfix"><div></div>';
//		_str += '<p class="thumb"><a href="#"><img src="'+docRoot+'voice/photo/thumb02.jpg" width="90" height="90" alt="" /></a></p>';
//		_str += '<p class="text"><a href="#">井上 佳代子さん</span></a></p>';
		_str += '</div>';
		_str += '</li>';
		_str += '</ul>';
		_str += '</div>';
		_str += '</div>';
	document.write(_str);
}


//=============================================
// setglobalMenu03
//=============================================
function setglobalMenu03(){
	var _str = ""
		_str += '<div id="menu03">';
		_str += '<ul>';
		_str += '<li><a href="'+docRoot+'service/"><img src="'+docRoot+'common/images/gmenu08.gif" width="200" height="65" alt="Diving Express" class="ov" /></a></li>';
		_str += '<li><a href="'+docRoot+'service/english.html"><img src="'+docRoot+'common/images/gmenu09.gif" width="200" height="65" alt="English Course" class="ov" /></a></li>';
		_str += '<li><a href="http://eastdive.com/blog/" rel="bl"><img src="'+docRoot+'common/images/gmenu10.gif" width="200" height="65" alt="Blog East" class="ov" /></a></li>';
		_str += '<li><a href="https://www.padi.com/elearning-scuba-registration/default.aspx?LanguageType=ja&CourseType=ow&CourseLang=ja&irra=8860" rel="bl"><img src="'+docRoot+'common/images/gmenu11.gif" width="200" height="65" alt="eleaning" class="ov" /></a></li>';
		_str += '<li><a href="'+docRoot+'service/mobile.html"><img src="'+docRoot+'common/images/gmenu12.gif" width="200" height="131" alt="Mobilep East" class="ov" /></a></li>';
		_str += '</ul>';
		_str += '</div>';
	document.write(_str);
}


//=============================================
// setglobalMenu04
//=============================================
function setglobalMenu04(){
	var _str = ""
		_str += '<div id="menu04">';
		_str += '<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fdive.east&amp;width=200&amp;height=290&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;stream=false&amp;header=true&amp;appId=226661857397706" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:290px;" allowTransparency="true"></iframe>';
		_str += '</div>';
	document.write(_str);
}


//=============================================
// setFooter
//=============================================
function setFooter(){
	var _str = ""
		_str += '<div id="footer01">';
		_str += '<div class="inner">';
		_str += '<p><img src="'+docRoot+'common/images/foot_eastdive.jpg" width="198" height="154" alt="【5STAR INSTRUCTOR DEVELOPMENT CENTER】東京都中野区中央4-2-19／営業時間11:00~20:00／03-5385-1126" /></p>';
		_str += '<dl class="f01">';
		_str += '<dt><img src="'+docRoot+'common/images/fmenu01.gif" width="106" height="10" alt="About East Dive" /></dt>';
		_str += '<dd><a href="'+docRoot+'about/">会社概要</a></dd>';
		_str += '<dd><a href="'+docRoot+'about/ecoproject.html">エコ・プロジェクト</a></dd>';
		_str += '<dd><a href="'+docRoot+'about/presentation.html">説明会の案内</a></dd>';
		_str += '<dd><a href="'+docRoot+'about/shop.html">ダイブ・ショップの案内</a></dd>';
		_str += '<dd><a href="'+docRoot+'about/staff.html">スタッフ紹介＆求人案内</a></dd>';
		_str += '</dl>';
		_str += '<dl class="f02">';
		_str += '<dt><img src="'+docRoot+'common/images/fmenu02.gif" width="96" height="10" alt="Course &amp; Tour" /></dt>';
		_str += '<dd><a href="'+docRoot+'course/beginner/">初心者Cカード取得</a></dd>';
		_str += '<dd><a href="'+docRoot+'course/license/">各種ライセンス取得</a></dd>';
		_str += '<dd><a href="'+docRoot+'course/pro/">プロコース</a></dd>';
		_str += '<dd><a href="'+docRoot+'course/tour/">ダイビングツアー</a></dd>';
		_str += '</dl>';
		_str += '<dl class="f03">';
		_str += '<dt><img src="'+docRoot+'common/images/fmenu03.gif" width="49" height="10" alt="Service" /></dt>';
		_str += '<dd><a href="'+docRoot+'service/">送迎サービス</a></dd>';
		_str += '<dd><a href="'+docRoot+'service/english.html">English Course</a></dd>';
		_str += '<dd><a href="http://eastdive.com/blog/" rel="bl">East Dive ブログ</a></dd>';
		_str += '<dd><a href="https://www.padi.com/elearning-scuba-registration/default.aspx?LanguageType=ja&CourseType=ow&CourseLang=ja&irra=8860" rel="bl">eラーニング</a></dd>';
		_str += '<dd><a href="'+docRoot+'service/mobile.html">モバイルサイト</a></dd>';
		_str += '</dl>';
		_str += '<dl class="f04">';
		_str += '<dt><img src="'+docRoot+'common/images/fmenu04.gif" width="149" height="10" alt="Reservation &amp; Contact" /></dt>';
		_str += '<dd><a href="https://secure990.sakura.ne.jp/eastdive.com/material/">資料請求お申込</a></dd>';
		_str += '<dd><a href="https://secure990.sakura.ne.jp/eastdive.com/reserve_dive/">ダイブの予約</a></dd>';
		_str += '<dd><a href="https://secure990.sakura.ne.jp/eastdive.com/reserve_tour/">ダイビングツアーの予約</a></dd>';
		_str += '<dd><a href="https://secure990.sakura.ne.jp/eastdive.com/contact/">お問い合わせ</a></dd>';
		_str += '</dl>';
		_str += '</div>';
		_str += '</div>';
		_str += '<div id="footer02">';
		_str += '<div class="inner">';
		_str += '<ul>';
		_str += '<li><a href="javascript:void(0)" onclick="popIsland(&#39;'+docRoot+'policy/privacy.html&#39;);">個人情報保護に関する方針</a></li>';
		_str += '<li><a href="javascript:void(0)" onclick="popIsland(&#39;'+docRoot+'policy/agreement.html&#39;);">弊社約款事項</a></li>';
		_str += '<li><a href="javascript:void(0)" onclick="popIsland(&#39;'+docRoot+'policy/sctlaw.html&#39;);">特定商取引法</a></li>';
		_str += '</ul>';
		_str += '<p>Copyright Eastdive.2001-2012 ALL Rights Reserved.</p>';
		_str += '</div>';
		_str += '</div>';
	document.write(_str);
}


//=============================================
// showsubMenu
//=============================================
function showsubMenu(){
	var subIdArray = new Array();
	subIdArray[0] = document.getElementById("subAbout");
	subIdArray[1] = document.getElementById("subCourse");
	subIdArray[2] = document.getElementById("subService");
	for(var i=0; i<subIdArray.length; i++){
		subIdArray[i].style.display = "none";//初めは全部消しておく
	}
	
	var myurl = location.href;
	var val =  myurl.split("/");
		val.pop();
		val = val.join("/");
		
	for(var i=0; i<subIdArray.length; i++){
		if( val.indexOf("about") >= 0 ){
			subIdArray[0].style.display = "block";
		}
		else if( val.indexOf("course") >= 0 ){
			subIdArray[1].style.display = "block";
		}
		else if( val.indexOf("service") >= 0 ){
			subIdArray[2].style.display = "block";
		}
		else{
			subIdArray[i].style.display = "none";
		}
	}
}


//=============================================
// TOP MAIN ANIMATION
//=============================================
var _imgcnt = 1;
var _count  = 5;
var _befcnt = null;
var tm;
function topMainAnimation(){
	for(var i=0; i<_count; i++){
		if(i != 0){
			$("#imageArea img:eq(" + i + ")").css({"display":"none"});
		}
	}
	tm = setInterval(function() {
		changeTopImage();
	}, 5000);
}
function changeTopImage(){
	if(_imgcnt == _count){_imgcnt = 0;}
	if(_befcnt != null){
		var bef = _befcnt;
	}else{
		var bef = (_imgcnt == 0)? 4 : (_imgcnt-1);
	}
	_befcnt = null;
	$("#imageArea img:eq(" + bef + ")").fadeOut(1000);
	$("#imageArea img:eq(" + _imgcnt + ")").fadeIn(2000);
	for(var i=0; i<_count; i++){
		if($("#imageIc img:eq(" + i + ")").get(0).src.indexOf("_on") >= 0){
			$("#imageIc img:eq(" + i + ")").get(0).src = $("#imageIc img:eq(" + i + ")").get(0).src.split("_on").join("_off");
		}
	}
	$("#imageIc img:eq(" + _imgcnt + ")").get(0).src = $("#imageIc img:eq(" + _imgcnt + ")").get(0).src.split("_off").join("_on");
	_imgcnt++;
}
function clickTopImage(num){
	_befcnt = (_imgcnt == 0)? 4 : (_imgcnt-1);
	if(num == _befcnt){return;}
	clearInterval(tm);
	_imgcnt = num;
	for(var i=0; i<_count; i++){
		if(_befcnt == i){
			$("#imageArea img:eq(" + i + ")").fadeIn(0);
		}else{
			$("#imageArea img:eq(" + i + ")").fadeOut(0);
		}
	}
	changeTopImage();
	tm = setInterval(function() {
		changeTopImage();
	}, 5000);
}

//=============================================
// VOICE
//=============================================
var _voicexml;
var _voicecnt = 0;
var _voicelng = 0;
var _voiceflg = true;
var _voicetm;
function setVoice(data){
	_voicexml = data;
	_voicelng = $(_voicexml).find("item").length;
	if($("#voicebox").get(0)){
		$("#voicebox div").html(getVoiceTag(0));
	}
	if($("#voicebox2").get(0)){
		$("#voicebox2 div").html(getVoiceTag(0));
	}
	_voicetm = setInterval(function() {
		changeVoice("next");
	}, 5000);
}
function getVoiceTag(num){
	var _url = docRoot + $(_voicexml).find("item:eq(" + num + ")").attr("link");
	var _img = docRoot + "voice/photo/" + $(_voicexml).find("item:eq(" + num + ")").attr("src");
	var _nme = $(_voicexml).find("item:eq(" + num + ")").attr("name");
	var _txt = $(_voicexml).find("item:eq(" + num + ")").text();
	if($("#voicebox").get(0)){
		return	'<p class="thumb"><a href="' + _url + '"><img src="' + _img + '" width="108" height="108" alt="" /></a></p>' +
				'<dl>' + 
				'<dt><a href="' + _url + '">' + _nme + '</a></dt>' + 
				'<dd>' + _txt + '</dd>' + 
				'</dl>';
	}else{
		return	'<p class="thumb"><a href="' + _url + '"><img src="' + _img + '" width="90" height="90" alt="" /></a></p>' +
				'<p class="text"><a href="' + _url + '">' + _nme + '</span></a></p>';
	}
}
function changeVoice(type){
	if(_voiceflg == false){return;}
	clearInterval(_voicetm);
	_voiceflg = false;

	_voicecnt = (type == "next")? _voicecnt+1 : _voicecnt-1 ;
	if(_voicecnt >= _voicelng){
		_voicecnt = 0;
	}
	if(_voicecnt < 0){
		_voicecnt = _voicelng-1;
	}
	// 
	if($("#voicebox").get(0)){
		$("#voicebox div").fadeOut(0);
		$("#voicebox div").html(getVoiceTag(_voicecnt));
		$("#voicebox div").fadeIn(500,voiceComp);
	}else{
		$("#voicebox2 div").fadeOut(0);
		$("#voicebox2 div").html(getVoiceTag(_voicecnt));
		$("#voicebox2 div").fadeIn(500,voiceComp);
	}
	_voicetm = setInterval(function() {
		changeVoice("next");
	}, 5000);
}
function voiceComp(){
	_voiceflg = true;
	if($.browser.msie){
		this.style.removeAttribute("filter");
	}
}


$(document).ready(function(){
	if($("#imageArea").get(0)){
		topMainAnimation();
	}
	$.ajax({url: docRoot + "common/data/voice.xml",dataType: "xml",success: function(data, status, xhr){
		setVoice(data);
	}});
});


//=============================================
// popIsland
//=============================================
function popIsland(theURL){
　　window.open(theURL,'island','scrollbars=1,toolbar=0,location=0,directories=0,status=no,menubar=0,resizable=no,width=670,height=600');
}

//=============================================
// popPolicy
//=============================================
function popPolicy(theURL){
　　window.open(theURL,'island','scrollbars=1,toolbar=0,location=0,directories=0,status=no,menubar=0,resizable=no,width=670,height=600');
}
