

    //ブラウザの名前とバージョンを取得&代入
    var detect = navigator.userAgent.toLowerCase();

    //各変数の宣言
    var OS,browser,version,total,thestring;

    //取得した値から判別したいブラウザの名前が入っているか判別
    function checkIt(string){
    place = detect.indexOf(string) + 1;
    thestring = string;
    return place;
    }


    //OSチェック
    if (!OS){
	    if(checkIt('mac')){
			OS = "Mac";

		}else if (checkIt('win')){
			OS = "Windows";
		}
	    else{
			OS = "an unknown operating system";
	    }
	
	    //ユーザーの環境に合わせてCSS書き出し
	    //WindowsのIEを使っている人はIE用のCSS
	    if(OS=="Windows"){
			document.write(" <link href=\"common/css/win.css\" rel=\"stylesheet\" type=\"text/css\" /> ");
			document.write(" <link href=\"../common/css/win.css\" rel=\"stylesheet\" type=\"text/css\" /> ");
			document.write(" <link href=\"../../common/css/win.css\" rel=\"stylesheet\" type=\"text/css\" /> ");
			document.write(" <link href=\"../../../common/css/win.css\" rel=\"stylesheet\" type=\"text/css\" /> ");
			document.write(" <link href=\"../../../../common/css/win.css\" rel=\"stylesheet\" type=\"text/css\" /> ");
	    }
	    //それ以外は普通のCSS
	    else{
			document.write(" <link href=\"common/css/mac.css\" rel=\"stylesheet\" type=\"text/css\" /> ");
			document.write(" <link href=\"../common/css/mac.css\" rel=\"stylesheet\" type=\"text/css\" /> ");
			document.write(" <link href=\"../../common/css/mac.css\" rel=\"stylesheet\" type=\"text/css\" /> ");
			document.write(" <link href=\"../../../common/css/mac.css\" rel=\"stylesheet\" type=\"text/css\" /> ");
			document.write(" <link href=\"../../../../common/css/mac.css\" rel=\"stylesheet\" type=\"text/css\" /> ");
		}

	}