/** * SWFAddress v1.2: Deep linking for Flash - 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 asual=="undefined"){var asual=new Object();}if(typeof asual.util=="undefined"){asual.util=new Object();}asual.util.Browser=new function(){var _1=navigator.userAgent;this.supported=false;this.ie=false;this.gecko=false;this.safari=false;this.opera=false;this.version=-1;if(/MSIE/.test(_1)){this.ie=true;this.version=parseFloat(_1.substring(_1.indexOf("MSIE")+4));this.supported=this.version>=6;}else{if(/AppleWebKit/.test(_1)){this.safari=true;this.version=parseFloat(_1.substring(_1.indexOf("Safari")+7));this.supported=this.version>=312;}else{if(/Opera/.test(_1)){this.opera=true;this.version=parseFloat(navigator.appVersion);this.supported=this.version>=9.02;}else{if(/Firefox/.test(_1)){this.gecko=true;this.version=parseFloat(_1.substring(_1.indexOf("Firefox")+8));this.supported=this.version>=1;}else{if(/Camino/.test(_1)){this.gecko=true;this.version=parseFloat(_1.substring(_1.indexOf("Camino")+7));this.supported=this.version>=1;}else{if(/Netscape/.test(_1)){this.gecko=true;this.version=parseFloat(_1.substring(_1.indexOf("Netscape")+9));this.supported=this.version>=8;}else{if(/Mozilla/.test(_1)&&/rv:/.test(_1)){this.gecko=true;this.version=parseFloat(_1.substring(_1.indexOf("rv:")+3));this.supported=this.version>=1.8;}}}}}}}};asual.util.Functions=new function(){this.extend=function(_2,_3){function inheritance(){}inheritance.prototype=_2.prototype;_3.prototype=new inheritance();_3.prototype.constructor=_3;_3.superConstructor=_2;_3.superClass=_2.prototype;return _3;};this.bindAsListener=function(_4,_5,_6){return function(_7){return _4.call(_5,_7||((_6)?_6.event:window.event));};};};asual.util.Events=new function(){var _8=new Array();this.addListener=function(_9,_a,_b){if(_9.addEventListener){_9.addEventListener(_a,_b,false);}else{if(_9.attachEvent){_9.attachEvent("on"+_a,_b);}else{_9["on"+_a]=_b;}}_8.push({o:_9,t:_a,l:_b});};this.removeListener=function(_c,_d,_e){if(_c.removeEventListener){_c.removeEventListener(_d,_e,false);}else{if(_c.detachEvent){_c.detachEvent("on"+_d,_e);}else{_c["on"+_d]=_e;}}};var _f=function(){for(var i=0,evt;evt=_8[i];i++){asual.util.Events.removeListener(evt.o,evt.t,evt.l);}};if(asual.util.Browser.ie||asual.util.Browser.safari){this.addListener(window,"unload",asual.util.Functions.bindAsListener(_f,this));}};asual.SWFAddress=new function(){var _12=asual.util.Browser;var _13,_14,_15=_12.supported;var _16,_17,_18=false;var _19=document.title;var _1a=history.length;var _1b=new Array();var _1c=window;var _1d=new Object();var _1e=true;var _1b=true;var js="swfaddress.js";var _20="swfaddress.html";var _21=function(){var _22=_1c.location.href.indexOf("#");if(_22!=-1){return _1c.location.href.substring(_22);}return "";};var _23=_21();var _24=function(){if(_12.ie&&_1c.document.title!=_19){asual.SWFAddress.setTitle(_19);}};var _25=function(){if(_12.safari){if(_1a!=history.length&&!_18){_1a=history.length;if(typeof _1b[_1a-1]!="undefined"){_23=_1b[_1a-1];}_26();}}else{if(_12.ie){if(_23!=_21()){if(_12.version<7){_1c.location.reload();}else{_27(_21().replace(/^#/g,""),false);}}}else{if(_23!=_1c.location.hash){_23=_21();_26();}}}_24();};var _26=function(){var _28=_23.replace(/^#/g,"");if(_28!=_16){_16=_28;var obj=document[_17]||document.getElementById(_17);if(obj&&obj.setSWFAddressValue){obj.setSWFAddressValue(_28);}if(typeof SWFAddress.onChange=="function"){SWFAddress.onChange();}}};var _2a=function(){if(_1e&&typeof urchinTracker!="undefined"){var _2b=_1c.location.pathname+this.getValue();_2b=_2b.replace(/\/\//,"/");_2b=_2b.replace(/^\/$/,"");urchinTracker(_2b);}};var _2c=function(){if(_13.contentWindow&&_13.contentWindow.location){var win=_13.contentWindow;win.document.title=_1c.document.title=_19;var src=win.location.href;if(src.indexOf("?")>-1){_23="#"+src.substring(src.indexOf("?")+1);}else{_23="#";}if(_23!=_21()){_26();_1c.location.hash=_23;}}};var _2f=function(){if(_12.ie||_12.safari){var _30=document.createElement("div");_30.id="swfaddress";var _31=document.getElementsByTagName("script");for(var i=0,s;s=_31[i];i++){if(s.src.indexOf(js)>-1){_20=(new String(s.src)).replace(js,_20);}}_30.innerHTML="<iframe id=\"swfaddress-iframe\" src=\""+_20+_21().replace(/^#/g,"?")+"\" frameborder=\"no\" scrolling=\"no\"></iframe>";document.body.appendChild(_30);_30.style.position="absolute";_30.style.left=_30.style.top="-9999px";_13=_30.getElementsByTagName("iframe")[0];}if(_12.ie){asual.util.Events.addListener(_13,"load",asual.util.Functions.bindAsListener(_2c,this));}if(_12.safari){_14=document.createElement("form");_14.id="swfaddress-form";_14.method="get";_30.appendChild(_14);if(typeof _1c.location.swfaddress=="undefined"){_1c.location.swfaddress=new Object();}if(typeof _1c.location.swfaddress.history!="undefined"){_1b=_1c.location.swfaddress.history.split(",");}}_2a.call(this);_26.call(this);setTimeout(function(){if(typeof SWFAddress.onChange=="function"){SWFAddress.onChange();}},1);setInterval(_25,50);};var _27=function(_34,_35){if(!_15){return null;}if(_34=="null"){_34="";}if(_16==_34){return;}_23="#"+_34;if(_35){_16=_34;_26();}else{_26();_16=_34;}if(_12.safari){if(_1b){_1b[history.length]=_23;_1c.location.swfaddress.history=_1b.toString();_18=true;_1a=history.length+1;if(_12.version<412){if(_1c.location.search==""){_14.action=_23;_14.submit();}}else{var evt=document.createEvent("MouseEvents");evt.initEvent("click",true,true);var _37=document.createElement("a");_37.href=_23;_37.dispatchEvent(evt);}_18=false;}else{_1c.location.hash=_23;}}else{if(_35){if(_1b){_1c.location.hash=_23;}else{location.replace(_23);}}}if(_12.ie&&_1b){var win=_13.contentWindow;var _39="?"+_21().substring(_23.indexOf("#")+1);win.location.assign(win.location.pathname+_39);}_2a.call(this);if(typeof SWFAddress.onChange=="function"){SWFAddress.onChange();}};var _3a=function(){if((!_15&&_1c.location.href.indexOf("#")!=-1)||(_12.safari&&_12.version<412&&_1c.location.href.indexOf("#")!=-1&&_1c.location.search!="")){_1c.document.open();_1c.document.write("<html><head><meta http-equiv=\"refresh\" content=\"0;url="+_1c.location.href.substr(0,_1c.location.href.indexOf("#"))+"\" /></head></html>");_1c.document.close();}};var _3b="    /**";var _3b="     * Loads the previous URL in the history list.";var _3b="     */";this.back=function(){history.back();};var _3b="    /**";var _3b="     * Loads the next URL in the history list.";var _3b="     */    ";this.forward=function(){history.forward();};var _3b="    /**";var _3b="     * Loads a URL from the history list.";var _3b="     * @param {Number} delta An integer representing a relative position in the history list";var _3b="     */    ";this.go=function(_3c){history.go(_3c);};var _3b="    /**";var _3b="     * Registers an event listener.";var _3b="     * @param {String} type Event type";var _3b="     * @param {Function} listener Event listener";var _3b="     */ ";this.addEventListener=function(_3d,_3e){if(typeof _1d[_3d]=="undefined"){_1d[_3d]=new Array();}_1d[_3d].push(_3e);};var _3b="    /**";var _3b="     * Removes an event listener. ";var _3b="     * @param {String} type Event type";var _3b="     * @param {Function} listener Event listener";var _3b="     */     ";this.removeEventListener=function(_3f,_40){if(typeof _1d[_3f]!="undefined"){for(var i=0,l;l=_1d[_3f][i];i++){if(l==_40){break;}}_1d[_3f].splice(i,1);}};var _3b="    /**";var _3b="     * Dispatches an event to all the available listeners. ";var _3b="     * @param {Object} event Event object";var _3b="     */       ";this.dispatchEvent=function(_43){if(typeof _1d[_43.type]!="undefined"){_43.target=this;for(var i=0,l;l=_1d[_43.type][i];i++){l(evt);}}};var _3b="    /**";var _3b="     * Checks the existance of any listeners registered for a specific type of event. ";var _3b="     * @param {String} event Event type";var _3b="     * @type Array";var _3b="     */     ";this.hasEventListener=function(_46){if(typeof _1d[_46]!="undefined"){return Objects.clone(this._listeners[_46],false);}};this.getHistoryEnabled=function(){return _1b;};this.setHistoryEnabled=function(_47){_1b=_47;};this.getTrackingEnabled=function(){return _1e;};this.setTrackingEnabled=function(_48){_1e=_48;};this.getWindow=function(){return _1c;};this.setWindow=function(win){var _4a=(win.location)?win:eval(win);if(_4a!=_1c){_1c=_4a;_3a();}};var _3b="    /**";var _3b="     * Opens a new URL in the browser. ";var _3b="     * @param {String} url The resource to be opened";var _3b="     * @param {String} target Target window";var _3b="     */";this.openLink=function(url,_4c){switch(_4c){case "_blank":window.open(url);break;case "_self":self.location=url;break;case "_top":top.location=url;break;default:self.location=url;break;}};var _3b="    /**";var _3b="     * Opens a browser popup window. ";var _3b="     * @param {String} url The resource to be opened";var _3b="     * @param {String} name The name of the popup window";var _3b="     * @param {String} options Popup window options in a format compatible window.open()";var _3b="     * @param {String} handler Optional handler function for window manipulation     ";var _3b="     */";this.openPopup=function(url,_4e,_4f,_50){var w=window.open(url,_4e,_4f);};this.getId=function(){if(!_15){return null;}return _17;};this.setId=function(id){if(!_15){return null;}_17=id;};this.getTitle=function(){if(!_15){return null;}return _1c.document.title;};this.setTitle=function(_53){if(!_15){return null;}if(_53=="null"){_53="";}if(typeof _53!="undefined"){_19=_53;_1c.document.title=_19;}};this.getStatus=function(){if(!_15){return null;}return _1c.status;};this.setStatus=function(_54){if(!_15){return null;}if(!_12.safari){if(_54=="null"||typeof _54=="undefined"){_54="";}var _55=_1c.location.href.indexOf("#");if(_55==-1){_54=_1c.location.href+"#"+_54;}else{_54=_1c.location.href.substr(0,_55)+"#"+_54;}_1c.status=_54;}};this.resetStatus=function(){_1c.status="";};this.getValue=function(){if(!_15){return null;}var _56=_23.replace(/^#/g,"");return _56;};this.setValue=function(_57){_27(_57,true);};this.getPath=function(){var _58=this.getValue();if(_58.indexOf("?")!=1){return _58.split("?")[0];}else{return _58;}};this.getQueryString=function(){var _59=this.getValue();var _5a=_59.indexOf("?");if(_5a!=-1&&_5a<_59.length){return _59.substr(_5a+1);}return "";};this.getParameter=function(_5b){var _5c=this.getValue();var _5d=_5c.indexOf("?");if(_5d!=-1){_5c=_5c.substr(_5d+1);var _5e=_5c.split("&");var p,i=_5e.length;while(i--){p=_5e[i].split("=");if(p[0]==_5b){return p[1];}}}return "";};_3a();if(!_15){return;}if(_12.safari){for(var i=1;i<_1a;i++){_1b.push("");}_1b.push(_1c.location.hash);}if(_12.ie){if(_23==""){_23=_1c.location.hash="#";}else{if(_1c.location.hash!=_21()){_1c.location.hash=_21();}}}_16=this.getValue();_24();asual.util.Events.addListener(window,"load",asual.util.Functions.bindAsListener(_2f,this));};if(typeof deconcept!="undefined"&&deconcept.SWFObject){asual.SWFAddressObject=asual.util.Functions.extend(deconcept.SWFObject,function(swf,id,w,h,ver,c,_68,_69,_6a,_6b){asual.SWFAddressObject.superConstructor.apply(this,arguments);asual.SWFAddress.setId(id);});SWFObject=deconcept.SWFObject=asual.SWFAddressObject;}SWFAddress=asual.SWFAddress;