/**
 * @author j.ao
 * 外部CSS、JSを切り替えます。
 * insertBeforeとかappendChildもやったけど document.writeの方が早い気がする、読み込めば何でもよい。
 */
(function(){
//変数定義
	var conf, ie, index;
//ブラウザ判定 グローバル
	ie = (function(){
			var undef, ver=3, div=document.createElement('div');
			while ( div.innerHTML = '<!--[if gt IE ' + (++ver) + ']><i></i><![endif]-->', div.getElementsByTagName('i')[0] );
			return (ver > 4)? ver : undef;
		}());
//読み込みファイル設定
	conf = {
		'css': {
				'index' : '/css/contents-index.css',
				'other' : '/css/contents.css'
			},
		'js' : {
				'ie9' : '/js/IE9.min.js',
				'jquery' : '/js/jquery-1.5.1.min.js'
			}
		};
//ファイル別別設定
	if (location.pathname.match(/^\/$|^\/index/g)) conf.css.other = null;
	else conf.css.index = undefined;
//ブラウザ別設定
	if (ie === undefined) conf.js.ie9 = conf.js.pie = undefined;
//CSS書き出し
//	for (index in conf.css) if (conf.css[index] != undefined) document.write('<link rel="stylesheet" href="' + conf.css[index] + '"/>');
//JavaScript書き出し
	for (index in conf.js) if (conf.js[index] != undefined) document.write('<script src="' + conf.js[index] + '"></script>');
})();

