var browsers = {"IE":{version:{max:999, min:6.0},os:["Win7","WinVista","WinXP","Win2000"],newVersion:7020005},"Firefox":{version:{max:999, min:3.0},os:["Mac","MacOSX","Win7","WinVista","WinXP","Win2000","Win98"],newVersion:7030000}};var ytb={};ytb.env={globals:{browser:null,browser_version:0,os:null,ie_ver_max:null,ie_ver_min:null,ie_os:[],ie_newest_ver:null,ff_ver_max:null,ff_ver_min:null,ff_os:[],ff_newest_ver:null,tb_version:null},checkEnvForYTB:function(){if(this.checkEnvForYTBIE()){return"IE"}else{if(this.checkEnvForYTBFF()){return"Firefox"}else{return false}}},checkEnvForYTBIE:function(){if(("IE"==this.globals.browser)&&(this.globals.ie_ver_min<=this.globals.browser_version)&&(this.globals.ie_ver_max>=this.globals.browser_version)&&this.checkOS(this.globals.ie_os)){return true}else{return false}},checkEnvForYTBFF:function(){if(("Firefox"==this.globals.browser)&&(this.globals.ff_ver_min<=this.globals.browser_version)&&(this.globals.ff_ver_max>=this.globals.browser_version)&&this.checkOS(this.globals.ff_os)){return true}else{return false}},isInstalledYTB:function(){if(-1==navigator.userAgent.indexOf("YTB")){return false}else{return true}},isInstalledYTBIE:function(){if("IE"==this.globals.browser&&this.isInstalledYTB()){return true}else{return false}},isInstalledYTBFF:function(){if("Firefox"==this.globals.browser&&this.isInstalledYTB()){return true}else{return false}},isNewestVersionIE:function(){if(null==this.globals.tb_version||null==this.globals.ie_newest_ver){return false}if("IE"==this.globals.browser){if(this.globals.tb_version<this.globals.ie_newest_ver){return false}else{return true}}},isNewestVersionFF:function(){if(null==this.globals.tb_version||null==this.globals.ff_newest_ver){return false}if("Firefox"==this.globals.browser){if(this.globals.tb_version<this.globals.ff_newest_ver){return false}else{return true}}},checkOS:function(a){for(i in a){if(a[i]==this.globals.os){return true}}return false},setUA:function(){if(-1!=navigator.userAgent.indexOf("MSIE")){this.globals.browser="IE";if(navigator.userAgent.indexOf("MSIE 6",0)!=-1){this.globals.browser_version=6}else{if(navigator.userAgent.indexOf("MSIE 7",0)!=-1){this.globals.browser_version=7}else{if(navigator.userAgent.indexOf("MSIE 8",0)!=-1){this.globals.browser_version=8}else{if(navigator.userAgent.indexOf("MSIE 9",0)!=-1){this.globals.browser_version=9}}}}}else{if(-1!=navigator.userAgent.indexOf("Firefox")){this.globals.browser="Firefox";if(navigator.userAgent.indexOf("Firefox/2",0)!=-1){this.globals.browser_version=2}else{if(navigator.userAgent.indexOf("Firefox/3",0)){this.globals.browser_version=3}}}}if(navigator.userAgent.indexOf("NT 5.0")!=-1){this.globals.os="Win2000"}else{if(navigator.userAgent.indexOf("NT 5.1")!=-1){this.globals.os="WinXP"}else{if(navigator.userAgent.indexOf("NT 6.0")!=-1){this.globals.os="WinVista"}else{if(navigator.userAgent.indexOf("Windows 98")!=-1){this.globals.os="Win98"}else{if(navigator.userAgent.indexOf("Mac")!=-1){this.globals.os="Mac"}}}}}if(this.isInstalledYTB()){this.globals.tb_version=navigator.userAgent.substring(navigator.userAgent.indexOf("YTB")+3,navigator.userAgent.indexOf("YTB")+6);this.globals.tb_version=eval(this.globals.tb_version.substr(0,1)+"0"+this.globals.tb_version.substr(1,2)+"000")}return true},setAllowedUA:function(){this.globals.ie_ver_max=browsers.IE.version.max;this.globals.ie_ver_min=browsers.IE.version.min;this.globals.ie_os=browsers.IE.os;this.globals.ie_newest_ver=eval(browsers.IE.newVersion.toString().substr(0,6));this.globals.ff_ver_max=browsers.Firefox.version.max;this.globals.ff_ver_min=browsers.Firefox.version.min;this.globals.ff_os=browsers.Firefox.os;this.globals.ff_newest_ver=browsers.Firefox.newVersion},setListeners:function(){},init:function(){this.setUA();this.setAllowedUA();this.setListeners()}};ytb.env.init();
