/*==============================================================================
 *
 * PACKAGE NAME  :#NA
 * FILE NAME     :judgeOS.js
 * REVISION      :1.0
 * SUMMARY       :OS定義Javascript
 * DESCRIPTION   :クライアントのOSを判定し、サイト製作ポリシーに叶う定義をします。
 *               :定義はcssSwitcherでCSSファイルの割り振りに使用されます。
 * AUTHOR:       :FJ
 * CREATED       :2010/04/01
 * UPDATED       :
 * REMARK        :
 *
 * Copyright(c) ChaseSystems Co.,Ltd.
 =============================================================================*/
/** 
 * 変数
 */
// OS定義用変数宣言
var os;

// navigatorオブジェクトのuserAgentプロパティの全文字列を小文字化
// ※コーディングの記述ミスを低減する為の準備処理
var agt = navigator.userAgent.toLowerCase();

// OS情報取得
this.win      = ((agt.indexOf("win") != -1) || (agt.indexOf("16bit") != -1));
this.mac      = ((agt.indexOf("mac") != -1) && (agt.indexOf("iphone") == -1));
this.iphone   = ((agt.indexOf("mac") != -1) && (agt.indexOf("iphone") != -1));
this.os2      = ((agt.indexOf("os/2") != -1) ||
                 (navigator.appVersion.indexOf("OS/2") != -1) ||   
                 (agt.indexOf("ibm-webexplorer") != -1));
this.sun      = (agt.indexOf("sunos") != -1);
this.irix     = (agt.indexOf("irix") != -1);
this.hpux     = (agt.indexOf("hp-ux") != -1);
this.aix      = (agt.indexOf("aix") != -1);
this.linux    = (agt.indexOf("inux") != -1);
this.sco      = (agt.indexOf("sco") != -1) || (agt.indexOf("unix_sv") != -1);
this.unixware = (agt.indexOf("unix_system_v") != -1);
this.mpras    = (agt.indexOf("ncr") != -1);
this.reliant  = (agt.indexOf("reliantunix") != -1);
this.dec      = ((agt.indexOf("dec") != -1) || (agt.indexOf("osf1") != -1) || 
                 (agt.indexOf("dec_alpha") != -1) ||
                 (agt.indexOf("alphaserver") != -1) || 
                 (agt.indexOf("ultrix") != -1) || (agt.indexOf("alphastation") != -1));
this.sinix    = (agt.indexOf("sinix") != -1);
this.freebsd  = (agt.indexOf("freebsd") != -1);
this.bsd      = (agt.indexOf("bsd") != -1);
this.unix     = ((agt.indexOf("x11") != -1) || this.sun || this.irix || this.hpux || 
                  this.sco || this.unixware || this.mpras || this.reliant || 
                  this.dec || this.sinix || this.aix || this.linux || this.bsd || 
                  this.freebsd);
this.vms      = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));



/** 
 * OS定義
 * ※「WindowsOS」、「MacintoshOS」、「iPhone」、「その他のOS」のカテゴリで定義します。
 */
// WINDOWS
if(this.win){
    os = "WIN";
}
// MACINTOSH
else if(this.mac){
    os = "MAC";
}
// iPhone
else if(this.iphone){
    os = "iPhone";
}

/* 以下の OS はコメントアウトとします。
 * 必要に応じて使用して下さい。
 */
/* コメントアウト start
// OS/2
else if(this.os2){
    os = "OS2";
}

// SUN
else if(this.sun){
    os = "SUN";
}

// IRIX
else if(this.irix){
    os = "IRIX";
}

// HP-UX
else if(this.hpux){
    os = "HP-UX";
}

// AIX
else if(this.aix){
    os = "AIX";
}

// LINUX
else if(this.linux){
    os = "LINUX";
}

// SCO
else if(this.sco){
    os = "SCO";
}

// UNIXWARE
else if(this.unixware){
    os = "UNIXWARE";
}

// MPRAS
else if(this.mpras){
    os = "MPRAS";
}

// RELIANT
else if(this.reliant){
    os = "RELIANT";
}

// DEC
else if(this.dec){
    os = "DEC";
}

// SINIX
else if(this.sinix){
    os = "SINIX";
}

// FREEBSD
else if(this.freebsd){
    os = "FREEBSD";
}

// BSD
else if(this.bsd) != -1){
    os = "BSD";
}

// UNIX
else if(this.unix){
    os = "UNIX";
}

// VMS
else if(this.vms){
    os = "VMS";
}
コメントアウト end */

// etc
else{
    os = "ETC";
}

