/*
	rootフォルダ用メニュースクリプト
*/
var isIE,isNS,isNS6,isDOM,lR,sR,vis,invis,myTimeOut,goName;
if (document.all) {
	isIE=true;
	lR="document.all.";
	sR=".style";
	vis="visible";
	invis="hidden";
}
if (document.layers) {
	isNS=true;
	lR="document.layers.";
	sR="";
	vis="show";
	invis="hide";
}
if (document.getElementById&&!isIE) {
	isDOM=true;
	lR="document.getElementById('";
	sR="').style";
	invis="hidden";
	vis="visible";
}
if (isDOM==true&&navigator.appName=="Netscape") {
	isNS6=true;
}

var oldwhich=0;
var x=0;
var layerTimer;

function layOver(which)
{
	x=0;
	l=eval(lR+"l"+which+sR);

	if (oldwhich!=which) {
		ol=eval(lR+"l"+oldwhich+sR);
		ol.visibility=invis;
	}
	l.visibility=vis;
	oldwhich=which;
	clearTimeout(layerTimer);
	return;
}

function stopOver()
{
	if (x<5) {
		x++;
	} else {
		ol=eval(lR+"l"+oldwhich+sR);
		ol.visibility=invis;
		x=0;
	}
	layerTimer=setTimeout("stopOver()",100);
}

function startOver()
{
	x=0;
	clearTimeout(layerTimer);
}

var strItem0 = new Array("sub00", "sub01"); 
var strItem1 = new Array("sub10", "sub11", "sub12", "sub13", "sub14");
/* 2010-2-19 correct
var strItem1 = new Array("sub10", "sub11", "sub12", "sub13", "sub14", "sub15");
*/
var strItem2 = new Array("sub20", "sub21"); 
var strItem3 = new Array("sub30", "sub31", "sub32", "sub33", "sub34");

function changebg1(item)
{
	if (document.getElementById) {
		if (item<10) { theone=eval("document.getElementById('"+strItem0[item]+"')"); }
		if (item>=10&&item<20) { theone=eval("document.getElementById('"+strItem1[item-10]+"')"); }
		if (item>=20&&item<30) { theone=eval("document.getElementById('"+strItem2[item-20]+"')"); }
		if (item>=30&&item<40) { theone=eval("document.getElementById('"+strItem3[item-30]+"')"); }
		
		theone.style.background='#7F9BC9';
		theone.style.color='#000000';
		if (isIE) {
			theone.style.cursor='hand';
		} else {
			theone.style.cursor='pointer';
		}
	}
}

function changebg2(item)
{
	if (document.getElementById) {
		if (item<10) { theone=eval("document.getElementById('"+strItem0[item]+"')"); }
		if (item>=10&&item<20) { theone=eval("document.getElementById('"+strItem1[item-10]+"')"); }
		if (item>=20&&item<30) { theone=eval("document.getElementById('"+strItem2[item-20]+"')"); }
		if (item>=30&&item<40) { theone=eval("document.getElementById('"+strItem3[item-30]+"')"); }

		theone.style.background='#EEEEEE';
		theone.style.color='#000000';
		if (isIE) {
			theone.style.cursor='hand';
		} else {
			theone.style.cursor='pointer';
		}
	}
}

var strURL0 = new Array("new_products.htm", 
						"news_release.htm");
var strURL1 = new Array("products/power/dcdcmain.htm",
						"products/acdc/acdcmain.htm", 
						"products/magnetics/magmain.htm",
						"products/meter/dmsmain.htm", 
						"products/compo/compmain.htm");
/* 2010-2-19 correct
						"exb/exbmain.htm#rfmw"); 
*/
var strURL2 = new Array("techinfo.htm", 
						"quality.htm");
var strURL3 = new Array("literatr.htm", 
						"company.htm#distr", 
						"contact.htm",
						"kkstock.htm",
						"leadtime.htm");

function changeURL(nURL)
{
	if (nURL<10) { window.location.href=strURL0[nURL]; }
	if (nURL>=10&&nURL<20) { window.location.href=strURL1[nURL-10]; }
	if (nURL>=20&&nURL<30) { window.location.href=strURL2[nURL-20]; }
	if (nURL>=30&&nURL<40) { window.location.href=strURL3[nURL-30]; }
}

var win,strURL;

function opennewURL(nURL)
{
	if (nURL<10) { strURL=strURL0[nURL]; }
	if (nURL>=10&&nURL<20) { strURL=strURL1[nURL-10]; }
	if (nURL>=20&&nURL<30) { strURL=strURL2[nURL-20]; }
	if (nURL>=30&&nURL<40) { strURL=strURL3[nURL-30]; }

	win=window.open(strURL, "Prod_view", "width=800, height=500, toolbar=yes, scrollbars=yes, resizable=yes"); 
	win.focus();
}

function LinkSelect(sel)
{
	c = sel.selectedIndex;
	v = sel.options[c].value;
	if (v.indexOf("-----")!=-1) { return; }
	if (v.indexOf("power/")!=-1) {
		adrs="http://www.murata-ps.jp/";
	}
	if (v.indexOf("acdc/") !=-1 || v.indexOf("magnetics/")!=-1 || v.indexOf("compo/")!=-1 || v.indexOf("meter/")!=-1 || v.indexOf("power2/")!=-1) {
/* 2010-2-19 correct	
	if (v.indexOf("acdc/") !=-1 || v.indexOf("magnetics/")!=-1 || v.indexOf("compo/")!=-1 || v.indexOf("exb/")!=-1 || v.indexOf("meter/")!=-1 || v.indexOf("power2/")!=-1) {
*/
		adrs="http://www.datel.murata-ps.jp/";
	}
	strURL = adrs+"products/"+sel.options[c].value;
	win=window.open(strURL, "Prod_view", "width=800, height=500, toolbar=yes, scrollbars=yes, resizable=yes"); 
	win.focus();
}

window.name="pedwindow";
sBrowserName=navigator.appName;

