<!--
var domainroot = "/";
var currentSection;

var posx = new Array();
var posy = new Array();
var numoflayers = arraymenu.length;
var tox, toy;
var activeObj;

var timeoutid1;
var timeoutid2;

var currentOnMenuid1 = "";
var currentOnMenuid2 = "";
var subLayerObj = null;


function getImageWidthArray(menuname)
{
	return imageWidthArray[menuname];
}

function initArrays()
{
	temp = layerFromLeft;
	posx["link0"] = layerFromLeft;
	posy["link0"] = layerFromTop;
	for(j=0; j<numoflayers; j++)
	{
		temp += getImageWidthArray(arraymenu[String(j)])+2;
		
		posx["link"+String(j+1)] = temp;
		posy["link"+String(j+1)] = layerFromTop;
	}
}


function genMenu()
{
	var chapterColor = "";
	if(document.URL.indexOf("/company/") != -1)
		currentSection = "company";
	if(document.URL.indexOf("/product/") != -1)
		currentSection = "product";
	if(document.URL.indexOf("/archive/") != -1)
		currentSection = "archive";
	if(document.URL.indexOf("/contact/") != -1)
		currentSection = "contact";

	chapterColor = chapterColorArray[currentSection];

	navbarhtml = '<table border="0" cellspacing="0" cellpadding="0" bgcolor="'+chapterColor+'" background="'+root+'images/shim.gif" width="433" height="15">'+"\n";
	navbarhtml += '<tr><td width="433">';

	var widthArray = new Array();
	widthArray[1] = 71;
	widthArray[2] = 58;
	widthArray[3] = 88;
	widthArray[4] = 86;
	widthArray[5] = 81;

	for(i=1; i<=numoflayers; i++)
	{
		category = arraymenu[i-1].toLowerCase();
		if(category == "home")
			href = root + "index.asp";
		else
			href = root + category + "/" + defaultLinkArray[category];
		alt = chapterTextArray[category];

		onMouseOverStr = "FirstLevelOnMouseOverFunction("+i+","+category+")";
		onMouseOutStr = "FirstLevelOnMouseOutFunction("+i+")";
		if(category == currentSection)
			imgsrcStr = "images/menu_" + category + "_on.gif";
		else
			imgsrcStr = "images/menu_" + category + ".gif";

		emptycell = "";
		if(i != numoflayers)
			emptycell = '<img src="images/shim.gif" width="8" height="1">';

		navbarhtml += '<a href="'+href+'" onMouseOver="'+onMouseOverStr+'" onMouseOut="'+onMouseOutStr+'"><img src="'+imgsrcStr+'" border="0" name="'+category+'" alt="'+alt+'" width="'+widthArray[i]+'" height="15"></a>'+emptycell;
	}
//	navbarhtml += '<img src="images/shim.gif" width="17" height="1">';
	navbarhtml += "</td></tr>\n";
	navbarhtml += "</table>";

	document.write(navbarhtml);
}

function getPosxy(layerid,type)
{
	layerid = type+layerid;
	if(document.all)
	{
		if(document.body.clientWidth <= 747)
			xxx = posx[layerid]+317;
		else
			xxx = ((document.body.clientWidth-747)/2)+posx[layerid]+317;
	}
	else
	{
		if(window.innerWidth <= 747)
			xxx = posx[layerid]+317;
		else
			xxx = Math.ceil(((window.innerWidth-747)/2)+posx[layerid]+309);
	}
	tox = parseInt(xxx);
	toy = posy[layerid];
}

function returnPosx(layerid)
{
	layerid = "link"+layerid;
	return posx[layerid];
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) 
  { v=args[i+2];

	if(v=='show')
	{
		if (obj.style)
		{ 
			obj=obj.style;
			v=(v=='show')?'visible':(v='hide')?'hidden':v;
		}

		n = args[i+1];

		getPosxy(n,"link");
		obj.left = tox;
		obj.top = toy;
		activeObj = obj;
	}
	else
	{
		if (obj.style)
		{ 
			obj=obj.style;
			v=(v=='show')?'visible':(v='hide')?'hidden':v;
		}
	}

	obj.visibility=v; 
  }
}

// begin 1st level
// ----------------------------------------------------------------
function FirstLevelOnMouseOverFunction(layernum, imgObj)
{
	ownid = layernum;
	ownMenuid = "link" + ownid;

	hideMenu(currentOnMenuid1);
	hideMenu(currentOnMenuid2);

	window.clearTimeout(timeoutid1);

	MM_swapImage(imgObj.name,'','images/menu_'+imgObj.name+'_on.gif',1);

	showMenu(ownMenuid,ownid-1);
	currentOnMenuid1 = ownMenuid;
}
function FirstLevelOnMouseOutFunction(layernum)
{
	MM_swapImgRestore();
	timeoutid1 = setTimeout("hideMenu(currentOnMenuid1)",500);
}
// end 1st level
// ----------------------------------------------------------------



// begin 2nd level
// ----------------------------------------------------------------
function SecondLevelOnMouseOverFunction(imageName, imageFileName, parentName, index1, index2)
{
	ownid = String(index1+1) + String(index2+1);
	ownMenuid = "link" + ownid;

	hideMenu(currentOnMenuid2);

	window.clearTimeout(timeoutid1);
	window.clearTimeout(timeoutid2);

	swapImage(imageName, imageFileName,1);
}
function SecondLevelOnMouseOutFunction(imageName, imageFileName, parentName, index1, index2)
{	
	timeoutid1 = setTimeout("hideMenu(currentOnMenuid1)",500);
	timeoutid2 = setTimeout("hideMenu(currentOnMenuid2)",500);

	if(subLayerObj == null)
		restoreImage(imageName, imageFileName, '');
}

function swapImage(imageName, filename, num)
{
	targetImg = root + "images/"+filename+"_on.gif";
	MM_swapImage(imageName,'',targetImg,1);
}
function restoreImage(imageName, filename, num)
{
	targetImg = root + "images/"+filename+".gif";
	MM_swapImage(imageName,'',targetImg,1);
}
function showMenu(layerid,num)
{
	MM_showHideLayers(layerid,num,'show');
}
function hideMenu(layerid,num)
{
	MM_showHideLayers(layerid,num,'hide');
}
function SecondLevelLayerOnMouseOverFunction(layerObj)
{
	if(document.all)
		layerObj.style.visibility='visible';
	else
		layerObj.visibility = 'show';
}
// end 2nd level
// ----------------------------------------------------------------




function genLayerMenu(num,arrayObj,parentName,chapterName)
{
	name = arrayObj[num].toLowerCase();
	chaptername = chapterName;

	if(parentName != "")
	{
		nameArrayObj = eval(chaptername + "_" + name + "NameArray");
		linkArrayObj = eval(chaptername + "_" + name + "LinkArray");
		textArrayObj = eval(chaptername + "_" + name + "TextArray");

		target = "_self";
		imgPath = root + "images/";

		if(nameArrayObj.length > 0)
		{
			var tablestr = "";
			tablestr += '<table border="0" cellpadding="0" cellspacing="0">';
			tablestr += '<tr>';
			tablestr += '<td rowspan="'+(2*nameArrayObj.length+1)+'" bgcolor="#FFFFFF"><img src="'+root+'images/shim.gif" width="1"></td>';
			tablestr += '<td bgcolor="#FFFFFF"><img src="'+root+'images/shim.gif" width="1"></td>';
			tablestr += '<td rowspan="'+(2*nameArrayObj.length+1)+'" bgcolor="#FFFFFF"><img src="'+root+'images/shim.gif" width="1"></td>';
			tablestr += '</tr>';

			for(i=0; i<nameArrayObj.length; i++)
			{
				var name = nameArrayObj[i];
				var menuImgName = chaptername+"_subimg"+(num+1)+""+(i+1);

				var onMouseOverStr = "ThirdLevelOnMouseOverFunction('"+menuImgName+"','"+name+"', '"+chaptername+"',"+num+","+i+")";
				var onMouseOutStr = "ThirdLevelOnMouseOutFunction("+num+","+i+", '"+chaptername+"')";

				if(name != null)
				{
					subfolder = name.substr(name.indexOf("_")+1, name.length);
					filepath = "/" + chaptername + "/" + parentName + "/";
					if(linkArrayObj[i].indexOf("/") != -1 || linkArrayObj[i].indexOf("javascript") != -1)
						href = linkArrayObj[i];
					else
						href = filepath + linkArrayObj[i];

					alt = textArrayObj[i];
					tablestr += '<tr>';
					tablestr += '<td>';
					tablestr += '<a href="'+href+'" onMouseOver="'+onMouseOverStr+'" onMouseOut="'+onMouseOutStr+'"><img src="'+imgPath+name+'.gif" border="0" name="'+menuImgName+'" alt="'+alt+'"></a>';
					tablestr += '</td>';
					tablestr += '</tr>';
					tablestr += '<tr>';
					tablestr += '<td bgcolor="#FFFFFF"><img src="'+root+'images/shim.gif" width="1"></td>';
					tablestr += '</tr>';
				}
			}
			tablestr += '</table>';
		}
	}
	else
	{
		nameArrayObj = eval(name + "NameArray");
		linkArrayObj = eval(name + "LinkArray");
		textArrayObj = eval(name + "TextArray");

		filepath = "/" + name + "/";
		target = "_self";
		imgPath = root+"images/";

		if(nameArrayObj.length > 0)
		{
			var tablestr = "";
			tablestr += '<table border="0" cellpadding="0" cellspacing="0">';
			tablestr += '<tr>';
			tablestr += '<td rowspan="'+(2*nameArrayObj.length+1)+'" bgcolor="#FFFFFF"><img src="'+root+'images/shim.gif" width="1"></td>';
			tablestr += '<td bgcolor="#FFFFFF"><img src="'+root+'images/shim.gif" width="1"></td>';
			tablestr += '<td rowspan="'+(2*nameArrayObj.length+1)+'" bgcolor="#FFFFFF"><img src="'+root+'images/shim.gif" width="1"></td>';
			tablestr += '</tr>';
			for(i=0; i<nameArrayObj.length; i++)
			{
				var name = nameArrayObj[i];
				var menuImgName = "img"+(num+1)+""+(i+1);
				name = "menu_" + chaptername.substr(0,3) + "_" + name;

				var onMouseOverStr = "SecondLevelOnMouseOverFunction('"+menuImgName+"','"+name+"', '"+chaptername+"',"+num+","+i+")";
				var onMouseOutStr = "SecondLevelOnMouseOutFunction('"+menuImgName+"','"+name+"', '"+chaptername+"',"+num+","+i+")";

				if(name != null)
				{
					filepath = "/" + chaptername + "/";

					var href;
					if(linkArrayObj[i].indexOf("/") != -1 || linkArrayObj[i].indexOf("javascript") != -1)
						href = 'href="'+linkArrayObj[i]+'"';
					else					
						href = 'href="' + filepath + linkArrayObj[i] + '"';

					alt = textArrayObj[i];
					imgsrc = imgPath + name + ".gif";
					arrowName = menuImgName + "a";

					tablestr += '<tr>';
					tablestr += '<td align="right" nowrap>';
					tablestr += '<a '+href+' onMouseOver="'+onMouseOverStr+'" onMouseOut="'+onMouseOutStr+'"><img src="'+imgPath+name+'.gif" border="0" name="'+menuImgName+'" alt="'+alt+'"></a>';
					tablestr += '</td>';
					tablestr += '</tr>';
					tablestr += '<tr>';
					tablestr += '<td bgcolor="#FFFFFF"><img src="'+root+'images/shim.gif" width="1"></td>';
					tablestr += '</tr>';
				}
			}
			tablestr += '</table>';
		}
	}
	return tablestr;
}

function genLayerDefinitions()
{
	var k;
	if(document.all)
	{
		for(k=0; k<numoflayers; k++)
		{
			linknum = k + 1;
			layerMenuContent = genLayerMenu(k,arraymenu,"",arraymenu[k]);

			var onMouseOverStr = "SecondLevelLayerOnMouseOverFunction(this)";

			if(layerMenuContent != null)
			{
				layerwidth = imageWidthArray[arraymenu[k]]+20;
				document.writeln('<div id="link'+linknum+'" style="position:absolute; width:'+layerwidth+'px; height:100px; z-index:10; left: 0px; top: 0px; visibility: hidden;" onMouseOver="'+onMouseOverStr+'">'+layerMenuContent+'</div>');
			}

			genSubLayerDefinitions(arraymenu,k);
		}
	}
	else
	{
		for(k=0; k<numoflayers; k++)
		{
			linknum = k + 1;
			layerMenuContent = genLayerMenu(k,arraymenu,"",arraymenu[k]);
			
			var onMouseOverStr = "SecondLevelLayerOnMouseOverFunction(this)";

			if(layerMenuContent != null)
			{
				layerwidth = imageWidthArray[arraymenu[k]]+20;
				document.writeln('<layer id="link'+linknum+'" left="0" top="0" width="'+layerwidth+'" height="10" visibility="hide" onMouseOver="'+onMouseOverStr+'">'+layerMenuContent+'</layer>');
			}

			genSubLayerDefinitions(arraymenu,k);
		}
	}
}

function genSubLayerDefinitions(arrayObj,k)
{
	subArraymenu = eval(arrayObj[k]+"NameArray");
	m = subArraymenu.length;

	var l;
	if(document.all)
	{
		for(l=0; l<m; l++)
		{
			sublinknum = linknum + String(l + 1);
			sublayerMenuContent = genLayerMenu(l,subArraymenu, eval(arrayObj[k]+"NameArray")[l], arraymenu[k]);

			var onMouseOverStr = "ThirdLevelLayerOnMouseOverFunction(this)";
			var onMouseOutStr = "ThirdLevelLayerOnMouseOutFunction("+sublinknum+")";

			assignSubLayerPosition(sublinknum,k,l+1);

			if(sublayerMenuContent != null)
				document.writeln('<div id="link'+sublinknum+'" style="position:absolute; width:100px; height:100px; z-index:10; left: 0px; top: 0px; visibility: hidden;" onMouseOver="'+onMouseOverStr+'" onMouseOut="'+onMouseOutStr+'">'+sublayerMenuContent+'</div>');
		}
	}
	else
	{
		for(l=0; l<m; l++)
		{
			sublinknum = linknum + String(l + 1);
			sublayerMenuContent = genLayerMenu(l,subArraymenu, eval(arrayObj[k]+"NameArray")[l], arraymenu[k]);

			var onMouseOverStr = "ThirdLevelLayerOnMouseOverFunction(this)";
			var onMouseOutStr = "ThirdLevelLayerOnMouseOutFunction("+sublinknum+")";
			
			assignSubLayerPosition(sublinknum,k,l+1);
			if(sublayerMenuContent != null)
				document.writeln('<layer id="link'+sublinknum+'" left="0" top="0" width="10" height="10" visibility="hide" onMouseOver="'+onMouseOverStr+'" onMouseOut="'+onMouseOutStr+'">'+sublayerMenuContent+'</layer>');
		}
	}
}

function assignSubLayerPosition(sublayerid,k,l)
{
	chapter = arraymenu[k];
	requiredArray = menuImageHeightArray[chapter];

	offsetY = layerFromTop;
	for(b=1; b<l; b++)
		offsetY += requiredArray[b]+1;
	
	var temp1 = returnPosx(k+1);
	offsetX = temp1;
	
	posx["link"+sublayerid] = offsetX-1;
	posy["link"+sublayerid] = offsetY;
}




// -----------------------
// for product section
// -----------------------
function addThumbText()
{
	document.write('<span class="text">各写真をクリックすると左側で拡大イメージがご覧になれます。</span>');
}

function genThumbTable(producttype)
{
	var totalRow = 4;
	document.writeln('<table border="0" cellspacing="0" cellpadding="3" background="images/shim.gif">');
	for(i=1; i<=totalRow; i++)
	{
		genThumbRow(producttype, i);
		genNumRow(i);
	}
	document.writeln('</table>');
}


thumbNumArray = new Array();
thumbNumArray["burn"] = 16;
thumbNumArray["combine"] = 5;
thumbNumArray["compress"] = 5;
thumbNumArray["header"] = 2;
thumbNumArray["modelling"] = 10;
thumbNumArray["plating"] = 4;
thumbNumArray["pressure"] = 10;
function genThumbRow(producttype, rowNum)
{
	totalColumn = 5;
	startNum = ((rowNum-1)*5)+1;
	endNum = startNum + totalColumn - 1;

	rowCode = '<tr>';
	for(j=startNum; j<=endNum; j++)
	{
		if(j > thumbNumArray[producttype])
			rowCode += '<td><img src="'+domainroot+'images/dummy.gif" width="63" height="40"></td>';
		else
		{
			temp = j;
			if(temp < 10)
				temp = "0" + j;

			imgname = producttype+"_pd_"+temp;
			imgsrc = domainroot+"images/"+imgname+".gif";
			onClick = "showProduct('"+imgname+"')";
			rowCode += '<td><a href="#" onClick="'+onClick+'"><img src="'+imgsrc+'" width="63" height="40" border="0"></a></td>';
		}
	}
	rowCode += '</tr>';

	document.writeln(rowCode);
}

function genNumRow(rowNum)
{
	totalColumn = 5;
	startNum = ((rowNum-1)*5)+1;
	endNum = startNum + totalColumn - 1;

	rowCode = '<tr>';
	for(j=startNum; j<=endNum; j++)
	{
		temp = j;
		if(temp < 10)
			temp = "0" + j;
		rowCode += '<td align="right" valign="top"><img src="'+domainroot+'images/pd_no'+temp+'.gif" width="13" height="9"></td>';
	}
	rowCode += '</tr>';

	document.writeln(rowCode);
}

function showProduct(filename)
{
	document.mainImage.src = domainroot + "images/"+filename+".jpg";
}

function addDefaultImage(producttype)
{
	document.write('<img src="'+domainroot+'images/'+producttype+'_pd_01.jpg" width="210" height="125" name="mainImage">');
}

function addProductTypeImage(producttype)
{
	document.write('<img src="images/'+producttype+'_cat.gif" width="110" height="86">');
}

function addFactoryInfoImage(producttype)
{
	if(producttype == "burn" || producttype == "compress")
		document.write('<img src="images/factinfo_out.gif" width="110" height="100" border="0" name="Image1" alt="工場情報">');
	else
	{
		onMouseOver = "MM_swapImage('Image1','','images/factinfo_over.gif',1)";
		document.write('<a href="'+producttype+'_info.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="'+onMouseOver+'"><img src="images/factinfo_out.gif" width="110" height="100" border="0" name="Image1" alt="工場情報"></a>');	
	}
}

productTypeCaptionArray = new Array();
productTypeCaptionArray["burn"] = "";
//productTypeCaptionArray["burn"] = "焼結工場では確かな技術の移植を果たしつつ、更なる高速化と安定した製品の供給を目指しています。";
productTypeCaptionArray["combine"] = "組立工場では最新の全自動設備を基に、１０００万分の１の品質管理まで徹底して行っています。";
productTypeCaptionArray["compress"] = "";
//productTypeCaptionArray["compress"] = "押出成形工場では確かな技術の移植を果たしつつ、更なる高速化と安定した製品の供給を目指しています。";
productTypeCaptionArray["header"] = "ヘッダー工場では中国では数少ない日本製設備を中心に、世界に通用する品質の製品を作るべく努力しています。";
productTypeCaptionArray["modelling"] = "成形工場では金型製作、成形加工共に技術革新を進める為、お客様の多様なニーズにお応えしています。";
productTypeCaptionArray["plating"] = "メッキ工場では品質の安定は無論のこと、地球環境にも配慮した製品作りを推し進めています。";
productTypeCaptionArray["pressure"] = "プレス工場では確かな技術の移植を果たしつつ、更なる機械の高速化と安定した製品の供給を目指しています。"; 

function addProductTypeCaption(producttype)
{
	caption = productTypeCaptionArray[producttype]
	document.write(caption);
}

var productArray = new Array("pressure", "header", "plating", "modelling", "combine", "compress", "burn");
var productTextArray1 = new Array();

productTextArray1["pressure"] = "プレス";
productTextArray1["header"] = "ヘッダー";
productTextArray1["plating"] = "メッキ";
productTextArray1["modelling"] = "成形";
productTextArray1["combine"] = "組立";
productTextArray1["compress"] = "押出成形";
productTextArray1["burn"] = "焼結";

function genProductMenu()
{
	var widthArray1 = new Array();
	widthArray1[0] = 47;
	widthArray1[1] = 48;
	widthArray1[2] = 46;
	widthArray1[3] = 48;
	widthArray1[4] = 46;
	widthArray1[5] = 48;
	widthArray1[6] = 47;

	menuCode = '<table width="330" border="0" cellspacing="0" cellpadding="0" height="60">';
	menuCode += '<tr>';
	for(i=0; i<productArray.length; i++)
		menuCode += '<td><img src="images/pd_top_'+productArray[i]+'_tit.gif" height="20" width="'+widthArray1[i]+'"></td>';
	menuCode += '</tr>';
	menuCode += '<tr>';
	for(i=0; i<productArray.length; i++)
	{
		imgsrc = "images/pd_top_"+productArray[i]+"_out.gif";
		if(document.URL.indexOf(productArray[i]) != -1)
			imgsrc = "images/pd_top_"+productArray[i]+"_over.gif";
		onMouseOver = "MM_swapImage('"+productArray[i]+"','','images/pd_top_"+productArray[i]+"_over.gif',1)";
		menuCode += '<td><a href="'+productArray[i]+'.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="'+onMouseOver+'"><img src="'+imgsrc+'" name="'+productArray[i]+'" alt="'+productTextArray1[productArray[i]]+'" border="0" width="'+widthArray1[i]+'" height="60"></a></td>';
	}
	menuCode += '</tr>';
	menuCode += '</table>';

	document.write(menuCode);
}

//-->
