//init
tier_cnt=0;
root_path="";

//renewはテストディレクトリ名
//違う名前を付けたい場合は、カンマ区切りで追加してください。
//本番用
//root_path_str = new Array("www.*******","www.*******");

//テスト用
root_path_str = new Array("www.lukavo.jp","lukavo.jp");

pathCheck = String(document.location);

//サファリ対策
if( navigator.appVersion.indexOf("Safari") ){
	urls = pathCheck.split(":/");
}else{
	urls = pathCheck.split("://");
}

str  = urls[1].split("/");

for (i in str){ tier_cnt ++;}

for (i in str){
	for (jj in root_path_str){
		if(str[i] == root_path_str[jj]){
			offset = (i-0)+2;
			break;
		}
	}
}

path_cnt = tier_cnt-offset;

for (i=0 ;i<path_cnt ;i++){
	root_path +="../";
}

//set path
img_path = root_path +"images_main/";

dir_1 = offset-1;

//--------------------------------------------------------------------

var ie=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0
var opera=window.opera?1:0

var folder=''
var image=''

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 LeftMenu(){

	menu_nm = new Array("home","about_hvcec","about_v","bposition_v","communication","bposition_hv","interview","dayofhv","forsafe","gallery","links_v");
	def_off = new Array("","","","","","","","","","","");

	btn_alt = new Array("ホーム","ヘルスボランティア・コミュニティー・e-センターとは？","ボランティアとは？","ボランティアの基本姿勢","コミュニケーションについて","ヘルスボランティアの基本姿勢","ヘルスボランティアインタビュー","ヘルスボランティアの1日","みんなの活動の安全を守るために","ヘルスボランティアギャラリー","ボランティア情報リンク");

	if(str[dir_1] == "index.html" || str[dir_1] == ""){
		//TOPページ
		def_off[0] = "_on";
	}else{
		//1階層下のページ
		for (ii in menu_nm){
			if( str[dir_1] == menu_nm[ii]){
				def_off[ii] = "_on";
				break;
			}
		}
	}


document.writeln("<table width=\"195\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");

document.writeln("<tr>");
document.writeln("  <td><img src=\""+img_path+"menutop.gif\" width=\"195\" height=\"5\"></td>");
document.writeln("</tr>");

for(mn=1;mn<11 ;mn++){

document.writeln("<tr>");
document.writeln("<td><a href=\""+root_path+menu_nm[mn]+"/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('"+menu_nm[mn]+"','','"+img_path+menu_nm[mn]+"_on.gif',1)\"><img src=\""+img_path+menu_nm[mn]+def_off[mn]+".gif\" alt=\""+btn_alt[mn]+"\" name=\""+menu_nm[mn]+"\" width=\"195\" height=\"33\" border=\"0\"></a></td>");
document.writeln("</tr>");

}


document.writeln("<tr>");
document.writeln("  <td><a href=\"https://www.lukavo.jp/login.php\"><img src=\""+img_path+"gakuse_login.gif\" width=\"194\" height=\"57\" vspace=\"5\" border=\"0\"></a></td>");
document.writeln("</tr>");

document.writeln("<tr>");
document.writeln("  <td><a href=\"http://www.lukavo.jp/special/index.html\"><img src=\""+img_path+"special_bn.gif\" width=\"194\" height=\"57\" vspace=\"5\" border=\"0\"></a></td>");
document.writeln("</tr>");

//document.writeln("<tr>");
//document.writeln("  <td><a href=\"https://www.lukavo.jp/enq/\"><img src=\""+img_path+"inq_bn.gif\" width=\"194\" height=\"57\" vspace=\"5\" border=\"0\"></a></td>");
//document.writeln("</tr>");

document.writeln("</table>");

}

//--------------------------------------------------------------------
function footer_menu(){
	with(document){

writeln("<p align=\"center\" class=\"stext\">");

writeln("<a href=\""+root_path+menu_nm[1]+"/index.html\"\">ヘルスボランティア・コミュニティー・e-センターとは？</a>　l　<a href=\""+root_path+menu_nm[2]+"/index.html\"\">ボランティアとは？</a>　l　<a href=\""+root_path+menu_nm[3]+"/index.html\"\">ボランティアの基本姿勢</a><br>");

writeln("<a href=\""+root_path+menu_nm[4]+"/index.html\"\">コミュニケーションについて</a>　l　<a href=\""+root_path+menu_nm[5]+"/index.html\"\">ヘルスボランティアの基本姿勢</a>　l　<a href=\""+root_path+menu_nm[6]+"/index.html\"\">ヘルスボランティアインタビュー</a><br>");

writeln("<a href=\""+root_path+menu_nm[7]+"/index.html\"\">ヘルスボランティアの1日</a>　l　<a href=\""+root_path+menu_nm[8]+"/index.html\"\">活動の安全を守るために</a>　l　<a href=\""+root_path+menu_nm[9]+"/index.html\"\">ヘルスボランティアギャラリー</a>　l　<a href=\""+root_path+menu_nm[10]+"/index.html\"\">ボランティア情報リンク</a>");

writeln("</p>");


	}
}
