//OSの種類判定
function getOSType(){
var uAgent = navigator.userAgent.toUpperCase();
if (uAgent.indexOf("MAC") >= 0) return "MacOS";
if (uAgent.indexOf("WIN") >= 0) return "Windows";
return "";
}

//ブラウザ名判定
function getBrowserName(){
var aName = navigator.appName.toUpperCase();
var uName = navigator.userAgent.toUpperCase();
if (uName.indexOf("SAFARI") >= 0) return "Safari";
if (uName.indexOf("OPERA") >= 0) return "Opera";
if (uName.indexOf("FIREFOX") >= 0) return "Firefox";
if (aName.indexOf("NETSCAPE") >= 0) return "Netscape";
if (aName.indexOf("MICROSOFT") >= 0) return "Explorer";
return "";
}


os = getOSType();
browser = getBrowserName();

if (os == "MacOS") dirName = "mac";
if (os == "Windows") dirName = "win";

//適用したいCSS

mac="common/css/mac.css";


//スタイルシート振り分け
switch(dirName){
case "mac":
dirName=mac;
break;
}

//stylesheet追加

link = document.createElement("link");
link.setAttribute("rel","stylesheet");
link.setAttribute("href",dirName);
link.setAttribute("type","text/css");

head = document.getElementsByTagName('head').item(0);
head.appendChild(link);