			/*
			  Function to set Atlas tags on CMS pages, it needs the following HTML code in the 
			  CMS template file (ASPX) to work properly.
				
				<!--Code for Atlas tags-->
				<div id="AtlasTagsDiv" style="display:none">Atlas Tags:
					<cc1:brandcontentplaceholdercontrol id="AtlasTagsControl" runat="server" PlaceholderToBind="xmlAtlasTags" MultiBrandEdit="False"
						EditControlHeight="100" EditControlWidth="400"></cc1:brandcontentplaceholdercontrol>
				<img height="1" width="1" id="imageTag" src=""/>
				</div>
				<script language="javascript">activateAtlasTag();</script>
				<!--/Code for Atlas tags-->
				
				In addition, a placeholder control definition for XML content is needed on the CMS Template.
				
				On edit mode, authors needs to enter Atlas tags in the folowing format:
				<DIV id=setAtlasTag>Enter Atlas Tag Here</DIV>
				i.e. <DIV id=setAtlasTag>http://switch.atdmt.com/action/krabak_BakersQ207LandingPage_1</DIV>
				 
			*/
			function activateAtlasTag(){
				//get the document edit state; edit-mode=AuthoringReedit, display=Nothing.
				var strUrl = document.URL;
				var isEditMode = strUrl.lastIndexOf("AuthoringReedit");
				var isEditSiteMode = strUrl.lastIndexOf("WBCMODE");
				var atlasDiv = document.getElementById("AtlasTagDiv");
				//if edit state is true, then show placeholder control for editing Atlas tag
				if (isEditMode != -1){
					atlasDiv.style.display="block";
				}else if(isEditSiteMode == -1) {
					//check if an Atlas tag has been set for this page
					var tagContainer = document.getElementById("setAtlasTag");
					//get the HTML image tag used to set the actual Atlas tag
					var img4Tag = document.getElementById("imageTag");
					//if an Atlas has been set, then flag the page
					if(tagContainer != undefined && img4Tag != undefined){
						//get the actual Atlas tag from the placeholder control
						var atlasTag = tagContainer.innerHTML;
						//set the tag
						img4Tag.src = atlasTag;						
					}
				}			
			}
			
			
			/*
			* Standard Function to set atlas tags from a Flash application
			*/
			var TrackTag = "http://switch.atdmt.com/action/";

			function GetActionTag(URL){
				if(GetActionTag){
					var img4Tag = document.getElementById("imageTag");
					//if an Atlas has been set, then flag the page
					if(img4Tag != undefined){
						img4Tag.src = TrackTag + URL;
					}
				}
			}