
//□初期設定とパスをセット
var load_path;

//■ページの初期設定
//引数：ルート(設定ファイルの設置ディレクトリ)からの相対パス
//戻値：無し
//説明：ページの初期設定群
//備考：css読込で使用する「@import」は、Netscape 4.x及びWindows IE 4以前で無効
function init_set(path){
	//パスを設定(グローバル)
	load_path = path;
	
	//stylesheet
	set_stylefile (load_path+'css/');
}

//■css分岐
//引数：パス
//戻値：無し
//説明：ブラウザ(UserAgent)により、フォント設定用cssを分岐させる
//備考：css読込で使用する「@import」は、Netscape 4.x及びWindows IE 4以前で無効
//　　　Windows[IE6.0以降、FF1.5以降、NS7.1以降、OP8.5以降]、Mac OS 9[NS7.02以降]、Mac OS X[SF2.02以降]に対応
//　　　他OS、ブラウザの場合other.cssに分岐
function set_stylefile(filepath) {
	document.write('<style type="text/css">'+"\n");
	document.write('<!--'+"\n");
	
	//bace.css
	document.write('@import url('+filepath+'bace.css);'+"\n");
	
	if(navigator.userAgent.indexOf("Win") != -1){
		//Windows
		if(navigator.userAgent.indexOf("Firefox") != -1){
			//Firefox
			document.write('@import url('+filepath+'win_ff.css);'+"\n");
		}else if(navigator.userAgent.indexOf("Netscape") != -1){
			//Netscape
			document.write('@import url('+filepath+'win_ns.css);'+"\n");
		}else if(navigator.userAgent.indexOf("Opera") != -1){
			//Netscape
			document.write('@import url('+filepath+'win_op.css);'+"\n");
		}else if(navigator.userAgent.indexOf("MSIE") != -1){
			//Internet Explorer
			document.write('@import url('+filepath+'win_ie.css);'+"\n");
		}else{
			//Other
			document.write('@import url('+filepath+'other.css);'+"\n");//未対応
		}
	}else if(navigator.userAgent.indexOf("Mac OS X") != -1){
		//Mac OS X
		if(navigator.userAgent.indexOf("Safari") != -1){
			//Safari
			document.write('@import url('+filepath+'macx_sf.css);'+"\n");
		}else if(navigator.userAgent.indexOf("Firefox") != -1){
			//Firefox
			document.write('@import url('+filepath+'other.css);'+"\n");//未対応
		}else{
			//Other
			document.write('@import url('+filepath+'other.css);'+"\n");//未対応
		}
	}else if(navigator.userAgent.indexOf("Mac") != -1){
		//Mac OS 9
		if(navigator.userAgent.indexOf("Netscape") != -1){
			//Netscape
			document.write('@import url('+filepath+'mac9_ns.css);'+"\n");
		}else{
			//Other
			document.write('@import url('+filepath+'other.css);'+"\n");//未対応
		}
	}else{
		//Other
		document.write('@import url('+filepath+'other.css);'+"\n");//未対応
	}
	
	document.write('-->'+"\n");
	document.write('</style>'+"\n");
}

