//--------------------------------- // linkタグ作成処理 // in :cssのファイル名 // out:linkタグ //--------------------------------- function createLinkTag(cssfile){ // cssファイルが格納してあるディレクトリ // !!!!!!!!!!!!環境に合わせて設定してください!!!!!!!!! var directory = "http://www3.nature-n.com/css/"; // linkタグ作成 var tag = ""; return tag; } //--------------------------------- // OS・ブラウザ分類処理 // in:なし // out:cssファイル名 //--------------------------------- function classify() { // ********************************************* // 各組み合わせのCSSファイル名を設定してください // !!!!!!!!!!!!環境に合わせて設定してください!!!!!!!!! // Windows x IE cssfile11 = "w_ie"; // Windows x NN cssfile12 = "w_nn"; // Windows x その他 cssfile13 = "w_other"; // Mac x IE cssfile21 = "m_ie"; // Mac x NN cssfile22 = "m_nn"; // Mac x その他 cssfile23 = "m_other"; // ********************************************* // 使用CSSファイル var cssfile = ""; // OS var platform = navigator.platform; // ブラウザ var browser = navigator.appName; // ユーザエージェント var agent = navigator.userAgent; // OS:Windows if (platform.indexOf("Win") != -1) { // Internet Explorer // (Operaが成りすましている可能性があるので"Opera"が入っていない場合とする) if ((agent.indexOf("MSIE") != -1) && (agent.indexOf("Opera") == -1)) { cssfile = cssfile11; } // Netscape Navigetor else if (agent.indexOf("Netscape") != -1) { cssfile = cssfile12; } // Netscape Navigetor 4以下 else if ((agent.indexOf("Mozilla/4") != -1) && (browser.indexOf("Netscape") != -1)) { cssfile = cssfile12; } // その他 else { cssfile = cssfile13; /* とりあえず今はコメント // Opera if (agent.indexOf("Opera") != -1) { } // Mozilla else if (agent.indexOf("Gecko") != -1) { } */ } } // OS:Mac他 else { // Internet Explorer // (Operaが成りすましている可能性があるので"Opera"が入っていない場合とする) if ((agent.indexOf("MSIE") != -1) && (agent.indexOf("Opera") == -1)) { cssfile = cssfile21; } // Netscape Navigetor else if (agent.indexOf("Netscape") != -1) { cssfile = cssfile22; } // Netscape Navigetor 4以下 else if ((agent.indexOf("Mozilla/4") != -1) && (browser.indexOf("Netscape") != -1)) { cssfile = cssfile22; } // その他 else { cssfile = cssfile23; /* とりあえず今はコメント // Opera if (agent.indexOf("Opera") != -1) { } // Safari else if (agent.indexOf("Safari") != -1) { } */ } } return cssfile; } //--------------------------------- // linkタグ出力処理 // in :なし // out:linkタグ //--------------------------------- function dispTag() { // cssファイル名を取得 var cssfile = classify(); // linkタグを作成し、作成後の文字列を返す return createLinkTag(cssfile); } document.write(dispTag());