/** * 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 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 _1=false;var _2=-1;var _3=navigator.userAgent;var _4=false;var _5=false;var _6=false;var _7=false;var _8=false;if(/MSIE/.test(_3)){_4=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 _4;};this.isSafari=function(){return _6;};this.isOpera=function(){return _7;};this.isCamino=function(){return _5;};this.isMozilla=function(){return _8;};};com.asual.util.Events=new function(){var _9=[];var _a=com.asual.util.Browser;var _b="DOMContentLoaded";if(_a.isIE()||_a.isSafari()){(function(){try{if(_a.isIE()||!/loaded|complete/.test(document.readyState)){document.documentElement.doScroll("left");}}catch(e){return setTimeout(arguments.callee,0);}for(var i=0,e;e=_9[i];i++){if(e.t==_b){e.l.call(null);}}})();}this.addListener=function(_e,_f,_10){_9.push({o:_e,t:_f,l:_10});if(_f==_b&&(_a.isIE()||_a.isSafari())){return;}if(_e.addEventListener){_e.addEventListener(_f,_10,false);}else{if(_e.attachEvent){_e.attachEvent("on"+_f,_10);}}};this.removeListener=function(obj,_12,_13){for(var i=0,e;e=_9[i];i++){if(e.o==obj&&e.t==_12&&e.l==_13){_9.splice(i,1);break;}}if(_12==_b&&(_a.isIE()||_a.isSafari())){return;}if(obj.removeEventListener){obj.removeEventListener(_12,_13,false);}else{if(obj.detachEvent){obj.detachEvent("on"+_12,_13);}}};var _16=function(){for(var i=0,evt;evt=_9[i];i++){if(evt.t!=_b){com.asual.util.Events.removeListener(evt.o,evt.t,evt.l);}}};this.addListener(window,"unload",_16);};SWFAddressEvent=function(_19){this.toString=function(){return "[object SWFAddressEvent]";};this.type=_19;this.target=[SWFAddress][0];this.value=SWFAddress.getValue();this.path=SWFAddress.getPath();this.parameters={};var _1a=SWFAddress.getParameterNames();for(var i=0,n;n=_1a[i];i++){this.parameters[n]=SWFAddress.getParameter(n);}};SWFAddressEvent.INIT="init";SWFAddressEvent.CHANGE="change";SWFAddress=new function(){var _1d=com.asual.util.Browser;var _1e=_1d.isSupported();var _d=top.document;var _h=top.history;var _l=top.location;var _22,_23,_24,_js="swfaddress.js";var _26=_d.title;var _27=_h.length;var _28=false;var _29={};var _2a=[];var _2b=[];var _2c=[];_2c["history"]=true;_2c["html"]=false;_2c["strict"]=true;_2c["tracker"]="urchinTracker";if((!_1e&&_l.href.indexOf("#")!=-1)||(_1d.isSafari()&&_1d.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 _2d=function(){var _2e=_l.href.indexOf("#");if(_2e!=-1){return _l.href.substring(_2e).replace(/^#/g,"");}return "";};var _2f=_2d();var _30=function(_31){if(_2c["strict"]){if(_31.substr(0,1)!="/"){_31="/"+_31;}_31=_31.replace(/^([^\?.]*[^\/])(\?|$)/,"$1/$2").replace(/\/\//,"/");}return _31;};var _32=function(){if(_1d.isIE()&&_d.title!=_26){SWFAddress.setTitle(_26);}};var _33=function(){if(!_28){if(_1d.isIE()){if(_2f!=_2d()){if(_1d.getVersion()<7){_l.reload();}else{SWFAddress.setValue(_2d());}}}else{if(_1d.isSafari()){if(_27!=_h.length){_27=_h.length;if(typeof _2a[_27-1]!="undefined"){_2f=_2a[_27-1];}_34();}}else{if(_2f!=_2d()){_2f=_2d();_34();}}}_32();}};var _35=function(_36){if(SWFAddress.hasEventListener(_36)){SWFAddress.dispatchEvent(new SWFAddressEvent(_36));}_36=_36.substr(0,1).toUpperCase()+_36.substring(1);if(typeof SWFAddress["on"+_36]=="function"){SWFAddress["on"+_36]();}};var _37=function(){_35("init");};var _38=function(){_35("change");};var _39=function(){for(var i=0,id;id=_2b[i];i++){var obj=document.getElementById(id);if(obj){if(obj.parentNode&&typeof obj.parentNode.so!="undefined"){obj.parentNode.so.call("setSWFAddressValue",SWFAddress.getValue());}else{obj=(typeof obj!="undefined"&&typeof obj.setSWFAddressValue!="undefined")?obj:((obj.getElementsByTagName("object").length&&typeof obj.getElementsByTagName("object")[0]!="undefined"&&typeof obj.getElementsByTagName("object")[0].setSWFAddressValue!="undefined")?obj.getElementsByTagName("object")[0]:((obj.getElementsByTagName("embed").length&&typeof obj.getElementsByTagName("embed")[0]!="undefined"&&typeof obj.getElementsByTagName("embed")[0].setSWFAddressValue!="undefined")?obj.getElementsByTagName("embed")[0]:null));if(obj){obj.setSWFAddressValue(SWFAddress.getValue());}}}}};var _34=function(){_39();_38();};var _3d=function(){if(typeof _2c["tracker"]!="undefined"&&eval("typeof "+_2c["tracker"]+" != \"undefined\"")){var fn=eval(_2c["tracker"]);if(typeof fn=="function"){fn((_l.pathname+SWFAddress.getValue()).replace(/\/\//,"/").replace(/^\/$/,""));}}};var _3f=function(){var doc=_22.contentWindow.document;doc.open();doc.write("<script>var swfaddress = \""+_2d()+"\";</script>");doc.close();};var _41=function(){if(_2c["html"]){var src=_22.contentWindow.location.href;_2f=(src.indexOf("?")>-1)?src.substring(src.indexOf("?")+1):"";}else{_2f=(typeof _22.contentWindow.swfaddress!="undefined")?_22.contentWindow.swfaddress:"";}if(_2f!=_2d()){_34();_l.hash="#"+_2f;}};var _43=function(){var _44=document.getElementsByTagName("script");for(var i=0,s;s=_44[i];i++){if(s.src.indexOf(_js)>-1){_24=String(s.src);break;}}if((qi=_24.indexOf("?"))>-1){var _47,_48=_24.substr(qi+1).split("&");for(var j=0,p;p=_48[j];j++){_47=p.split("=");if(/^(history|html|strict)$/.test(_47[0])){_2c[_47[0]]=(isNaN(_47[1])?eval(_47[1]):(parseFloat(_47[1])>0));}if(/^tracker$/.test(_47[0])){_2c[_47[0]]=_47[1];}}}if(/file:\/\//.test(_l.href)){_2c["html"]=false;}var _4b="id=\"swfaddress\" style=\"position:absolute;top:-9999px;\"";if(_1d.isIE()){document.body.innerHTML+="<iframe "+_4b+" src=\""+(_2c["html"]?_24.replace(/\.js(\?.*)?$/,".html")+"?"+_2d():"javascript:false;")+"\"></iframe>";_22=document.getElementById("swfaddress");setTimeout(function(){if(!_2c["html"]&&typeof _22.contentWindow.swfaddress=="undefined"){_3f();}com.asual.util.Events.addListener(_22,"load",_41);},10);}else{if(_1d.isSafari()){if(_1d.getVersion()<412){document.body.innerHTML+="<form "+_4b+" method=\"get\"></form>";_23=document.getElementById("swfaddress");}if(typeof _l.swfaddress=="undefined"){_l.swfaddress={};}if(typeof _l.swfaddress[_l.pathname]!="undefined"){_2a=_l.swfaddress[_l.pathname].split(",");}}else{if(_1d.isOpera()&&_2b.length==0){document.body.innerHTML+="<embed "+_4b+" src=\""+_24.replace(/\.js(\?.*)?$/,".swf")+"\" type=\"application/x-shockwave-flash\" />";}}}setTimeout(_37,1);setTimeout(_38,2);setTimeout(_3d,10);setInterval(_33,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(_4c){_h.go(_4c);};this.href=function(url,_4e){_4e=typeof _4e!="undefined"?_4e:"_self";switch(_4e){case "_self":self.location.href=url;break;case "_top":_l.href=url;break;case "_blank":window.open(url);break;default:top.frames[_4e].location.href=url;break;}};this.popup=function(url,_50,_51,_52){var _53=window.open(url,_50,eval(_51));eval(_52);};this.addEventListener=function(_54,_55){if(typeof _29[_54]=="undefined"){_29[_54]=[];}_29[_54].push(_55);};this.removeEventListener=function(_56,_57){if(typeof _29[_56]!="undefined"){for(var i=0,l;l=_29[_56][i];i++){if(l==_57){break;}}_29[_56].splice(i,1);}};this.dispatchEvent=function(_5a){if(typeof _29[_5a.type]!="undefined"&&_29[_5a.type].length){_5a.target=this;for(var i=0,l;l=_29[_5a.type][i];i++){l(_5a);}return true;}return false;};this.hasEventListener=function(_5d){return (typeof _29[_5d]!="undefined"&&_29[_5d].length>0);};this.getStrict=function(){return _2c["strict"];};this.setStrict=function(_5e){_2c["strict"]=enabled;};this.getHistory=function(){return _2c["history"];};this.setHistory=function(_5f){_2c["history"]=_5f;};this.getTracker=function(){return _2c["tracker"];};this.setTracker=function(_60){_2c["tracker"]=_60;};this.getIds=function(){return _2b;};this.getId=function(_61){return _2b[0];};this.setId=function(id){_2b[0]=id;};this.addId=function(id){this.removeId(id);_2b.push(id);};this.removeId=function(id){for(var i=0,_66;_66=_2b[i];i++){if(id==_66){_2b.splice(i,1);break;}}};this.getTitle=function(){return _d.title;};this.setTitle=function(_67){if(!_1e){return null;}if(typeof _67=="undefined"){return;}if(_67=="null"){_67="";}_26=_d.title=_67;if(_22&&_22.contentWindow){_22.contentWindow.document.title=_67;}};this.getStatus=function(){return top.status;};this.setStatus=function(_68){if(!_1e){return null;}if(typeof _68=="undefined"){return;}if(!_1d.isSafari()){if(_68=="null"){_68="";}_68=_30(_68);if(_68=="/"){_68="";}if(!(/http(s)?:\/\//.test(_68))){var _69=_l.href.indexOf("#");_68=(_69==-1?_l.href:_l.href.substr(0,_69))+"#"+_68;}top.status=_68;}};this.resetStatus=function(){top.status="";};this.getValue=function(){if(!_1e){return null;}return _30(_2f);};this.setValue=function(_6a){if(!_1e){return null;}if(typeof _6a=="undefined"){return;}if(_6a=="null"){_6a="";}_6a=_30(_6a);if(_6a=="/"){_6a="";}if(_2f==_6a){return;}_2f=_6a;_28=true;_34();_2a[_h.length]=_2f;if(_1d.isSafari()){if(_2c["history"]){_l.swfaddress[_l.pathname]=_2a.toString();_27=_h.length+1;if(_1d.getVersion()<412){if(_l.search==""){_23.action="#"+_2f;_23.submit();}}else{var evt=document.createEvent("MouseEvents");evt.initEvent("click",true,true);var _6c=document.createElement("a");_6c.href="#"+_2f;_6c.dispatchEvent(evt);}}else{_l.hash="#"+_2f;}}else{if(_2f!=_2d()){if(_2c["history"]){_l.hash="#"+_2f;}else{_l.replace("#"+_2f);}}}if(_1d.isIE()&&_2c["history"]){if(_2c["html"]){_22.contentWindow.location.assign(_22.contentWindow.location.pathname+"?"+_2d());}else{_3f();}}setTimeout(_3d,10);_28=false;};this.getPath=function(){var _6d=this.getValue();if(_6d.indexOf("?")!=-1){return _6d.split("?")[0];}else{return _6d;}};this.getQueryString=function(){var _6e=this.getValue();var _6f=_6e.indexOf("?");if(_6f!=-1&&_6f<_6e.length){return _6e.substr(_6f+1);}return "";};this.getParameter=function(_70){var _71=this.getValue();var _72=_71.indexOf("?");if(_72!=-1){_71=_71.substr(_72+1);var _73=_71.split("&");var p,i=_73.length;while(i--){p=_73[i].split("=");if(p[0]==_70){return p[1];}}}return "";};this.getParameterNames=function(){var _76=this.getValue();var _77=_76.indexOf("?");var _78=[];if(_77!=-1){_76=_76.substr(_77+1);if(_76!=""&&_76.indexOf("=")!=-1){var _79=_76.split("&");var i=0;while(i<_79.length){_78.push(_79[i].split("=")[0]);i++;}}}return _78;};if(!_1e){return;}for(var i=1;i<_27;i++){_2a.push("");}_2a.push(_l.hash.replace(/^#/g,""));if(_1d.isIE()&&_l.hash!=_2d()){_l.hash="#"+_2d();}_32();com.asual.util.Events.addListener(document,"DOMContentLoaded",_43);};if(typeof swfobject!="undefined"){SWFObject=swfobject;}if(typeof FlashObject!="undefined"){SWFObject=FlashObject;}if(typeof SWFObject!="undefined"){if(SWFObject.prototype&&SWFObject.prototype.write){com.asual.SWFObjectWrite=SWFObject.prototype.write;SWFObject.prototype.write=function(){if(this.getAttribute("version").major<8){this.addVariable("$swfaddress",SWFAddress.getValue());((typeof arguments[0]=="string")?document.getElementById(arguments[0]):arguments[0]).so=this;}com.asual.SWFObjectWrite.apply(this,arguments);SWFAddress.addId(this.getAttribute("id"));};}else{com.asual.SWFObjectRegisterObject=SWFObject.registerObject;SWFObject.registerObject=function(){com.asual.SWFObjectRegisterObject.apply(this,arguments);SWFAddress.addId(arguments[0]);};com.asual.SWFObjectCreateSWF=SWFObject.createSWF;SWFObject.createSWF=function(){com.asual.SWFObjectCreateSWF.apply(this,arguments);SWFAddress.addId(arguments[0].id);};com.asual.SWFObjectEmbedSWF=SWFObject.embedSWF;SWFObject.embedSWF=function(){com.asual.SWFObjectEmbedSWF.apply(this,arguments);SWFAddress.addId(arguments[8].id);};}}if(typeof UFO!="undefined"){com.asual.UFOCreate=UFO.create;UFO.create=function(){com.asual.UFOCreate.apply(this,arguments);SWFAddress.addId(arguments[0].id);};}if(typeof AC_FL_RunContent!="undefined"){com.asual.AC_FL_RunContent=AC_FL_RunContent;AC_FL_RunContent=function(){com.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;}}};}