/** * SWFAddress 2.2: 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 com=="undefined"){var com={}}if(typeof com.asual=="undefined"){com.asual={}}if(typeof com.asual.util=="undefined"){com.asual.util={}}com.asual.util.Browser=new function(){var J=-1;var I=navigator.userAgent;var H=false,F=false,E=false,D=false,C=false,B=false,A=false;var G=function(L,K){return parseFloat(I.substr(I.indexOf(L)+K))};if(H=/MSIE/.test(I)){J=G("MSIE",4)}if(E=/AppleWebKit/.test(I)){J=G("Safari",7)}if(D=/Opera/.test(I)){J=parseFloat(navigator.appVersion)}if(F=/Camino/.test(I)){J=G("Camino",7)}if(C=/Firefox/.test(I)){J=G("Firefox",8)}if(B=/Netscape/.test(I)){J=G("Netscape",9)}if(A=/Mozilla/.test(I)&&/rv:/.test(I)){J=G("rv:",3)}this.getVersion=function(){return J};this.isIE=function(){return H};this.isSafari=function(){return E};this.isOpera=function(){return D};this.isCamino=function(){return F};this.isFirefox=function(){return C};this.isNetscape=function(){return B};this.isMozilla=function(){return A}};com.asual.util.Events=new function(){var B=[],A=com.asual.util.Browser;var F="DOMContentLoaded",E="onstop";if(A.isIE()||A.isSafari()){(function(){try{if((A.isIE()&&document.body.appendChild)||!/loaded|complete/.test(document.readyState)){document.documentElement.doScroll("left")}}catch(H){return setTimeout(arguments.callee,0)}for(var G=0,H;H=B[G];G++){if(H.t==F){H.l.call(null)}}})()}this.addListener=function(I,H,G){B.push({o:I,t:H,l:G});if(!(H==F&&(A.isIE()||A.isSafari()))){if(I.addEventListener){I.addEventListener(H,G,false)}else{if(I.attachEvent){I.attachEvent("on"+H,G)}}}};this.removeListener=function(K,H,G){for(var I=0,J;J=B[I];I++){if(J.o==K&&J.t==H&&J.l==G){B.splice(I,1);break}}if(!(H==F&&(A.isIE()||A.isSafari()))){if(K.removeEventListener){K.removeEventListener(H,G,false)}else{if(K.detachEvent){K.detachEvent("on"+H,G)}}}};var D=function(){if(document.readyState=="interactive"){function G(){document.detachEvent(E,G);_unload()}document.attachEvent(E,G);window.setTimeout(function(){document.detachEvent(E,G)},0)}};if(A.isIE()){window.attachEvent("onbeforeunload",D)}var C=function(){for(var H=0,G;G=B[H];H++){if(G.t!=F){com.asual.util.Events.removeListener(G.o,G.t,G.l)}}};this.addListener(window,"unload",C)};SWFAddressEvent=function(A){this.toString=function(){return"[object SWFAddressEvent]"};this.type=A;this.target=[SWFAddress][0];this.value=SWFAddress.getValue();this.path=SWFAddress.getPath();this.pathNames=SWFAddress.getPathNames();this.parameters={};var C=SWFAddress.getParameterNames();for(var D=0,B=C.length;D<B;D++){this.parameters[C[D]]=SWFAddress.getParameter(C[D])}this.parametersNames=C};SWFAddressEvent.INIT="init";SWFAddressEvent.CHANGE="change";SWFAddress=new function(){var _23=com.asual.util.Browser;var _24=com.asual.util.Events;var _25=_23.getVersion();var _26=false;if(_23.isIE()){_26=_25>=6}if(_23.isSafari()){_26=_25>=312}if(_23.isOpera()){_26=_25>=9.02}if(_23.isCamino()){_26=_25>=1}if(_23.isFirefox()){_26=_25>=1}if(_23.isNetscape()){_26=_25>=8}if(_23.isMozilla()){_26=_25>=1.8}var _t=top,_d=_t.document,_h=_t.history,_l=_t.location,_st=setTimeout,_dc=decodeURIComponent,_ec=encodeURIComponent;var _2e,_2f,_30,_31=_d.title,_32=_h.length,_33=false,_34=false;var _35=[],_36=[],_37={},_38={history:true,html:false,strict:true,tracker:"_trackDefault"};var _39="function",_3a="undefined",_3b="swfaddress";if((!_26&&_l.href.indexOf("#")!=-1)||(_23.isSafari()&&_25<412&&_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 _3c=function(){var _3d=_l.href.indexOf("#");return(_3d!=-1)?_l.href.substr(_3d+1):""};var _3e=_3c();var _3f=function(_40,_41){if(_38.strict){_40=_41?(_40.substr(0,1)!="/"?"/"+_40:_40):(_40==""?"/":_40)}return _40};var _42=function(_43){return(_23.isIE()&&_l.protocol=="file:")?_3e.replace(/\?/,"%3F"):_43};var _44=function(el){if(el.src&&/swfaddress\.js(\?.*)?$/.test(el.src)){return el}for(var i=0,l=el.childNodes.length,s;i<l;i++){if(s=_44(el.childNodes[i])){return s}}};var _49=function(){if(_23.isIE()&&_d.title!=_31){SWFAddress.setTitle(_31)}};var _4a=function(){if(!_33){var _4b=_3c();if(_23.isIE()){if(_3e!=_4b){if(_25<7){_l.reload()}else{SWFAddress.setValue(_4b)}}}else{if(_23.isSafari()&&_25<523){if(_32!=_h.length){_32=_h.length;if(typeof _35[_32-1]!=_3a){_3e=_35[_32-1]}_4c()}}else{if(_3e!=_4b){_3e=_4b;_4c()}}}_49()}};var _4d=function(_4e){if(SWFAddress.hasEventListener(_4e)){SWFAddress.dispatchEvent(new SWFAddressEvent(_4e))}_4e=_4e.substr(0,1).toUpperCase()+_4e.substr(1);if(typeof SWFAddress["on"+_4e]==_39){SWFAddress["on"+_4e]()}};var _4f=function(){_4d("init")};var _50=function(){_4d("change")};var _51=function(){for(var i=0,id,_54=SWFAddress.getValue(),_55="setSWFAddressValue";id=_36[i];i++){var obj=document.getElementById(id);if(obj){if(obj.parentNode&&typeof obj.parentNode.so!=_3a){obj.parentNode.so.call(_55,_54)}else{if(!(obj&&typeof obj[_55]!=_3a)){var _57=obj.getElementsByTagName("object");var _58=obj.getElementsByTagName("embed");obj=((_57[0]&&typeof _57[0][_55]!=_3a)?_57[0]:((_58[0]&&typeof _58[0][_55]!=_3a)?_58[0]:null))}if(obj){obj[_55](_54)}}}else{if(obj=document[id]){if(typeof obj[_55]!=_3a){obj[_55](_54)}}}}};var _4c=function(){_51();_50();_st(_59,10)};var _5a=function(_5b){if(typeof urchinTracker==_39){urchinTracker(_5b)}if(typeof pageTracker!=_3a&&typeof pageTracker._trackPageview==_39){pageTracker._trackPageview(_5b)}};eval("var _trackDefault = "+_5a+";");var _59=function(){if(typeof _38.tracker!=_3a&&eval("typeof "+_38.tracker+' != "'+_3a+'"')){var fn=eval(_38.tracker);if(typeof fn==_39){fn((_l.pathname+(/\/$/.test(_l.pathname)?"":"/")+SWFAddress.getValue()).replace(/\/\//,"/").replace(/^\/$/,""))}}};var _5d=function(){var doc=_2e.contentWindow.document;doc.open();doc.write("<script>var "+_3b+' = "'+_ec(_3c())+'";<\/script>');doc.close()};var _5f=function(){var win=_2e.contentWindow;if(_38.html){var src=win.location.href;_3e=(src.indexOf("?")>-1)?_dc(src.substr(src.indexOf("?")+1)):""}else{_3e=(typeof win[_3b]!=_3a)?_dc(win[_3b]):""}win.document.title=_d.title;if(_3e!=_3c()){_4c();_l.hash=_42(_3e)}};var _62=function(){if(!_34){_34=true;var _63='id="'+_3b+'" style="position:absolute;top:-9999px;"';if(_23.isIE()){document.body.appendChild(document.createElement("div")).innerHTML="<iframe "+_63+' src="'+(_38.html?_30.replace(/\.js(\?.*)?$/,".html")+"?"+_ec(_3c()):"javascript:false;")+'" width="0" height="0"></iframe>';_2e=document.getElementById(_3b);_st(function(){_24.addListener(_2e,"load",_5f);if(!_38.html&&typeof _2e.contentWindow[_3b]==_3a){_5d()}},10)}else{if(_23.isSafari()){if(_25<412){document.body.innerHTML+="<form "+_63+' method="get"></form>';_2f=document.getElementById(_3b)}if(typeof _l[_3b]==_3a){_l[_3b]={}}if(typeof _l[_3b][_l.pathname]!=_3a){_35=_l[_3b][_l.pathname].split(",")}}else{if(_23.isOpera()&&_36.length==0&&typeof navigator.plugins["Shockwave Flash"]=="object"){document.body.innerHTML+="<embed "+_63+' src="'+_30.replace(/\.js(\?.*)?$/,".swf")+'" type="application/x-shockwave-flash" />'}}}_st(_4f,1);_st(_50,2);_st(_59,10);setInterval(_4a,50)}};this.onInit=null;this.onChange=null;this.toString=function(){return"[class SWFAddress]"};this.back=function(){_h.back()};this.forward=function(){_h.forward()};this.go=function(_64){_h.go(_64)};this.href=function(url,_66){_66=(typeof _66!=_3a)?_66:"_self";if(_66=="_self"){self.location.href=url}if(_66=="_top"){_l.href=url}if(_66=="_blank"){window.open(url)}else{_t.frames[_66].location.href=url}};this.popup=function(url,_68,_69,_6a){var _6b=window.open(url,_68,eval(_69));eval(_6a)};this.addEventListener=function(_6c,_6d){if(typeof _37[_6c]==_3a){_37[_6c]=[]}_37[_6c].push(_6d)};this.removeEventListener=function(_6e,_6f){if(typeof _37[_6e]!=_3a){for(var i=0,l;l=_37[_6e][i];i++){if(l==_6f){break}}_37[_6e].splice(i,1)}};this.dispatchEvent=function(_72){if(typeof _37[_72.type]!=_3a&&_37[_72.type].length){_72.target=this;for(var i=0,l;l=_37[_72.type][i];i++){l(_72)}return true}return false};this.hasEventListener=function(_75){return(typeof _37[_75]!=_3a&&_37[_75].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 _38.strict};this.setStrict=function(_77){_38.strict=_77};this.getHistory=function(){return _38.history};this.setHistory=function(_78){_38.history=_78};this.getTracker=function(){return _38.tracker};this.setTracker=function(_79){_38.tracker=_79};this.getIds=function(){return _36};this.getId=function(_7a){return _36[0]};this.setId=function(id){_36[0]=id};this.addId=function(id){this.removeId(id);_36.push(id)};this.removeId=function(id){for(var i=0;i<_36.length;i++){if(id==_36[i]){_36.splice(i,1);break}}};this.getTitle=function(){return _d.title};this.setTitle=function(_7f){if(!_26){return null}if(typeof _7f==_3a){return }if(_7f=="null"){_7f=""}_31=_d.title=_7f;_st(function(){if(_2e&&_2e.contentWindow&&_2e.contentWindow.document&&_2e.contentWindow.title){_2e.contentWindow.document.title=_31}},1000)};this.getStatus=function(){return _t.status};this.setStatus=function(_80){if(!_26){return null}if(typeof _80==_3a){return }if(!_23.isSafari()){_80=_3f((_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(!_26){return null}return _3f(_3e,false)};this.setValue=function(_82){if(!_26){return null}if(typeof _82==_3a){return }if(_82=="null"){_82=""}_82=_3f(_82,true);if(_82=="/"){_82=""}if(_3e==_82){return }_3e=_82;_33=true;_4c();_35[_h.length]=_3e;if(_23.isSafari()){if(_38.history){_l[_3b][_l.pathname]=_35.toString();_32=_h.length+1;if(_25<412){if(_l.search==""){_2f.action="#"+_3e;_2f.submit()}}else{if(_25<523||_3e==""){var evt=document.createEvent("MouseEvents");evt.initEvent("click",true,true);var _84=document.createElement("a");_84.href="#"+_3e;_84.dispatchEvent(evt)}else{_l.hash="#"+_3e}}}else{_l.replace("#"+_3e)}}else{if(_3e!=_3c()){if(_38.history){_l.hash="#"+_42(_3e)}else{_l.replace("#"+_3e)}}}if(_23.isIE()&&_38.history){if(_38.html){var loc=_2e.contentWindow.location;loc.assign(loc.pathname+"?"+_3c())}else{_5d()}}if(_23.isSafari()){_st(function(){_33=false},1)}else{_33=false}};this.getPath=function(){var _86=this.getValue();return(_86.indexOf("?")!=-1)?_86.split("?")[0]:_86};this.getPathNames=function(){var _87=SWFAddress.getPath();var _88=_87.split("/");if(_87.substr(0,1)=="/"){_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(_26){for(var i=1;i<_32;i++){_35.push("")}_35.push(_3c());if(_23.isIE()&&_l.hash!=_3c()){_l.hash="#"+_42(_3c())}try{_30=String(_44(document).src);var qi=_30.indexOf("?");if(_30&&qi>-1){var _98,_99=_30.substr(qi+1).split("&");for(var i=0,p;p=_99[i];i++){_98=p.split("=");if(/^(history|html|strict)$/.test(_98[0])){_38[_98[0]]=(isNaN(_98[1])?eval(_98[1]):(parseFloat(_98[1])>0))}if(/^tracker$/.test(_98[0])){_38[_98[0]]=_98[1]}}}}catch(e){}if(/file:\/\//.test(_l.href)){_38.html=false}_49();_24.addListener(document,"DOMContentLoaded",_62);_24.addListener(window,"load",_62)}else{_59()}};new function(){var C,B;var A="undefined";if(typeof swfobject!=A){SWFObject=swfobject}if(typeof FlashObject!=A){SWFObject=FlashObject}if(typeof SWFObject!=A){if(SWFObject.prototype&&SWFObject.prototype.write){C=SWFObject.prototype.write;SWFObject.prototype.write=function(){B=arguments;if(this.getAttribute("version").major<8){this.addVariable("$swfaddress",SWFAddress.getValue());((typeof B[0]=="string")?document.getElementById(B[0]):B[0]).so=this}var D;if(D=C.apply(this,B)){SWFAddress.addId(this.getAttribute("id"))}return D}}else{C=SWFObject.registerObject;SWFObject.registerObject=function(){B=arguments;C.apply(this,B);SWFAddress.addId(B[0])};C=SWFObject.createSWF;SWFObject.createSWF=function(){B=arguments;C.apply(this,B);SWFAddress.addId(B[0].id)};C=SWFObject.embedSWF;SWFObject.embedSWF=function(){B=arguments;C.apply(this,B);SWFAddress.addId(B[8].id)}}}if(typeof UFO!=A){C=UFO.create;UFO.create=function(){B=arguments;C.apply(this,B);SWFAddress.addId(B[0].id)}}if(typeof AC_FL_RunContent!=A){C=AC_FL_RunContent;AC_FL_RunContent=function(){B=arguments;C.apply(this,B);for(var E=0,D=B.length;E<D;E++){if(B[E]=="id"){SWFAddress.addId(B[E+1])}}}}};