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

pathCheck = String(document.location);
urls = pathCheck.split("://");
str  = urls[1].split("/");

for (i in str){ tier_cnt ++;}

for (i in str){
	if(str[i] == "www.avc-akasaka.com" || str[i] == "avc-akasaka.com" ){
		offset = (i-0)+2;
		break;
	}
}

path_cnt = tier_cnt-offset;

for (i=0 ;i<path_cnt ;i++){
	root_path +="../";
}

//set param
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_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.0
  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 && document.getElementById) x=document.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 view(page)
{
	self.name="main"
	OpenWin = this.open(page, "view", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,status=no,width=526,height=690");
}




//--------------------------------------------------------------------
function TitleMenu(){
with (document) {
writeln("<table width=\"744\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
writeln("<tr>");
writeln("<td><img src=\""+img_path+"logo.gif\" width=\"236\" height=\"65\" border=\"0\" usemap=\"#TitleMap\" alt=\"AVC ÔâƒrƒfƒIƒZƒ“ƒ^[\"></td>");
writeln("<td width=\"55\"><img src=\""+img_path+"tbs_logo.gif\" width=\"55\" height=\"62\"></td>");
writeln("</tr>");
writeln("</table>");


writeln("<map name=\"TitleMap\">");
writeln("<area shape=\"rect\" coords=\"1,19,234,63\" href=\""+root_path+"index.html\">");
writeln("</map>");
}

}





//--------------------------------------------------------------------
function TopMenu() {

	menu_nm = new Array("home","company","services","works","studio","equipment","recruit","news");
	def_off = new Array("_off","_off","_off","_off","_off","_off","_off","_off");

	sub_menu  = new Array("company","services","studio");
	
	if(str[dir_1] == "index.html" || str[dir_1] == ""){
		//TOPƒy[ƒW
		def_off[0] = "_on";
	}else{
		//1ŠK‘w‰º‚Ìƒy[ƒW
		for (ii in menu_nm){
			if( str[dir_1] == menu_nm[ii]){
				def_off[ii] = "_on";
				break;
			}
		}
	}



set_bg=0;

for (ii in sub_menu){
	if( str[dir_1] == sub_menu[ii]){
		document.writeln("<tr><td align=\"center\" background=\""+img_path+"menu_back_"+str[dir_1]+".gif\">");
		set_bg=1;
		break;
	}
}

if(set_bg==0){
	document.writeln("<tr><td align=\"center\" background=\""+img_path+"menu_back.gif\">");
}

with (document) {

writeln("<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">");
writeln("<tr>");

writeln("<td><a href=\""+root_path+"index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('menu_home','','"+img_path+menu_nm[0]+"_on.gif',1)\">");
writeln("<img name=\"menu_home\" src=\""+img_path+menu_nm[0]+def_off[0]+".gif\" width=93 height=35 border=0 alt=\"AVC ƒz[ƒ€\"></a></td>");


writeln("<td><a href=\""+root_path+"company/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('menu_company','','"+img_path+menu_nm[1]+"_on.gif',1)\">");
writeln("<img name=\"menu_company\" src=\""+img_path+menu_nm[1]+def_off[1]+".gif\" width=93 height=35 border=0 alt=\"AVC ‰ïŽÐˆÄ“à\"></a></td>");


writeln("<td><a href=\""+root_path+"services/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('menu_services','','"+img_path+menu_nm[2]+"_on.gif',1)\">");
writeln("<img name=\"menu_services\" src=\""+img_path+menu_nm[2]+def_off[2]+".gif\" width=93 height=35 border=0 alt=\"AVC ‹Æ–±“à—e\"></a></td>");


writeln("<td><a href=\""+root_path+"works/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('menu_works','','"+img_path+menu_nm[3]+"_on.gif',1)\">");
writeln("<img name=\"menu_works\" src=\""+img_path+menu_nm[3]+def_off[3]+".gif\" width=93 height=35 border=0 alt=\"AVC ì‹ÆŽÀÑ\"></a></td>");


writeln("<td><a href=\""+root_path+"studio/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('menu_studio','','"+img_path+menu_nm[4]+"_on.gif',1)\">");
writeln("<img name=\"menu_studio\" src=\""+img_path+menu_nm[4]+def_off[4]+".gif\" width=93 height=35 border=0 alt=\"AVC Ž–‹ÆŠ\"></a></td>");


writeln("<td><a href=\""+root_path+"equipment/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('menu_equipment','','"+img_path+menu_nm[5]+"_on.gif',1)\">");
writeln("<img name=\"menu_equipment\" src=\""+img_path+menu_nm[5]+def_off[5]+".gif\" width=93 height=35 border=0 alt=\"AVC ‹@Þˆê——\"></a></td>");


writeln("<td><a href=\""+root_path+"recruit/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('menu_recruit','','"+img_path+menu_nm[6]+"_on.gif',1)\">");
writeln("<img name=\"menu_recruit\" src=\""+img_path+menu_nm[6]+def_off[6]+".gif\" width=93 height=35 border=0 alt=\"AVC Ì—pî•ñ\"></a></td>");


writeln("<td><a href=\""+root_path+"news/index.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('menu_news','','"+img_path+menu_nm[7]+"_on.gif',1)\">");
writeln("<img name=\"menu_news\" src=\""+img_path+menu_nm[7]+def_off[7]+".gif\" width=93 height=35 border=0 alt=\"AVC ƒjƒ…[ƒXˆê——\"></a></td>");

writeln("</tr>");

for (ii in sub_menu){
	if( str[dir_1] == sub_menu[ii]){

		writeln("<tr><td colspan=8 align=\"center\">");
		writeln("<img src=\""+img_path+"submenu_"+str[dir_1]+".gif\" width=\"744\" height=\"20\" border=\"0\" usemap=\"#submenu_"+str[dir_1]+"\"></td>");
		writeln("</tr>");
		break;
	}
}

writeln("</table>");

writeln("</td></tr>");

writeln("<map name=\"submenu_company\">");
writeln("  <area shape=\"rect\" coords=\"376,0,440,20\" href=\""+root_path+"company/enkaku.html\" alt=\"AVC ‰ïŽÐ‰ˆŠv\">");
writeln("  <area shape=\"rect\" coords=\"304,0,368,20\" href=\""+root_path+"company/index.html\" alt=\"AVC ‰ïŽÐŠT—v\">");
writeln("</map>");

writeln("<map name=\"submenu_services\">");
writeln("  <area shape=\"rect\" coords=\"457,0,543,20\" href=\""+root_path+"services/vtr.html\" alt=\"AVC Žû˜^¥‘—o‹Æ–±\">");
writeln("  <area shape=\"rect\" coords=\"363,0,443,20\" href=\""+root_path+"services/db.html\" alt=\"AVC ƒ_ƒrƒ“ƒO‹Æ–±\">");
writeln("  <area shape=\"rect\" coords=\"292,0,351,20\" href=\""+root_path+"services/ma.html\" alt=\"AVC MA‹Æ–±\">");
writeln("  <area shape=\"rect\" coords=\"218,0,286,20\" href=\""+root_path+"services/index.html\" alt=\"AVC •ÒW‹Æ–±\">");
writeln("</map>");

writeln("<map name=\"submenu_studio\">");
writeln("  <area shape=\"rect\" coords=\"431,0,470,20\" href=\""+root_path+"studio/midoriyama.html\" alt=\"AVC —ÎŽR ’n}\">");
writeln("  <area shape=\"rect\" coords=\"373,0,421,20\" href=\""+root_path+"studio/sannoushita.html\" alt=\"AVC ŽR‰¤‰º ’n}\">");
writeln("  <area shape=\"rect\" coords=\"323,0,362,20\" href=\""+root_path+"studio/akasaka.html\" alt=\"AVC Ôâ ’n}\">");
writeln("  <area shape=\"rect\" coords=\"274,0,313,20\" href=\""+root_path+"studio/index.html\" alt=\"AVC –{ŽÐ ’n}\">");
writeln("</map>");

}
}


