/** * 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;for(var p in _2){if(p!="prototype"){_3[p]=_2[p];}}return _3;};this.bindAsListener=function(_5,_6,_7){return function(_8){return _5.call(_6,_8||((_7)?_7.event:window.event));};};};asual.util.Events=new function(){var _9=new Array();this.addListener=function(_a,_b,_c){if(_a.addEventListener){_a.addEventListener(_b,_c,false);}else{if(_a.attachEvent){_a.attachEvent("on"+_b,_c);}else{_a["on"+_b]=_c;}}_9.push({o:_a,t:_b,l:_c});};this.removeListener=function(_d,_e,_f){if(_d.removeEventListener){_d.removeEventListener(_e,_f,false);}else{if(_d.detachEvent){_d.detachEvent("on"+_e,_f);}else{_d["on"+_e]=_f;}}};var _10=function(){for(var i=0,evt;evt=_9[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(_10,this));}};asual.SWFAddress=new function(){var _13=asual.util.Browser;var _14,_15,_16=_13.supported;var _17,_18,_19,_1a=false;var _1b=document.title;var _1c=history.length;var _1d=new Array();var _1e=new Object();var _1f=true;var _20=true;var js="swfaddress.js";var _22="swfaddress.html";if((!_16&&top.location.href.indexOf("#")!=-1)||(_13.safari&&_13.version<412&&top.location.href.indexOf("#")!=-1&&top.location.search!="")){top.document.open();top.document.write("<html><head><meta http-equiv=\"refresh\" content=\"0;url="+top.location.href.substr(0,top.location.href.indexOf("#"))+"\" /></head></html>");top.document.close();}var _23=function(){var _24=top.location.href.indexOf("#");if(_24!=-1){return top.location.href.substring(_24);}return "";};var _25=_23();var _26=function(){if(_13.ie&&top.document.title!=_1b){asual.SWFAddress.setTitle(_1b);}};var _27=function(){if(_13.safari){if(_1c!=history.length&&!_1a){_1c=history.length;if(typeof _1d[_1c-1]!="undefined"){_25=_1d[_1c-1];}_28();}}else{if(_13.ie){if(_25!=_23()){if(_13.version<7){top.location.reload();}else{_29(_23().replace(/^#/g,""),false);}}}else{if(_25!=top.location.hash){_25=_23();_28();}}}_26();};var _28=function(){var _2a=_25.replace(/^#/g,"");if(_2a!=_17){_17=_2a;var obj=document[_19]||document.getElementById(_19);if(obj&&obj.setSWFAddressValue){obj.setSWFAddressValue(_2a);}if(_18.call){_18.call("setSWFAddressValue",_2a);}if(typeof SWFAddress.onChange=="function"){SWFAddress.onChange();}}};var _2c=function(){if(_1f&&typeof urchinTracker!="undefined"){var _2d=top.location.pathname+this.getValue();_2d=_2d.replace(/\/\//,"/");_2d=_2d.replace(/^\/$/,"");urchinTracker(_2d);}};var _2e=function(){if(_14.contentWindow&&_14.contentWindow.location){var win=_14.contentWindow;win.document.title=top.document.title=_1b;var src=win.location.href;if(src.indexOf("?")>-1){_25="#"+src.substring(src.indexOf("?")+1);}else{_25="#";}if(_25!=_23()){_28();top.location.hash=_25;}}};var _31=function(){if(_13.ie||_13.safari){var _32=document.createElement("div");_32.id="swfaddress";var _33=document.getElementsByTagName("script");for(var i=0,s;s=_33[i];i++){if(s.src.indexOf(js)>-1){_22=(new String(s.src)).replace(js,_22);}}_32.innerHTML="<iframe id=\"swfaddress-iframe\" src=\""+_22+_23().replace(/^#/g,"?")+"\" frameborder=\"no\" scrolling=\"no\"></iframe>";document.body.appendChild(_32);_32.style.position="absolute";_32.style.left=_32.style.top="-9999px";_14=_32.getElementsByTagName("iframe")[0];}if(_13.ie){asual.util.Events.addListener(_14,"load",asual.util.Functions.bindAsListener(_2e,this));}if(_13.safari){_15=document.createElement("form");_15.id="swfaddress-form";_15.method="get";_32.appendChild(_15);if(typeof top.location.swfaddress=="undefined"){top.location.swfaddress=new Object();}if(typeof top.location.swfaddress.history!="undefined"){_1d=top.location.swfaddress.history.split(",");}}_2c.call(this);_28.call(this);setTimeout(function(){if(typeof SWFAddress.onChange=="function"){SWFAddress.onChange();}},1);setInterval(_27,50);};var _29=function(_36,_37){if(!_16){return null;}if(_36=="null"){_36="";}if(_17==_36){return;}_25="#"+_36;if(_37){_17=_36;_28();}else{_28();_17=_36;}if(_13.safari){if(_20){_1d[history.length]=_25;top.location.swfaddress.history=_1d.toString();_1a=true;_1c=history.length+1;if(_13.version<412){if(top.location.search==""){_15.action=_25;_15.submit();}}else{var evt=document.createEvent("MouseEvents");evt.initEvent("click",true,true);var _39=document.createElement("a");_39.href=_25;_39.dispatchEvent(evt);}_1a=false;}else{top.location.hash=_25;}}else{if(_37){if(_20){top.location.hash=_25;}else{top.location.replace(_25);}}}if(_13.ie&&_20){var win=_14.contentWindow;var _3b="?"+_23().substring(_25.indexOf("#")+1);win.location.assign(win.location.pathname+_3b);}_2c.call(this);if(typeof SWFAddress.onChange=="function"){SWFAddress.onChange();}};this.toString=function(){return "[object SWFAddress]";};this.back=function(){history.back();};this.forward=function(){history.forward();};this.go=function(_3c){history.go(_3c);};this.addEventListener=function(_3d,_3e){if(typeof _1e[_3d]=="undefined"){_1e[_3d]=new Array();}_1e[_3d].push(_3e);};this.removeEventListener=function(_3f,_40){if(typeof _1e[_3f]!="undefined"){for(var i=0,l;l=_1e[_3f][i];i++){if(l==_40){break;}}_1e[_3f].splice(i,1);}};this.dispatchEvent=function(_43){if(typeof _1e[_43.type]!="undefined"){_43.target=this;for(var i=0,l;l=_1e[_43.type][i];i++){l(evt);}}};this.hasEventListener=function(_46){if(typeof _1e[_46]!="undefined"){return Objects.clone(this._listeners[_46],false);}};this.getHistoryEnabled=function(){return _20;};this.setHistoryEnabled=function(_47){_20=_47;};this.getTrackingEnabled=function(){return _1f;};this.setTrackingEnabled=function(_48){_1f=_48;};this.openLink=function(url,_4a){switch(_4a){case "_blank":window.open(url);break;case "_self":self.location=url;break;case "_top":top.location=url;break;default:self.location=url;break;}};this.openPopup=function(url,_4c,_4d,_4e){var w=window.open(url,_4c,_4d);};this.getSWFObject=function(){if(!_16){return null;}return _18;};this.setSWFObject=function(_50){if(!_16){return null;}_18=_50;};this.getId=function(){if(!_16){return null;}return _19;};this.setId=function(id){if(!_16){return null;}_19=id;};this.getTitle=function(){if(!_16){return null;}return top.document.title;};this.setTitle=function(_52){if(!_16){return null;}if(_52=="null"){_52="";}if(typeof _52!="undefined"){_1b=_52;top.document.title=_1b;}};this.getStatus=function(){if(!_16){return null;}return top.status;};this.setStatus=function(_53){if(!_16){return null;}if(!_13.safari){if(_53=="null"||typeof _53=="undefined"){_53="";}var _54=top.location.href.indexOf("#");if(_54==-1){_53=top.location.href+"#"+_53;}else{_53=top.location.href.substr(0,_54)+"#"+_53;}top.status=_53;}};this.resetStatus=function(){top.status="";};this.getValue=function(){if(!_16){return null;}var _55=_25.replace(/^#/g,"");return _55;};this.setValue=function(_56){_29(_56,true);};this.getPath=function(){var _57=this.getValue();if(_57.indexOf("?")!=1){return _57.split("?")[0];}else{return _57;}};this.getQueryString=function(){var _58=this.getValue();var _59=_58.indexOf("?");if(_59!=-1&&_59<_58.length){return _58.substr(_59+1);}return "";};this.getParameter=function(_5a){var _5b=this.getValue();var _5c=_5b.indexOf("?");if(_5c!=-1){_5b=_5b.substr(_5c+1);var _5d=_5b.split("&");var p,i=_5d.length;while(i--){p=_5d[i].split("=");if(p[0]==_5a){return p[1];}}}return "";};this.init=function(){if(_18.call){_18.call("setSWFAddressValue",SWFAddress.getValue());}};if(!_16){return;}if(_13.safari){for(var i=1;i<_1c;i++){_1d.push("");}_1d.push(top.location.hash);}if(_13.ie){if(_25==""){_25=top.location.hash="#";}else{if(top.location.hash!=_23()){top.location.hash=_23();}}}_17=this.getValue();_26();asual.util.Events.addListener(window,"load",asual.util.Functions.bindAsListener(_31,this));};SWFAddress=asual.SWFAddress;if(typeof deconcept!="undefined"&&deconcept.SWFObject){asual.SWFAddressObject=asual.util.Functions.extend(deconcept.SWFObject,function(swf,id,w,h,ver,c,_67,_68,_69,_6a){asual.SWFAddressObject.superConstructor.apply(this,arguments);SWFAddress.setSWFObject(this);SWFAddress.setId(id);this.setAttribute("style",";");if(this.getAttribute("version").major<8){this.addVariable("$swfaddress",SWFAddress.getValue());}});SWFObject=deconcept.SWFObject=asual.SWFAddressObject;}
