if (typeof(PltCore) == "undefined")
{
   var PltCore =
   {
      ScriptTagStart: " <script type='text/javascript' src='",
      ScriptTagEnd: "'></script>",
      ScriptBaseURL: "/plt_controls_v2/scripts/",
      
      Initialize: function()
      {
      },
      
      LoadScriptConditional: function(type, scriptFilename)
      {
         if (type == "undefined")
         {
            document.write(PltCore.ScriptTagStart + PltCore.ScriptBaseURL + scriptFilename + PltCore.ScriptTagEnd);
         }
      },
      
      QueryString: function(key)
      {
         var page = new PltCore.PageQuery(window.location.search);
         return unescape(page.getValue(key));
      },
      
      PageQuery: function(q)
      {
         if(q.length > 1) 
         {
            this.q = q.substring(1, q.length);
         }    
         else 
         {
            this.q = null;
         }    
         
         this.keyValuePairs = new Array();
         
         if(q) 
         {
            for(var i=0; i < this.q.split("&").length; i++) 
            {
               this.keyValuePairs[i] = this.q.split("&")[i];
            }
         }
          
         this.getKeyValuePairs = function() { return this.keyValuePairs; }
          
         this.getValue = function(s)
         {
            for(var j=0; j < this.keyValuePairs.length; j++)
            {
               if(this.keyValuePairs[j].split("=")[0] == s)
               {
                  return this.keyValuePairs[j].split("=")[1];
               }
            }
            return false;
          }
          
          this.getParameters = function()
          {
            var a = new Array(this.getLength());
            for(var j=0; j < this.keyValuePairs.length; j++)
            {
               a[j] = this.keyValuePairs[j].split("=")[0];
            }
            return a;
          }  
      },
      
      SwitchText: function(object, baseText, eventName)
      {
         if (eventName == "blur")
         {
            if (object.value == "")
            {
               object.value = baseText;
            }
         }
         else
         {
            if (object.value == baseText)
            {
                  object.value = "";
            }
         }
      },
      
      ShowOfferPopup: function(ID)
      {
         if (ID != "")
         {
            o = document.getElementById(ID);
            /*
            o.style.left = window.event.clientX + 5;
            o.style.top = window.event.clientY + 5;
            */
            o.style.display = "block";
         }
      },
      
      HideOfferPopup: function(ID)
      {
         o = document.getElementById(ID);
         o.style.display = "none";
      },
      
      UrchinTracker: function(trackingData)
      {
         try
         {
            try
            {
               urchinTracker(trackingData);
            }
            catch(err)
            {
              urchinTracker("/ClickTracker/Errors/" + err.description); 
            }
         }
         catch(outerError)
         {
         }
         
         return true;
      },
      
      AtlasTracker: function(desc)
      {
         if (document.images)
         {
            (new Image()).src = 'http://switch.atdmt.com/action/' + desc;
            PltCore.AtlasTrackerDelay(300);
         }
         return true;
      },
      
      AtlasTrackerDelay: function(mseconds)
      {
         var currentTime = new Date();
         var endTime = currentTime.getTime() + mseconds;
         while (currentTime.getTime() < endTime)
         {
             currentTime = new Date();
         }
      }   
   };

   PltCore.Initialize();
}
