/** * SWFAddress 2.1: 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 J=-1;var I=navigator.userAgent;var H=false,F=false,E=false,D=false,C=false,B=false,A=false;var G=function(L,K){return parseFloat(I.substr(I.indexOf(L)+K))};if(H=/MSIE/.test(I)){J=G("MSIE",4)}if(E=/AppleWebKit/.test(I)){J=G("Safari",7)}if(D=/Opera/.test(I)){J=parseFloat(navigator.appVersion)}if(F=/Camino/.test(I)){J=G("Camino",7)}if(C=/Firefox/.test(I)){J=G("Firefox",8)}if(B=/Netscape/.test(I)){J=G("Netscape",9)}if(A=/Mozilla/.test(I)&&/rv:/.test(I)){J=G("rv:",3)}this.getVersion=function(){return J};this.isIE=function(){return H};this.isSafari=function(){return E};this.isOpera=function(){return D};this.isCamino=function(){return F};this.isFirefox=function(){return C};this.isNetscape=function(){return B};this.isMozilla=function(){return A}};com.asual.util.Events=new function(){var B=[];var A=com.asual.util.Browser;var D="DOMContentLoaded";if(A.isIE()||A.isSafari()){(function(){try{if(A.isIE()||!/loaded|complete/.test(document.readyState)){document.documentElement.doScroll("left")}}catch(F){return setTimeout(arguments.callee,0)}for(var E=0,F;F=B[E];E++){if(F.t==D){F.l.call(null)}}})()}this.addListener=function(G,F,E){B.push({o:G,t:F,l:E});if(!(F==D&&(A.isIE()||A.isSafari()))){if(G.addEventListener){G.addEventListener(F,E,false)}else{if(G.attachEvent){G.attachEvent("on"+F,E)}}}};this.removeListener=function(I,G,E){for(var F=0,H;H=B[F];F++){if(H.o==I&&H.t==G&&H.l==E){B.splice(F,1);break}}if(!(G==D&&(A.isIE()||A.isSafari()))){if(I.removeEventListener){I.removeEventListener(G,E,false)}else{if(I.detachEvent){I.detachEvent("on"+G,E)}}}};var C=function(){for(var F=0,E;E=B[F];F++){if(E.t!=D){com.asual.util.Events.removeListener(E.o,E.t,E.l)}}};this.addListener(window,"unload",C)};SWFAddressEvent=function(C){this.toString=function(){return"[object SWFAddressEvent]"};this.type=C;this.target=[SWFAddress][0];this.value=SWFAddress.getValue();this.path=SWFAddress.getPath();this.pathNames=SWFAddress.getPathNames();this.parameters={};var B=SWFAddress.getParameterNames();for(var D=0,A=B.length;D<A;D++){this.parameters[B[D]]=SWFAddress.getParameter(B[D])}this.parametersNames=B};SWFAddressEvent.INIT="init";SWFAddressEvent.CHANGE="change";SWFAddress=new function(){var _21=com.asual.util.Browser;var _22=com.asual.util.Events;var _23=_21.getVersion();var _24=false;if(_21.isIE()){_24=_23>=6}if(_21.isSafari()){_24=_23>=312}if(_21.isOpera()){_24=_23>=9.02}if(_21.isCamino()){_24=_23>=1}if(_21.isFirefox()){_24=_23>=1}if(_21.isNetscape()){_24=_23>=8}if(_21.isMozilla()){_24=_23>=1.8}var _t=top;var _d=_t.document;var _h=_t.history;var _l=_t.location;var _st=setTimeout;var _2a="function";var _2b="undefined";var _2c="swfaddress";var _2d,_2e,_2f;var _30=_d.title;var _31=_h.length;var _32=false;var _33={};var _34=[];var _35=[];var _36={};_36.history=true;_36.html=false;_36.strict=true;_36.tracker="_trackDefault";if((!_24&&_l.href.indexOf("#")!=-1)||(_21.isSafari()&&_23<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 _37=function(){var _38=_l.href.indexOf("#");if(_38!=-1){var _39=unescape(_l.href.substr(_38+1));if(/^[a-z0-9 ,=_&\-\.\?\+\/]*$/i.test(_39)){return _39}else{_l.replace(_l.href.substr(0,_38))}}return""};var _3a=_37();var _3b=function(_3c,_3d){if(_36.strict){_3c=_3d?(_3c.substr(0,1)!="/"?"/"+_3c:_3c):(_3c==""?"/":_3c)}return _3c};var _3e=function(_3f){return(_21.isIE()&&_l.protocol=="file:")?_3a.replace(/\?/,"%3F"):_3f};var _40=function(el){if(el.src&&/swfaddress\.js(\?.*)?$/.test(el.src)){return el}for(var i=0,l=el.childNodes.length,s;i<l;i++){if(s=_40(el.childNodes[i])){return s}}};var _45=function(){if(_21.isIE()&&_d.title!=_30){SWFAddress.setTitle(_30)}};var _46=function(){if(!_32){var _47=_37();if(_21.isIE()){if(_3a!=_47){if(_23<7){_l.reload()}else{SWFAddress.setValue(_47)}}}else{if(_21.isSafari()&&_23<523){if(_31!=_h.length){_31=_h.length;if(typeof _34[_31-1]!=_2b){_3a=_34[_31-1]}_48()}}else{if(_3a!=_47){_3a=_47;_48()}}}_45()}};var _49=function(_4a){if(SWFAddress.hasEventListener(_4a)){SWFAddress.dispatchEvent(new SWFAddressEvent(_4a))}_4a=_4a.substr(0,1).toUpperCase()+_4a.substr(1);if(typeof SWFAddress["on"+_4a]==_2a){SWFAddress["on"+_4a]()}};var _4b=function(){_49("init")};var _4c=function(){_49("change")};var _4d=function(){for(var i=0,id,_50=SWFAddress.getValue(),_51="setSWFAddressValue";id=_35[i];i++){var obj=document.getElementById(id);if(obj){if(obj.parentNode&&typeof obj.parentNode.so!=_2b){obj.parentNode.so.call(_51,_50)}else{if(!(obj&&typeof obj[_51]!=_2b)){var _53=obj.getElementsByTagName("object");var _54=obj.getElementsByTagName("embed");obj=((_53[0]&&typeof _53[0][_51]!=_2b)?_53:((_54[0]&&typeof _54[0][_51]!=_2b)?_54[0]:null))}if(obj){obj[_51](_50)}}}else{if(obj=document[id]){if(typeof obj[_51]!=_2b){obj[_51](_50)}}}}};var _48=function(){_4d();_4c();_st(_55,10)};var _56=function(_57){if(typeof urchinTracker==_2a){urchinTracker(_57)}if(typeof pageTracker!=_2b&&typeof pageTracker._trackPageview==_2a){pageTracker._trackPageview(_57)}};eval("var _trackDefault = "+_56+";");var _55=function(){if(typeof _36.tracker!=_2b&&eval("typeof "+_36.tracker+' != "'+_2b+'"')){var fn=eval(_36.tracker);if(typeof fn==_2a){fn((_l.pathname+(/\/$/.test(_l.pathname)?"":"/")+SWFAddress.getValue()).replace(/\/\//,"/").replace(/^\/$/,""))}}};var _59=function(){var doc=_2d.contentWindow.document;doc.open();doc.write("<script>var "+_2c+' = "'+_37()+'";<\/script>');doc.close()};var _5b=function(){var win=_2d.contentWindow;if(_36.html){var src=win.location.href;_3a=(src.indexOf("?")>-1)?src.substr(src.indexOf("?")+1):""}else{_3a=(typeof win[_2c]!=_2b)?win[_2c]:""}win.document.title=_d.title;if(_3a!=_37()){_48();_l.hash=_3e(_3a)}};var _5e=function(){var _5f='id="'+_2c+'" style="position:absolute;top:-9999px;"';if(_21.isIE()){document.body.appendChild(document.createElement("div")).innerHTML="<iframe "+_5f+' src="'+(_36.html?_2f.replace(/\.js(\?.*)?$/,".html")+"?"+_37():"javascript:false;")+'" width="0" height="0"></iframe>';_2d=document.getElementById(_2c);_st(function(){_22.addListener(_2d,"load",_5b);if(!_36.html&&typeof _2d.contentWindow[_2c]==_2b){_59()}},10)}else{if(_21.isSafari()){if(_23<412){document.body.innerHTML+="<form "+_5f+' method="get"></form>';_2e=document.getElementById(_2c)}if(typeof _l[_2c]==_2b){_l[_2c]={}}if(typeof _l[_2c][_l.pathname]!=_2b){_34=_l[_2c][_l.pathname].split(",")}}else{if(_21.isOpera()&&_35.length==0&&typeof navigator.plugins["Shockwave Flash"]=="object"){document.body.innerHTML+="<embed "+_5f+' src="'+_2f.replace(/\.js(\?.*)?$/,".swf")+'" type="application/x-shockwave-flash" />'}}}_st(_4b,1);_st(_4c,2);_st(_55,10);setInterval(_46,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(_60){_h.go(_60)};this.href=function(url,_62){_62=(typeof _62!=_2b)?_62:"_self";if(_62=="_self"){self.location.href=url}if(_62=="_top"){_l.href=url}if(_62=="_blank"){window.open(url)}else{_t.frames[_62].location.href=url}};this.popup=function(url,_64,_65,_66){var _67=window.open(url,_64,eval(_65));eval(_66)};this.addEventListener=function(_68,_69){if(typeof _33[_68]==_2b){_33[_68]=[]}_33[_68].push(_69)};this.removeEventListener=function(_6a,_6b){if(typeof _33[_6a]!=_2b){for(var i=0,l;l=_33[_6a][i];i++){if(l==_6b){break}}_33[_6a].splice(i,1)}};this.dispatchEvent=function(_6e){if(typeof _33[_6e.type]!=_2b&&_33[_6e.type].length){_6e.target=this;for(var i=0,l;l=_33[_6e.type][i];i++){l(_6e)}return true}return false};this.hasEventListener=function(_71){return(typeof _33[_71]!=_2b&&_33[_71].length>0)};this.getBaseURL=function(){var url=_l.href;if(url.indexOf("#")!=-1){url=url.substr(0,url.indexOf("#"))}if(url.substr(url.length-1)=="/"){url=url.substr(0,url.length-1)}return url};this.getStrict=function(){return _36.strict};this.setStrict=function(_73){_36.strict=_73};this.getHistory=function(){return _36.history};this.setHistory=function(_74){_36.history=_74};this.getTracker=function(){return _36.tracker};this.setTracker=function(_75){_36.tracker=_75};this.getIds=function(){return _35};this.getId=function(_76){return _35[0]};this.setId=function(id){_35[0]=id};this.addId=function(id){this.removeId(id);_35.push(id)};this.removeId=function(id){for(var i=0;i<_35.length;i++){if(id==_35[i]){_35.splice(i,1);break}}};this.getTitle=function(){return _d.title};this.setTitle=function(_7b){if(!_24){return null}if(typeof _7b==_2b){return }if(_7b=="null"){_7b=""}_30=_d.title=_7b;_st(function(){if(_2d&&_2d.contentWindow&&_2d.contentWindow.document&&_2d.contentWindow.title){_2d.contentWindow.document.title=_30}},1000)};this.getStatus=function(){return _t.status};this.setStatus=function(_7c){if(!_24){return null}if(typeof _7c==_2b){return }if(!_21.isSafari()){_7c=_3b((_7c!="null")?_7c:"",true);if(_7c=="/"){_7c=""}if(!(/http(s)?:\/\//.test(_7c))){var _7d=_l.href.indexOf("#");_7c=(_7d==-1?_l.href:_l.href.substr(0,_7d))+"#"+_7c}_t.status=_7c}};this.resetStatus=function(){_t.status=""};this.getValue=function(){if(!_24){return null}return _3b(_3a,false)};this.setValue=function(_7e){if(!_24){return null}if(typeof _7e==_2b){return }if(_7e=="null"){_7e=""}_7e=_3b(_7e,true);if(_7e=="/"){_7e=""}if(_3a==_7e){return }_3a=_7e;_32=true;_48();_34[_h.length]=_3a;if(_21.isSafari()){if(_36.history){_l[_2c][_l.pathname]=_34.toString();_31=_h.length+1;if(_23<412){if(_l.search==""){_2e.action="#"+_3a;_2e.submit()}}else{if(_23<523){var evt=document.createEvent("MouseEvents");evt.initEvent("click",true,true);var _80=document.createElement("a");_80.href="#"+_3a;_80.dispatchEvent(evt)}else{_l.hash="#"+_3a}}}else{_l.replace("#"+_3a)}}else{if(_3a!=_37()){if(_36.history){_l.hash="#"+_3e(_3a)}else{_l.replace("#"+_3a)}}}if(_21.isIE()&&_36.history){if(_36.html){var loc=_2d.contentWindow.location;loc.assign(loc.pathname+"?"+_37())}else{_59()}}if(_21.isSafari()){_st(function(){_32=false},1)}else{_32=false}};this.getPath=function(){var _82=this.getValue();return(_82.indexOf("?")!=-1)?_82.split("?")[0]:_82};this.getPathNames=function(){var _83=SWFAddress.getPath();var _84=_83.split("/");if(_83.substr(0,1)=="/"){_84.splice(0,1)}if(_83.substr(_83.length-1,1)=="/"){_84.splice(_84.length-1,1)}return _84};this.getQueryString=function(){var _85=this.getValue();var _86=_85.indexOf("?");return(_86!=-1&&_86<_85.length)?_85.substr(_86+1):""};this.getParameter=function(_87){var _88=this.getValue();var _89=_88.indexOf("?");if(_89!=-1){_88=_88.substr(_89+1);var _8a=_88.split("&");var p,i=_8a.length;while(i--){p=_8a[i].split("=");if(p[0]==_87){return p[1]}}}return""};this.getParameterNames=function(){var _8d=this.getValue();var _8e=_8d.indexOf("?");var _8f=[];if(_8e!=-1){_8d=_8d.substr(_8e+1);if(_8d!=""&&_8d.indexOf("=")!=-1){var _90=_8d.split("&");var i=0;while(i<_90.length){_8f.push(_90[i].split("=")[0]);i++}}}return _8f};if(_24){for(var i=1;i<_31;i++){_34.push("")}_34.push(_37());if(_21.isIE()&&_l.hash!=_37()){_l.hash="#"+_3e(_37())}try{_2f=String(_40(document).src);var qi=_2f.indexOf("?");if(_2f&&qi>-1){var _94,_95=_2f.substr(qi+1).split("&");for(var i=0,p;p=_95[i];i++){_94=p.split("=");if(/^(history|html|strict)$/.test(_94[0])){_36[_94[0]]=(isNaN(_94[1])?eval(_94[1]):(parseFloat(_94[1])>0))}if(/^tracker$/.test(_94[0])){_36[_94[0]]=_94[1]}}}}catch(e){}if(/file:\/\//.test(_l.href)){_36.html=false}_45();_22.addListener(document,"DOMContentLoaded",_5e)}else{_55()}};new function(){var C,B;var A="undefined";if(typeof swfobject!=A){SWFObject=swfobject}if(typeof FlashObject!=A){SWFObject=FlashObject}if(typeof SWFObject!=A){if(SWFObject.prototype&&SWFObject.prototype.write){C=SWFObject.prototype.write;SWFObject.prototype.write=function(){B=arguments;if(this.getAttribute("version").major<8){this.addVariable("$swfaddress",SWFAddress.getValue());((typeof B[0]=="string")?document.getElementById(B[0]):B[0]).so=this}var D;if(D=C.apply(this,B)){SWFAddress.addId(this.getAttribute("id"))}return D}}else{C=SWFObject.registerObject;SWFObject.registerObject=function(){B=arguments;C.apply(this,B);SWFAddress.addId(B[0])};C=SWFObject.createSWF;SWFObject.createSWF=function(){B=arguments;C.apply(this,B);SWFAddress.addId(B[0].id)};C=SWFObject.embedSWF;SWFObject.embedSWF=function(){B=arguments;C.apply(this,B);SWFAddress.addId(B[8].id)}}}if(typeof UFO!=A){C=UFO.create;UFO.create=function(){B=arguments;C.apply(this,B);SWFAddress.addId(B[0].id)}}if(typeof AC_FL_RunContent!=A){C=AC_FL_RunContent;AC_FL_RunContent=function(){B=arguments;C.apply(this,B);for(var E=0,D=B.length;E<D;E++){if(B[E]=="id"){SWFAddress.addId(B[E+1])}}}}};/** * 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 = {};/** * @class Utility class that provides detailed browser information. * @static * @ignore */com.asual.util.Browser = new function() {    var _supported = false;    var _version = -1;    var _agent = navigator.userAgent;    var _ie = false;    var _camino = false;    var _safari = false;    var _opera = false;    var _mozilla = false;    if (/MSIE/.test(_agent)) {        _ie = true;        _version = parseFloat(_agent.substring(_agent.indexOf('MSIE') + 4));        _supported = _version >= 6;    } else if (/AppleWebKit/.test(_agent)) {        _safari = true;        _version = parseFloat(_agent.substring(_agent.indexOf('Safari') + 7));        _supported = _version >= 312;    } else if (/Opera/.test(_agent)) {        _opera = true;        _version = parseFloat(navigator.appVersion);        _supported = _version >= 9.02;    } else if (/Camino/.test(_agent)) {        _camino = true;        _version = parseFloat(_agent.substring(_agent.indexOf('Camino') + 7));        _supported = _version >= 1;    } else if (/Firefox/.test(_agent)) {        _mozilla = true;        _version = parseFloat(_agent.substring(_agent.indexOf('Firefox') + 8));        _supported = _version >= 1;    } else if (/Netscape/.test(_agent)) {        _mozilla = true;        _version = parseFloat(_agent.substring(_agent.indexOf('Netscape') + 9));        _supported = _version >= 8;    } else if (/Mozilla/.test(_agent) && /rv:/.test(_agent)) {        _mozilla = true;        _version = parseFloat(_agent.substring(_agent.indexOf('rv:') + 3));        _supported = _version >= 1.8;    }    /**     * Detects if the browser is supported.     * @return {Boolean}     * @static     */    this.isSupported = function() {        return _supported;    }    /**     * Detects the version of the browser.     * @return {Number}     * @static     */    this.getVersion = function() {        return _version;    }    /**     * Detects if the browser is Internet Explorer.     * @return {Boolean}     * @static     */    this.isIE = function() {        return _ie;    }    /**     * Detects if the browser is Safari.     * @return {Boolean}     * @static     */    this.isSafari = function() {        return _safari;    }    /**     * Detects if the browser is Opera.     * @return {Boolean}     * @static     */    this.isOpera = function() {        return _opera;    }    /**     * Detects if the browser is Camino.     * @return {Boolean}     * @static     */    this.isCamino = function() {        return _camino;    }    /**     * Detects if the browser is Mozilla.     * @return {Boolean}     * @static     */    this.isMozilla = function() {        return _mozilla;    }}/** * @class Utility class that provides event helpers. * @static * @ignore */com.asual.util.Events = new function() {    var _cache = [];    var _browser = com.asual.util.Browser;    var _dcl = 'DOMContentLoaded';    if (_browser.isIE() || _browser.isSafari()) {        (function(){            try {                if (_browser.isIE() || !/loaded|complete/.test(document.readyState))                    document.documentElement.doScroll('left');            } catch(e) {                return setTimeout(arguments.callee, 0);            }            for (var i = 0, e; e = _cache[i]; i++) {                if (e.t == _dcl) e.l.call(null);            }        })();    }    /**     * Adds an event listener to an object.     * @param {Object} obj The object that provides events.     * @param {String} type The type of the event.     * @param {Function} listener The event listener function.     * @return {void}     * @static     */    this.addListener = function(obj, type, listener) {        _cache.push({o: obj, t: type, l: listener});        if (type == _dcl && (_browser.isIE() || _browser.isSafari()))            return;        if (obj.addEventListener){            obj.addEventListener(type, listener, false);        } else if (obj.attachEvent){            obj.attachEvent('on' + type, listener);        }    }    /**     * Removes an event listener from an object.     * @param {Object} obj The object that provides events.     * @param {String} type The type of the event.     * @param {Function} listener The event listener function.     * @return {void}     * @static     */    this.removeListener = function(obj, type, listener) {        for (var i = 0, e; e = _cache[i]; i++) {            if (e.o == obj && e.t == type && e.l == listener) {                _cache.splice(i, 1);                break;            }        }        if (type == _dcl && (_browser.isIE() || _browser.isSafari()))            return;        if (obj.removeEventListener){            obj.removeEventListener(type, listener, false);        } else if (obj.detachEvent){            obj.detachEvent('on' + type, listener);        }    }    var _unload = function() {        for (var i = 0, evt; evt = _cache[i]; i++) {            if (evt.t != _dcl)                com.asual.util.Events.removeListener(evt.o, evt.t, evt.l);        }    }    this.addListener(window, 'unload', _unload);}/** * Creates a new SWFAddress event. * @class Event class for SWFAddress. * @param {String} type Type of the event. */SWFAddressEvent = function(type) {    /**     * String representation of this object.     * @ignore     */    this.toString = function() {        return '[object SWFAddressEvent]';    }    /**     * The type of this event.     * @type String     */    this.type = type;    /**     * The target of this event.     * @type Function     */    this.target = [SWFAddress][0];    /**     * The value of this event.     * @type String     */    this.value = SWFAddress.getValue();    /**     * The path of this event.     * @type String     */    this.path = SWFAddress.getPath();    /**     * The parameters of this event.     * @type Object     */    this.parameters = {};    var _names = SWFAddress.getParameterNames();    for (var i = 0, n; n = _names[i]; i++) {        this.parameters[n] = SWFAddress.getParameter(n);    }}/** * Init event. * @type String * @memberOf SWFAddressEvent * @static */SWFAddressEvent.INIT = 'init';/** * Change event. * @type String * @memberOf SWFAddressEvent * @static */SWFAddressEvent.CHANGE = 'change';/** * @class The SWFAddress class can be configured with query parameters using the following format: * swfaddress.js?html=false&history=1&tracker=pageTracker._trackPageview&strict=1.<br /> * The list of supported options include:<br /><br /> * <code>history:Boolean</code> - Enables or disables the creation of history entries.<br /> * <code>html:Boolean</code> - Enables or disables the usage of swfaddress.html.<br /> * <code>strict:Boolean</code> - Enables or disables the strict mode.<br /> * <code>tracker:String</code> - Sets a function for page view tracking.<br /> * @static */SWFAddress = new function() {    var _browser = com.asual.util.Browser;    var _supported = _browser.isSupported();        var _d = top.document;    var _h = top.history;    var _l = top.location;    var _iframe, _form, _url, _js = 'swfaddress.js';    var _title = _d.title;    var _length = _h.length;    var _silent = false;    var _listeners = {};    var _stack = [];    var _ids = [];    var _opts = [];    _opts['history'] = true;    _opts['html'] = false;    _opts['strict'] = true;   // _opts['tracker'] = 'urchinTracker';    if ((!_supported && _l.href.indexOf('#') != -1) ||        (_browser.isSafari() && _browser.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 _getHash = function() {        var index = _l.href.indexOf('#');        if (index != -1) {            return _l.href.substring(index).replace(/^#/g, '');        }        return '';    }    var _value = _getHash();    var _strictCheck = function(value, force) {        if (_opts['strict']) {            if (force) {                if (value.substr(0, 1) != '/') value = '/' + value;                value = value.replace(/^([^\?.]*[^\/])(\?|$)/, '$1/$2').replace(/\/\//, '/');            } else {                if (value == '') value = '/';            }        }        return value;    }    var _titleCheck = function() {        if (_browser.isIE() && _d.title != _title) {            SWFAddress.setTitle(_title);        }    }    var _listen = function() {        if (!_silent) {            if (_browser.isIE()) {                if (_value != _getHash()) {                    if (_browser.getVersion() < 7) {                        _l.reload();                    } else {                        SWFAddress.setValue(_getHash());                    }                }            } else if (_browser.isSafari()) {                if (_length != _h.length) {                    _length = _h.length;                    if (typeof _stack[_length - 1] != 'undefined') {                        _value = _stack[_length - 1];                    }                    _update();                }            } else if (_value != _getHash()) {                _value = _getHash();                _update();            }            _titleCheck();        }    }    var _jsDispatch = function(type) {        if (SWFAddress.hasEventListener(type)) {            SWFAddress.dispatchEvent(new SWFAddressEvent(type));        }        type = type.substr(0, 1).toUpperCase() + type.substring(1);        if(typeof SWFAddress['on' + type] == 'function') {            SWFAddress['on' + type]();        }    }    var _jsInit = function() {        _jsDispatch('init');    }    var _jsChange = function() {        _jsDispatch('change');    }    var _swfChange = function() {        for (var i = 0, id; id = _ids[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 = (obj && typeof obj.setSWFAddressValue != 'undefined') ?                        obj : ((obj.getElementsByTagName('object')[0] &&                        typeof obj.getElementsByTagName('object')[0].setSWFAddressValue != 'undefined') ?                        obj.getElementsByTagName('object')[0] : ((obj.getElementsByTagName('embed')[0] &&                        typeof obj.getElementsByTagName('embed')[0].setSWFAddressValue != 'undefined') ?                        obj.getElementsByTagName('embed')[0] : null));                    if (obj) {                        obj.setSWFAddressValue(SWFAddress.getValue());                    }                }            }        }    }    var _update = function() {        _swfChange();        _jsChange();    }    var _track = function() {        if (typeof _opts['tracker'] != 'undefined' && eval('typeof ' + _opts['tracker'] + ' != "undefined"')){            var fn = eval(_opts['tracker']);            if (typeof fn == 'function') {                fn((_l.pathname + SWFAddress.getValue()).replace(/\/\//, '/').replace(/^\/$/, ''));            }        }    }    var _htmlWrite = function() {        var doc = _iframe.contentWindow.document;        doc.open();        doc.write('<script>var swfaddress = "' + _getHash() + '";</script>');        doc.close();    }    var _htmlLoad = function() {        if (_opts['html']) {            var src = _iframe.contentWindow.location.href;            _value = (src.indexOf('?') > -1) ?                src.substring(src.indexOf('?') + 1) : '';        } else {            _value = (typeof _iframe.contentWindow.swfaddress != 'undefined') ?                _iframe.contentWindow.swfaddress : '';        }        if (_value != _getHash()) {            _update();            _l.hash = _value;        }    }    var _load = function() {        var attr = 'id="swfaddress" style="position:absolute;top:-9999px;"';        if (_browser.isIE()) {            document.body.appendChild(document.createElement('div')).innerHTML = '<iframe ' + attr + ' src="' +                (_opts['html'] ? _url.replace(/\.js(\?.*)?$/, '.html') + '?' + _getHash() : 'javascript:false;') +                '"></iframe>';            _iframe = document.getElementById('swfaddress');            setTimeout(function() {                if (!_opts['html'] && typeof _iframe.contentWindow.swfaddress == 'undefined') _htmlWrite();                com.asual.util.Events.addListener(_iframe, 'load', _htmlLoad);            }, 10);        } else if (_browser.isSafari()) {            if (_browser.getVersion() < 412) {                document.body.innerHTML += '<form ' + attr + ' method="get"></form>';                _form = document.getElementById('swfaddress');            }            if (typeof _l.swfaddress == 'undefined') _l.swfaddress = {};            if (typeof _l.swfaddress[_l.pathname] != 'undefined') _stack = _l.swfaddress[_l.pathname].split(',');        } else if (_browser.isOpera() && _ids.length == 0) {            document.body.innerHTML += '<embed ' + attr + ' src="' + _url.replace(/\.js(\?.*)?$/, '.swf') +                '" type="application/x-shockwave-flash" />';        }        setTimeout(_jsInit, 1);        setTimeout(_jsChange, 2);        setTimeout(_track, 10);        setInterval(_listen, 50);    }    /**     * Init event.     * @type Function     * @event     * @static     */    this.onInit = null;    /**     * Change event.     * @type Function     * @event     * @static     */    this.onChange = null;    /**     * String representation of this class.     * @ignore     */    this.toString = function() {        return '[class SWFAddress]';    }    /**     * Loads the previous URL in the history list.     * @return {void}     * @static     */    this.back = function() {        _h.back();    }    /**     * Loads the next URL in the history list.     * @return {void}     * @static     */    this.forward = function() {        _h.forward();    }    /**     * Loads a URL from the history list.     * @param {Number} delta An integer representing a relative position in the history list.     * @return {void}     * @static     */    this.go = function(delta) {        _h.go(delta);    }    /**     * Opens a new URL in the browser.     * @param {String} url The resource to be opened.     * @param {String} target Target window.     * @return {void}     * @static     */    this.href = function(url, target) {        target = typeof target != 'undefined' ? target : '_self';        switch(target) {            case '_self':                self.location.href = url;                break;            case '_top':                _l.href = url;                break;            case '_blank':                window.open(url);                break;            default:                top.frames[target].location.href = url;                break;        }    }    /**     * Opens a browser popup window.     * @param {String} url Resource location.     * @param {String} name Name of the popup window.     * @param {String} options Options which get evaluted and passed to the window.open() method.     * @param {String} handler Optional JavaScript code for popup handling.     * @return {void}     * @static     */    this.popup = function(url, name, options, handler) {        var popup = window.open(url, name, eval(options));        eval(handler);    }    /**     * Registers an event listener..     * @param {String} type Event type.     * @param {Function} listener Event listener.     * @return {void}     * @static     */    this.addEventListener = function (type, listener) {        if (typeof _listeners[type] == 'undefined') {            _listeners[type] = [];        }        _listeners[type].push(listener);    }    /**     * Removes an event listener.     * @param {String} type Event type.     * @param {Function} listener Event listener.     * @return {void}     * @static     */    this.removeEventListener = function (type, listener) {        if (typeof _listeners[type] != 'undefined') {            for (var i = 0, l; l = _listeners[type][i]; i++) {                if (l == listener) break;            }            _listeners[type].splice(i, 1);        }    }    /**     * Dispatches an event to all the registered listeners.     * @param {Object} event Event object.     * @return {Boolean}     * @static     */    this.dispatchEvent = function (event) {        if (typeof _listeners[event.type] != 'undefined' && _listeners[event.type].length) {            event.target = this;            for (var i = 0, l; l = _listeners[event.type][i]; i++) {                l(event);            }            return true;        }        return false;    }    /**     * Checks the existance of any listeners registered for a specific type of event.     * @param {String} event Event type.     * @return {Boolean}     * @static     */    this.hasEventListener = function (type) {        return (typeof _listeners[type] != 'undefined' && _listeners[type].length > 0);    }    /**     * Provides the state of the strict mode setting.     * @return {Boolean}     * @static     */    this.getStrict = function() {        return _opts['strict'];    }    /**     * Enables or disables the strict mode.     * @param {Boolean} strict Strict mode state.     * @return {void}     * @static     */    this.setStrict = function(strict) {        _opts['strict'] = enabled;    }    /**     * Provides the state of the history setting.     * @return {Boolean}     * @static     */    this.getHistory = function() {        return _opts['history'];    }    /**     * Enables or disables the creation of history entries.     * @param {Boolean} history History state.     * @return {void}     * @static     */    this.setHistory = function(history) {        _opts['history'] = history;    }    /**     * Provides the tracker function.     * @return {String}     * @static     */    this.getTracker = function() {        return _opts['tracker'];    }    /**     * Sets a function for page view tracking. The default value is 'urchinTracker'.     * @param {String} tracker Tracker function.     * @return {void}     * @static     */    this.setTracker = function(tracker) {        _opts['tracker'] = tracker;    }    /**     * Provides a list of all the Flash objects registered.     * @return {Array}     * @static     */    this.getIds = function() {        return _ids;    }    /**     * Provides the id the first and probably the only Flash object registered.     * @return {String}     * @static     */    this.getId = function(index) {        return _ids[0];    }    /**     * Sets the id of a single Flash object which will be registered for deep linking.     * @param {String} id ID of the object.     * @return {void}     * @static     */    this.setId = function(id) {        _ids[0] = id;    }    /**     * Adds an id to the list of Flash object registered for deep linking.     * @param {String} id ID of the object.     * @return {void}     * @static     */    this.addId = function(id) {        this.removeId(id);        _ids.push(id);    }    /**     * Removes an id from the list of Flash object registered for deep linking.     * @param {String} id ID of the object.     * @return {void}     * @static     */    this.removeId = function(id) {        for (var i = 0, swfid; swfid = _ids[i]; i++) {            if (id == swfid) {                _ids.splice(i, 1);                break;            }        }    }    /**     * Provides the title of the HTML document.     * @return {String}     * @static     */    this.getTitle = function() {        return _d.title;    }    /**     * Sets the title of the HTML document.     * @param {String} title Title value.     * @return {void}     * @static     */    this.setTitle = function(title) {        if (!_supported) return null;        if (typeof title == 'undefined') return;        if (title == 'null') title = '';        _title = _d.title = title;        if (_iframe && _iframe.contentWindow)            _iframe.contentWindow.document.title = title;    }    /**     * Provides the status of the browser window.     * @return {String}     * @static     */    this.getStatus = function() {        return top.status;    }    /**     * Sets the status of the browser window.     * @param {String} status Status value.     * @return {void}     * @static     */    this.setStatus = function(status) {        if (!_supported) return null;        if (typeof status == 'undefined') return;        if (!_browser.isSafari()) {            if (status == 'null') status = '';            status = _strictCheck(status, true);            if (status == '/') status = '';            if (!(/http(s)?:\/\//.test(status))) {                var index = _l.href.indexOf('#');                status = (index == -1 ? _l.href : _l.href.substr(0, index)) + '#' + status;            }            top.status = status;        }    }    /**     * Resets the status of the browser window.     * @return {void}     * @static     */    this.resetStatus = function() {        top.status = '';    }    /**     * Provides the current deep linking value.     * @return {String}     * @static     */    this.getValue = function() {        if (!_supported) return null;        return _strictCheck(_value, false);    }    /**     * Sets the current deep linking value.     * @param {String} value A value which will be appended to the base link of the HTML document.     * @return {void}     * @static     */    this.setValue = function(value) {        if (!_supported) return null;        if (typeof value == 'undefined') return;        if (value == 'null') value = ''        value = _strictCheck(value, true);        if (value == '/') value = '';        if (_value == value) return;        _value = value;        _silent = true;        _update();        _stack[_h.length] = _value;        if (_browser.isSafari()) {            if (_opts['history']) {                _l.swfaddress[_l.pathname] = _stack.toString();                _length = _h.length + 1;                if (_browser.getVersion() < 412) {                    if (_l.search == '') {                        _form.action = '#' + _value;                        _form.submit();                    }                } else {                    var evt = document.createEvent('MouseEvents');                    evt.initEvent('click', true, true);                    var anchor = document.createElement('a');                    anchor.href = '#' + _value;                    anchor.dispatchEvent(evt);                }            } else {                _l.replace('#' + _value);            }        } else if (_value != _getHash()) {            if (_opts['history']) {                _l.hash = '#' + _value;            } else {                _l.replace('#' + _value);            }        }        if (_browser.isIE() && _opts['history']) {            if (_opts['html']) {                _iframe.contentWindow.location.assign(_iframe.contentWindow.location.pathname +                    '?' + _getHash());            } else {                _htmlWrite();            }        }        setTimeout(_track, 10);        _silent = false;    }    /**     * Provides the deep linking value without the query string.     * @return {String}     * @static     */    this.getPath = function() {        var value = this.getValue();        if (value.indexOf('?') != -1) {            return value.split('?')[0];        } else {            return value;        }    }    /**     * Provides the query string part of the deep linking value.     * @return {String}     * @static     */    this.getQueryString = function() {        var value = this.getValue();        var index = value.indexOf('?');        if (index != -1 && index < value.length) {            return value.substr(index + 1);        }        return '';    }    /**     * Provides the value of a specific query parameter.     * @param {String} param Parameter name.     * @return {String}     * @static     */    this.getParameter = function(param) {        var value = this.getValue();        var index = value.indexOf('?');        if (index != -1) {            value = value.substr(index + 1);            var params = value.split('&');            var p, i = params.length;            while(i--) {                p = params[i].split('=');                if (p[0] == param) {                    return p[1];                }            }        }        return '';    }    /**     * Provides a list of all the query parameter names.     * @return {Array}     * @static     */    this.getParameterNames = function() {        var value = this.getValue();        var index = value.indexOf('?');        var names = [];        if (index != -1) {            value = value.substr(index + 1);            if (value != '' && value.indexOf('=') != -1) {                var params = value.split('&');                var i = 0;                while(i < params.length) {                    names.push(params[i].split('=')[0]);                    i++;                }            }        }        return names;    }    if (!_supported) return;    for (var i = 1; i < _length; i++) {        _stack.push('');    }    _stack.push(_l.hash.replace(/^#/g, ''));    if (_browser.isIE() && _l.hash != _getHash()) {        _l.hash = '#' + _getHash();    }    var scripts = document.getElementsByTagName('script');    for (var i = 0, s; s = scripts[i]; i++) {        if (s.src.indexOf(_js) > -1) {            _url = String(s.src);            break;        }    }    if ((qi = _url.indexOf('?')) > -1) {        var param, params = _url.substr(qi + 1).split('&');        for (var j = 0, p; p = params[j]; j++) {            param = p.split('=');            if (/^(history|html|strict)$/.test(param[0])) {                _opts[param[0]] = (isNaN(param[1]) ? eval(param[1]) : (parseFloat(param[1]) > 0));            }            if (/^tracker$/.test(param[0])) {                _opts[param[0]] = param[1];            }        }    }    if (/file:\/\//.test(_l.href)) _opts['html'] = false;    _titleCheck();    com.asual.util.Events.addListener(document, 'DOMContentLoaded', _load);}/* Flash embedding hooks */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;        /**         * @ignore         */        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;            }            if (success = com.asual.SWFObjectWrite.apply(this, arguments))                SWFAddress.addId(this.getAttribute('id'));            return success;        }    } 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;            }        }    }}