///////////////////////////////////////////
///	『 JAVASCRIPTライブラリ 』	///
///		第一電子株式会社	///
///	Copyright (C) 2001		///
///	DaiichiDenshi Corporation.	///
///	All Rights Reserved.		///
///////////////////////////////////////////


//////////////
// 月日取得 //
//////////////
atDate = new Date();
atMonth = atDate.getMonth()+1;
atDate = atDate.getDate();

//////////////////////
//イメージプレロード//
//////////////////////
//data = new Array("img1.jpg","img2.jpg","img3.jpg","img4.jpg");
//prImg= new Array();
//for (i=0; i<data.length; i++)
//{
//	prImg[i] = new Image();
//	prImg[i].src = data[i];
//}

//////////////////////////////
// オンマウスオーバーボタン //
//////////////////////////////
ULink = new Array();
for (i = 0; i <= 6; i++) {ULink[i] = new Image();ULink[i].src='../images/btn_menu_'+i+'on.gif'; }

function LinkI(n){ document.images['Link' + n].src = ULink[n].src; }
function LinkO(n){ document.images['Link' + n].src = '../images/btn_menu_' + n + 'off.gif'; }


////////////////////////
// ブラウザーチェック //
////////////////////////
function navType(){
	if( navigator.appName == 'Microsoft Internet Explorer' ){
		if( navigator.appVersion == '4.0'){}
	}
	if( navigator.appName == 'Netscape' ){
		if( navigator.appVersion == '4.78'){}
		if( navigator.appVersion == '5.0'){}
	}
}

///////////////////////
// 直前のURLチェック //
///////////////////////
function checkURL(){
	nxtURL = 'http://www./';		//ジャンプ先のURL指定
	myURL = document.URL;			//現在のURL取得
	myHOST = location.hostname;		//ホスト名の取得
	oldURL = document.referrer;		//ジャンプ元のURL取得
	oldHOST = oldURL.substring(7,19);	//substring(http://の文字数,ドメインまでの文字数)
	if(oldHOST != myHOST || oldHOST == 0){location.href(nxtURL);}
}

//////////////////////
// ファイル名の取得 //
//////////////////////
function GetFileName(file_url){
	file_url = file_url.substring(file_url.lastIndexOf("/")+1,file_url.length)
	//拡張子も取り除く場合は次の行のコメントアウトをはずしてください
	//file_url = file_url.substring(0,file_url.indexOf("."));
	return file_url;
MyFile = GetFileName(location.href);
}

////////////////////////////
// ポップアップウインドウ //
////////////////////////////
//【HTML記述例】popWin('表示させるアドレス',ウィンドウの幅,ウインドウの高さ,スクロールバーON/OFF);
function popWin(url,w,h,s){
	window.open(url, 'win','width='+ w +',height='+ h +',scrollbars=' + s + ',status=0,directories=0,menubar=0,resizable=1,toolbar=0,fullscreen=0,dependent=1');
}

////////////////////////
// ウインドウリサイズ //
////////////////////////
function winResize(){
	if (navigator.appName == "Netscape"){
		moveTo(7, 7);
		resizeTo(715, 365);
	}
	else{
		if (navigator.appName == "Microsoft Internet Explorer"){
			moveTo(14, 50);
			resizeTo(747, 524);
		}
		else{
			alert("The window autoresize feature is not supported by your browser.  Please resize the window manually.");
		}
	}
}

////////////////////////
// プルダウンメニュー //
////////////////////////
function DM(tag) {
	if ( document.getElementById ) {
		if ( document.getElementById(tag).style.visibility == "hidden" ){
			document.getElementById(tag).style.visibility = "visible"; }
		else { document.getElementById(tag).style.visibility = "hidden"; }
	}
	if ( document.layers ) {
		if ( document.layers[tag].visibility == "hide" ){
			document.layers[tag].visibility = "show"; }
		else { document.layers[tag].visibility= "hide"; }
	}
}

function DMoff(tag) {
	if ( document.getElementById ) {
		if ( document.getElementById(tag).style.visibility == "visible" ){
			document.getElementById(tag).style.visibility = "hidden"; }
		else { document.getElementById(tag).style.visibility = "hidden"; }
	}
	if ( document.layers ) {
		if ( document.layers[tag].visibility == "show" ){
			document.layers[tag].visibility = "hide"; }
		else { document.layers[tag].visibility= "hide"; }
	}
}
function DMon(tag) {
	if ( document.getElementById ) {
		if ( document.getElementById(tag).style.visibility == "hidden" ){
			document.getElementById(tag).style.visibility = "visible"; }
		else { document.getElementById(tag).style.visibility = "visible"; }
	}
	if ( document.layers ) {
		if ( document.layers[tag].visibility == "hide" ){
			document.layers[tag].visibility = "show"; }
		else { document.layers[tag].visibility= "show"; }
	}
}

function Header(){
MyFile = GetFileName(location.href);
	document.write('<table border="0" align="center" width="770" cellpadding="0" cellspacing="0">\n');
	document.write('<tr><td height="4" colspan="2" bgcolor="#355DA4"><img src="../images/clear.gif" width="1" height="1"></td></tr>\n');
	document.write('<tr><td height="2" colspan="2"><img src="../images/clear.gif" width="1" height="1"></td></tr>\n');
	document.write('<tr><td height="80" colspan="2" bgcolor="#FFFFFF" class="head"><div class="IndentA"><a href="../index.html"><img src="../images/head_name.gif" width="256" height="74" border="0" alt="野澤産業株式会社"></a></div></td></tr>\n');
	document.write('<tr><td bgcolor="#FFFFFF">\n');
	document.write('	<table border="0" align="center" width="770" cellpadding="0" cellspacing="0">\n');
	document.write('	<tr><td bgcolor="#355DA4">\n');
	document.write('		<table border="0" width="600" height="24" cellspacing="0">\n');
	document.write('		<tr>\n');
	document.write('		    <td align="center" rowspan="2"><img src="../images/clear.gif" width="6"></td>\n');
	document.write('		    <td width="3"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		    <td align="center" rowspan="2"><a href="../index.html" onMouseOver="LinkI(1);" onMouseOut="LinkO(1);"><img src="../images/btn_menu_1off.gif" height="28" border="0" name="Link1" alt="ホーム"></a></td>\n');
	document.write('		    <td width="3"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		    <td align="center" rowspan="2" onMouseOver="LinkI(2);DMon(\'tag1\');" onMouseOut="LinkO(2);DMoff(\'tag1\');"><img src="../images/btn_menu_2off.gif" height="28" border="0" name="Link2" alt="会社情報"></td>\n');
	document.write('		    <td width="3"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		    <td align="center" rowspan="2"><a href="../product/index.html" onMouseOver="LinkI(3);" onMouseOut="LinkO(3);"><img src="../images/btn_menu_3off.gif" height="28" border="0" name="Link3" alt="商品情報"></td>\n');
	document.write('		    <td width="3"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		    <td align="center" rowspan="2"><a href="../recruit/index.html" onMouseOver="LinkI(4);" onMouseOut="LinkO(4);"><img src="../images/btn_menu_4off.gif" height="28" border="0" name="Link4" alt="採用情報"></td>\n');
	document.write('		    <td width="3"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		    <td align="center" rowspan="2"><a href="../partner/admin.cgi" onMouseOver="LinkI(5);" onMouseOut="LinkO(5);"><img src="../images/btn_menu_5off.gif" height="28" border="0" name="Link5" alt="ビジネスパートナー"></td>\n');
	document.write('		    <td width="3"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		    <td align="center" rowspan="2"><a href="../inquiry/form.html" onMouseOver="LinkI(6);" onMouseOut="LinkO(6);"><img src="../images/btn_menu_6off.gif" height="28" border="0" name="Link6" alt="お問合せ"></td>\n');
	document.write('		    <td width="3"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		</tr>\n');
	document.write('		<tr>\n');
	document.write('		    <td width="3" height="20" bgcolor="#FFFFFF"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		    <td width="3" height="20" bgcolor="#FFFFFF"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		    <td width="3" height="20" bgcolor="#FFFFFF"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		    <td width="3" height="20" bgcolor="#FFFFFF"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		    <td width="3" height="20" bgcolor="#FFFFFF"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		    <td width="3" height="20" bgcolor="#FFFFFF"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		    <td width="3" height="20" bgcolor="#FFFFFF"><img src="../images/clear.gif" width="1" height="1"></td>\n');
	document.write('		</tr>\n');
	document.write('		</table>\n');
	document.write('	</td></tr>\n');
	document.write('	</table>\n');
	document.write('</td></tr>\n');
	document.write('<tr><td bgcolor="#FFFFFF">\n');
}

function Footer(){
MyFile = GetFileName(location.href);
	w = 770 / 2;
	if(window.innerWidth){ h = innerWidth;}
	else{ h = document.body.clientWidth; }
	l = h/2;
	stl = l - w;

	document.write('    </td>\n');
	document.write('</tr>\n');
	document.write('<tr><td height="2" colspan="2"><img src="../images/clear.gif" width="1" height="1"></td></tr>\n');
	document.write('<tr><td height="4" colspan="2" bgcolor="#355DA4"><img src="../images/clear.gif" width="1" height="1"></td></tr>\n');
	document.write('</table>\n');
	document.write('<div align="center" class="Footer">Copyright (c) 2005 NOZAWA SANGYO Co., Ltd All Rights Reserved.</div>');

	if(MyFile !=0 || MyFile != 'index.html'){
		document.write('<span align="center" id="tag1" style="left:',stl,';" class="pdown2" onmouseout="JavaScript:DM(\'tag1\');">\n');
		document.write('<a href="../company/profile.html" class="pdown" onmouseover="DMon(\'tag1\');" onmouseout="DMon(\'tag1\');">ご挨拶</a><br>\n');
		document.write('<a href="../company/profile.html#2" class="pdown" onmouseover="DMon(\'tag1\');" onmouseout="DMon(\'tag1\');">理念</a><br>\n');
		document.write('<a href="../company/outline.html" class="pdown" onmouseover="DMon(\'tag1\');" onmouseout="DMon(\'tag1\');">会社概要</a>\n');
		document.write('</span>\n');
	}
}
