/** * SWFAddress 2.3: Deep linking for Flash and Ajax <http://www.asual.com/swfaddress/> * * SWFAddress is (c) 2006-2008 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 H=-1,C=navigator.userAgent,D=false,B=false,G=false,E=false,F=false;var A=function(J,I){return parseFloat(C.substr(C.indexOf(J)+I));};if(G=/Opera/.test(C)){H=parseFloat(navigator.appVersion);}if(D=/MSIE/.test(C)){H=A("MSIE",4);}if(E=/Chrome/.test(C)){H=A("Chrome",7);}if(B=(/AppleWebKit/.test(C)&&!E)){H=A("Safari",7);}if(F=(navigator&&navigator.product=="Gecko"&&!E&&!B)){H=A("rv:",3);}this.toString=function(){return "[class Browser]";};this.getVersion=function(){return H;};this.isIE=function(){return D;};this.isSafari=function(){return B;};this.isOpera=function(){return G;};this.isGecko=function(){return F;};this.isChrome=function(){return E;};};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 T="swfaddress",E="function",b="undefined",v=asual.swfaddress,I=asual.util,W=I.Browser,f=I.Events,F=I.Functions,O=W.getVersion(),w=false,k=top,x=k.document,u=k.history,r=k.location,P=setInterval,L=setTimeout,M=decodeURIComponent,y=encodeURIComponent,S,d,G,c=x.title,Z=u.length,Q=false,o=false,g=true,e=true,U=[],V={},X={history:true,html:false,strict:true};if(W.isOpera()){w=O>=9.02;}if(W.isIE()){w=O>=6;}if(W.isSafari()){w=O>=312;}if(W.isChrome()){w=O>=0.2;}if(W.isGecko()){w=O>=1;}if((!w&&r.href.indexOf("#")!=-1)||(W.isSafari()&&O<418&&r.href.indexOf("#")!=-1&&r.search!="")){x.open();x.write("<html><head><meta http-equiv=\"refresh\" content=\"0;url="+r.href.substr(0,r.href.indexOf("#"))+"\" /></head></html>");x.close();}var l=function(){var i=r.href.indexOf("#");return i!=-1?r.href.substr(i+1):"";};var m=l();var a=function(p,i){if(X.strict){p=i?(p.substr(0,1)!="/"?"/"+p:p):(p==""?"/":p);}return p;};var N=function(i){return (W.isIE()&&r.protocol=="file:")?m.replace(/\?/,"%3F"):i;};var z=function(AC){for(var AA=0,p=AC.childNodes.length,AB;AA<p;AA++){if(AC.childNodes[AA].src){G=String(AC.childNodes[AA].src);}if(AB=z(AC.childNodes[AA])){return AB;}}};var A=function(){if(x.title!=c&&x.title.indexOf("#")!=-1){x.title=c;if(X.html&&S&&S.contentWindow&&S.contentWindow.document){S.contentWindow.document.title=c;}}};var t=function(){if(!Q){var p=l();var i=!(m==p||m==M(p)||M(m)==p);if(W.isSafari()&&O<523){if(Z!=u.length){Z=u.length;if(typeof U[Z-1]!=b){m=U[Z-1];}q.call(this);}}else{if(W.isIE()&&i){if(O<7){r.reload();}else{this.setValue(p);}}else{if(i){m=p;q.call(this);}}}if(W.isIE()){A.call(this);}}};var j=function(i){this.dispatchEvent(new v.WEBAddressEvent(i));i=i.substr(0,1).toUpperCase()+i.substr(1);if(typeof this["on"+i]==E){this["on"+i]();}};var J=function(){j.call(this,"init");};var Y=function(){j.call(this,"change");};var q=function(){Y.call(this);L(F.bind(R,this),10);};var R=function(){var p=M((r.pathname+(/\/$/.test(r.pathname)?"":"/")+this.getValue()).replace(/\/\//,"/").replace(/^\/$/,""));var i=window[X.tracker];if(typeof i==E){i(p);}else{if(typeof pageTracker!=b&&typeof pageTracker._trackPageview==E){pageTracker._trackPageview(p);}else{if(typeof urchinTracker==E){urchinTracker(p);}}}};var D=function(){var i=S.contentWindow.document;i.open();i.write("<html><head><title>"+x.title+"</title><script>var "+T+" = \""+y(l())+"\";</script></head></html>");i.close();};var K=function(){var i=S.contentWindow;var p=i.location.href;m=(X.html)?(p.indexOf("?")>-1?M(p.substr(p.indexOf("?")+1)):""):(typeof i[T]!=b?M(i[T]):"");if(X.html){i.document.title=c;}if(m!=l()){q.call(v.WEBAddress);r.hash=N(m);}};var h=function(){if(!o){o=true;var i="id=\""+T+"\" style=\"position:absolute;top:-9999px;\"";if(W.isIE()&&O<8){x.body.appendChild(x.createElement("div")).innerHTML="<iframe "+i+" src=\""+(X.html?G.replace(/\.js(\?.*)?$/,".html")+"?"+y(l()):"javascript:false;")+"\" width=\"0\" height=\"0\"></iframe>";S=x.getElementById(T);L(function(){f.addListener(S,"load",K);if(!X.html&&typeof S.contentWindow[T]==b){D();}},50);}else{if(W.isSafari()){if(O<418){x.body.innerHTML+="<form "+i+" method=\"get\"></form>";d=x.getElementById(T);}if(typeof r[T]==b){r[T]={};}if(typeof r[T][r.pathname]!=b){U=r[T][r.pathname].split(",");}}}L(F.bind(J,this),20);L(F.bind(Y,this),21);L(F.bind(R,this),22);if(W.isIE()&&O>=8){x.body.onhashchange=F.bind(t,this);P(F.bind(A,this),50);}else{P(F.bind(t,this),50);}}};this.onInit=null;this.onChange=null;this.toString=function(){return "[class WEBAddress]";};this.back=function(){u.back();};this.forward=function(){u.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){u.go(i);};this.addEventListener=function(i,p){if(typeof V[i]==b){V[i]=[];}V[i].push(p);};this.removeEventListener=function(AB,AC){if(typeof V[AB]!=b){for(var AA=0,p;p=V[AB][AA];AA++){if(p==AC){break;}}V[AB].splice(AA,1);}};this.dispatchEvent=function(AB){if(this.hasEventListener(AB.type)){AB.target=this;for(var AA=0,p;p=V[AB.type][AA];AA++){p(AB);}return true;}return false;};this.hasEventListener=function(i){return (typeof V[i]!=b&&V[i].length>0);};this.getBaseURL=function(){var i=r.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 X.strict;};this.setStrict=function(i){X.strict=i;};this.getHistory=function(){return X.history;};this.setHistory=function(i){X.history=i;};this.getTracker=function(){return X.tracker;};this.setTracker=function(i){X.tracker=i;};this.getTitle=function(){return x.title;};this.setTitle=function(i){if(!w){return null;}if(typeof i==b){return;}if(i=="null"){i="";}c=x.title=i;L(function(){if((e||X.html)&&S&&S.contentWindow&&S.contentWindow.document){S.contentWindow.document.title=i;e=false;}if(!g&&W.isGecko()){r.replace(r.href.indexOf("#")!=-1?r.href:r.href+"#");}g=false;},50);};this.getStatus=function(){return k.status;};this.setStatus=function(i){if(typeof i==b){return;}if(!W.isSafari()){i=a((i!="null")?i:"",true);if(i=="/"){i="";}if(!(/http(s)?:\/\//.test(i))){var p=r.href.indexOf("#");i=(p==-1?r.href:r.href.substr(0,p))+"#"+i;}k.status=i;}};this.resetStatus=function(){k.status="";};this.getValue=function(){if(!w){return null;}return a(m,false);};this.setValue=function(AA){if(!w){return null;}if(typeof AA==b){return;}if(AA=="null"){AA="";}AA=a(AA,true);if(AA=="/"){AA="";}if(m==AA||m==M(AA)||M(m)==AA){return;}g=true;m=AA;Q=true;q.call(v.WEBAddress);U[u.length]=m;if(W.isSafari()){if(X.history){r[T][r.pathname]=U.toString();Z=u.length+1;if(O<418){if(r.search==""){d.action="#"+m;d.submit();}}else{if(O<523||m==""){var i=x.createEvent("MouseEvents");i.initEvent("click",true,true);var p=x.createElement("a");p.href="#"+m;p.dispatchEvent(i);}else{r.hash="#"+m;}}}else{r.replace("#"+m);}}else{if(m!=l()){if(X.history){r.hash=(W.isChrome()?"":"#")+N(m);}else{r.replace("#"+m);}}}if((W.isIE()&&O<8)&&X.history){if(X.html){L(function(){var AB=S.contentWindow.location;AB.assign(AB.pathname+"?"+l());},50);}else{L(D,50);}}if(W.isSafari()){L(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(AF){var AC=this.getValue();var AA=AC.indexOf("?");if(AA!=-1){AC=AC.substr(AA+1);var AE=AC.split("&");var AD,AB=AE.length;while(AB--){AD=AE[AB].split("=");if(AD[0]==AF){return AD[1];}}}};this.getParameterNames=function(){var AB=this.getValue();var p=AB.indexOf("?");var AC=[];if(p!=-1){AB=AB.substr(p+1);if(AB!=""&&AB.indexOf("=")!=-1){var AD=AB.split("&");var AA=0;while(AA<AD.length){AC.push(AD[AA].split("=")[0]);AA++;}}}return AC;};if(w){for(var s=1;s<Z;s++){U.push("");}U.push(l());if(W.isIE()&&r.hash!=l()){r.hash="#"+N(l());}z(document);var B=G.indexOf("?");if(G&&B>-1){var H,C=G.substr(B+1).split("&");for(var s=0,n;n=C[s];s++){H=n.split("=");if(/^(history|strict)$/.test(H[0])){X[H[0]]=(isNaN(H[1])?/^(true|yes)$/i.test(H[1]):(parseInt(H[1])!=0));}if(/^tracker$/.test(H[0])){X[H[0]]=H[1];}}}if(/file:\/\//.test(r.href)){X.html=false;}if(W.isIE()){A.call(this);}if(window==k){f.addListener(document,"DOMContentLoaded",F.bind(h,this));}f.addListener(k,"load",F.bind(h,this));}else{R();}};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 _98="undefined",_t=top,_l=_t.location,_9b=this,_9c,_9d,_9e=[],_9f=[],_a0={},_a1=asual.util,_a2=asual.util.Functions,_a3=asual.swfaddress.WEBAddress;for(var p in _a3){this[p]=_a3[p];}var _a5=function(_a6){this.dispatchEvent(new SWFAddressEvent(_a6));_a6=_a6.substr(0,1).toUpperCase()+_a6.substr(1);if(typeof this["on"+_a6]=="function"){this["on"+_a6]();}};var _a7=function(e){if(_9f.length>0){var _a9=window.open(_9f[0],_9f[1],eval(_9f[2]));if(typeof _9f[3]!=_98){eval(_9f[3]);}}_9f=[];};var _aa=function(){if(_a1.Browser.isSafari()){document.body.addEventListener("click",_a7);}_a5.call(this,"init");};var _ab=function(){_ac();_a5.call(this,"change");};var _ac=function(){for(var i=0,id,obj,_b0=SWFAddress.getValue(),_b1="setSWFAddressValue";id=_9e[i];i++){obj=document.getElementById(id);if(obj){if(obj.parentNode&&typeof obj.parentNode.so!=_98){obj.parentNode.so.call(_b1,_b0);}else{if(!(obj&&typeof obj[_b1]!=_98)){var _b2=obj.getElementsByTagName("object");var _b3=obj.getElementsByTagName("embed");obj=((_b2[0]&&typeof _b2[0][_b1]!=_98)?_b2[0]:((_b3[0]&&typeof _b3[0][_b1]!=_98)?_b3[0]:null));}if(obj){obj[_b1](decodeURIComponent(_b0));}}}else{if(obj=document[id]){if(typeof obj[_b1]!=_98){obj[_b1](_b0);}}}}};var _b4=function(_b5,_b6,_b7){if(typeof _b7!=_98){clearTimeout(_b7);}if(_9e.length!=0&&_a1.Browser.isGecko()&&navigator.userAgent.indexOf("Mac")!=-1){_b7=setTimeout(function(){_a3[_b5].call(SWFAddress,_b6);},500);}else{_a3[_b5].call(this,_b6);}};this.toString=function(){return "[class SWFAddress]";};this.addEventListener=function(_b8,_b9){if(typeof _a0[_b8]==_98){_a0[_b8]=[];}_a0[_b8].push(_b9);};this.removeEventListener=function(_ba,_bb){if(typeof _a0[_ba]!=_98){for(var i=0,l;l=_a0[_ba][i];i++){if(l==_bb){break;}}_a0[_ba].splice(i,1);}};this.dispatchEvent=function(_be){if(typeof _a0[_be.type]!=_98&&_a0[_be.type].length){_be.target=this;for(var i=0,l;l=_a0[_be.type][i];i++){l(_be);}return true;}return false;};this.hasEventListener=function(_c1){return (typeof _a0[_c1]!=_98&&_a0[_c1].length>0);};this.href=function(url,_c3){_c3=typeof _c3!=_98?_c3:"_self";if(_c3=="_self"){self.location.href=url;}else{if(_c3=="_top"){_l.href=url;}else{if(_c3=="_blank"){window.open(url);}else{_t.frames[_c3].location.href=url;}}}};this.popup=function(url,_c5,_c6,_c7){try{var _c8=window.open(url,_c5,eval(_c6));if(typeof _c7!=_98){eval(_c7);}}catch(ex){}_9f=arguments;};this.getIds=function(){return _9e;};this.getId=function(_c9){return _9e[0];};this.setId=function(id){_9e[0]=id;};this.addId=function(id){this.removeId(id);_9e.push(id);};this.removeId=function(id){for(var i=0;i<_9e.length;i++){if(id==_9e[i]){_9e.splice(i,1);break;}}};this.setValue=function(_ce){_b4("setValue",_ce,_9c);};this.setTitle=function(_cf){_b4("setTitle",_cf,_9d);};_a3.addEventListener("init",_a2.bind(_aa,this));_a3.addEventListener("change",_a2.bind(_ab,this));(function(){var _d0;if(typeof FlashObject!=_98){SWFObject=FlashObject;}if(typeof SWFObject!=_98&&SWFObject.prototype&&SWFObject.prototype.write){var _s1=SWFObject.prototype.write;SWFObject.prototype.write=function(){_d0=arguments;if(this.getAttribute("version").major<8){this.addVariable("$swfaddress",SWFAddress.getValue());((typeof _d0[0]=="string")?document.getElementById(_d0[0]):_d0[0]).so=this;}var _d2;if(_d2=_s1.apply(this,_d0)){_9b.addId(this.getAttribute("id"));}return _d2;};}if(typeof swfobject!=_98){var _d3=swfobject.registerObject;swfobject.registerObject=function(){_d0=arguments;_d3.apply(this,_d0);_9b.addId(_d0[0]);};var _d4=swfobject.createSWF;swfobject.createSWF=function(){_d0=arguments;_d4.apply(this,_d0);_9b.addId(_d0[0].id);};var _d5=swfobject.embedSWF;swfobject.embedSWF=function(){_d0=arguments;_d5.apply(this,_d0);_9b.addId(_d0[8].id);};}if(typeof UFO!=_98){var _u=UFO.create;UFO.create=function(){_d0=arguments;_u.apply(this,_d0);_9b.addId(_d0[0].id);};}if(typeof AC_FL_RunContent!=_98){var _a=AC_FL_RunContent;AC_FL_RunContent=function(){_d0=arguments;_a.apply(this,_d0);for(var i=0,l=_d0.length;i<l;i++){if(_d0[i]=="id"){_9b.addId(_d0[i+1]);}}};}})();};
