filesbox/web/dist/design/designstatic/home/js/video/swfobject.js
2024-07-26 14:10:54 +08:00

4 lines
9.2 KiB
JavaScript

/*! SWFObject v2.2 <//code.google.com/p/swfobject/>
is released under the MIT License <//www.opensource.org/licenses/mit-license.php>
*/var swfobject=function(){var u="undefined",m="object",J="Shockwave Flash",ne="ShockwaveFlash.ShockwaveFlash",B="application/x-shockwave-flash",U="SWFObjectExprInst",z="onreadystatechange",y=window,s=document,w=navigator,K=!1,F=[ie],A=[],x=[],N=[],S,k,D,Y,E=!1,V=!1,g,P,Z=!0,a=function(){var e=typeof s.getElementById!=u&&typeof s.getElementsByTagName!=u&&typeof s.createElement!=u,t=w.userAgent.toLowerCase(),n=w.platform.toLowerCase(),i=n?/win/.test(n):/win/.test(t),r=n?/mac/.test(n):/mac/.test(t),l=/webkit/.test(t)?parseFloat(t.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,o=!+"\v1",d=[0,0,0],f=null;if(typeof w.plugins!=u&&typeof w.plugins[J]==m)f=w.plugins[J].description,f&&!(typeof w.mimeTypes!=u&&w.mimeTypes[B]&&!w.mimeTypes[B].enabledPlugin)&&(K=!0,o=!1,f=f.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),d[0]=parseInt(f.replace(/^(.*)\..*$/,"$1"),10),d[1]=parseInt(f.replace(/^.*\.(.*)\s.*$/,"$1"),10),d[2]=/[a-zA-Z]/.test(f)?parseInt(f.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof y.ActiveXObject!=u)try{var p=new ActiveXObject(ne);p&&(f=p.GetVariable("$version"),f&&(o=!0,f=f.split(" ")[1].split(","),d=[parseInt(f[0],10),parseInt(f[1],10),parseInt(f[2],10)]))}catch(c){}return{w3:e,pv:d,wk:l,ie:o,win:i,mac:r}}(),ue=function(){!a.w3||((typeof s.readyState!=u&&s.readyState=="complete"||typeof s.readyState==u&&(s.getElementsByTagName("body")[0]||s.body))&&T(),E||(typeof s.addEventListener!=u&&s.addEventListener("DOMContentLoaded",T,!1),a.ie&&a.win&&(s.attachEvent(z,function(){s.readyState=="complete"&&(s.detachEvent(z,arguments.callee),T())}),y==top&&function(){if(!E){try{s.documentElement.doScroll("left")}catch(e){setTimeout(arguments.callee,0);return}T()}}()),a.wk&&function(){if(!E){if(!/loaded|complete/.test(s.readyState)){setTimeout(arguments.callee,0);return}T()}}(),Q(T)))}();function T(){if(!E){try{var e=s.getElementsByTagName("body")[0].appendChild(C("span"));e.parentNode.removeChild(e)}catch(i){return}E=!0;for(var t=F.length,n=0;n<t;n++)F[n]()}}function q(e){E?e():F[F.length]=e}function Q(e){if(typeof y.addEventListener!=u)y.addEventListener("load",e,!1);else if(typeof s.addEventListener!=u)s.addEventListener("load",e,!1);else if(typeof y.attachEvent!=u)oe(y,"onload",e);else if(typeof y.onload=="function"){var t=y.onload;y.onload=function(){t(),e()}}else y.onload=e}function ie(){K?ae():H()}function ae(){var e=s.getElementsByTagName("body")[0],t=C(m);t.setAttribute("type",B),t.setAttribute("style","display:none");var n=e.appendChild(t);if(n){var i=0;(function(){if(typeof n.GetVariable!=u){var r=n.GetVariable("$version");r&&(r=r.split(" ")[1].split(","),a.pv=[parseInt(r[0],10),parseInt(r[1],10),parseInt(r[2],10)])}else if(i<10){i++,setTimeout(arguments.callee,10);return}e.removeChild(t),n=null,H()})()}else H()}function H(){var e=A.length;if(e>0)for(var t=0;t<e;t++){var n=A[t].id,i=A[t].callbackFn,r={success:!1,id:n};if(a.pv[0]>0){var l=h(n);if(l)if(M(A[t].swfVersion)&&!(a.wk&&a.wk<312))L(n,!0),i&&(r.success=!0,r.ref=_(n),i(r));else if(A[t].expressInstall&&R()){var o={};o.data=A[t].expressInstall,o.width=l.getAttribute("width")||"0",o.height=l.getAttribute("height")||"0",l.getAttribute("class")&&(o.styleclass=l.getAttribute("class")),l.getAttribute("align")&&(o.align=l.getAttribute("align"));for(var d={},f=l.getElementsByTagName("param"),p=f.length,c=0;c<p;c++)f[c].getAttribute("name").toLowerCase()!="movie"&&(d[f[c].getAttribute("name")]=f[c].getAttribute("value"));W(o,d,n,i)}else re(l),i&&i(r)}else if(L(n,!0),i){var v=_(n);v&&typeof v.SetVariable!=u&&(r.success=!0,r.ref=v),i(r)}}}function _(e){var t=null,n=h(e);if(n&&n.nodeName=="OBJECT")if(typeof n.SetVariable!=u)t=n;else{var i=n.getElementsByTagName(m)[0];i&&(t=i)}return t}function R(){return!V&&M("6.0.65")&&(a.win||a.mac)&&!(a.wk&&a.wk<312)}function W(e,t,n,i){V=!0,D=i||null,Y={success:!1,id:n};var r=h(n);if(r){r.nodeName=="OBJECT"?(S=X(r),k=null):(S=r,k=n),e.id=U,(typeof e.width==u||!/%$/.test(e.width)&&parseInt(e.width,10)<310)&&(e.width="310"),(typeof e.height==u||!/%$/.test(e.height)&&parseInt(e.height,10)<137)&&(e.height="137"),s.title=s.title.slice(0,47)+" - Flash Player Installation";var l=a.ie&&a.win?"ActiveX":"PlugIn",o="MMredirectURL="+encodeURI(window.location).toString().replace(/&/g,"%26")+"&MMplayerType="+l+"&MMdoctitle="+s.title;if(typeof t.flashvars!=u?t.flashvars+="&"+o:t.flashvars=o,a.ie&&a.win&&r.readyState!=4){var d=C("div");n+="SWFObjectNew",d.setAttribute("id",n),r.parentNode.insertBefore(d,r),r.style.display="none",function(){r.readyState==4?r.parentNode.removeChild(r):setTimeout(arguments.callee,10)}()}G(e,t,n)}}function re(e){if(a.ie&&a.win&&e.readyState!=4){var t=C("div");e.parentNode.insertBefore(t,e),t.parentNode.replaceChild(X(e),t),e.style.display="none",function(){e.readyState==4?e.parentNode.removeChild(e):setTimeout(arguments.callee,10)}()}else e.parentNode.replaceChild(X(e),e)}function X(e){var t=C("div");if(a.win&&a.ie)t.innerHTML=e.innerHTML;else{var n=e.getElementsByTagName(m)[0];if(n){var i=n.childNodes;if(i)for(var r=i.length,l=0;l<r;l++)!(i[l].nodeType==1&&i[l].nodeName=="PARAM")&&i[l].nodeType!=8&&t.appendChild(i[l].cloneNode(!0))}}return t}function G(e,t,n){var i,r=h(n);if(a.wk&&a.wk<312)return i;if(r)if(typeof e.id==u&&(e.id=n),a.ie&&a.win){var l="";for(var o in e)e[o]!=Object.prototype[o]&&(o.toLowerCase()=="data"?t.movie=e[o]:o.toLowerCase()=="styleclass"?l+=' class="'+e[o]+'"':o.toLowerCase()!="classid"&&(l+=" "+o+'="'+e[o]+'"'));var d="";for(var f in t)t[f]!=Object.prototype[f]&&(d+='<param name="'+f+'" value="'+t[f]+'" />');r.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+l+">"+d+"</object>",x[x.length]=e.id,i=h(e.id)}else{var p=C(m);p.setAttribute("type",B);for(var c in e)e[c]!=Object.prototype[c]&&(c.toLowerCase()=="styleclass"?p.setAttribute("class",e[c]):c.toLowerCase()!="classid"&&p.setAttribute(c,e[c]));for(var v in t)t[v]!=Object.prototype[v]&&v.toLowerCase()!="movie"&&se(p,v,t[v]);r.parentNode.replaceChild(p,r),i=p}return i}function se(e,t,n){var i=C("param");i.setAttribute("name",t),i.setAttribute("value",n),e.appendChild(i)}function b(e){var t=h(e);t&&t.nodeName=="OBJECT"&&(a.ie&&a.win?(t.style.display="none",function(){t.readyState==4?le(e):setTimeout(arguments.callee,10)}()):t.parentNode.removeChild(t))}function le(e){var t=h(e);if(t){for(var n in t)typeof t[n]=="function"&&(t[n]=null);t.parentNode.removeChild(t)}}function h(e){var t=null;try{t=s.getElementById(e)}catch(n){}return t}function C(e){return s.createElement(e)}function oe(e,t,n){e.attachEvent(t,n),N[N.length]=[e,t,n]}function M(e){var t=a.pv,n=e.split(".");return n[0]=parseInt(n[0],10),n[1]=parseInt(n[1],10)||0,n[2]=parseInt(n[2],10)||0,t[0]>n[0]||t[0]==n[0]&&t[1]>n[1]||t[0]==n[0]&&t[1]==n[1]&&t[2]>=n[2]}function O(e,t,n,i){if(!(a.ie&&a.mac)){var r=s.getElementsByTagName("head")[0];if(!!r){var l=n&&typeof n=="string"?n:"screen";if(i&&(g=null,P=null),!g||P!=l){var o=C("style");o.setAttribute("type","text/css"),o.setAttribute("media",l),g=r.appendChild(o),a.ie&&a.win&&typeof s.styleSheets!=u&&s.styleSheets.length>0&&(g=s.styleSheets[s.styleSheets.length-1]),P=l}a.ie&&a.win?g&&typeof g.addRule==m&&g.addRule(e,t):g&&typeof s.createTextNode!=u&&g.appendChild(s.createTextNode(e+" {"+t+"}"))}}}function L(e,t){if(!!Z){var n=t?"visible":"hidden";E&&h(e)?h(e).style.visibility=n:O("#"+e,"visibility:"+n)}}function j(e){var t=/[\\\"<>\.;]/,n=t.exec(e)!=null;return n&&typeof encodeURIComponent!=u?encodeURIComponent(e):e}var de=function(){a.ie&&a.win&&window.attachEvent("onunload",function(){for(var e=N.length,t=0;t<e;t++)N[t][0].detachEvent(N[t][1],N[t][2]);for(var n=x.length,i=0;i<n;i++)b(x[i]);for(var r in a)a[r]=null;a=null;for(var l in swfobject)swfobject[l]=null;swfobject=null})}();return{registerObject:function(e,t,n,i){if(a.w3&&e&&t){var r={};r.id=e,r.swfVersion=t,r.expressInstall=n,r.callbackFn=i,A[A.length]=r,L(e,!1)}else i&&i({success:!1,id:e})},getObjectById:function(e){if(a.w3)return _(e)},embedSWF:function(e,t,n,i,r,l,o,d,f,p){var c={success:!1,id:t};a.w3&&!(a.wk&&a.wk<312)&&e&&t&&n&&i&&r?(L(t,!1),q(function(){n+="",i+="";var v={};if(f&&typeof f===m)for(var ee in f)v[ee]=f[ee];v.data=e,v.width=n,v.height=i;var I={};if(d&&typeof d===m)for(var te in d)I[te]=d[te];if(o&&typeof o===m)for(var $ in o)typeof I.flashvars!=u?I.flashvars+="&"+$+"="+o[$]:I.flashvars=$+"="+o[$];if(M(r)){var fe=G(v,I,t);v.id==t&&L(t,!0),c.success=!0,c.ref=fe}else if(l&&R()){v.data=l,W(v,I,t,p);return}else L(t,!0);p&&p(c)})):p&&p(c)},switchOffAutoHideShow:function(){Z=!1},ua:a,getFlashPlayerVersion:function(){return{major:a.pv[0],minor:a.pv[1],release:a.pv[2]}},hasFlashPlayerVersion:M,createSWF:function(e,t,n){if(a.w3)return G(e,t,n)},showExpressInstall:function(e,t,n,i){a.w3&&R()&&W(e,t,n,i)},removeSWF:function(e){a.w3&&b(e)},createCSS:function(e,t,n,i){a.w3&&O(e,t,n,i)},addDomLoadEvent:q,addLoadEvent:Q,getQueryParamValue:function(e){var t=s.location.search||s.location.hash;if(t){if(/\?/.test(t)&&(t=t.split("?")[1]),e==null)return j(t);for(var n=t.split("&"),i=0;i<n.length;i++)if(n[i].substring(0,n[i].indexOf("="))==e)return j(n[i].substring(n[i].indexOf("=")+1))}return""},expressInstallCallback:function(){if(V){var e=h(U);e&&S&&(e.parentNode.replaceChild(S,e),k&&(L(k,!0),a.ie&&a.win&&(S.style.display="block")),D&&D(Y)),V=!1}}}}();