Atlas={Go:function(country,project,location,view,unload)
{var dr=document.referrer;this.m_dataMap.single.project=project;this.m_dataMap.pair.country.value=country;this.m_dataMap.pair.location.value=location;this.m_dataMap.pair.url.value=encodeURIComponent(dr);this.m_dataMap.pair.domain.value=this.GetDomain(dr);this.m_dataMap.pair.keywords.value=this.GetSearchKeywords(dr);this.m_dataMap.pair.search.value=this.GetSearchResult(dr);this.m_dataMap.pair.source.value=this.GetQuerystringValue("source");this.m_dataMap.pair.var1.value=this.GetCookieValue("var1");this.m_dataMap.pair.var2.value=this.GetCookieValue("var2");this.m_dataMap.pair.var3.value=this.GetDoveDomain();if(parseInt(this.m_dataMap.pair.var1.value)<0)
this.m_dataMap.pair.var1.value=null;if(parseInt(this.m_dataMap.pair.var2.value)<0)
this.m_dataMap.pair.var2.value=null;if(view)
{this.View();}
if(unload)
{this.BindUnloadEvent();}
document.attachEvent("onmouseup",Atlas.Click);},SetCountry:function(country)
{this.m_dataMap.pair.country.value=country;},SetLocation:function(location)
{this.m_dataMap.pair.location.value=location;},SetLanguage:function(language)
{this.m_dataMap.pair.language.value=language;},SetTimePivot:function(pivot)
{this.m_timePivot=pivot;},GetSearchKeywords:function(i)
{for(var search in this.m_searchProviders)
{if(i.indexOf(this.m_searchProviders[search].form)==0)
{return this.GetQuerystringValue(this.m_searchProviders[search].key,i).replace(/[+]/g,",");}}
return"";},GetSearchResult:function(i)
{for(var search in this.m_searchProviders)
{if(i.indexOf(this.m_searchProviders[search].form)==0)
{return search;}}
return"";},GetDomain:function(i)
{var regex="(?:http|https)://(.*?)/";if(i&&i.length>0)
{var matches=i.match(regex);if(matches&&matches.length>1)
{return encodeURIComponent(matches[1]);}}
return"";},GetDoveDomain:function()
{var d=this.GetCookieValue("SiteReturnUrl");if(d&&d.length>0)
return this.GetDomain(d);else
return window.location.host;},GetQuerystringValue:function(s,u)
{var m=(u?u:window.location.href).toString().match(s+"=([^&#]*)(?:[#&]*)"),ml=m?m.length:-1;if(ml>0)
return m[ml-1];return"";},GetCookieValue:function(key)
{key+='=';var c=document.cookie,i=c.indexOf(key);if(i>-1)
{var j=c.indexOf(';',i+key.length);return c.substring(i+key.length,j==-1?c.length:j);}
else
return'';},m_actionListeners:new Array(),m_timePivot:5,m_image:new Image(),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:""},var1:{value:""},var2:{value:""},var3:{value:""},time:{value:""},resolution:{value:screen.width+"x"+
screen.height},search:{value:""},keywords:{value:""},domain:{value:""},url:{value:""}},buildUrl:function()
{var u=[window.location.protocol+"/"];for(var s in this.single)
{u.push(this.single[s]);}
for(var p in this.pair)
{var v=this.pair[p].value;if(v!="")
{u.push(p+"."+v);}
if(this.pair[p].reset)
{this.pair[p].value="";}}
return u.join('/');}},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(action)
{var a=this.CleanString(action);var p=a.split("|");for(var i=0;i<p.length;++i)
{switch(i)
{case 0:this.m_dataMap.pair.action.value=p[i];break;case 1:this.m_dataMap.pair.actionname.value=escape(p[i]);break;case 2:this.m_dataMap.pair.section.value=escape(p[i]);break;}}
var url=this.m_dataMap.buildUrl();this.LoadImage(url);for(var i=0;i<this.m_actionListeners.length;++i)
{var cb=this.m_actionListeners[i];if(typeof cb=='function')
cb(url);}},View:function()
{this.Action("view");},OnAction:function(callback)
{this.m_actionListeners.push(callback);},Event:function()
{var me=this;me.anchor=getAnchor(event.srcElement);this.Send=function()
{var link=me.anchor;if(!link)
return;var track=link.getAttribute('track');track=(!track||track.length==0)?link.id:track;if(!track||track.length==0)
return;if(track.indexOf("|")==-1)
return;Atlas.Action(track);};function getAnchor(el)
{while(el&&!(el.tagName=='A'))
el=el.parentNode;return el;};},BindUnloadEvent:function(a)
{var then=new Date();window.attachEvent("onunload",function()
{var s=Math.round(((new Date()).getTime()-then.getTime())/1000);Atlas.m_dataMap.pair.time.value=s;Atlas.Action("unload");});},LoadImage:function(i)
{Atlas.m_image.src=i+"/?"+Math.random();},CleanString:function(i)
{return i.replace(/\/|\?|&|\.|#/g,"_");}}
function __bindEventHdlr(target)
{if(target&&!target.attachEvent)
{target.attachEvent=function(type,callback)
{type=type.substring(2);target.addEventListener(type,GenWindowEvent,false);target.addEventListener(type,callback,false);function GenWindowEvent(e)
{try
{var i=0;while(e.target&&e.target.nodeType!=1&&++i<50)
e.target=e.target.parentNode;}
catch(ex)
{}
window.event=e;}}}}
__bindEventHdlr(window);__bindEventHdlr(document);