
if(!document.attachEvent)
{document.attachEvent=function(type,callback)
{type=type.substring(2);document.addEventListener(type,GenWindowEvent,false);document.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)
{e.target=null;}
e.srcElement=e.target;window.event=e;}}}
function $(id)
{return document.getElementById(id);}
if(!window.CS)window.CS={}
CS.Utility={Href:function()
{this.QueryStringValue=function(s)
{s+="=";var h=window.location.href,ss=h.indexOf(s),a="&";q=h.indexOf('?');if(q>0&&ss>q)
{sh=h.substring(ss+s.length);return sh.indexOf(a)>0?sh.substring(0,sh.indexOf(a)):sh;}
else
{return""}};},Events:function()
{this.AddLoad=function(g)
{var f=window.onload;window.onload=(typeof window.onload=='function')?function(){f();g()}:g;};this.AddPage=function(e,g)
{document.attachEvent(e,g);}},Email:function()
{this.Send=function(r,s,b,ap,ta)
{s=s.replace(/{TITLE}/g,document.title);b=b.replace(/{TITLE}/g,document.title);h=window.location.href;if(ap)
{h+=(h.indexOf('?')>0?'&':'?')+"source=email";}
s=s.replace(/{HREF}/g,h);b=b.replace(/{HREF}/g,h);if(ta&&ta!="")
{CS.Atlas.Action(ta);}
location.href="mailto:"+escape(r)+"?subject="+escape(s)+"&body="+escape(b);}}}
CS.Utility.Events=new CS.Utility.Events();CS.Utility.Href=new CS.Utility.Href();CS.Utility.Email=new CS.Utility.Email();CS.Atlas={Attributes:{Image:"",Location:"",Project:"",BaseUrl:"http://switch.atdmt.com/",NVPairs:function()
{return"";},ClickUrl:function()
{return this.BaseUrl+"action/"+this.Project+"/v3"+
this.NVPairs()+"/location."+this.Location+"/action.";},ViewUrl:function()
{return this.BaseUrl+"view/"+this.Project+"/v3"+
this.NVPairs()+"/location."+this.Location;}},Initialize:function(project,location,view)
{this.Attributes.Project=project;this.Attributes.Location=location;this.Attributes.Image=new Image();document.attachEvent("onclick",CS.Atlas.Click);if(view)this.View();},Click:function()
{(new CS.Atlas.Event()).Send();},Action:function(action)
{this.Load(this.Attributes.ClickUrl()+action.replace(/\s/g,'_'));},View:function()
{this.Load(this.Attributes.ViewUrl());},Load:function(i)
{this.Attributes.Image.src=i+"/?r="+Math.random();},Event:function()
{var me=this;me.anchor=getAnchor(event.srcElement);this.Send=function()
{if(!me.anchor||!me.anchor.id)
return;CS.Atlas.Action(me.anchor.id);};function getAnchor(el)
{while(el&&!(el.tagName=='A'))
el=el.parentNode;return el;};},AddNameValuePair:function(n,v)
{var f=this.Attributes.NVPairs;this.Attributes.NVPairs=function()
{return f()+"/"+(n+"."+(typeof v=='function'?v():v));};}}