Atlas={Go:function(c,d,b,f,e){var a=document.referrer;this.m_dataMap.single.project=d;this.m_dataMap.pair.country.value=c;this.m_dataMap.pair.location.value=b;this.m_dataMap.pair.url.value=encodeURIComponent(a);this.m_dataMap.pair.domain.value=this.GetDomain(a);this.m_dataMap.pair.keywords.value=this.GetSearchKeywords(a);this.m_dataMap.pair.search.value=this.GetSearchResult(a);this.m_dataMap.pair.source.value=this.GetQuerystringValue("source");if(f)this.View();if(e)this.BindUnloadEvent();document.attachEvent("onmouseup",Atlas.Click)},SetCountry:function(a){this.m_dataMap.pair.country.value=a},SetLocation:function(a){this.m_dataMap.pair.location.value=a},SetLanguage:function(a){this.m_dataMap.pair.language.value=a},SetTimePivot:function(a){this.m_timePivot=a},GetSearchKeywords:function(b){for(var a in this.m_searchProviders)if(b.indexOf(this.m_searchProviders[a].form)==0)return this.GetQuerystringValue(this.m_searchProviders[a].key,b).replace(/[+]/g,",");return ""},GetSearchResult:function(b){for(var a in this.m_searchProviders)if(b.indexOf(this.m_searchProviders[a].form)==0)return a;return ""},GetDomain:function(b){var c="(?:http|https)://(.*?)/";if(b&&b.length>0){var a=b.match(c);if(a&&a.length>1)return encodeURIComponent(a[1])}return ""},GetQuerystringValue:function(b,e){b+="=";var a=e?e:window.location.href,c=a.indexOf(b),d="&";q=a.indexOf("?");if(q>0&&c>q){sh=a.substring(c+b.length);return sh.indexOf(d)>0?sh.substring(0,sh.indexOf(d)):sh}return ""},m_imgCollection:{},m_actionListeners:[],m_timePivot:5,m_dataMap:{single:{url:"switch.atdmt.com",type:"action",project:"",version:"v3"},pair:{language:{value:navigator.language?navigator.language:navigator.browserLanguage},country:{value:""},location:{value:""},action:{value:"",reset:1},actionname:{value:"",reset:1},section:{value:"",reset:1},source:{value:""},time:{value:""},resolution:{value:screen.width+"x"+screen.height},search:{value:""},keywords:{value:""},domain:{value:""},url:{value:""}},buildUrl:function(e){var b=["http:/"];for(var c in this.single)b.push(this.single[c]);for(var a in this.pair){var d=this.pair[a].value;if(d!="")b.push(a+"."+d);if(this.pair[a].reset)this.pair[a].value=""}return b.join("/")+e}},m_searchProviders:{Live:{form:"http://search.live.com/results.aspx?",key:"q"},Google:{form:"http://www.google.com/search?",key:"q"},Yahoo:{form:"http://search.yahoo.com/search?",key:"p"},Ask:{form:"http://www.ask.com/web?",key:"q"},Baidu:{form:"http://www.baidu.com/s?",key:"wd"}},Click:function(){(new Atlas.Event).Send()},Action:function(d){var h=this.m_dataMap.pair.location.value;if(arguments.length>1)this.m_dataMap.pair.location.value=arguments[1];var j=this.CleanStringExceptDot(d),c=j.split("|"),e="";if(c.length>4)for(a=4;a<c.length;a++)e+="/"+c[a];var i=this.CleanString(d),b=i.split("|");for(var a=0;a<b.length;++a)switch(a){case 0:this.m_dataMap.pair.action.value=b[a];break;case 1:this.m_dataMap.pair.actionname.value=escape(b[a]);break;case 2:this.m_dataMap.pair.section.value=escape(b[a]);break;case 3:if(escape(b[a]).length>0)this.m_dataMap.pair.location.value=escape(b[a])}var f=this.m_dataMap.buildUrl(e);this.LoadImage(f);for(var a=0;a<this.m_actionListeners.length;++a){var g=this.m_actionListeners[a];if(typeof g=="function")g(f)}this.m_dataMap.pair.location.value=h},View:function(){if(arguments.length>0)this.Action("view",arguments[0]);else this.Action("view")},OnAction:function(a){this.m_actionListeners.push(a)},Event:function(){var a=this;a.anchor=b(event.srcElement);this.Send=function(){var c=a.anchor;if(!c)return;var b=c.getAttribute("track");b=!b||b.length==0?c.id:b;if(!b||b.length==0)return;if(b.indexOf("|")==-1)return;Atlas.Action(b)};function b(a){while(a&&!(a.tagName=="A"))a=a.parentNode;return a}},BindUnloadEvent:function(){var a=new Date;window.attachEvent("onunload",function(){var b=Math.round(((new Date).getTime()-a.getTime())/1000);Atlas.m_dataMap.pair.time.value=b;Atlas.Action("unload")})},LoadImage:function(b){var a=b+"/?"+Math.random();this.m_imgCollection[a]=new Image;this.m_imgCollection[a].onload=function(){Atlas.OnImageLoaded(a)};this.m_imgCollection[a].onerror=function(){Atlas.OnImageLoaded(a)};this.m_imgCollection[a].onabort=function(){Atlas.OnImageLoaded(a)};this.m_imgCollection[a].src=a},OnImageLoaded:function(a){if(!delete this.m_imgCollection[a])this.m_imgCollection[a]=null},CleanString:function(a){return a.replace(/\/|\?|&|\.|#/g,"_")},CleanStringExceptDot:function(a){return a.replace(/\/|\?|&|#/g,"_")}};function __bindEventHdlr(a){if(a&&!a.attachEvent)a.attachEvent=function(b,d){b=b.substring(2);a.addEventListener(b,c,false);a.addEventListener(b,d,false);function c(a){try{var b=0;while(a.target&&a.target.nodeType!=1&&++b<50)a.target=a.target.parentNode}catch(c){a.target=null}a.srcElement=a.target;window.event=a}}}__bindEventHdlr(window);__bindEventHdlr(document)