/** * SWFAddress 2.1: Deep linking for Flash and Ajax - http://www.asual.com/swfaddress/ * * SWFAddress is (c) 2006-2007 Rostislav Hristov and 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;var _2c,_2d,_2e,_2f=_d.title,_30=_h.length,_31=false,_32=false;var _33=[],_34=[],_35={},_36={history:true,html:false,strict:true,tracker:"_trackDefault"};var _37="function",_38="undefined",_39="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 _3a=function(){var _3b=_l.href.indexOf("#");if(_3b!=-1){var _3c=unescape(_l.href.substr(_3b+1));if(/^[a-z0-9 ,=_&\-\.\:\;\?\+\(\)\/]*$/i.test(_3c)){return _3c}else{_l.replace(_l.href.substr(0,_3b))}}return""};var _3d=_3a();var _3e=function(_3f,_40){if(_36.strict){_3f=_40?(_3f.substr(0,1)!="/"?"/"+_3f:_3f):(_3f==""?"/":_3f)}return _3f};var _41=function(_42){return(_23.isIE()&&_l.protocol=="file:")?_3d.replace(/\?/,"%3F"):_42};var _43=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=_43(el.childNodes[i])){return s}}};var _48=function(){if(_23.isIE()&&_d.title!=_2f){SWFAddress.setTitle(_2f)}};var _49=function(){if(!_31){var _4a=_3a();if(_23.isIE()){if(_3d!=_4a){if(_25<7){_l.reload()}else{SWFAddress.setValue(_4a)}}}else{if(_23.isSafari()&&_25<523){if(_30!=_h.length){_30=_h.length;if(typeof _33[_30-1]!=_38){_3d=_33[_30-1]}_4b()}}else{if(_3d!=_4a){_3d=_4a;_4b()}}}_48()}};var _4c=function(_4d){if(SWFAddress.hasEventListener(_4d)){SWFAddress.dispatchEvent(new SWFAddressEvent(_4d))}_4d=_4d.substr(0,1).toUpperCase()+_4d.substr(1);if(typeof SWFAddress["on"+_4d]==_37){SWFAddress["on"+_4d]()}};var _4e=function(){_4c("init")};var _4f=function(){_4c("change")};var _50=function(){for(var i=0,id,_53=SWFAddress.getValue(),_54="setSWFAddressValue";id=_34[i];i++){var obj=document.getElementById(id);if(obj){if(obj.parentNode&&typeof obj.parentNode.so!=_38){obj.parentNode.so.call(_54,_53)}else{if(!(obj&&typeof obj[_54]!=_38)){var _56=obj.getElementsByTagName("object");var _57=obj.getElementsByTagName("embed");obj=((_56[0]&&typeof _56[0][_54]!=_38)?_56[0]:((_57[0]&&typeof _57[0][_54]!=_38)?_57[0]:null))}if(obj){obj[_54](_53)}}}else{if(obj=document[id]){if(typeof obj[_54]!=_38){obj[_54](_53)}}}}};var _4b=function(){_50();_4f();_st(_58,10)};var _59=function(_5a){if(typeof urchinTracker==_37){urchinTracker(_5a)}if(typeof pageTracker!=_38&&typeof pageTracker._trackPageview==_37){pageTracker._trackPageview(_5a)}};eval("var _trackDefault = "+_59+";");var _58=function(){if(typeof _36.tracker!=_38&&eval("typeof "+_36.tracker+' != "'+_38+'"')){var fn=eval(_36.tracker);if(typeof fn==_37){fn((_l.pathname+(/\/$/.test(_l.pathname)?"":"/")+SWFAddress.getValue()).replace(/\/\//,"/").replace(/^\/$/,""))}}};var _5c=function(){var doc=_2c.contentWindow.document;doc.open();doc.write("<script>var "+_39+' = "'+_3a()+'";<\/script>');doc.close()};var _5e=function(){var win=_2c.contentWindow;if(_36.html){var src=win.location.href;_3d=(src.indexOf("?")>-1)?src.substr(src.indexOf("?")+1):""}else{_3d=(typeof win[_39]!=_38)?win[_39]:""}win.document.title=_d.title;if(_3d!=_3a()){_4b();_l.hash=_41(_3d)}};var _61=function(){if(!_32){_32=true;var _62='id="'+_39+'" style="position:absolute;top:-9999px;"';if(_23.isIE()){document.body.appendChild(document.createElement("div")).innerHTML="<iframe "+_62+' src="'+(_36.html?_2e.replace(/\.js(\?.*)?$/,".html")+"?"+_3a():"javascript:false;")+'" width="0" height="0"></iframe>';_2c=document.getElementById(_39);_st(function(){_24.addListener(_2c,"load",_5e);if(!_36.html&&typeof _2c.contentWindow[_39]==_38){_5c()}},10)}else{if(_23.isSafari()){if(_25<412){document.body.innerHTML+="<form "+_62+' method="get"></form>';_2d=document.getElementById(_39)}if(typeof _l[_39]==_38){_l[_39]={}}if(typeof _l[_39][_l.pathname]!=_38){_33=_l[_39][_l.pathname].split(",")}}else{if(_23.isOpera()&&_34.length==0&&typeof navigator.plugins["Shockwave Flash"]=="object"){document.body.innerHTML+="<embed "+_62+' src="'+_2e.replace(/\.js(\?.*)?$/,".swf")+'" type="application/x-shockwave-flash" />'}}}_st(_4e,1);_st(_4f,2);_st(_58,10);setInterval(_49,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(_63){_h.go(_63)};this.href=function(url,_65){_65=(typeof _65!=_38)?_65:"_self";if(_65=="_self"){self.location.href=url}if(_65=="_top"){_l.href=url}if(_65=="_blank"){window.open(url)}else{_t.frames[_65].location.href=url}};this.popup=function(url,_67,_68,_69){var _6a=window.open(url,_67,eval(_68));eval(_69)};this.addEventListener=function(_6b,_6c){if(typeof _35[_6b]==_38){_35[_6b]=[]}_35[_6b].push(_6c)};this.removeEventListener=function(_6d,_6e){if(typeof _35[_6d]!=_38){for(var i=0,l;l=_35[_6d][i];i++){if(l==_6e){break}}_35[_6d].splice(i,1)}};this.dispatchEvent=function(_71){if(typeof _35[_71.type]!=_38&&_35[_71.type].length){_71.target=this;for(var i=0,l;l=_35[_71.type][i];i++){l(_71)}return true}return false};this.hasEventListener=function(_74){return(typeof _35[_74]!=_38&&_35[_74].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 _36.strict};this.setStrict=function(_76){_36.strict=_76};this.getHistory=function(){return _36.history};this.setHistory=function(_77){_36.history=_77};this.getTracker=function(){return _36.tracker};this.setTracker=function(_78){_36.tracker=_78};this.getIds=function(){return _34};this.getId=function(_79){return _34[0]};this.setId=function(id){_34[0]=id};this.addId=function(id){this.removeId(id);_34.push(id)};this.removeId=function(id){for(var i=0;i<_34.length;i++){if(id==_34[i]){_34.splice(i,1);break}}};this.getTitle=function(){return _d.title};this.setTitle=function(_7e){if(!_26){return null}if(typeof _7e==_38){return }if(_7e=="null"){_7e=""}_2f=_d.title=_7e;_st(function(){if(_2c&&_2c.contentWindow&&_2c.contentWindow.document&&_2c.contentWindow.title){_2c.contentWindow.document.title=_2f}},1000)};this.getStatus=function(){return _t.status};this.setStatus=function(_7f){if(!_26){return null}if(typeof _7f==_38){return }if(!_23.isSafari()){_7f=_3e((_7f!="null")?_7f:"",true);if(_7f=="/"){_7f=""}if(!(/http(s)?:\/\//.test(_7f))){var _80=_l.href.indexOf("#");_7f=(_80==-1?_l.href:_l.href.substr(0,_80))+"#"+_7f}_t.status=_7f}};this.resetStatus=function(){_t.status=""};this.getValue=function(){if(!_26){return null}return _3e(_3d,false)};this.setValue=function(_81){if(!_26){return null}if(typeof _81==_38){return }if(_81=="null"){_81=""}_81=_3e(_81,true);if(_81=="/"){_81=""}if(_3d==_81){return }_3d=_81;_31=true;_4b();_33[_h.length]=_3d;if(_23.isSafari()){if(_36.history){_l[_39][_l.pathname]=_33.toString();_30=_h.length+1;if(_25<412){if(_l.search==""){_2d.action="#"+_3d;_2d.submit()}}else{if(_25<523){var evt=document.createEvent("MouseEvents");evt.initEvent("click",true,true);var _83=document.createElement("a");_83.href="#"+_3d;_83.dispatchEvent(evt)}else{_l.hash="#"+_3d}}}else{_l.replace("#"+_3d)}}else{if(_3d!=_3a()){if(_36.history){_l.hash="#"+_41(_3d)}else{_l.replace("#"+_3d)}}}if(_23.isIE()&&_36.history){if(_36.html){var loc=_2c.contentWindow.location;loc.assign(loc.pathname+"?"+_3a())}else{_5c()}}if(_23.isSafari()){_st(function(){_31=false},1)}else{_31=false}};this.getPath=function(){var _85=this.getValue();return(_85.indexOf("?")!=-1)?_85.split("?")[0]:_85};this.getPathNames=function(){var _86=SWFAddress.getPath();var _87=_86.split("/");if(_86.substr(0,1)=="/"){_87.splice(0,1)}if(_86.substr(_86.length-1,1)=="/"){_87.splice(_87.length-1,1)}return _87};this.getQueryString=function(){var _88=this.getValue();var _89=_88.indexOf("?");return(_89!=-1&&_89<_88.length)?_88.substr(_89+1):""};this.getParameter=function(_8a){var _8b=this.getValue();var _8c=_8b.indexOf("?");if(_8c!=-1){_8b=_8b.substr(_8c+1);var _8d=_8b.split("&");var p,i=_8d.length;while(i--){p=_8d[i].split("=");if(p[0]==_8a){return p[1]}}}return""};this.getParameterNames=function(){var _90=this.getValue();var _91=_90.indexOf("?");var _92=[];if(_91!=-1){_90=_90.substr(_91+1);if(_90!=""&&_90.indexOf("=")!=-1){var _93=_90.split("&");var i=0;while(i<_93.length){_92.push(_93[i].split("=")[0]);i++}}}return _92};if(_26){for(var i=1;i<_30;i++){_33.push("")}_33.push(_3a());if(_23.isIE()&&_l.hash!=_3a()){_l.hash="#"+_41(_3a())}try{_2e=String(_43(document).src);var qi=_2e.indexOf("?");if(_2e&&qi>-1){var _97,_98=_2e.substr(qi+1).split("&");for(var i=0,p;p=_98[i];i++){_97=p.split("=");if(/^(history|html|strict)$/.test(_97[0])){_36[_97[0]]=(isNaN(_97[1])?eval(_97[1]):(parseFloat(_97[1])>0))}if(/^tracker$/.test(_97[0])){_36[_97[0]]=_97[1]}}}}catch(e){}if(/file:\/\//.test(_l.href)){_36.html=false}_48();_24.addListener(document,"DOMContentLoaded",_61);_24.addListener(window,"load",_61)}else{_58()}};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])}}}}};
