/** * 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;}}}}}}}if((!this.supported&&top.location.href.indexOf("#")!=-1)||(this.safari&&this.version<412&&top.location.href.indexOf("#")!=-1&&top.location.search!="")){document.open();document.write("<html><head><meta http-equiv=\"refresh\" content=\"0;url="+top.location.href.substr(0,top.location.href.indexOf("#"))+"\" /></head></html>");document.close();}};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=true;var _1d=true;var js="swfaddress.js";var _1f="swfaddress.html";var _20=function(){var _21=top.location.href.indexOf("#");if(_21!=-1){return top.location.href.substring(_21);}return "";};var _22=_20();var _23=function(){if(_12.ie&&top.document.title!=_19){asual.SWFAddress.setTitle(_19);}};var _24=function(){if(_12.safari){if(_1a!=history.length&&!_18){_1a=history.length;if(typeof _1b[_1a-1]!="undefined"){_22=_1b[_1a-1];}_25();}}else{if(_12.ie){if(_22!=_20()){if(_12.version<7){top.location.reload();}else{_26(_20().replace(/^#/g,""),false);}}}else{if(_22!=top.location.hash){_22=_20();_25();}}}_23();};var _25=function(){var _27=_22.replace(/^#/g,"");if(_27!=_16){_16=_27;var obj=document[_17]||document.getElementById(_17);if(obj&&obj.setSWFAddressValue){obj.setSWFAddressValue(_27);}if(typeof SWFAddress.onChange=="function"){SWFAddress.onChange();}}};var _29=function(){if(_1c&&typeof urchinTracker!="undefined"){var _2a=top.location.pathname+this.getValue();_2a=_2a.replace(/\/\//,"/");_2a=_2a.replace(/^\/$/,"");urchinTracker(_2a);}};var _2b=function(){if(_13.contentWindow&&_13.contentWindow.location){var win=_13.contentWindow;win.document.title=top.document.title=_19;var src=win.location.href;if(src.indexOf("?")>-1){_22="#"+src.substring(src.indexOf("?")+1);}else{_22="#";}if(_22!=_20()){_25();top.location.hash=_22;}}};var _2e=function(){if(_12.ie||_12.safari){var _2f=document.createElement("div");_2f.id="swfaddress";var _30=document.getElementsByTagName("script");for(var i=0,s;s=_30[i];i++){if(s.src.indexOf(js)>-1){_1f=(new String(s.src)).replace(js,_1f);}}_2f.innerHTML="<iframe id=\"swfaddress-iframe\" src=\""+_1f+_20().replace(/^#/g,"?")+"\" frameborder=\"no\" scrolling=\"no\"></iframe>";document.body.appendChild(_2f);_2f.style.position="absolute";_2f.style.left=_2f.style.top="-9999px";_13=_2f.getElementsByTagName("iframe")[0];}if(_12.ie){asual.util.Events.addListener(_13,"load",asual.util.Functions.bindAsListener(_2b,this));}if(_12.safari){_14=document.createElement("form");_14.id="swfaddress-form";_14.method="get";_2f.appendChild(_14);if(typeof top.document.location.swfaddress=="undefined"){top.document.location.swfaddress=new Object();}if(typeof top.document.location.swfaddress.history!="undefined"){_1b=top.document.location.swfaddress.history.split(",");}}_29.call(this);_25.call(this);setTimeout(function(){if(typeof SWFAddress.onChange=="function"){SWFAddress.onChange();}},1);setInterval(_24,50);};var _26=function(_33,_34){if(!_15){return null;}if(_33=="null"){_33="";}if(_16==_33){return;}_22="#"+_33;if(_34){_16=_33;_25();}else{_25();_16=_33;}if(_12.safari){if(_1d){_1b[history.length]=_22;top.document.location.swfaddress.history=_1b.toString();_18=true;_1a=history.length+1;if(_12.version<412){if(top.location.search==""){_14.action=_22;_14.submit();}}else{var evt=document.createEvent("MouseEvents");evt.initEvent("click",true,true);var _36=document.createElement("a");_36.href=_22;_36.dispatchEvent(evt);}_18=false;}else{top.document.location.hash=_22;}}else{if(_34){if(_1d){top.location.hash=_22;}else{location.replace(_22);}}}if(_12.ie&&_1d){var win=_13.contentWindow;var _38="?"+_20().substring(_22.indexOf("#")+1);win.location.assign(win.location.pathname+_38);}_29.call(this);if(typeof SWFAddress.onChange=="function"){SWFAddress.onChange();}};var _39="    /**";var _39="     * Loads the previous URL in the history list.";var _39="     */";this.back=function(){history.back();};var _39="    /**";var _39="     * Loads the next URL in the history list.";var _39="     */    ";this.forward=function(){history.forward();};var _39="    /**";var _39="     * Loads a URL from the history list.";var _39="     * @param {Number} delta An integer representing a relative position in the history list";var _39="     */    ";this.go=function(_3a){history.go(_3a);};var _3b=new Object();var _39="    /**";var _39="     * Registers an event listener.";var _39="     * @param {String} type Event type";var _39="     * @param {Function} listener Event listener";var _39="     */ ";this.addEventListener=function(_3c,_3d){if(typeof _3b[_3c]=="undefined"){_3b[_3c]=new Array();}_3b[_3c].push(_3d);};var _39="    /**";var _39="     * Removes an event listener. ";var _39="     * @param {String} type Event type";var _39="     * @param {Function} listener Event listener";var _39="     */     ";this.removeEventListener=function(_3e,_3f){if(typeof _3b[_3e]!="undefined"){for(var i=0,l;l=_3b[_3e][i];i++){if(l==_3f){break;}}_3b[_3e].splice(i,1);}};var _39="    /**";var _39="     * Dispatches an event to all the available listeners. ";var _39="     * @param {Object} event Event object";var _39="     */       ";this.dispatchEvent=function(_42){if(typeof _3b[_42.type]!="undefined"){_42.target=this;for(var i=0,l;l=_3b[_42.type][i];i++){l(evt);}}};var _39="    /**";var _39="     * Checks the existance of any listeners registered for a specific type of event. ";var _39="     * @param {String} event Event type";var _39="     * @type Array";var _39="     */     ";this.hasEventListener=function(_45){if(typeof _3b[_45]!="undefined"){return Objects.clone(this._listeners[_45],false);}};this.setHistoryEnabled=function(_46){_1d=_46;};this.setTrackingEnabled=function(_47){_1c=_47;};var _39="    /**";var _39="     * Opens a new URL in the browser. ";var _39="     * @param {String} url The resource to be opened";var _39="     * @param {String} target Target window";var _39="     */";this.openLink=function(url,_49){switch(_49){case "_blank":window.open(url);break;case "_self":self.location=url;break;case "_top":top.location=url;break;default:self.location=url;break;}};var _39="    /**";var _39="     * Opens a browser popup window. ";var _39="     * @param {String} url The resource to be opened";var _39="     * @param {String} name The name of the popup window";var _39="     * @param {String} options Popup window options in a format compatible window.open()";var _39="     * @param {String} handler Optional handler function for window manipulation     ";var _39="     */";this.openPopup=function(url,_4b,_4c,_4d){var w=window.open(url,_4b,_4c);};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 top.document.title;};this.setTitle=function(_50){if(!_15){return null;}if(_50=="null"){_50="";}if(typeof _50!="undefined"){_19=_50;top.document.title=_19;}};this.getStatus=function(){if(!_15){return null;}return top.status;};this.setStatus=function(_51){if(!_15){return null;}if(!_12.safari){if(_51=="null"||typeof _51=="undefined"){_51="";}var _52=top.location.href.indexOf("#");if(_52==-1){_51=top.location.href+"#"+_51;}else{_51=top.location.href.substr(0,_52)+"#"+_51;}top.status=_51;}};this.resetStatus=function(){top.status="";};this.getValue=function(){if(!_15){return null;}var _53=_22.replace(/^#/g,"");return _53;};this.setValue=function(_54){_26(_54,true);};this.getPath=function(){var _55=this.getValue();if(_55.indexOf("?")!=1){return _55.split("?")[0];}else{return _55;}};this.getQueryString=function(){var _56=this.getValue();var _57=_56.indexOf("?");if(_57!=-1&&_57<_56.length){return _56.substr(_57+1);}return "";};this.getParameter=function(_58){var _59=this.getValue();var _5a=_59.indexOf("?");if(_5a!=-1){_59=_59.substr(_5a+1);var _5b=_59.split("&");var p,i=_5b.length;while(i--){p=_5b[i].split("=");if(p[0]==_58){return p[1];}}}return "";};if(!_15){return;}if(_12.safari){for(var i=1;i<_1a;i++){_1b.push("");}_1b.push(top.location.hash);}if(_12.ie){if(_22==""){_22=top.location.hash="#";}else{if(top.location.hash!=_20()){top.location.hash=_20();}}}_16=this.getValue();_23();asual.util.Events.addListener(window,"load",asual.util.Functions.bindAsListener(_2e,this));};if(typeof deconcept!="undefined"&&deconcept.SWFObject){asual.SWFAddressObject=asual.util.Functions.extend(deconcept.SWFObject,function(swf,id,w,h,ver,c,_65,_66,_67,_68){asual.SWFAddressObject.superConstructor.apply(this,arguments);asual.SWFAddress.setId(id);});SWFObject=deconcept.SWFObject=asual.SWFAddressObject;}SWFAddress=asual.SWFAddress;