﻿/***************************************************************
 *
 * [embedcss.js] CSS embed HTML code generator for Static HTML.
 * 	initial at 2006.12.11 by Hiroyuki Nakatsuka		rev.1.00
 * 		branched at 2010.09.11 by Ryutaro Miyashita	rev.1.20
 * @author : miyashita@littel.co.jp
***************************************************************/
function embedCSS() {
	// Get UserAgent
	var nua = navigator.userAgent;
	// Get Filename
	var path = location.pathname;
	var file = path.substring(path.lastIndexOf('/', path.length) + 1, path.length);
	var name = file.substring(0, file.lastIndexOf('.'));
	// for IE8, Firefox 3+, Safari 4+, Chrome 5+, Opera 10.6+ (Modern)
	document.writeln('<link rel="stylesheet" href="./css/reset.css" type="text/css" media="screen" />');
	document.writeln('<link rel="stylesheet" href="./css/common.css" type="text/css" media="screen" />');
	// Filename to accord css
	document.write('<!-- ' + file + ' -->')
	if(name == 'index' || name == '') {
		document.writeln('<link rel="stylesheet" href="./css/index.css" type="text/css" media="screen" />');
	} else {
		document.writeln('<link rel="stylesheet" href="./css/' + name + '.css" type="text/css" media="screen" />');
	}
	// Colorbox CSS
	if(name == 'paper') {
		document.writeln('<link rel="stylesheet" href="./js/colorbox/style.css" type="text/css" media="screen" />');
	}
	// Classic browser (Internet Explorer 6, Internet Explorer 7)
	if(nua.indexOf('MSIE 7') > -1 || nua.indexOf('MSIE 6') > -1) {
		document.writeln('<link rel="stylesheet" href="./css/iefix.css" type="text/css" />');
	} else {
		// Do not nothing.
	}
	// Windows PC Font Override (using "Meiryo" series)
	if(nua.indexOf('Windows') > -1) {
		document.writeln('<style type="text/css"> body { font-family: "Segoe UI","Tahoma","メイリオ","Meiryo",sans-serif; } </style>');
	} else {
		// Do not nothing.
	}
}

