/** * 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 B=-1,D=navigator.userAgent,H=false,G=false,F=false,A=false,C=false,I=false;var E=function(K,J){return parseFloat(D.substr(D.indexOf(K)+J));};if(A=/Opera/.test(D)){B=parseFloat(navigator.appVersion);}if(H=/MSIE/.test(D)){B=E("MSIE",4);}if(I=/Chrome/.test(D)){B=E("Chrome",7);}if(G=/Camino/.test(D)){B=E("Camino",7);}if(F=(/AppleWebKit/.test(D)&&!I)){B=E("Safari",7);}if(C=(/Firefox/.test(D)&&!G)){B=E("Firefox",8);}this.toString=function(){return "[class Browser]";};this.getVersion=function(){return B;};this.isIE=function(){return H;};this.isSafari=function(){return F;};this.isOpera=function(){return A;};this.isCamino=function(){return G;};this.isFirefox=function(){return C;};this.isChrome=function(){return I;};};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 ID="",_2f="function",_30="undefined",_31=asual.swfaddress,_32=asual.util,_33=_32.Browser,_34=_32.Events,_35=_32.Functions,_36=_33.getVersion(),_37=false,_t=self,_d=_t.document,_h=_t.history,_l=_t.location,_si=setInterval,_st=setTimeout,_dc=decodeURIComponent,_ec=encodeURIComponent,_40,_41,_42,_43,_44=_d.title,_45=_h.length,_46=false,_47=false,_48=true,_49=true,_4a=[],_4b={},_4c={history:true,html:false,strict:true,tracker:"_trackDefault"};if(_33.isOpera()){_37=_36>=9.02;}if(_33.isIE()){_37=_36>=6;}if(_33.isSafari()){_37=_36>=312;}if(_33.isChrome()){_37=_36>=0.2;}if(_33.isCamino()){_37=_36>=1;}if(_33.isFirefox()){_37=_36>=1;}if((!_37&&_l.href.indexOf("#")!=-1)||(_33.isSafari()&&_36<418&&_l.href.indexOf("#")!=-1&&_l.search!="")){_d.open();_d.write("<html><head><meta http-equiv=\"refresh\" content=\"0;url="+_l.href.substr(0,_l.href.indexOf("#"))+"\" /></head></html>");_d.close();}var _4d=function(){var _4e=_l.href.indexOf("#");return _4e!=-1?_l.href.substr(_4e+1):"";};var _4f=_4d();var _50=function(_51,_52){if(_4c.strict){_51=_52?(_51.substr(0,1)!="/"?"/"+_51:_51):(_51==""?"/":_51);}return _51;};var _53=function(_54){return (_33.isIE()&&_l.protocol=="file:")?_4f.replace(/\?/,"%3F"):_54;};var _55=function(el){for(var i=0,l=el.childNodes.length,s;i<l;i++){if(el.childNodes[i].src){_42=String(el.childNodes[i].src);}if(s=_55(el.childNodes[i])){return s;}}};var _5a=function(){if(_33.isIE()&&_d.title!=_44&&_d.title.indexOf("#")!=-1){_d.title=_44;if(_4c.html&&_40&&_40.contentWindow&&_40.contentWindow.document){_40.contentWindow.document.title=_44;}}};var _5b=function(){if(!_46){var _5c=_4d();var _5d=!(_4f==_5c||_4f==_dc(_5c)||_dc(_4f)==_5c);if(_33.isSafari()&&_36<523){if(_45!=_h.length){_45=_h.length;if(typeof _4a[_45-1]!=_30){_4f=_4a[_45-1];}_5e.call(this);}}else{if(_33.isIE()&&_5d){if(_36<7){_l.reload();}else{this.setValue(_5c);}}else{if(_5d){_4f=_5c;_5e.call(this);}}}_5a.call(this);}};var _5f=function(_60){this.dispatchEvent(new _31.WEBAddressEvent(_60));_60=_60.substr(0,1).toUpperCase()+_60.substr(1);if(typeof this["on"+_60]==_2f){this["on"+_60]();}};var _61=function(){_5f.call(this,"init");};var _62=function(){_5f.call(this,"change");};var _5e=function(){_62.call(this);_st(_35.bind(_63,this),10);};var _64=function(_65){if(typeof urchinTracker==_2f){urchinTracker(_65);}if(typeof pageTracker!=_30&&typeof pageTracker._trackPageview==_2f){pageTracker._trackPageview(_65);}};eval("var _trackDefault = "+_64+";");var _63=function(){if(typeof _4c.tracker!=_30&&eval("typeof "+_4c.tracker+" != \""+_30+"\"")){var fn=eval(_4c.tracker);if(typeof fn==_2f){fn(_dc((_l.pathname+(/\/$/.test(_l.pathname)?"":"/")+this.getValue()).replace(/\/\//,"/").replace(/^\/$/,"")));}}};var _67=function(){var doc=_40.contentWindow.document;doc.open();doc.write("<html><head><title>"+_d.title+"</title><script>var "+ID+" = \""+_ec(_4d())+"\";</script></head></html>");doc.close();};var _69=function(){var win=_40.contentWindow;var src=win.location.href;_4f=(_4c.html)?(src.indexOf("?")>-1?_dc(src.substr(src.indexOf("?")+1)):""):(typeof win[ID]!=_30?_dc(win[ID]):"");if(_4c.html){win.document.title=_44;}if(_4f!=_4d()){_5e.call(_31.WEBAddress);_l.hash=_53(_4f);}};var _6c=function(){if(!_47){_47=true;var _6d="id=\""+ID+"\" style=\"position:absolute;top:-9999px;\"";if(_33.isIE()&&_36<8){_d.body.appendChild(_d.createElement("div")).innerHTML="<iframe "+_6d+" src=\""+(_4c.html?_42.replace(/\.js(\?.*)?$/,".html")+"?"+_ec(_4d()):"javascript:false;")+"\" width=\"0\" height=\"0\"></iframe>";_40=_d.getElementById(ID);_st(function(){_34.addListener(_40,"load",_69);if(!_4c.html&&typeof _40.contentWindow[ID]==_30){_67();}},50);}else{if(_33.isSafari()){if(_36<418){_d.body.innerHTML+="<form "+_6d+" method=\"get\"></form>";_41=_d.getElementById(ID);}if(typeof _l[ID]==_30){_l[ID]={};}if(typeof _l[ID][_l.pathname]!=_30){_4a=_l[ID][_l.pathname].split(",");}}}_st(_35.bind(_61,this),20);_st(_35.bind(_62,this),21);_st(_35.bind(_63,this),22);if(_33.isIE()&&_36>=8){_d.body.onhashchange=_35.bind(_5b,this);_43=_si(_35.bind(_5a,this),50);}else{_43=_si(_35.bind(_5b,this),50);}}};var _6e=function(){clearInterval(_43);};this.onInit=null;this.onChange=null;this.toString=function(){return "[class WEBAddress]";};this.back=function(){_h.back();};this.forward=function(){_h.forward();};this.up=function(){var _6f=this.getPath();this.setValue(_6f.substr(0,_6f.lastIndexOf("/",_6f.length-2)+(_6f.substr(_6f.length-1)=="/"?1:0)));};this.go=function(_70){_h.go(_70);};this.addEventListener=function(_71,_72){if(typeof _4b[_71]==_30){_4b[_71]=[];}_4b[_71].push(_72);};this.removeEventListener=function(_73,_74){if(typeof _4b[_73]!=_30){for(var i=0,l;l=_4b[_73][i];i++){if(l==_74){break;}}_4b[_73].splice(i,1);}};this.dispatchEvent=function(_77){if(this.hasEventListener(_77.type)){_77.target=this;for(var i=0,l;l=_4b[_77.type][i];i++){l(_77);}return true;}return false;};this.hasEventListener=function(_7a){return (typeof _4b[_7a]!=_30&&_4b[_7a].length>0);};this.getBaseURL=function(){var url=_l.href;if(url.indexOf("#")!=-1){url=url.substr(0,url.indexOf("#"));}if(url.substr(url.length-1)=="/"){url=url.substr(0,url.length-1);}return url;};this.getStrict=function(){return _4c.strict;};this.setStrict=function(_7c){_4c.strict=_7c;};this.getHistory=function(){return _4c.history;};this.setHistory=function(_7d){_4c.history=_7d;};this.getTracker=function(){return _4c.tracker;};this.setTracker=function(_7e){_4c.tracker=_7e;};this.getTitle=function(){return _d.title;};this.setTitle=function(_7f){if(!_37){return null;}if(typeof _7f==_30){return;}if(_7f=="null"){_7f="";}_44=_d.title=_7f;_st(function(){if((_49||_4c.html)&&_40&&_40.contentWindow&&_40.contentWindow.document){_40.contentWindow.document.title=_7f;_49=false;}if(!_48&&(_33.isCamino()||_33.isFirefox())){_l.replace(_l.href.indexOf("#")!=-1?_l.href:_l.href+"#");}_48=false;},50);};this.getStatus=function(){return _t.status;};this.setStatus=function(_80){if(typeof _80==_30){return;}if(!_33.isSafari()){_80=_50((_80!="null")?_80:"",true);if(_80=="/"){_80="";}if(!(/http(s)?:\/\//.test(_80))){var _81=_l.href.indexOf("#");_80=(_81==-1?_l.href:_l.href.substr(0,_81))+"#"+_80;}_t.status=_80;}};this.resetStatus=function(){_t.status="";};this.getValue=function(){if(!_37){return null;}return _50(_4f,false);};this.setValue=function(_82){if(!_37){return null;}if(typeof _82==_30){return;}if(_82=="null"){_82="";}_82=_50(_82,true);if(_82=="/"){_82="";}if(_4f==_82||_4f==_dc(_82)||_dc(_4f)==_82){return;}_48=true;_4f=_82;_46=true;_5e.call(_31.WEBAddress);_4a[_h.length]=_4f;if(_33.isSafari()){if(_4c.history){_l[ID][_l.pathname]=_4a.toString();_45=_h.length+1;if(_36<418){if(_l.search==""){_41.action="#"+_4f;_41.submit();}}else{if(_36<523||_4f==""){var evt=_d.createEvent("MouseEvents");evt.initEvent("click",true,true);var _84=_d.createElement("a");_84.href="#"+_4f;_84.dispatchEvent(evt);}else{_l.hash="#"+_4f;}}}else{_l.replace("#"+_4f);}}else{if(_4f!=_4d()){if(_4c.history){_l.hash=(_33.isChrome()?"":"#")+_53(_4f);}else{_l.replace("#"+_4f);}}}if((_33.isIE()&&_36<8)&&_4c.history){if(_4c.html){_st(function(){var loc=_40.contentWindow.location;loc.assign(loc.pathname+"?"+_4d());},50);}else{_st(_67,50);}}if(_33.isSafari()){_st(function(){_46=false;},1);}else{_46=false;}};this.getPath=function(){var _86=this.getValue();return (_86.indexOf("?")!=-1)?_86.split("?")[0]:_86;};this.getPathNames=function(){var _87=this.getPath();var _88=_87.split("/");if(_87.substr(0,1)=="/"||_87.length==0){_88.splice(0,1);}if(_87.substr(_87.length-1,1)=="/"){_88.splice(_88.length-1,1);}return _88;};this.getQueryString=function(){var _89=this.getValue();var _8a=_89.indexOf("?");return (_8a!=-1&&_8a<_89.length)?_89.substr(_8a+1):"";};this.getParameter=function(_8b){var _8c=this.getValue();var _8d=_8c.indexOf("?");if(_8d!=-1){_8c=_8c.substr(_8d+1);var _8e=_8c.split("&");var p,i=_8e.length;while(i--){p=_8e[i].split("=");if(p[0]==_8b){return p[1];}}}return "";};this.getParameterNames=function(){var _91=this.getValue();var _92=_91.indexOf("?");var _93=[];if(_92!=-1){_91=_91.substr(_92+1);if(_91!=""&&_91.indexOf("=")!=-1){var _94=_91.split("&");var i=0;while(i<_94.length){_93.push(_94[i].split("=")[0]);i++;}}}return _93;};if(_37){for(var i=1;i<_45;i++){_4a.push("");}_4a.push(_4d());if(_33.isIE()&&_l.hash!=_4d()){_l.hash="#"+_53(_4d());}_55(document);var _qi=_42.indexOf("?");if(_42&&_qi>-1){var _98,_99=_42.substr(_qi+1).split("&");for(var i=0,p;p=_99[i];i++){_98=p.split("=");if(/^(history|html|strict)$/.test(_98[0])){_4c[_98[0]]=(isNaN(_98[1])?eval(_98[1]):(parseFloat(_98[1])>0));}if(/^tracker$/.test(_98[0])){_4c[_98[0]]=_98[1];}}}if(/file:\/\//.test(_l.href)){_4c.html=false;}var _ei=_42.indexOf(".js"),l;if(_42&&_ei>-1){while(_ei--){l=_42.substr(_ei,1);if(/(\/|\\)/.test(l)){break;}ID=l+ID;}}_5a.call(this);if(window==_t){_34.addListener(document,"DOMContentLoaded",_35.bind(_6c,this));}_34.addListener(_t,"load",_35.bind(_6c,this));_34.addListener(_t,"unload",_35.bind(_6e,this));}else{_63();}};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 _9e="undefined",_t=top,_l=_t.location,_a1=this,_a2=[],_a3=[],_a4=[],_a5={},_a6=asual.util,_a7=asual.util.Functions,_a8=asual.swfaddress.WEBAddress;for(var p in _a8){this[p]=_a8[p];}var _aa=function(_ab){this.dispatchEvent(new SWFAddressEvent(_ab));_ab=_ab.substr(0,1).toUpperCase()+_ab.substr(1);if(typeof this["on"+_ab]=="function"){this["on"+_ab]();}};var _ac=function(e){if(_a3.length>0){var _ae=window.open(_a3[0],_a3[1],eval(_a3[2]));if(typeof _a3[3]!=_9e){eval(_a3[3]);}}_a3=[];};var _af=function(){if(_a6.Browser.isSafari()){document.body.addEventListener("click",_ac);}_aa.call(this,"init");};var _b0=function(){_b1();_aa.call(this,"change");};var _b1=function(){for(var i=0,id,obj,_b5=SWFAddress.getValue(),_b6="setSWFAddressValue";id=_a2[i];i++){obj=document.getElementById(id);if(obj){if(obj.parentNode&&typeof obj.parentNode.so!=_9e){obj.parentNode.so.call(_b6,_b5);}else{if(!(obj&&typeof obj[_b6]!=_9e)){var _b7=obj.getElementsByTagName("object");var _b8=obj.getElementsByTagName("embed");obj=((_b7[0]&&typeof _b7[0][_b6]!=_9e)?_b7[0]:((_b8[0]&&typeof _b8[0][_b6]!=_9e)?_b8[0]:null));}if(obj){obj[_b6](decodeURIComponent(_b5));}}}else{if(obj=document[id]){if(typeof obj[_b6]!=_9e){obj[_b6](_b5);}}}}};var _b9=function(_ba,_bb,_bc,_bd){if(typeof _a4[_bc]!=_9e){clearTimeout(_a4[_bc]);}if(_a2.length!=0&&_a6.Browser.isFirefox()&&/Mac/.test(navigator.userAgent)){_a4[_bc]=setTimeout(function(){_a8[_ba].call(SWFAddress,_bb);delete _a4[_bc];},_bd);}else{_a8[_ba].call(this,_bb);}};this.toString=function(){return "[class SWFAddress]";};this.addEventListener=function(_be,_bf){if(typeof _a5[_be]==_9e){_a5[_be]=[];}_a5[_be].push(_bf);};this.removeEventListener=function(_c0,_c1){if(typeof _a5[_c0]!=_9e){for(var i=0,l;l=_a5[_c0][i];i++){if(l==_c1){break;}}_a5[_c0].splice(i,1);}};this.dispatchEvent=function(_c4){if(typeof _a5[_c4.type]!=_9e&&_a5[_c4.type].length){_c4.target=this;for(var i=0,l;l=_a5[_c4.type][i];i++){l(_c4);}return true;}return false;};this.hasEventListener=function(_c7){return (typeof _a5[_c7]!=_9e&&_a5[_c7].length>0);};this.href=function(url,_c9){_c9=typeof _c9!=_9e?_c9:"_self";if(_c9=="_self"){self.location.href=url;}else{if(_c9=="_top"){_l.href=url;}else{if(_c9=="_blank"){window.open(url);}else{_t.frames[_c9].location.href=url;}}}};this.popup=function(url,_cb,_cc,_cd){try{var _ce=window.open(url,_cb,eval(_cc));if(typeof _cd!=_9e){eval(_cd);}}catch(ex){}_a3=arguments;};this.getIds=function(){return _a2;};this.getId=function(_cf){return _a2[0];};this.setId=function(id){_a2[0]=id;};this.addId=function(id){this.removeId(id);_a2.push(id);};this.removeId=function(id){for(var i=0;i<_a2.length;i++){if(id==_a2[i]){_a2.splice(i,1);break;}}};this.setValue=function(_d4){_b9("setValue",_d4,0,500);};this.setTitle=function(_d5){_b9("setTitle",_d5,1,typeof _a4[0]!=_9e?700:0);};_a8.addEventListener("init",_a7.bind(_af,this));_a8.addEventListener("change",_a7.bind(_b0,this));(function(){var _d6;if(typeof FlashObject!=_9e){SWFObject=FlashObject;}if(typeof SWFObject!=_9e&&SWFObject.prototype&&SWFObject.prototype.write){var _s1=SWFObject.prototype.write;SWFObject.prototype.write=function(){_d6=arguments;if(this.getAttribute("version").major<8){this.addVariable("$swfaddress",SWFAddress.getValue());((typeof _d6[0]=="string")?document.getElementById(_d6[0]):_d6[0]).so=this;}var _d8;if(_d8=_s1.apply(this,_d6)){_a1.addId(this.getAttribute("id"));}return _d8;};}if(typeof swfobject!=_9e){var _d9=swfobject.registerObject;swfobject.registerObject=function(){_d6=arguments;_d9.apply(this,_d6);_a1.addId(_d6[0]);};var _da=swfobject.createSWF;swfobject.createSWF=function(){_d6=arguments;_da.apply(this,_d6);_a1.addId(_d6[0].id);};var _db=swfobject.embedSWF;swfobject.embedSWF=function(){_d6=arguments;_db.apply(this,_d6);_a1.addId(_d6[8].id);};}if(typeof UFO!=_9e){var _u=UFO.create;UFO.create=function(){_d6=arguments;_u.apply(this,_d6);_a1.addId(_d6[0].id);};}if(typeof AC_FL_RunContent!=_9e){var _a=AC_FL_RunContent;AC_FL_RunContent=function(){_d6=arguments;_a.apply(this,_d6);for(var i=0,l=_d6.length;i<l;i++){if(_d6[i]=="id"){_a1.addId(_d6[i+1]);}}};}})();};
