var	domain = "toyoink.co.jp";

// jump to each localized page -------------------------------------------------
function	Jump2EnPage( url ) {
	var	url2	= url.substring( 0, url.indexOf( domain ) ) + domain + "/en" + url.substring( url.indexOf( domain ) + domain.length, url.length );
	
	window.location.href = url2;
}

function	Jump2JaPage( url ) {
	var	url2 = url.substring( 0, url.indexOf( domain ) ) + domain + url.substring( url.indexOf( domain ) + domain.length + 3, url.length );
	
	window.location.href = url2;
}

// write common header ---------------------------------------------------------
function	WriteJaHeader() {
	document.write( '<div class="align_c">' );
	document.write( '<table border="0" width="100%" cellpadding="0" cellspacing="8">' );
	document.write( '<tr class="align_m">' );
	document.write( '<td class="align_l"><a href="http://www.toyoink.co.jp/index.html"><img src="/common/header_logo.gif" width="165" height="26" alt="TOYO INK" title="東洋インキウェブサイトの表紙ページへ" border="0"></a></td>' );
	document.write( '<td class="align_r"><table border="0" cellpadding="0" cellspacing="4" class="align_r"><form name="namazu" method="get" action="http://www.toyoink.co.jp/cgi-bin/jp/namazu.cgi"><tr>' );
	document.write( '<td><input type="text" name="query" size="20" class="bx_blue"><input type="hidden" name="max" value="20"><input type="hidden" name="sort" value="score"></td>' );
	document.write( '<td><input type="image" src="/common/bt_search_ja.gif" name="submit" width="72" height="19" alt="検索" title=""></td>' );
	if ( document.URL.indexOf( "inquiry" ) == -1 ) {
		document.write( '<td><a href="http://www.toyoink.co.jp/inquiry/index.html"><img src="/common/bt_mail_ja.gif" width="92" height="19" alt="お問い合わせ" title="問い合わせメールのフォームへ"></a></td>' );
	}
	document.write( '</tr></form></table></td>' );
	document.write( '</tr>' );
	document.write( '</table>' );
	document.write( '</div>' );
}

function	WriteEnHeader() {
	document.write( '<div class="align_c">' );
	document.write( '<table border="0" width="100%" cellpadding="0" cellspacing="8">' );
	document.write( '<tr class="align_m">' );
	document.write( '<td class="align_l"><a href="http://www.toyoink.co.jp/en/index.html"><img src="/common/header_logo.gif" width="165" height="26" alt="TOYO INK" title="To the Home Page of TOYO INK Website" border="0"></a></td>' );
	document.write( '<td class="align_r"><table border="0" cellpadding="0" cellspacing="4" class="align_r"><form name="namazu" method="get" action="http://www.toyoink.co.jp/cgi-bin/en/namazu.cgi"><tr>' );
	document.write( '<td><input type="text" name="query" size="20" class="bx_blue"><input type="hidden" name="max" value="20"><input type="hidden" name="sort" value="score"></td>' );
	document.write( '<td><input type="image" src="/common/bt_search_en.gif" name="submit" width="72" height="19" alt="Search" title=""></td>' );
	if ( document.URL.indexOf( "inquiry" ) == -1 ) {
		document.write( '<td><a href="http://www.toyoink.co.jp/en/inquiry/index.html"><img src="/common/bt_mail_en.gif" width="92" height="19" alt="Contact Us" title="To Mail Form Page to contact us"></a></td>' );
	}
	document.write( '</tr></form></table></td>' );
	document.write( '</tr>' );
	document.write( '</table>' );
	document.write( '</div>' );
}

// write global navigation bar -------------------------------------------------
function	WriteJaGlobalNavi( bilingual ) {
	document.write( '<div class="align_c">' );
	document.write( '<map name="gnav">' );
	document.write( '<area shape="rect" coords="5,0,58,21" href="http://www.toyoink.co.jp/products/index.html" title="製品情報">' );
	document.write( '<area shape="rect" coords="59,0,112,21" href="http://www.toyoink.co.jp/company/index.html" title="会社案内">' );
	document.write( '<area shape="rect" coords="113,0,203,21" href="http://www.toyoink.co.jp/investor/index.html" title="IR情報・電子公告">' );
	document.write( '<area shape="rect" coords="204,0,297,21" href="http://www.toyoink.co.jp/news/index.html" title="ニュースリリース">' );
	document.write( '<area shape="rect" coords="298,0,377,21" href="http://www.toyoink.co.jp/csr_env/index.html" title="社会・環境活動">' );
	document.write( '<area shape="rect" coords="378,0,431,21" href="http://www.toyoink.co.jp/recruit/index.html" title="採用情報">' );
	document.write( '<area shape="rect" coords="432,0,504,21" href="http://www.toyoink.co.jp/events/index.html" title="イベント案内">' );
	document.write( '</map>' );
	document.write( '<table border="0" width="100%" cellpadding="0" cellspacing="0">' );
	document.write( '<tr>' );
	document.write( '<td width="45" class="bg_gnav align_l"><a href="http://www.toyoink.co.jp/index.html"><img src="/common/gnav_home_ja.gif" width="45" height="22" alt="ホーム" title="東洋インキウェブサイトの表紙ページへ"></a></td>' );
	document.write( '<td width="*" class="bg_gnav align_c"><img src="/common/gnav_ja.gif" width="510" height="22" usemap="#gnav" alt="コーナー一覧" title=""></td>' );
	if ( bilingual ) {
		document.write( '<td width="45" class="bg_gnav align_r"><a href="javascript:Jump2EnPage(document.URL)"><img src="/common/gnav_lang_en.gif" width="45" height="22" alt="English" title="To Corresponding English Page"></a></td>' );
	}
	else {
		document.write( '<td width="45" class="bg_gnav align_r"><img src="/common/spacer_0.gif" width="45" height="22" alt=""></td>' );
	}
	document.write( '</tr>' );
	document.write( '</table>' );
	document.write( '</div>' );
}

function WriteEnGlobalNavi( bilingual ) {
	document.write( '<div class="align_c">' );
	document.write( '<map name="gnav">' );
	document.write( '<area shape="rect" coords="15,0,74,21" href="http://www.toyoink.co.jp/en/products/index.html" title="Products">' );
	document.write( '<area shape="rect" coords="75,0,157,21" href="http://www.toyoink.co.jp/en/company/index.html" title="Our Company">' );
	document.write( '<area shape="rect" coords="158,0,239,21" href="http://www.toyoink.co.jp/en/investor/index.html" title="For Investors">' );
	document.write( '<area shape="rect" coords="240,0,331,21" href="http://www.toyoink.co.jp/en/news/index.html" title="News Releases">' );
	document.write( '<area shape="rect" coords="332,0,419,21" href="http://www.toyoink.co.jp/en/csr_env/index.html" title="CSR Activities">' );
	document.write( '<area shape="rect" coords="420,0,493,21" href="http://www.toyoink.co.jp/en/events/index.html" title="Events Info.">' );
	document.write( '</map>' );
	document.write( '<table border="0" width="100%" cellpadding="0" cellspacing="0">' );
	document.write( '<tr>' );
	document.write( '<td width="45" class="bg_gnav align_l"><a href="http://www.toyoink.co.jp/en/index.html"><img src="/common/gnav_home_en.gif" width="45" height="22" alt="Home" title="To the Home Page of TOYO INK Website"></a></td>' );
	document.write( '<td width="*" class="bg_gnav align_c"><img src="/common/gnav_en.gif" width="510" height="22" usemap="#gnav" alt="Corner List" title=""></td>' );
	if ( bilingual ) {
		document.write( '<td width="45" class="bg_gnav align_r"><a href="javascript:Jump2JaPage(document.URL)"><img src="/common/gnav_lang_ja.gif" width="45" height="22" alt="Japanese" title="To Corresponding Japanese Page"></a></td>' );
	}
	else {
		document.write( '<td width="45" class="bg_gnav align_r"><img src="/common/spacer_0.gif" width="45" height="22" alt=""></td>' );
	}
	document.write( '</tr>' );
	document.write( '</table>' );
	document.write( '</div>' );
}

// write common footer ---------------------------------------------------------
function	WriteJaFooter( year )	{
	document.write( '<table border="0" width="100%" cellpadding="0" cellspacing="8">' );
	document.write( '<tr><td><table border="0" width="100%" cellpadding="0" cellspacing="0">' );
	document.write( '<tr><td colspan="2" class="align_r"><a href="http://www.toyoink.co.jp/sitemap.html">サイトマップ</a> | <a href="http://www.toyoink.co.jp/privpolicy.html">個人情報保護方針</a> | <a href="http://www.toyoink.co.jp/termsofuse.html">サイト利用規約</a></td></tr>' );
	document.write( '<tr><td colspan="2" class="bg_black"><img src="/common/spacer_k.gif" width="584" height="1" alt=""></td></tr>' );
	document.write( '<tr>' );
	document.write( '<td class="align_l"><table border="0" cellpadding="0" cellspacing="0"><tr>' );
	document.write( '<td class="bg_blue9"><img src="/common/spacer_0.gif" width="8" height="24" alt=""></td>' );
	document.write( '<td class="align_t"><img src="/common/footer_logo.gif" width="110" height="24" alt=""></td>' );
	document.write( '<td class="copyrights">Copyright &copy; 1998,' + year + ' TOYO INK MFG. CO.,LTD. All rights reserved.</td>' );
	document.write( '</tr></table></td>' );
	if ( document.URL.indexOf( "inquiry" ) == -1 ) {
		document.write( '<td class="align_r align_b"><a href="http://www.toyoink.co.jp/inquiry/index.html"><img src="/common/bt_mail_ja.gif" width="92" height="19" alt="お問い合わせ" title="問い合わせメールのフォームへ"></a></td>' );
	}
	else {
		document.write( '<td class="align_r align_b"><img src="/common/spacer_0.gif" width="1" height="1" alt=""></td>' );
	}
	document.write( '</tr>' );
	document.write( '</table></td></tr>' );
	document.write( '</table>' );
}

function	WriteEnFooter( year )	{
	document.write( '<table border="0" width="100%" cellpadding="0" cellspacing="8">' );
	document.write( '<tr><td><table border="0" width="100%" cellpadding="0" cellspacing="0">' );
	document.write( '<tr><td colspan="2" class="align_r"><a href="http://www.toyoink.co.jp/en/sitemap.html">Site Map</a> | <a href="http://www.toyoink.co.jp/en/privpolicy.html">Privacy Policy</a> | <a href="http://www.toyoink.co.jp/en/termsofuse.html">Terms of Use</a></td></tr>' );
	document.write( '<tr><td colspan="2" class="bg_black"><img src="/common/spacer_k.gif" width="584" height="1" alt=""></td></tr>' );
	document.write( '<tr>' );
	document.write( '<td class="align_l"><table border="0" cellpadding="0" cellspacing="0"><tr>' );
	document.write( '<td class="bg_blue9"><img src="/common/spacer_0.gif" width="8" height="24" alt=""></td>' );
	document.write( '<td class="align_t"><img src="/common/footer_logo.gif" width="110" height="24" alt=""></td>' );
	document.write( '<td class="copyrights">Copyright &copy; 1998,' + year + ' TOYO INK MFG. CO.,LTD. All rights reserved.</td>' );
	document.write( '</tr></table></td>' );
	if ( document.URL.indexOf( "inquiry" ) == -1 ) {
		document.write( '<td class="align_r align_b"><a href="http://www.toyoink.co.jp/en/inquiry/index.html"><img src="/common/bt_mail_en.gif" width="92" height="19" alt="Contact Us" title="To Mail Form Page to contact us"></a></td>' );
	}
	else {
		document.write( '<td class="align_r align_b"><img src="/common/spacer_0.gif" width="1" height="1" alt=""></td>' );
	}
	document.write( '</tr>' );
	document.write( '</table></td></tr>' );
	document.write( '</table>' );
}

// image roll over -------------------------------------------------------------
var	orgImgNames = new Array();

function	PreloadImage( img ) {
	if ( ! orgImgNames[ img.name ] ) {
		orgImgNames[ img.name ] = img.src;
		var	head = img.src.substring( 0, lastIndexOf( "." ) - 1 );
		var tail = img.src.substring( lastIndexOf( "." ) + 1, img.src.length );
		(new Image).src = head + "0" + tail;
		(new Image).src = head + "1" + tail;
	}
}

function	SwapImage( img, suffix ) {
	var	head = orgImgNames[ img.name ].substring( 0, lastIndexOf( "." ) - 1 );
	var	tail = orgImgNames[ img.name ].substring( lastIndexOf( "." ) + 1, orgImgNames[ img.name ].length );
	img.src = head + suffix + tail;
}

function	MouseOver( img ) {
	SwapImage( img, "1" );
}

function	MouseOut( img ) {
	SwapImage( img, "0" );
}

// USAGE: <img src="ImageUri" name="ImageName" onMouseOver="MouseOver(this)" onMouseOut="MouseOut(this)" onLoad="PreloadImage(this)">

// -----------------------------------------------------------------------------