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 align="center">' );
	document.write( '<table border="0" width="100%" cellpadding="0" cellspacing="8">' );
	document.write( '<tr valign="middle">' );
	document.write( '<td align="left"><a href="/index.html"><img src="/common/header_logo.gif" width="165" height="26" alt="TOYO INK" title="東洋インキウェブサイトの表紙ページへ" border="0"></a></td>' );
	document.write( '<td align="right"><table border="0" cellpadding="0" cellspacing="4" align="right"><form name="namazu" method="get" action="/cgi-bin/jp/namazu.cgi"><tr>' );
	document.write( '<td><input type="text" name="query" size="40" class="box"><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="" border="0"></td>' );
	document.write( '<td><a href="/cgi-bin/jp/namazu.cgi"><small>使い方</small></a></td>' );
	document.write( '</tr></form></table></td>' );
	document.write( '</tr>' );
	document.write( '</table>' );
	document.write( '</div>' );
}

function	WriteEnHeader() {
	document.write( '<div align="center">' );
	document.write( '<table border="0" width="100%" cellpadding="0" cellspacing="8">' );
	document.write( '<tr valign="middle">' );
	document.write( '<td align="left"><a href="/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 align="right"><table border="0" cellpadding="0" cellspacing="4" align="right"><form name="namazu" method="get" action="/cgi-bin/en/namazu.cgi"><tr>' );
	document.write( '<td><input type="text" name="query" size="40" class="box"><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="" border="0"></td>' );
	document.write( '<td><a href="/cgi-bin/en/namazu.cgi"><small>Tips</small></a></td>' );
	document.write( '</tr></form></table></td>' );
	document.write( '</tr>' );
	document.write( '</table>' );
	document.write( '</div>' );
}

// write global navigation bar -------------------------------------------------
function	WriteJaGlobalNavi( lg ) {
	document.write( '<div align="center">' );
	document.write( '<map name="gnav">' );
	document.write( '<area shape="rect" coords="5,0,58,21" href="/products/index.html" title="製品情報">' );
	document.write( '<area shape="rect" coords="59,0,112,21" href="/company/index.html" title="会社案内">' );
	document.write( '<area shape="rect" coords="113,0,203,21" href="/investor/index.html" title="IR情報・電子公告">' );
	document.write( '<area shape="rect" coords="204,0,297,21" href="/news/index.html" title="ニュースリリース">' );
	document.write( '<area shape="rect" coords="298,0,377,21" href="/csr_env/index.html" title="社会・環境活動">' );
	document.write( '<area shape="rect" coords="378,0,431,21" href="/recruit/index.html" title="採用情報">' );
	document.write( '<area shape="rect" coords="432,0,504,21" href="/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" align="left" background="/common/gnav_back.gif" bgcolor="#CDD8E2"><a href="/index.html"><img src="/common/gnav_home_ja.gif" width="45" height="22" alt="ホーム" title="東洋インキウェブサイトの表紙ページへ" border="0"></a></td>' );
	document.write( '<td width="*" align="center" background="/common/gnav_back.gif" bgcolor="#CDD8E2"><img src="/common/gnav_ja.gif" width="510" height="22" usemap="#gnav" alt="コーナー一覧" title="" border="0"></td>' );
	if ( lg ) {
		document.write( '<td width="45" align="right" background="/common/gnav_back.gif" bgcolor="#CDD8E2"><a href="javascript:Jump2EnPage(document.URL)"><img src="/common/gnav_lang_en.gif" width="45" height="22" alt="English" title="To Corresponding English Page" border="0"></a></td>' );
	}
	else {
		document.write( '<td width="45" align="right" background="/common/gnav_back.gif" bgcolor="#CDD8E2"><img src="/common/spacer_0.gif" width="45" height="22" alt=""></td>' );
	}
	document.write( '</tr>' );
	document.write( '</table>' );
	document.write( '</div>' );
}

function WriteEnGlobalNavi( lg ) {
	document.write( '<div align="center">' );
	document.write( '<map name="gnav">' );
	document.write( '<area shape="rect" coords="15,0,74,21" href="/en/products/index.html" title="Products">' );
	document.write( '<area shape="rect" coords="75,0,157,21" href="/en/company/index.html" title="Our Company">' );
	document.write( '<area shape="rect" coords="158,0,239,21" href="/en/investor/index.html" title="For Investors">' );
	document.write( '<area shape="rect" coords="240,0,331,21" href="/en/news/index.html" title="News Releases">' );
	document.write( '<area shape="rect" coords="332,0,419,21" href="/en/csr_env/index.html" title="CSR Activities">' );
	document.write( '<area shape="rect" coords="420,0,493,21" href="/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" align="left" background="/common/gnav_back.gif" bgcolor="#CDD8E2"><a href="/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" border="0"></a></td>' );
	document.write( '<td width="*" align="center" background="/common/gnav_back.gif" bgcolor="#CDD8E2"><img src="/common/gnav_en.gif" width="510" height="22" usemap="#gnav" alt="Corner List" title="" border="0"></td>' );
	if ( lg ) {
		document.write( '<td width="45" align="right" background="/common/gnav_back.gif" bgcolor="#CDD8E2"><a href="javascript:Jump2JaPage(document.URL)"><img src="/common/gnav_lang_ja.gif" width="45" height="22" alt="Japanese" title="To Corresponding Japanese Page" border="0"></a></td>' );
	}
	else {
		document.write( '<td width="45" align="right" background="/common/gnav_back.gif" bgcolor="#CDD8E2"><img src="/common/spacer_0.gif" width="45" height="22" alt=""></td>' );
	}
	document.write( '</tr>' );
	document.write( '</table>' );
	document.write( '</div>' );
}

// open mail window ------------------------------------------------------------
function	OpenJaMail() {
	window.open( "http://www.toyoink.co.jp/mail.html", "mail", "width=640,height=616,scrollbars=yes,titlebar=yes,resizable=yes" );
}

function	OpenEnMail() {
	window.open( "http://www.toyoink.co.jp/en/mail.html", "mail", "width=640,height=643,scrollbars=yes,titlebar=yes,resizable=yes" );
}

// write mail button -----------------------------------------------------------
function	WriteJaMailButton() {
//	document.write( '<a href="javascript:;" onClick="OpenJaMail(document.URL);return false;"><img src="/common/bt_mail_ja.gif" width="92" height="19" alt="お問い合わせ" title="問い合わせメールのフォームへ" border="0"></a>' );
	document.write( '<a href="http://www.toyoink.co.jp/inquiry/index.html"><img src="/common/bt_mail_ja.gif" width="92" height="19" alt="お問い合わせ" title="問い合わせメールのフォームへ" border="0"></a>' );
}

function	WriteEnMailButton() {
//	document.write( '<a href="javascript:;" onClick="OpenEnMail(document.URL);return false;"><img src="/common/bt_mail_en.gif" width="92" height="19" alt="Contact Us" title="To Mail Form Page to contact us" border="0"></a>' );
	document.write( '<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" border="0"></a>' );
}

// 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)">

// -----------------------------------------------------------------------------