/** * SWFAddress 2.3: Deep linking for Flash and Ajax <http://www.asual.com/swfaddress/> * * SWFAddress is (c) 2006-2009 Rostislav Hristov and contributors * This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> * */if(typeof asual=="undefined"){var asual={};}if(typeof asual.swfaddress=="undefined"){asual.swfaddress={};}if(typeof asual.util=="undefined"){asual.util={};}asual.util.Browser=new function(){var A=navigator.userAgent.toLowerCase();_version=parseFloat((A.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1]);_chrome=/chrome/.test(A);_safari=/webkit/.test(A)&&!/chrome/.test(A);_opera=/opera/.test(A);_ie=/msie/.test(A)&&!/opera/.test(A);_mozilla=/mozilla/.test(A)&&!/(compatible|webkit)/.test(A);this.toString=function(){return "[class Browser]";};this.getVersion=function(){return _version;};this.isIE=function(){return _ie;};this.isSafari=function(){return _safari;};this.isOpera=function(){return _opera;};this.isChrome=function(){return _chrome;};this.isMozilla=function(){return _mozilla;};};asual.util.Events=new function(){var C="DOMContentLoaded",G="onstop",I=window,F=document,B=[],A=asual.util,D=A.Browser;this.toString=function(){return "[class Events]";};this.addListener=function(L,J,K){B.push({o:L,t:J,l:K});if(!(J==C&&(D.isIE()||D.isSafari()))){if(L.addEventListener){L.addEventListener(J,K,false);}else{if(L.attachEvent){L.attachEvent("on"+J,K);}}}};this.removeListener=function(N,K,L){for(var J=0,M;M=B[J];J++){if(M.o==N&&M.t==K&&M.l==L){B.splice(J,1);break;}}if(!(K==C&&(D.isIE()||D.isSafari()))){if(N.removeEventListener){N.removeEventListener(K,L,false);}else{if(N.detachEvent){N.detachEvent("on"+K,L);}}}};var H=function(){for(var K=0,J;J=B[K];K++){if(J.t!=C){A.Events.removeListener(J.o,J.t,J.l);}}};var E=function(){if(F.readyState=="interactive"){function J(){F.detachEvent(G,J);H();};F.attachEvent(G,J);I.setTimeout(function(){F.detachEvent(G,J);},0);}};if(D.isIE()||D.isSafari()){(function(){try{if((D.isIE()&&F.body)||!/loaded|complete/.test(F.readyState)){F.documentElement.doScroll("left");}}catch(K){return setTimeout(arguments.callee,0);}for(var J=0,K;K=B[J];J++){if(K.t==C){K.l.call(null);}}})();}if(D.isIE()){I.attachEvent("onbeforeunload",E);}this.addListener(I,"unload",H);};asual.util.Functions=new function(){this.toString=function(){return "[class Functions]";};this.extend=function(C,A){function B(){};B.prototype=C.prototype;A.prototype=new B();A.prototype.constructor=A;A.superConstructor=C;A.superClass=C.prototype;return A;};this.bind=function(F,B,E){for(var C=2,D,A=[];D=arguments[C];C++){A.push(D);}return function(){return F.apply(B,A);};};};asual.swfaddress.WEBAddressEvent=function(D){var A=asual.swfaddress.WEBAddress;this.toString=function(){return "[object WEBAddressEvent]";};this.type=D;this.target=[A][0];this.value=A.getValue();this.path=A.getPath();this.pathNames=A.getPathNames();this.parameters={};var E=A.getParameterNames();for(var C=0,B=E.length;C<B;C++){this.parameters[E[C]]=A.getParameter(E[C]);}this.parametersNames=E;};asual.swfaddress.WEBAddressEvent.INIT="init";asual.swfaddress.WEBAddressEvent.CHANGE="change";asual.swfaddress.WEBAddress=new function(){var m=function(){var i=s.href.indexOf("#");return i!=-1?s.href.substr(i+1):"";};var F=function(){try{top.document;return top;}catch(i){return window;}};var b=function(p,i){if(Y.strict){p=i?(p.substr(0,1)!="/"?"/"+p:p):(p==""?"/":p);}return p;};var O=function(i){return (X.isIE()&&s.protocol=="file:")?n.replace(/\?/,"%3F"):i;};var AA=function(AD){for(var AB=0,p=AD.childNodes.length,AC;AB<p;AB++){if(AD.childNodes[AB].src){G=String(AD.childNodes[AB].src);}if(AC=AA(AD.childNodes[AB])){return AC;}}};var A=function(){if(y.title!=d&&y.title.indexOf("#")!=-1){y.title=d;}};var u=function(){if(!Q){var p=m();var i=!(n==p||n==N(p)||N(n)==p);if(X.isSafari()&&P<523){if(a!=v.length){a=v.length;if(typeof W[a-1]!=c){n=W[a-1];}r.call(this);}}else{if(X.isIE()&&i){if(P<7){s.reload();}else{this.setValue(p);}}else{if(i){n=p;r.call(this);}}}if(X.isIE()){A.call(this);}}};var l=function(i){this.dispatchEvent(new w.WEBAddressEvent(i));i=i.substr(0,1).toUpperCase()+i.substr(1);if(typeof this["on"+i]==E){this["on"+i]();}};var K=function(){l.call(this,"init");};var Z=function(){l.call(this,"change");};var r=function(){Z.call(this);M(H.bind(S,this),10);};var S=function(){var p=N((s.pathname+(/\/$/.test(s.pathname)?"":"/")+this.getValue()).replace(/\/\//,"/").replace(/^\/$/,""));var i=window[Y.tracker];if(typeof i==E){i(p);}else{if(typeof pageTracker!=c&&typeof pageTracker._trackPageview==E){pageTracker._trackPageview(p);}else{if(typeof urchinTracker==E){urchinTracker(p);}}}};var D=function(){var i=T.contentWindow.document;i.open();i.write("<html><head><title>"+y.title+"</title><script>var "+U+" = \""+z(m())+"\";</script></head></html>");i.close();};var L=function(){var i=T.contentWindow;var p=i.location.href;n=(typeof i[U]!=c?N(i[U]):"");if(n!=m()){r.call(w.WEBAddress);s.hash=O(n);}};var j=function(){if(!q){q=true;var i="id=\""+U+"\" style=\"position:absolute;top:-9999px;\"";if(X.isIE()&&P<8){y.body.appendChild(y.createElement("div")).innerHTML="<iframe "+i+" src=\"javascript:false;\" width=\"0\" height=\"0\"></iframe>";T=y.getElementById(U);M(function(){g.addListener(T,"load",L);if(typeof T.contentWindow[U]==c){D();}},50);}else{if(X.isSafari()){if(P<418){y.body.innerHTML+="<form "+i+" method=\"get\"></form>";e=y.getElementById(U);}if(typeof s[U]==c){s[U]={};}if(typeof s[U][s.pathname]!=c){W=s[U][s.pathname].split(",");}}}M(H.bind(K,this),20);M(H.bind(Z,this),21);M(H.bind(S,this),22);if(X.isIE()&&P>=8){y.body.onhashchange=H.bind(u,this);R(H.bind(A,this),50);}else{R(H.bind(u,this),50);}}};var U="swfaddress",E="function",c="undefined",w=asual.swfaddress,J=asual.util,X=J.Browser,g=J.Events,H=J.Functions,P=X.getVersion(),x=false,k=F(),y=k.document,v=k.history,s=k.location,R=setInterval,M=setTimeout,N=decodeURIComponent,z=encodeURIComponent,T,e,G,d=y.title,a=v.length,Q=false,q=false,h=true,f=true,W=[],V={},n=m(),Y={history:true,strict:true};if(X.isOpera()){x=P>=9.02;}if(X.isIE()){x=P>=6;}if(X.isSafari()){x=P>=312;}if(X.isChrome()){x=P>=0.2;}if(X.isMozilla()){x=P>=1;}if(x){for(var t=1;t<a;t++){W.push("");}W.push(m());if(X.isIE()&&s.hash!=m()){s.hash="#"+O(m());}AA(document);var B=G.indexOf("?");if(G&&B>-1){var I,C=G.substr(B+1).split("&");for(var t=0,o;o=C[t];t++){I=o.split("=");if(/^(history|strict)$/.test(I[0])){Y[I[0]]=(isNaN(I[1])?/^(true|yes)$/i.test(I[1]):(parseInt(I[1])!=0));}if(/^tracker$/.test(I[0])){Y[I[0]]=I[1];}}}if(X.isIE()){A.call(this);}if(window==k){g.addListener(document,"DOMContentLoaded",H.bind(j,this));}g.addListener(k,"load",H.bind(j,this));}else{if((!x&&s.href.indexOf("#")!=-1)||(X.isSafari()&&P<418&&s.href.indexOf("#")!=-1&&s.search!="")){y.open();y.write("<html><head><meta http-equiv=\"refresh\" content=\"0;url="+s.href.substr(0,s.href.indexOf("#"))+"\" /></head></html>");y.close();}else{S();}}this.toString=function(){return "[class WEBAddress]";};this.back=function(){v.back();};this.forward=function(){v.forward();};this.up=function(){var i=this.getPath();this.setValue(i.substr(0,i.lastIndexOf("/",i.length-2)+(i.substr(i.length-1)=="/"?1:0)));};this.go=function(i){v.go(i);};this.addEventListener=function(i,p){if(typeof V[i]==c){V[i]=[];}V[i].push(p);};this.removeEventListener=function(AC,AD){if(typeof V[AC]!=c){for(var AB=0,p;p=V[AC][AB];AB++){if(p==AD){break;}}V[AC].splice(AB,1);}};this.dispatchEvent=function(AC){if(this.hasEventListener(AC.type)){AC.target=this;for(var AB=0,p;p=V[AC.type][AB];AB++){p(AC);}return true;}return false;};this.hasEventListener=function(i){return (typeof V[i]!=c&&V[i].length>0);};this.getBaseURL=function(){var i=s.href;if(i.indexOf("#")!=-1){i=i.substr(0,i.indexOf("#"));}if(i.substr(i.length-1)=="/"){i=i.substr(0,i.length-1);}return i;};this.getStrict=function(){return Y.strict;};this.setStrict=function(i){Y.strict=i;};this.getHistory=function(){return Y.history;};this.setHistory=function(i){Y.history=i;};this.getTracker=function(){return Y.tracker;};this.setTracker=function(i){Y.tracker=i;};this.getTitle=function(){return y.title;};this.setTitle=function(i){if(!x){return null;}if(typeof i==c){return;}if(i=="null"){i="";}d=y.title=i;M(function(){if(f&&T&&T.contentWindow&&T.contentWindow.document){T.contentWindow.document.title=i;f=false;}if(!h&&X.isMozilla()){s.replace(s.href.indexOf("#")!=-1?s.href:s.href+"#");}h=false;},50);};this.getStatus=function(){return k.status;};this.setStatus=function(i){if(typeof i==c){return;}if(!X.isSafari()){i=b((i!="null")?i:"",true);if(i=="/"){i="";}if(!(/http(s)?:\/\//.test(i))){var p=s.href.indexOf("#");i=(p==-1?s.href:s.href.substr(0,p))+"#"+i;}k.status=i;}};this.resetStatus=function(){k.status="";};this.getValue=function(){if(!x){return null;}return b(n,false);};this.setValue=function(AB){if(!x){return null;}if(typeof AB==c){return;}if(AB=="null"){AB="";}AB=b(AB,true);if(AB=="/"){AB="";}if(n==AB||n==N(AB)||N(n)==AB){return;}h=true;n=AB;Q=true;r.call(w.WEBAddress);W[v.length]=n;if(X.isSafari()){if(Y.history){s[U][s.pathname]=W.toString();a=v.length+1;if(P<418){if(s.search==""){e.action="#"+n;e.submit();}}else{if(P<523||n==""){var i=y.createEvent("MouseEvents");i.initEvent("click",true,true);var p=y.createElement("a");p.href="#"+n;p.dispatchEvent(i);}else{s.hash="#"+n;}}}else{s.replace("#"+n);}}else{if(n!=m()){if(Y.history){s.hash=(X.isChrome()?"":"#")+O(n);}else{s.replace("#"+n);}}}if((X.isIE()&&P<8)&&Y.history){M(D,50);}if(X.isSafari()){M(function(){Q=false;},1);}else{Q=false;}};this.getPath=function(){var i=this.getValue();return (i.indexOf("?")!=-1)?i.split("?")[0]:i;};this.getPathNames=function(){var p=this.getPath();var i=p.split("/");if(p.substr(0,1)=="/"||p.length==0){i.splice(0,1);}if(p.substr(p.length-1,1)=="/"){i.splice(i.length-1,1);}return i;};this.getQueryString=function(){var p=this.getValue();var i=p.indexOf("?");return (i!=-1&&i<p.length)?p.substr(i+1):"";};this.getParameter=function(AG){var AD=this.getValue();var AB=AD.indexOf("?");if(AB!=-1){AD=AD.substr(AB+1);var AF=AD.split("&");var AE,AC=AF.length;while(AC--){AE=AF[AC].split("=");if(AE[0]==AG){return AE[1];}}}};this.getParameterNames=function(){var AC=this.getValue();var p=AC.indexOf("?");var AD=[];if(p!=-1){AC=AC.substr(p+1);if(AC!=""&&AC.indexOf("=")!=-1){var AE=AC.split("&");var AB=0;while(AB<AE.length){AD.push(AE[AB].split("=")[0]);AB++;}}}return AD;};this.onInit=null;this.onChange=null;};SWFAddressEvent=asual.swfaddress.SWFAddressEvent=function(A){SWFAddressEvent.superConstructor.apply(this,arguments);this.target=[SWFAddress][0];this.toString=function(){return "[object SWFAddressEvent]";};};asual.util.Functions.extend(asual.swfaddress.WEBAddressEvent,SWFAddressEvent);asual.swfaddress.SWFAddressEvent.INIT="init";asual.swfaddress.SWFAddressEvent.CHANGE="change";SWFAddress=asual.swfaddress.SWFAddress=new function(){var _8f="undefined",_t=top,_l=_t.location,_92=this,_93,_94,_95=[],_96=[],_97={},_98=asual.util,_99=asual.util.Functions,_9a=asual.swfaddress.WEBAddress;for(var p in _9a){this[p]=_9a[p];}var _9c=function(_9d){this.dispatchEvent(new SWFAddressEvent(_9d));_9d=_9d.substr(0,1).toUpperCase()+_9d.substr(1);if(typeof this["on"+_9d]=="function"){this["on"+_9d]();}};var _9e=function(e){if(_96.length>0){var _a0=window.open(_96[0],_96[1],eval(_96[2]));if(typeof _96[3]!=_8f){eval(_96[3]);}}_96=[];};var _a1=function(){if(_98.Browser.isSafari()){document.body.addEventListener("click",_9e);}_9c.call(this,"init");};var _a2=function(){_a3();_9c.call(this,"change");};var _a3=function(){for(var i=0,id,obj,_a7=SWFAddress.getValue(),_a8="setSWFAddressValue";id=_95[i];i++){obj=document.getElementById(id);if(obj){if(obj.parentNode&&typeof obj.parentNode.so!=_8f){obj.parentNode.so.call(_a8,_a7);}else{if(!(obj&&typeof obj[_a8]!=_8f)){var _a9=obj.getElementsByTagName("object");var _aa=obj.getElementsByTagName("embed");obj=((_a9[0]&&typeof _a9[0][_a8]!=_8f)?_a9[0]:((_aa[0]&&typeof _aa[0][_a8]!=_8f)?_aa[0]:null));}if(obj){obj[_a8](decodeURIComponent(_a7));}}}else{if(obj=document[id]){if(typeof obj[_a8]!=_8f){obj[_a8](_a7);}}}}};var _ab=function(_ac,_ad,_ae){if(typeof _ae!=_8f){clearTimeout(_ae);}if(_95.length!=0&&_98.Browser.isMozilla()&&navigator.userAgent.indexOf("Mac")!=-1){_ae=setTimeout(function(){_9a[_ac].call(SWFAddress,_ad);},1);}else{_9a[_ac].call(this,_ad);}};this.toString=function(){return "[class SWFAddress]";};this.addEventListener=function(_af,_b0){if(typeof _97[_af]==_8f){_97[_af]=[];}_97[_af].push(_b0);};this.removeEventListener=function(_b1,_b2){if(typeof _97[_b1]!=_8f){for(var i=0,l;l=_97[_b1][i];i++){if(l==_b2){break;}}_97[_b1].splice(i,1);}};this.dispatchEvent=function(_b5){if(typeof _97[_b5.type]!=_8f&&_97[_b5.type].length){_b5.target=this;for(var i=0,l;l=_97[_b5.type][i];i++){l(_b5);}return true;}return false;};this.hasEventListener=function(_b8){return (typeof _97[_b8]!=_8f&&_97[_b8].length>0);};this.href=function(url,_ba){_ba=typeof _ba!=_8f?_ba:"_self";if(_ba=="_self"){self.location.href=url;}else{if(_ba=="_top"){_l.href=url;}else{if(_ba=="_blank"){window.open(url);}else{_t.frames[_ba].location.href=url;}}}};this.popup=function(url,_bc,_bd,_be){try{var _bf=window.open(url,_bc,eval(_bd));if(typeof _be!=_8f){eval(_be);}}catch(ex){}_96=arguments;};this.getIds=function(){return _95;};this.getId=function(_c0){return _95[0];};this.setId=function(id){_95[0]=id;};this.addId=function(id){this.removeId(id);_95.push(id);};this.removeId=function(id){for(var i=0;i<_95.length;i++){if(id==_95[i]){_95.splice(i,1);break;}}};this.setValue=function(_c5){_ab("setValue",_c5,_93);};this.setTitle=function(_c6){_ab("setTitle",_c6,_94);};_9a.addEventListener("init",_99.bind(_a1,this));_9a.addEventListener("change",_99.bind(_a2,this));(function(){var _c7;if(typeof FlashObject!=_8f){SWFObject=FlashObject;}if(typeof SWFObject!=_8f&&SWFObject.prototype&&SWFObject.prototype.write){var _s1=SWFObject.prototype.write;SWFObject.prototype.write=function(){_c7=arguments;if(this.getAttribute("version").major<8){this.addVariable("$swfaddress",SWFAddress.getValue());((typeof _c7[0]=="string")?document.getElementById(_c7[0]):_c7[0]).so=this;}var _c9;if(_c9=_s1.apply(this,_c7)){_92.addId(this.getAttribute("id"));}return _c9;};}if(typeof swfobject!=_8f){var _ca=swfobject.registerObject;swfobject.registerObject=function(){_c7=arguments;_ca.apply(this,_c7);_92.addId(_c7[0]);};var _cb=swfobject.createSWF;swfobject.createSWF=function(){_c7=arguments;_cb.apply(this,_c7);_92.addId(_c7[0].id);};var _cc=swfobject.embedSWF;swfobject.embedSWF=function(){_c7=arguments;_cc.apply(this,_c7);_92.addId(_c7[8].id);};}if(typeof UFO!=_8f){var _u=UFO.create;UFO.create=function(){_c7=arguments;_u.apply(this,_c7);_92.addId(_c7[0].id);};}if(typeof AC_FL_RunContent!=_8f){var _a=AC_FL_RunContent;AC_FL_RunContent=function(){_c7=arguments;_a.apply(this,_c7);for(var i=0,l=_c7.length;i<l;i++){if(_c7[i]=="id"){_92.addId(_c7[i+1]);}}};}})();};