// -*- coding: UTF-8 -*-
// iwata.js - JavaScript
// Copyright 2005 Sofrosune. All rights reserved.
// Author: Sofrosune; www.sofrosune.net
// No part of this program may be reproduced or transmitted in any form or 
// by any means without permission from the author, Sofrosune.
//
// Date: June 18, 2005.
// Version: 1.00; June 18, 2005.
// Version: 1.10; March 8, 2007.

// Usage:
/**
<head>
	<script type="text/javascript" src="../scripts/iwata.js"></script>
	<script type="text/javascript" src="../scripts/iwata_data.js"></script>
</head>
*/

// Constants:

// search engine
var kIWATA_QUERY_FORM = '\
<form method="get" action="http://www.google.co.jp/search" target="viewSearch">\
<input type="hidden" name="ie" value="UTF-8" />\
<input type="hidden" name="oe" value="UTF-8" />\
<input type="hidden" name="hl" value="ja" />\
<input type="hidden" name="domains" value="iwata.co.jp" />\
<input type="hidden" name="sitesearch" value="iwata.co.jp" />\
<input type="text" name="q" size="8" maxlength="255" style="vertical-align:middle; width:120px; height:14px; font-size:12px; color:#000000; background-color:#fffff7; border:1px solid darkgray; padding:1px;" value="" /> \
<!--<input type="image" style="vertical-align:middle;" name="btnG" border="0" width="40" height="18" src="$$$rootdir$$$images/buttons/button-search-40x18.png" />-->\
<input type="submit" name="btnG" style="vertical-align:middle; height:18px; font-size:10px; color:#0000FF; background-color:#e6e6fa; border:1px solid darkgray; padding:1px;" title="$$$search$$$" value="$$$search$$$" />\
</form>\
';

var kIWATA_QUERY_LABEL = "Search";

// flash object
var kFLASH_TMPL = '\
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=$$$version$$$" width="$$$width$$$" height="$$$height$$$" id="$$$id$$$" align="middle">\
<param name="allowScriptAccess" value="$$$access$$$" />\
<param name="movie" value="$$$swfpath$$$" />\
<param name="FlashVars" value="$$$flashvars$$$" />\
<param name="loop" value="$$$loop$$$" />\
<param name="quality" value="high" />\
<param name="bgcolor" value="$$$bgcolor$$$" />\
<embed src="$$$swfpath$$$" FlashVars="$$$flashvars$$$" loop="$$$loop$$$" quality="high" bgcolor="$$$bgcolor$$$" width="$$$width$$$" height="$$$height$$$" name="$$$name$$$" align="middle" allowScriptAccess="$$$access$$$" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\
</object>\
';

var gIWATA_movieID = "";
var gIWATA_movie = null;

// copyright
var kIWATA_COPYRIGHT = '<span class="serif">Copyright &copy; $$$year1$$$ - $$$year2$$$ iwata Corporation. All Rights Reserved.</span>';

// shownavi
var kIWATA_SHOWNAVI_HOME = "HOME";
var kIWATA_SHOWNAVI_CAP = '[NAVI] ';
var kIWATA_SHOWNAVI_DEBUG = kIWATA_SHOWNAVI_CAP + '<a href="#">HOME</a> &gt; <a href="#">Profile</a>';

// rootdir
kIWATA_MENU = '\
<a title="HOME" href="$$$rootdir$$$index.html">HOME</a>\
<a title="Contact Us" href="$$$rootdir$$$contact/index.html">Contact Us</a>\
';

// Variables:

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// common functions
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_cPref
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	var aPref = new iwata_cPref();
//	aPref.parse();
//	var key = aPref.key;

var gPref = new iwata_cPref();
gPref.parse();

function iwata_cPref() {
	this.title = "";
	this.meta = { };
	this.rootdir = ""; // Ex. "/pages-123/abc/xyz/doc.html" --> rootdir="../../../"
	this.path = "";
	this.nodes = new Array();
	this.comet = "";

	// parse
	this.parse = function () {

		// title
		this.title = document.title; // e3/N2

		// path
		this.path = path = window.location.pathname; // e3/N2
		this.path = this.path.replace(/\\/g,"/");
		this.nodes = iwata_parse_path(this.path);
		for (var k = 0; k < (this.nodes.length - 2); k++) { this.rootdir += "../"; }

		// meta
		this.meta = iwata_parse_meta();
	}

	// parse meta
	this.parseMeta = function () {
		// retrieve meta
	//	this.meta = iwata_parse_meta();

		// set sepcial keys
		if (this.meta.comet != undefined) {
			this.comet = this.meta.comet;
		}
	}

}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_parse_meta
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	var meta = iwata_parse_meta();  // returns { name1:value1, name2,value2, ... }
//	var track = iwata_parse_meta().track; // returns undefined if missing.
//	var track = iwata_parse_meta()["track"]; // returns undefined if missing.
//	if (meta.track != undefined) { title = meta.track; }

function iwata_parse_meta() {

	var meta = {};

	// retrieve data from meta tags
	var elems = document.getElementsByTagName("meta");
//	document.writeln("count="+elems.length+"<br>");

	for (var n = 0; n < elems.length; n++) {
		var elem = elems.item(n);
		var key = elem.getAttribute("name");
		if ((key != "") && (key != null)) {
			var value = elem.getAttribute("content");
			key = key.toLowerCase();
			meta[key] = value;
		//	document.writeln("attr=["+key+" | "+value+"]<br>");
		}
	}

	return meta;
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_parse_path
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	var path = ".../pages-20041201/prod11/prod11-1a.html"
//	var nodes = iwata_parse_path(path);
//	returns nodes = ["pages-20041201","prod11","prod11-1a.html"]

function iwata_parse_path(path) {

	if (path == undefined) {
	//	url = document.URL; // e3/N2
		path = window.location.pathname; // e3/N2
	//	href = window.location.href; // e3/N2
	}

	path = path.replace(/\\/g,"/");
//	path = path.replace("\\","/");
//	if (gShownavi_debug) {
//		document.writeln("path="+path+"<br>");
//	}

	var filename = "";
	var elems = path.split("/");
	var nodes = new Array();
	var n = elems.length;
	for (var k = 0; k < elems.length; k++) {
		var nodeStr = elems[n - k - 1];
		if (nodeStr == "") { break; }
		if (nodeStr.search(/\.(html|htm|php)$/i) != -1) {
			filename = nodeStr;
			nodes[nodes.length] = nodeStr;
			continue; }
		if (nodeStr.search(/^[e]?pages[-\d]*/) != -1) {
			nodes[nodes.length] = nodeStr;
			break; }
		nodes[nodes.length] = nodeStr;
	}
	nodes.reverse();

//	if (gDebug) {
//		document.writeln("filename="+filename+"<br>");
//		document.writeln("path=["+nodes.join(" , ")+"]<br>");
//	}

	return nodes;
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_get_option
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	option = iwata_get_option(obj,option);
//	var href = option.href;
//	var path = option.path;
//	var target = option.target;
//	var help = option.help;
//	var width = option.width;
//	var height = option.height;
//
//	<a onclick="func(this,{type:'image',width:128,height:96,help:'msg'});">

function iwata_get_option(obj,option) {
	if (option == undefined) { option = { }; }

	option.href = (option.href != undefined) ? option.href : ((obj.getAttribute("href") != undefined) ? obj.getAttribute("href"): "");

	option.path = (option.path != undefined) ? option.path : ((obj.getAttribute("path") != undefined) ? obj.getAttribute("path"): "");

	option.target = (option.target != undefined) ? option.target : ((obj.getAttribute("target") != undefined) ? obj.getAttribute("target"): "");

	option.help = (option.help != undefined) ? option.help : ((obj.getAttribute("help") != undefined) ? obj.getAttribute("help"): "");
	if (option.help == "") { option.help = obj.title; }

	option.width = (option.width != undefined) ? option.width : ((obj.getAttribute("width") != undefined) ? obj.getAttribute("width"): "0");
	option.width = parseInt(option.width);

	option.height = (option.height != undefined) ? option.height : ((obj.getAttribute("height") != undefined) ? obj.getAttribute("height"): "0");
	option.height = parseInt(option.height);

	var url = (option.path != "" ? option.path : option.href );
	if (url.search(/(\d+)x(\d+)\.(jpg|png|gif|swf|html)$/i) != -1) {
		option.width = parseInt(RegExp.$1);
		option.height = parseInt(RegExp.$2);
	}

	return option;
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_query_put
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	<script type="text/javascript">iwata_query_put();</script>

function iwata_query_put() {

	var msg = kIWATA_QUERY_FORM;
	msg = msg.replace(/\$\$\$search\$\$\$/g,kIWATA_QUERY_LABEL);

	document.write(msg);
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_menu_put
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	<script type="text/javascript">iwata_menu_put();</script>

function iwata_menu_put() {

	var rootdir = gPref.rootdir;

	var msg = kIWATA_MENU;
	msg = msg.replace(/\$\$\$rootdir\$\$\$/g,rootdir);
	document.write(msg);
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_flash_put
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	var swfpath = "movies/movie-320x240.swf";
//	var swfpath = undefined; // (default) taken from "#" followers of url path
//	var option = { }; // width and height can be taken from the filename
//	var option = { width:320, height:240 };
//	var option = { version:"6" }; // (default) "9"
//	var option = { id:"movie_320x240" }; // (default) taken from filename
//	var option = { flashvars:"var1=data1&var2=data2" }; // (default) ""
//	var option = { access:"always" }; // (default) "sameDomain"
//	var option = { loop:true }; // (default) false
//	var option = { bgcolor:"#000000" }; // (default) "white" or "#ffffff"
//	<script type="text/javascript">iwata_flash_put(swfpath [,option]);</script>

function iwata_flash_put(swfpath,option) {

	// get basename
	var basename = swfpath.replace(/\.swf$/gi,"").replace(/^.*\//,"");

	// get width and height to parse swf filename:
	// Ex. "movie-400x200-20070329.swf" will get width=400, height=200
	var width_default = 320;
	var height_default = 240;
	if (basename.search(/-(\d+)x(\d+)/i) != -1) {
		width_default = parseInt(RegExp.$1);
		height_default = parseInt(RegExp.$2);
	}

	if (option == undefined) { option = { }; }
	// make by canonical format; Ex. "movie-320x240.swf" -> "movie_320x240"
	var id = (option.id != undefined) ? option.id : basename.replace(/[%#+=-]/g,"_");
	var name = id;
	var width = (option.width != undefined) ? option.width : width_default;
	var height = (option.height != undefined) ? option.height : height_default;
	var version = (option.version != undefined) ? option.version : "9";
	var flashvars = (option.flashvars != undefined) ? option.flashvars : "";
	var access = (option.access != undefined) ? option.access : "sameDomain";
	var loop = (option.loop != undefined) ? option.loop : "false";
	var bgcolor = (option.bgcolor != undefined) ? option.bgcolor : "#ffffff";

	if (version.search(/^\d+$/) != -1) { version += ".0.0.0"; } // "9.0.0.0"

	var msg = kFLASH_TMPL;
	msg = msg.replace(/\$\$\$id\$\$\$/g,id);
	msg = msg.replace(/\$\$\$name\$\$\$/g,name);
	msg = msg.replace(/\$\$\$version\$\$\$/g,version);
	msg = msg.replace(/\$\$\$swfpath\$\$\$/g,swfpath);
	msg = msg.replace(/\$\$\$width\$\$\$/g,width);
	msg = msg.replace(/\$\$\$height\$\$\$/g,height);
	msg = msg.replace(/\$\$\$flashvars\$\$\$/g,flashvars);
	msg = msg.replace(/\$\$\$access\$\$\$/g,access);
	msg = msg.replace(/\$\$\$loop\$\$\$/g,loop);
	msg = msg.replace(/\$\$\$bgcolor\$\$\$/g,bgcolor);

	gIWATA_movieID = id;

	document.write(msg);
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_get_movie
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	var movieID = "movie_320x240";
//	var movie = iwata_get_movie(movieID);

function iwata_get_movie(movieID) {

	if ((movieID == undefined) || (movieID == "")) {
		movieID = gIWATA_movieID;
	}

	// get movie
	var appName = navigator.appName.toLowerCase();
	var useragent = navigator.userAgent.toLowerCase();
	var movie = null;
	//	if (useragent.indexOf("gecko") != -1) {
	//		movie = window.parent.document.embeds[0]; // For Firefox, NS6
	//	} else {
	//		movie = window.document[movieID]; // For IE, Opera
	//	}
		var movie = null;
		if (appName.indexOf("microsoft") != -1) {
			movie = window[movieID];
		} else {
			movie = window.document[movieID];
		}

	gIWATA_movie = movie;

	return movie;
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_shownavi_put
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	<script type="text/javascript">iwata_shownavi_put();</script>

function iwata_shownavi_put(path) {
	// get path
	if (path == undefined) {
		path = window.location.pathname;
		path = path.replace(/\\/g,"/");
	}

	// generate navigation
	var title = document.title;
	var track = iwata_parse_meta().track;
	if (track != undefined) { title = track + ":" + title; }
	var msg = iwata_shownavi_generate(path,title);

	document.write(msg);
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_shownavi_generate
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	var msg = iwata_shownavi_generate(path,title);
//
//	[top]/{*.html} T1
//		(HOME)
//	[contact|info|recruit|whatsnew]{*.html} T1:T2
//		(HOME) > T2
//	[profile]{*.html} T1:T2[:T3]
//		(HOME) > T2
//		(HOME) > (T2:index.html) > T3
//	[product]{*.html} T1:T2[:T3:T4]
//		(HOME) > T2
//		(HOME) > (T2:index.html) > (T3:page_00.html)

function iwata_shownavi_generate(path,title) {

//	return kIWATA_SHOWNAVI_DEBUG;

	// split path to nodes by "/"
	var nodes = path.split("/");
	while (nodes.length > 1) {
		if (nodes.shift().search(/^pages/) != -1) { break; }
	}

	// split title to terms by ":"
	var terms = title.replace(/^\s*/,"").replace(/\s*$/,"").replace(/\s*:\s*/g,":").split(":");

	var home_label = kIWATA_SHOWNAVI_HOME;
	var home_url = "index.html";
	for (var n = 0; n < (nodes.length - 1); n++) { home_url = "../" + home_url; }

	var task = nodes[0]; if (task == undefined) { task = ""; }
	var sect = nodes[1]; if (sect == undefined) { sect = ""; }
	var filename = nodes[nodes.length - 1];

	var msg = kIWATA_SHOWNAVI_CAP; // kIWATA_SHOWNAVI_DEBUG;

	if (task.search(/^(?:top)$/i) != -1) {
	//	[top]/{*.html} T1
		msg += iwata_shownavi_element(home_label);
	} else if (task.search(/^(?:contact|info|recruit|whatsnew)$/i) != -1) {
	//	[contact|info|recruit|whatsnew]{*.html} T1:T2
		msg += iwata_shownavi_element(home_label,home_url);
		msg += iwata_shownavi_element(terms[1]);
	} else if (task.search(/^(?:corp)/i) != -1) {
		if (terms.length > 2) {
		//	[profile]{*.html} T1:T2:T3
			msg += iwata_shownavi_element(home_label,home_url);
			msg += iwata_shownavi_element(terms[1],"index.html");
			msg += iwata_shownavi_element(terms[2]);
		} else {
		//	[profile]{*.html} T1:T2
			msg += iwata_shownavi_element(home_label,home_url);
			msg += iwata_shownavi_element(terms[1]);
		}
	} else if (task.search(/^(?:prod)/i) != -1) {
		if (terms.length > 3) {
		//	[product]{*.html} T1:T2:T3:T4
		//	var url2 = filename.replace(/[_-]\d+(\.html)/,"\$1");
			var url1 = "../prod10/index.html";
			var url2 = "index.html";
			msg += iwata_shownavi_element(home_label,home_url);
			msg += iwata_shownavi_element(terms[1],url1);
			msg += iwata_shownavi_element(terms[2],url2);
			msg += iwata_shownavi_element(terms[3]);
		} else if (terms.length > 2) {
			var url1 = "../prod20/index.html";
			if (task.search(/^(?:prod3)/i) != -1) { url1 = "../prod30/index.html"; }
			var url2 = "index.html";
			msg += iwata_shownavi_element(home_label,home_url);
			msg += iwata_shownavi_element(terms[1],url1);
			msg += iwata_shownavi_element(terms[2]);
		} else if (terms.length > 1) {
			msg += iwata_shownavi_element(home_label,home_url);
			msg += iwata_shownavi_element(terms[1]);
		}
	} else {
		if (terms.length > 3) {
		//	[product]{*.html} T1:T2:T3:T4
		//	var url2 = filename.replace(/[_-]\d+(\.html)/,"\$1");
			var url1 = "../index.html";
			var url2 = "index.html";
			msg += iwata_shownavi_element(home_label,home_url);
			msg += iwata_shownavi_element(terms[1],url1);
			msg += iwata_shownavi_element(terms[2],url2);
			msg += iwata_shownavi_element(terms[3]);
		} else if (terms.length > 2) {
			msg += iwata_shownavi_element(home_label,home_url);
			msg += iwata_shownavi_element(terms[1],"index.html");
			msg += iwata_shownavi_element(terms[2]);
		} else if (terms.length > 1) {
			msg += iwata_shownavi_element(home_label,home_url);
			msg += iwata_shownavi_element(terms[1]);
		}
	}

	return msg;
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_shownavi_element
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:

function iwata_shownavi_element(label,url,sep) {
	if (sep == undefined) { sep = ' &gt; '; }
	if (url == undefined) { url = ""; sep = ""; }

	var msg = label;
	if (url != "") {
		msg = '<a href="'+url+'" title="'+label+'">'+msg+'</a>';
	}
	if (sep != "") { msg += sep; }

	return msg;
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_openTopics
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	<a href="url" onclick="iwata_openTopics(this); return false;">[CLICK]</a>

function iwata_openTopics(obj,option) {
	option = iwata_get_option(obj,option);

	var screenw = window.screen.width;
	var screenh = window.screen.height;
	if (screenh > 640) { screenh -= 200; }

	var href = option.href;
	var target = (option.target != "") ? option.target : "viewTopics";
	var width = (option.width != 0) ? option.width : 544;
	var height = (option.height != 0) ? option.height : screenh;

	openNewHTMLWindowScroll(href,target,width,height);
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_copyright_put
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	<script type="text/javascript">iwata_copyright_put();</script>

function iwata_copyright_put() {

	var year1 = 1996;
	var year2 = (new Date()).getYear();
	if (year2 < 2000) { year2 += 1900; }

	var msg = kIWATA_COPYRIGHT;
	msg = msg.replace(/\$\$\$year1\$\$\$/g,year1).replace(/\$\$\$year2\$\$\$/g,year2);
	document.write(msg);
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_timestamp_put
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	<script type="text/javascript">iwata_timestamp_put();</script>

function iwata_timestamp_put() {
	var modDate = new Date(document.lastModified);
	var y = modDate.getYear(); if (y < 1900) { y += 1900; }
	var m = 1 + modDate.getMonth();
	var d = modDate.getDate();
	var th = modDate.getHours();
	var tm = modDate.getMinutes();
	var ts = modDate.getSeconds();

	var sm = "00" + m; sm = sm.substr(sm.length-2);
	var sd = "00" + d; sd = sd.substr(sd.length-2);
	var sth = "00" + th; sth = sth.substr(sth.length-2);
	var stm = "00" + tm; stm = stm.substr(stm.length-2);
	var sts = "00" + ts; sts = sts.substr(sts.length-2);

//	var ymd = y + "/" + m + "/" + d;
//	var ymd = y + "." + sm + "." + sd;
	var ymd = y + "-" + sm + "-" + sd;
	var hms = sth + ":" + stm ;
//	var datestr = ymd + " " + hms
	document.write(ymd);
}

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// iwata_init
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Usage:
//	<body onload="iwata_init();">
//	window.onload = iwata_init;

function iwata_init() {

	return;

	var path = window.location.pathname.replace(/\\/g,"/");

	// set window name for index.html
	if (path.search(/20[0-9]{2}-[0-9]{2}.*?\/index\.html$/) != -1) {
		window.name = "home";
	} else if (path.search(/20[0-9]{2}-[0-9]{2}.*?\/print-.+?\.html/) != -1) {
		window.name = "print";
	} else if (path.search(/notes\/.+?\.html/) != -1) {
		if (window.name == "") { window.name = "note"; }
	} else if (path.search(/topics\/news-.+?\.html/) != -1) {
		if (window.name == "") { window.name = "news"; }
	} else {
		window.name = "home";
	}
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// main functions:
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

window.onload = iwata_init;

// end of javascript

