//init
tier_cnt=0;
root_path="";

//root_path_str = new Array("test");
root_path_str = new Array("www.aji.tv","aji.tv","html");


pathCheck = String(document.location);
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/";
css_path = root_path +"css/";
js_path  = root_path +"js/";

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 Menu(){

	menu_nm = new Array("top","first","profile","work","inquiry","blog","link","sitemap","news");
	def_off = new Array("_off","_off","_off","_off","_off","_off","_off","_off","_off");

	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;
			}
		}
	}


with (document) {



writeln("<table width='220' border='0' cellpadding='0' cellspacing='0'>");

writeln("<tr>");
writeln("<td><a href='http://www.aji.tv/' onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('top','','"+img_path+menu_nm[0]+"_on.gif',0)\"><img src=\""+img_path+menu_nm[0]+def_off[0]+".gif\" alt='トップページ' name='top' width='220' height='43' border='0'></a></td>");
writeln("</tr>");

writeln("<tr>");
writeln("<td><a href=\""+root_path+menu_nm[2]+"/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('profile','','"+img_path+menu_nm[2]+"_on.gif',0)\"><img src=\""+img_path+menu_nm[2]+def_off[2]+".gif\" alt='プ奏ィーE name='profile' width='220' height='43' border='0'></a></td>");
writeln("</tr>");


writeln("<tr>");
writeln("<td><a href=\""+root_path+menu_nm[8]+"/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('news','','"+img_path+menu_nm[8]+"_on.gif',0)\"><img src=\""+img_path+menu_nm[8]+def_off[8]+".gif\" alt='ニュース' name='news' width='220' height='43' border='0'></a></td>");
writeln("</tr>");


writeln("<tr>");
writeln("<td><img src=\""+img_path+menu_nm[3]+def_off[3]+".gif\" alt='お仕E name='work' width='220' height='43' border='0'></a></td>");
writeln("</tr>");
writeln("</table>");

writeln("<table width='220' border='0' cellpadding='8' cellspacing='0'>");
writeln("<tr>");
writeln("<td>");
writeln("・<a href=\""+root_path+"work/tv/index.html\">TV（通販・バラエティ・CM等）</a><br>");
writeln("・<a href=\""+root_path+"work/magazine/index.html\">雑E取材・コラム執筆)</a><br>");
writeln("・<a href=\""+root_path+"work/book/index.html\">本の執筆</a><br>");
writeln("・<a href=\""+root_path+"work/presentation/index.html\">講演E/a><br>");
writeln("・<a href=\""+root_path+"work/event/index.html\">イベントでの商品説明・司E/a><br>");
writeln("</td>");
writeln("</tr>");
writeln("</table>");



writeln("<table width='220' border='0' cellpadding='0' cellspacing='0'>");
writeln("<tr>");
writeln("<td><img src=\""+img_path+"fp_off.gif\" alt='ベガス味岡おすすめ商品' name='Goods' width='220' height='43' border='0'></td>");
writeln("</tr>");
writeln("</table>");

writeln("<table width='220' border='0' cellpadding='8' cellspacing='0'>");
writeln("<tr>");
writeln("<td>");
writeln("・<a href=\"http://www.vegastore.tv/fs/vegas/item/34001\" target=\"_blank\">クE好織E．E奪廛好謄ック マウスTM</a><br>");
writeln("・<a href=\"http://www.vegastore.tv/fs/vegas/item/14001\" target=\"_blank\">サ充ネヘアカットブラシ</a>");
writeln("</td>");
writeln("</tr>");
writeln("</table>");


writeln("<table width='220' border='0' cellpadding='0' cellspacing='0'>");
writeln("<tr>");
writeln("<td><a href=\""+root_path+menu_nm[4]+"/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('inquiry','','"+img_path+menu_nm[4]+"_on.gif',0)\"><img src=\""+img_path+menu_nm[4]+def_off[4]+".gif\" alt='お問い合E' name='Inquiry' width='220' height='43' border='0'></a></td>");
writeln("</tr>");

writeln("<tr>");
writeln("<td><a href=\"http://ameblo.jp/vegas-ajioka/\" target='_blank' onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('blog','','"+img_path+menu_nm[5]+"_on.gif',0)\"><img src=\""+img_path+menu_nm[5]+def_off[5]+".gif\" alt='ブ前' name='blog' width='220' height='43' border='0'></a></td>");
writeln("</tr>");

writeln("<tr>");
writeln("<td><a href=\""+root_path+menu_nm[6]+"/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('link','','"+img_path+menu_nm[6]+"_on.gif',0)\"><img src=\""+img_path+menu_nm[6]+def_off[6]+".gif\" alt='E鵐' name='link' width='220' height='43' border='0'></a></td>");
writeln("</tr>");

writeln("<tr>");
writeln("<td><a href=\""+root_path+menu_nm[7]+"/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sitemap','','"+img_path+menu_nm[7]+"_on.gif',0)\"><img src=\""+img_path+menu_nm[7]+def_off[7]+".gif\" alt='サイトマップ' name='sitemap' width='220' height='43' border='0'></a></td>");
writeln("</tr>");
writeln("</table>");



writeln("<table width='220' border='0' cellpadding='0' cellspacing='0'>");
writeln("<tr>");
writeln("<td><img src=\""+img_path+"menu_line.gif\" alt='' width='220' height='8' border='0'></td>");
writeln("</tr>");
writeln("</table>");


	}
}


//--------------------------------------------------------------------
function blogopen(){
	alert("blog window open!! \n ここにスクE廛判颪い討");
}

//--------------------------------------------------------------------
function copy(){
with (document) {
	
writeln("<tr>");
writeln("<td height='20' colspan='2' align='center' background=\""+img_path+"copy_back.gif\" class='copy'>Copyright(C) Aji.2006-2010Allrights reserved. </td>");
writeln("</tr>");

}

}