/** * SWFAddress 2.0: 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 asual=="undefined"){var asual={};}if(typeof asual.util=="undefined"){asual.util={};}asual.util.Browser=new function(){var _1=false;var _2=-1;var _3=navigator.userAgent;var ie=false;var _5=false;var _6=false;var _7=false;var _8=false;if(/MSIE/.test(_3)){ie=true;_2=parseFloat(_3.substring(_3.indexOf("MSIE")+4));_1=_2>=6;}else{if(/AppleWebKit/.test(_3)){_6=true;_2=parseFloat(_3.substring(_3.indexOf("Safari")+7));_1=_2>=312;}else{if(/Opera/.test(_3)){_7=true;_2=parseFloat(navigator.appVersion);_1=_2>=9.02;}else{if(/Camino/.test(_3)){_5=true;_2=parseFloat(_3.substring(_3.indexOf("Camino")+7));_1=_2>=1;}else{if(/Firefox/.test(_3)){_8=true;_2=parseFloat(_3.substring(_3.indexOf("Firefox")+8));_1=_2>=1;}else{if(/Netscape/.test(_3)){_8=true;_2=parseFloat(_3.substring(_3.indexOf("Netscape")+9));_1=_2>=8;}else{if(/Mozilla/.test(_3)&&/rv:/.test(_3)){_8=true;_2=parseFloat(_3.substring(_3.indexOf("rv:")+3));_1=_2>=1.8;}}}}}}}this.isSupported=function(){return _1;};this.getVersion=function(){return _2;};this.isIE=function(){return ie;};this.isSafari=function(){return _6;};this.isOpera=function(){return _7;};this.isCamino=function(){return _5;};this.isMozilla=function(){return _8;};};asual.util.Events=new function(){var _9=[];var _a=asual.util.Browser;var _b="DOMContentLoaded";if(_a.isIE()){document.write("<script id=swfaddress-domload defer=true src=//:></script>");document.getElementById("swfaddress-domload").onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);for(var i=0,e;e=_9[i];i++){if(e.t==_b){e.l.call(null);}}}};}else{if(_a.isSafari()){var _e=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(_e);for(var i=0,e;e=_9[i];i++){if(e.t==_b){e.l.call(null);}}}},10);}}this.addListener=function(obj,_12,_13){_9.push({o:obj,t:_12,l:_13});if(_12==_b&&(_a.isIE()||_a.isSafari())){return;}if(obj.addEventListener){obj.addEventListener(_12,_13,false);}else{if(obj.attachEvent){obj.attachEvent("on"+_12,_13);}}};this.removeListener=function(obj,_15,_16){for(var i=0,e;e=_9[i];i++){if(e.o==obj&&e.t==_15&&e.l==_16){_9.splice(i,1);break;}}if(_15==_b&&(_a.isIE()||_a.isSafari())){return;}if(obj.removeEventListener){obj.removeEventListener(_15,_16,false);}else{if(obj.detachEvent){obj.detachEvent("on"+_15,_16);}}};var _19=function(){for(var i=0,evt;evt=_9[i];i++){if(evt.t!=_b){asual.util.Events.removeListener(evt.o,evt.t,evt.l);}}};this.addListener(window,"unload",_19);};SWFAddressEvent=function(_1c){this.type=_1c;this.target=[SWFAddress][0];this.value=SWFAddress.getValue();this.path=SWFAddress.getPath();this.parameters={};var _1d=SWFAddress.getParameterNames();for(var i=0,n;n=_1d[i];i++){this.parameters[n]=SWFAddress.getParameter(n);}};SWFAddressEvent.INIT="init";SWFAddressEvent.CHANGE="change";SWFAddress=new function(){var _20=asual.util.Browser;var _21,_22,_23=_20.isSupported();var _24,_25,_26=false;var _27=document.title;var _28=history.length;var _29=[];var _2a=[];var _2b={};var _2c=true;var _2d=true;var js="swfaddress.js";var swf="swfaddress.swf";var _30="swfaddress.html";var d=top.document;var h=top.history;var l=top.location;var s=top.status;if((!_23&&l.href.indexOf("#")!=-1)||(_20.isSafari()&&_20.getVersion()<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 _35=function(url){var _37=document.getElementsByTagName("script");for(var i=0,s;s=_37[i];i++){if(s.src.indexOf(js)>-1){return (new String(s.src)).replace(js,url);}}};var _39=function(){var _3a=l.href.indexOf("#");if(_3a!=-1){return l.href.substring(_3a).replace(/^#/g,"");}return "";};var _3b=_39();var _3c=function(){if(_20.isIE()&&d.title!=_27){SWFAddress.setTitle(_27);}};var _3d=function(){if(!_26){if(_20.isIE()){if(_3b!=_39()){if(_20.getVersion()<7){l.reload();}else{SWFAddress.setValue(_39());}}}else{if(_20.isSafari()){if(_28!=h.length){_28=h.length;if(typeof _29[_28-1]!="undefined"){_3b=_29[_28-1];}_3e();}}else{if(_3b!=_39()){_3b=_39();_3e();}}}_3c();}};var _3f=function(_40){if(SWFAddress.hasEventListener(_40)){SWFAddress.dispatchEvent(new SWFAddressEvent(_40));}_40=_40.substr(0,1).toUpperCase()+_40.substring(1);if(typeof SWFAddress["on"+_40]=="function"){SWFAddress["on"+_40]();}};var _41=function(){_3f("init");};var _42=function(){_3f("change");};var _43=function(){for(var i=0,_45;_45=_2a[i];i++){var obj=document.getElementById(_45);if(obj){if(obj.parentNode&&typeof obj.parentNode.so!="undefined"){obj.parentNode.so.call("setSWFAddressValue",_24);}else{obj=(typeof obj!="undefined"&&typeof obj.setSWFAddressValue!="undefined")?obj:((typeof obj.getElementsByTagName("object")[0]!="undefined"&&typeof obj.getElementsByTagName("object")[0].setSWFAddressValue!="undefined")?obj.getElementsByTagName("object")[0]:((typeof obj.getElementsByTagName("embed")[0]!="undefined"&&typeof obj.getElementsByTagName("embed")[0].setSWFAddressValue!="undefined")?obj.getElementsByTagName("embed")[0]:null));if(obj){obj.setSWFAddressValue(_24);}}}}};var _3e=function(){if(_24!=_3b){_24=_3b;_43();_42();}};var _47=function(){if(_2c&&typeof urchinTracker!="undefined"){var _48=l.pathname+SWFAddress.getValue();_48=_48.replace(/\/\//,"/");_48=_48.replace(/^\/$/,"");urchinTracker(_48);}};var _49=function(){if(_21.contentWindow&&_21.contentWindow.location){var win=_21.contentWindow;win.document.title=d.title=_27;var src=win.location.href;if(src.indexOf("?")>-1){_3b=src.substring(src.indexOf("?")+1);}else{_3b="";}if(_3b!=_39()){_3e();l.hash="#"+_3b;}}};var _4c=function(){var _4d=document.createElement("div");document.body.appendChild(_4d);_4d.id="swfaddress";_4d.style.position="absolute";_4d.style.top="-999px";if(_20.isIE()||_20.isSafari()){_4d.innerHTML="<iframe src=\""+_35(_30)+"?"+_39()+"\" width=\"0\" height=\"0\"></iframe>";_21=_4d.getElementsByTagName("iframe")[0];}if(_20.isIE()){asual.util.Events.addListener(_21,"load",_49);}if(_20.isSafari()){_22=document.createElement("form");_22.id="swfaddress-form";_22.method="get";_4d.appendChild(_22);if(typeof l.swfaddress=="undefined"){l.swfaddress={};}if(typeof l.swfaddress.history!="undefined"){_29=l.swfaddress.history.split(",");}}if(_20.isOpera()&&typeof _2a.length>0){_4d.innerHTML="<embed src=\""+_35(swf)+"\" type=\"application/x-shockwave-flash\" width=\"1\" height=\"1\" />";}setTimeout(_41,1);setTimeout(_42,2);setInterval(_3d,50);_47();};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(_4e){h.go(_4e);};this.addEventListener=function(_4f,_50){if(typeof _2b[_4f]=="undefined"){_2b[_4f]=[];}_2b[_4f].push(_50);};this.removeEventListener=function(_51,_52){if(typeof _2b[_51]!="undefined"){for(var i=0,l;l=_2b[_51][i];i++){if(l==_52){break;}}_2b[_51].splice(i,1);}};this.dispatchEvent=function(_54){if(typeof _2b[_54.type]!="undefined"){_54.target=this;for(var i=0,l;l=_2b[_54.type][i];i++){l(_54);}}};this.hasEventListener=function(_56){return (typeof _2b[_56]!="undefined"&&_2b[_56].length>0);};this.getHistoryEnabled=function(){return _2d;};this.setHistoryEnabled=function(_57){_2d=_57;};this.getTrackingEnabled=function(){return _2c;};this.setTrackingEnabled=function(_58){_2c=_58;};this.href=function(url,_5a){_5a=typeof _5a!="undefined"?_5a:"_self";switch(_5a){case "_self":self.location.href=url;break;case "_top":top.location.href=url;break;case "_blank":window.open(url);break;default:document.frames[_5a].location.href=url;break;}};this.popup=function(url,_5c,_5d,_5e){var _5f=window.open(url,_5c,eval(_5d));eval(_5e);};this.getIds=function(){return _2a;};this.getId=function(_60){return _2a[0];};this.setId=function(id){_2a[0]=id;};this.addId=function(id){_2a.push(id);};this.removeId=function(id){for(var i=0,_65;_65=_2a[i];i++){if(id==_65){_2a.splice(i,1);return;}}};this.getTitle=function(){return d.title;};this.setTitle=function(_66){if(!_23){return null;}if(_66=="null"){_66="";}if(typeof _66!="undefined"){_27=_66;d.title=_27;}};this.getStatus=function(){return s;};this.setStatus=function(_67){if(!_23){return null;}if(!_20.isSafari()){if(_67=="null"||typeof _67=="undefined"){_67="";}if(/http(s)?:\/\//.test(_67)==false){var _68=l.href.indexOf("#");_67=(_68==-1?l.href:l.href.substr(0,_68))+"#"+_67;}s=_67;}};this.resetStatus=function(){s="";};this.getValue=function(){if(!_23){return null;}return _3b;};this.setValue=function(_69){if(!_23){return null;}if(_69=="null"){_69="";}if(_24==_69){return;}_26=true;_3b=_69;_3e();if(_24!=_69){return;}_29[history.length]=_3b;if(_20.isSafari()){if(_2d){l.swfaddress.history=_29.toString();_28=history.length+1;if(_20.getVersion()<412){if(l.search==""){_22.action="#"+_3b;_22.submit();}}else{var evt=document.createEvent("MouseEvents");evt.initEvent("click",true,true);var _6b=document.createElement("a");_6b.href="#"+_3b;_6b.dispatchEvent(evt);}}else{l.hash="#"+_3b;}}else{if(_3b!=_39()){if(_2d){l.hash="#"+_3b;}else{l.replace("#"+_3b);}}}if(_20.isIE()&&_2d){var win=_21.contentWindow;var _6d="?"+_39();win.location.assign(win.location.pathname+_6d);}_47();_26=false;};this.getPath=function(){var _6e=this.getValue();if(_6e.indexOf("?")!=-1){return _6e.split("?")[0];}else{return _6e;}};this.getQueryString=function(){var _6f=this.getValue();var _70=_6f.indexOf("?");if(_70!=-1&&_70<_6f.length){return _6f.substr(_70+1);}return "";};this.getParameter=function(_71){var _72=this.getValue();var _73=_72.indexOf("?");if(_73!=-1){_72=_72.substr(_73+1);var _74=_72.split("&");var p,i=_74.length;while(i--){p=_74[i].split("=");if(p[0]==_71){return p[1];}}}return "";};this.getParameterNames=function(){var _77=this.getValue();var _78=_77.indexOf("?");var _79=[];if(_78!=-1){_77=_77.substr(_78+1);if(_77!=""&&_77.indexOf("=")!=-1){var _7a=_77.split("&");var i=0;while(i<_7a.length){_79.push(_7a[i].split("=")[0]);i++;}}}return _79;};if(!_23){return;}for(var i=1;i<_28;i++){_29.push("");}_29.push(l.hash.replace(/^#/g,""));if(_20.isIE()&&l.hash!=_39()){l.hash="#"+_39();}_24=this.getValue();_3c();asual.util.Events.addListener(document,"DOMContentLoaded",_4c);};if(typeof swfobject!="undefined"){SWFObject=swfobject;}if(typeof SWFObject!="undefined"){if(SWFObject.prototype&&SWFObject.prototype.write){asual.SWFObjectWrite=SWFObject.prototype.write;SWFObject.prototype.write=function(_7d){if(this.getAttribute("version").major<8){this.addVariable("$swfaddress",SWFAddress.getValue());((typeof _7d=="string")?document.getElementById(_7d):_7d).so=this;}asual.SWFObjectWrite.apply(this,arguments);SWFAddress.addId(this.getAttribute("id"));};}else{asual.SWFObjectRegisterObject=SWFObject.registerObject;SWFObject.registerObject=function(_7e,_7f,_80){asual.SWFObjectRegisterObject.apply(this,arguments);SWFAddress.addId(_7e);};asual.SWFObjectCreateSWF=SWFObject.createSWF;SWFObject.createSWF=function(_81,_82,el){asual.SWFObjectCreateSWF.apply(this,arguments);SWFAddress.addId(_81.id);};asual.SWFObjectEmbedSWF=SWFObject.embedSWF;SWFObject.embedSWF=function(_84,_85,_86,_87,_88,_89,_8a,_8b,_8c){asual.SWFObjectEmbedSWF.apply(this,arguments);SWFAddress.addId(_8c.id);};}}if(typeof UFO!="undefined"){asual.UFOCreate=UFO.create;UFO.create=function(FO,id){asual.UFOCreate.apply(this,arguments);SWFAddress.addId(id);};}if(typeof AC_FL_RunContent!="undefined"){asual.AC_FL_RunContent=AC_FL_RunContent;AC_FL_RunContent=function(){asual.AC_FL_RunContent.apply(this,arguments);for(var i=0,a;a=arguments[i];i++){if(a=="id"){SWFAddress.addId(arguments[i+1]);break;}}};}