//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 += '';
}
else
{
str += '';
}
document.write(str);
}
function ac_fl_runcontent(){
var ret =
ac_getargs
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
, "application/x-shockwave-flash"
);
ac_generateobj(ret.objattrs, ret.params, ret.embedattrs);
}
function ac_sw_runcontent(){
var ret =
ac_getargs
( arguments, ".dcr", "src", "clsid:166b1bca-3f9c-11cf-8075-444553540000"
, null
);
ac_generateobj(ret.objattrs, ret.params, ret.embedattrs);
}
function ac_getargs(args, ext, srcparamname, classid, mimetype){
var ret = new object();
ret.embedattrs = new object();
ret.params = new object();
ret.objattrs = new object();
for (var i=0; i < args.length; i=i+2){
var currarg = args[i].tolowercase();
switch (currarg){
case "classid":
break;
case "pluginspage":
ret.embedattrs[args[i]] = args[i+1];
break;
case "src":
case "movie":
args[i+1] = ac_addextension(args[i+1], ext);
ret.embedattrs["src"] = args[i+1];
ret.params[srcparamname] = args[i+1];
break;
case "onafterupdate":
case "onbeforeupdate":
case "onblur":
case "oncellchange":
case "onclick":
case "ondblclick":
case "ondrag":
case "ondragend":
case "ondragenter":
case "ondragleave":
case "ondragover":
case "ondrop":
case "onfinish":
case "onfocus":
case "onhelp":
case "onmousedown":
case "onmouseup":
case "onmouseover":
case "onmousemove":
case "onmouseout":
case "onkeypress":
case "onkeydown":
case "onkeyup":
case "onload":
case "onlosecapture":
case "onpropertychange":
case "onreadystatechange":
case "onrowsdelete":
case "onrowenter":
case "onrowexit":
case "onrowsinserted":
case "onstart":
case "onscroll":
case "onbeforeeditfocus":
case "onactivate":
case "onbeforedeactivate":
case "ondeactivate":
case "type":
case "codebase":
case "id":
ret.objattrs[args[i]] = args[i+1];
break;
case "width":
case "height":
case "align":
case "vspace":
case "hspace":
case "class":
case "title":
case "accesskey":
case "name":
case "tabindex":
ret.embedattrs[args[i]] = ret.objattrs[args[i]] = args[i+1];
break;
default:
ret.embedattrs[args[i]] = ret.params[args[i]] = args[i+1];
}
}
ret.objattrs["classid"] = classid;
if (mimetype) ret.embedattrs["type"] = mimetype;
return ret;
}
//控制默认图片
function imgonerror(img)
{
img.src="/skin/default/images/nopic.jpg";
img.onerror=null;//控制不要一直跳动
}
//页面js容错处理
function killerrors() {
return true;
}
window.onerror = killerrors;