//v1.7 // flash player version detection // detect client browser type // copyright 2005-2007 adobe systems incorporated. all rights reserved. var isie = (navigator.appversion.indexof("msie") != -1) ? true : false; var iswin = (navigator.appversion.tolowercase().indexof("win") != -1) ? true : false; var isopera = (navigator.useragent.indexof("opera") != -1) ? true : false; function controlversion() { var version; var axo; var e; // note : new activexobject(strfoo) throws an exception if strfoo isn't in the registry try { // version will be set for 7.x or greater players axo = new activexobject("shockwaveflash.shockwaveflash.7"); version = axo.getvariable("$version"); } catch (e) { } if (!version) { try { // version will be set for 6.x players only axo = new activexobject("shockwaveflash.shockwaveflash.6"); // installed player is some revision of 6.0 // getvariable("$version") crashes for versions 6.0.22 through 6.0.29, // so we have to be careful. // default to the first public version version = "win 6,0,21,0"; // throws if allowscripaccess does not exist (introduced in 6.0r47) axo.allowscriptaccess = "always"; // safe to call for 6.0r47 or greater version = axo.getvariable("$version"); } catch (e) { } } if (!version) { try { // version will be set for 4.x or 5.x player axo = new activexobject("shockwaveflash.shockwaveflash.3"); version = axo.getvariable("$version"); } catch (e) { } } if (!version) { try { // version will be set for 3.x player axo = new activexobject("shockwaveflash.shockwaveflash.3"); version = "win 3,0,18,0"; } catch (e) { } } if (!version) { try { // version will be set for 2.x player axo = new activexobject("shockwaveflash.shockwaveflash"); version = "win 2,0,0,11"; } catch (e) { version = -1; } } return version; } // javascript helper required to detect flash player plugin version information function getswfver(){ // ns/opera version >= 3 check for flash plugin in plugin array var flashver = -1; if (navigator.plugins != null && navigator.plugins.length > 0) { if (navigator.plugins["shockwave flash 2.0"] || navigator.plugins["shockwave flash"]) { var swver2 = navigator.plugins["shockwave flash 2.0"] ? " 2.0" : ""; var flashdescription = navigator.plugins["shockwave flash" + swver2].description; var descarray = flashdescription.split(" "); var temparraymajor = descarray[2].split("."); var versionmajor = temparraymajor[0]; var versionminor = temparraymajor[1]; var versionrevision = descarray[3]; if (versionrevision == "") { versionrevision = descarray[4]; } if (versionrevision[0] == "d") { versionrevision = versionrevision.substring(1); } else if (versionrevision[0] == "r") { versionrevision = versionrevision.substring(1); if (versionrevision.indexof("d") > 0) { versionrevision = versionrevision.substring(0, versionrevision.indexof("d")); } } var flashver = versionmajor + "." + versionminor + "." + versionrevision; } } // msn/webtv 2.6 supports flash 4 else if (navigator.useragent.tolowercase().indexof("webtv/2.6") != -1) flashver = 4; // webtv 2.5 supports flash 3 else if (navigator.useragent.tolowercase().indexof("webtv/2.5") != -1) flashver = 3; // older webtv supports flash 2 else if (navigator.useragent.tolowercase().indexof("webtv") != -1) flashver = 2; else if ( isie && iswin && !isopera ) { flashver = controlversion(); } return flashver; } // when called with reqmajorver, reqminorver, reqrevision returns true if that version or greater is available function detectflashver(reqmajorver, reqminorver, reqrevision) { versionstr = getswfver(); if (versionstr == -1 ) { return false; } else if (versionstr != 0) { if(isie && iswin && !isopera) { // given "win 2,0,0,11" temparray = versionstr.split(" "); // ["win", "2,0,0,11"] tempstring = temparray[1]; // "2,0,0,11" versionarray = tempstring.split(","); // ['2', '0', '0', '11'] } else { versionarray = versionstr.split("."); } var versionmajor = versionarray[0]; var versionminor = versionarray[1]; var versionrevision = versionarray[2]; // is the major.revision >= requested major.revision and the minor version >= requested minor if (versionmajor > parsefloat(reqmajorver)) { return true; } else if (versionmajor == parsefloat(reqmajorver)) { if (versionminor > parsefloat(reqminorver)) return true; else if (versionminor == parsefloat(reqminorver)) { if (versionrevision >= parsefloat(reqrevision)) return true; } } return false; } } function ac_addextension(src, ext) { if (src.indexof('?') != -1) return src.replace(/\?/, ext+'?'); else return src + ext; } function ac_generateobj(objattrs, params, embedattrs) { var str = ''; if (isie && iswin && !isopera) { str += ' '; } str += ''; } else { str += ' //控制默认图片 function imgonerror(img) { img.src="/skin/default/images/nopic.jpg"; img.onerror=null;//控制不要一直跳动 } //页面js容错处理 function killerrors() { return true; } window.onerror = killerrors;