/**
 * 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 B=false;var D=-1;var F=navigator.userAgent;var H=false;var A=false;var G=false;var C=false;var E=false;if(/MSIE/.test(F)){H=true;D=parseFloat(F.substring(F.indexOf("MSIE")+4));B=D>=6}else{if(/AppleWebKit/.test(F)){G=true;D=parseFloat(F.substring(F.indexOf("Safari")+7));B=D>=312}else{if(/Opera/.test(F)){C=true;D=parseFloat(navigator.appVersion);B=D>=9.02}else{if(/Camino/.test(F)){A=true;D=parseFloat(F.substring(F.indexOf("Camino")+7));B=D>=1}else{if(/Firefox/.test(F)){E=true;D=parseFloat(F.substring(F.indexOf("Firefox")+8));B=D>=1}else{if(/Netscape/.test(F)){E=true;D=parseFloat(F.substring(F.indexOf("Netscape")+9));B=D>=8}else{if(/Mozilla/.test(F)&&/rv:/.test(F)){E=true;D=parseFloat(F.substring(F.indexOf("rv:")+3));B=D>=1.8}}}}}}}this.isSupported=function(){return B};this.getVersion=function(){return D};this.isIE=function(){return H};this.isSafari=function(){return G};this.isOpera=function(){return C};this.isCamino=function(){return A};this.isMozilla=function(){return E}};asual.util.Events=new function(){var B=[];var C=asual.util.Browser;var D="DOMContentLoaded";if(C.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 F=0,G;G=B[F];F++){if(G.t==D){G.l.call(null)}}}}}else{if(C.isSafari()){var E=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(E);for(var F=0,G;G=B[F];F++){if(G.t==D){G.l.call(null)}}}},10)}}this.addListener=function(H,F,G){B.push({o:H,t:F,l:G});if(F==D&&(C.isIE()||C.isSafari())){return }if(H.addEventListener){H.addEventListener(F,G,false)}else{if(H.attachEvent){H.attachEvent("on"+F,G)}}};this.removeListener=function(J,G,H){for(var F=0,I;I=B[F];F++){if(I.o==J&&I.t==G&&I.l==H){B.splice(F,1);break}}if(G==D&&(C.isIE()||C.isSafari())){return }if(J.removeEventListener){J.removeEventListener(G,H,false)}else{if(J.detachEvent){J.detachEvent("on"+G,H)}}};var A=function(){for(var G=0,F;F=B[G];G++){if(F.t!=D){asual.util.Events.removeListener(F.o,F.t,F.l)}}};if(C.isIE()||C.isSafari()){this.addListener(window,"unload",A)}};SWFAddressEvent=function(B){this.type=B;this.target=[SWFAddress][0];this.value=SWFAddress.getValue();this.path=SWFAddress.getPath();this.parameters=[];var C=SWFAddress.getParameterNames();for(var A=0,D;D=C[A];A++){this.parameters[D]=SWFAddress.getParameter(D)}};SWFAddressEvent.INIT="init";SWFAddressEvent.CHANGE="change";SWFAddress=new function(){var browser=asual.util.Browser;var iframe,form,supported=browser.isSupported();var swfaddr,swfobj,swfupdate=false;var swftitle=document.title;var swflength=history.length;var swfhistory=[];var swfids=[];var listeners={};var swftrackingEnabled=true;var swfhistoryEnabled=true;var js="swfaddress.js";var swf="swfaddress.swf";var html="swfaddress.html";var d=top.document;var h=top.history;var l=top.location;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 getURL=function(url){var scripts=document.getElementsByTagName("script");for(var i=0,s;s=scripts[i];i++){if(s.src.indexOf(js)>-1){return(new String(s.src)).replace(js,url)}}};var getHash=function(){var index=l.href.indexOf("#");if(index!=-1){return l.href.substring(index).replace(/^#/g,"")}return""};var hash=getHash();var titleListener=function(){if(browser.isIE()&&d.title!=swftitle){SWFAddress.setTitle(swftitle)}};var listen=function(){if(!swfupdate){if(browser.isIE()){if(hash!=getHash()){if(browser.getVersion()<7){l.reload()}else{SWFAddress.setValue(getHash())}}}else{if(browser.isSafari()){if(swflength!=h.length){swflength=h.length;if(typeof swfhistory[swflength-1]!="undefined"){hash=swfhistory[swflength-1]}update()}}else{if(hash!=getHash()){hash=getHash();update()}}}titleListener()}};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,swfid;swfid=swfids[i];i++){var obj=document.getElementById(swfid);if(obj){if(obj.parentNode&&typeof obj.parentNode.so!="undefined"){obj.parentNode.so.call("setSWFAddressValue",swfaddr)}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(swfaddr)}}}}};var update=function(){if(swfaddr!=hash){swfaddr=hash;swfChange();jsChange()}};var track=function(){if(swftrackingEnabled&&typeof urchinTracker!="undefined"){var path=l.pathname+SWFAddress.getValue();path=path.replace(/\/\//,"/");path=path.replace(/^\/$/,"");urchinTracker(path)}};var loadSuccess=function(){if(iframe.contentWindow&&iframe.contentWindow.location){var win=iframe.contentWindow;win.document.title=d.title=swftitle;var src=win.location.href;if(src.indexOf("?")>-1){hash=src.substring(src.indexOf("?")+1)}else{hash=""}if(hash!=getHash()){update();l.hash="#"+hash}}};var load=function(){var content=document.createElement("div");document.body.appendChild(content);content.id="swfaddress";content.style.position="absolute";content.style.left=content.style.top="-9999px";if(browser.isIE()||browser.isSafari()){content.innerHTML="<iframe src=\""+getURL(html)+"?"+getHash()+"\" width=\"0\" height=\"0\"></iframe>";iframe=content.getElementsByTagName("iframe")[0]}if(browser.isIE()){asual.util.Events.addListener(iframe,"load",loadSuccess)}if(browser.isSafari()){form=document.createElement("form");form.id="swfaddress-form";form.method="get";content.appendChild(form);if(typeof l.swfaddress=="undefined"){l.swfaddress={}}if(typeof l.swfaddress.history!="undefined"){swfhistory=l.swfaddress.history.split(",")}}if(browser.isOpera()&&typeof swfids.length>0){content.innerHTML="<embed src=\""+getURL(swf)+"\" type=\"application/x-shockwave-flash\" width=\"1\" height=\"1\" />"}setTimeout(jsInit,1);setTimeout(jsChange,2);setInterval(listen,50);track()};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(delta){h.go(delta)};this.addEventListener=function(type,listener){if(typeof listeners[type]=="undefined"){listeners[type]=[]}listeners[type].push(listener)};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)}};this.dispatchEvent=function(event){if(typeof listeners[event.type]!="undefined"){event.target=this;for(var i=0,l;l=listeners[event.type][i];i++){l(event)}}};this.hasEventListener=function(type){return(typeof listeners[type]!="undefined"&&listeners[type].length>0)};this.getHistoryEnabled=function(){return swfhistoryEnabled};this.setHistoryEnabled=function(enabled){swfhistoryEnabled=enabled};this.getTrackingEnabled=function(){return swftrackingEnabled};this.setTrackingEnabled=function(enabled){swftrackingEnabled=enabled};this.href=function(url,target){target=typeof target!="undefined"?target:"_self";switch(target){case"_self":self.location.href=url;break;case"_top":top.location.href=url;break;case"_blank":window.open(url);break;default:document.frames[target].location.href=url;break}};this.popup=function(url,name,options,handler){var popup=window.open(url,name,eval(options));eval(handler)};this.getIds=function(){return swfids};this.getId=function(index){return swfids[0]};this.setId=function(id){swfids[0]=id};this.addId=function(id){swfids.push(id)};this.getTitle=function(){return d.title};this.setTitle=function(title){if(!supported){return null}if(title=="null"){title=""}if(typeof title!="undefined"){swftitle=title;d.title=swftitle}};this.getStatus=function(){return top.status};this.setStatus=function(status){if(!supported){return null}if(!browser.isSafari()){if(status=="null"||typeof status=="undefined"){status=""}if(/http(s)?:\/\//.test(status)==false){var index=l.href.indexOf("#");status=(index==-1?l.href:l.href.substr(0,index))+"#"+status}top.status=status}};this.resetStatus=function(){top.status=""};this.getValue=function(){if(!supported){return null}return hash};this.setValue=function(value){if(!supported){return null}if(value=="null"){value=""}if(swfaddr==value){return }swfupdate=true;hash=value;update();if(swfaddr!=value){return }swfhistory[history.length]=hash;if(browser.isSafari()){if(swfhistoryEnabled){l.swfaddress.history=swfhistory.toString();swflength=history.length+1;if(browser.getVersion()<412){if(l.search==""){form.action="#"+hash;form.submit()}}else{var evt=document.createEvent("MouseEvents");evt.initEvent("click",true,true);var anchor=document.createElement("a");anchor.href="#"+hash;anchor.dispatchEvent(evt)}}else{l.hash="#"+hash}}else{if(hash!=getHash()){if(swfhistoryEnabled){l.hash="#"+hash}else{l.replace("#"+hash)}}}if(browser.isIE()&&swfhistoryEnabled){var win=iframe.contentWindow;var query="?"+getHash();win.location.assign(win.location.pathname+query)}track();swfupdate=false};this.getPath=function(){var value=this.getValue();if(value.indexOf("?")!=-1){return value.split("?")[0]}else{return value}};this.getQueryString=function(){var value=this.getValue();var index=value.indexOf("?");if(index!=-1&&index<value.length){return value.substr(index+1)}return""};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""};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<swflength;i++){swfhistory.push("")}swfhistory.push(l.hash.replace(/^#/g,""));if(browser.isIE()&&l.hash!=getHash()){l.hash="#"+getHash()}swfaddr=this.getValue();titleListener();asual.util.Events.addListener(document,"DOMContentLoaded",load)};if(typeof SWFObject!="undefined"){asual.SWFObjectWrite=SWFObject.prototype.write;SWFObject.prototype.write=function(A){if(this.getAttribute("version").major<8){this.addVariable("$swfaddress",SWFAddress.getValue());((typeof A=="string")?document.getElementById(A):A).so=this}asual.SWFObjectWrite.apply(this,arguments);SWFAddress.addId(this.getAttribute("id"))}}if(typeof SWFFix!="undefined"){asual.SWFFixRegisterObject=SWFFix.registerObject;SWFFix.registerObject=function(C,A,B){asual.SWFFixRegisterObject.apply(this,arguments);SWFAddress.addId(C)};asual.SWFFixCreateSWF=SWFFix.createSWF;SWFFix.createSWF=function(B,A,C){asual.SWFFixCreateSWF.apply(this,arguments);SWFAddress.addId(B.id)};asual.SWFFixEmbedSWF=SWFFix.embedSWF;SWFFix.embedSWF=function(D,I,F,H,A,C,B,E,G){asual.SWFFixEmbedSWF.apply(this,arguments);SWFAddress.addId(G.id)}}if(typeof UFO!="undefined"){asual.UFOCreate=UFO.create;UFO.create=function(A,B){asual.UFOCreate.apply(this,arguments);SWFAddress.addId(B)}}if(typeof LFI_RunContent!="undefined"){asual.LFI_RunContent=LFI_RunContent;LFI_RunContent=function(){asual.LFI_RunContent.apply(this,arguments);for(var B=0,A;A=arguments[B];B++){if(A=="id"){SWFAddress.addId(arguments[B+1]);break}}}}