﻿if (!PS) var PS = new Object();

PS.Window = new Object();

PS.Window.popUpESRB = function()
{
   day = new Date();
   id = day.getTime();
   eval("page" + id + " = window.open('http://www.esrb.org/esrbratingdef.html', '" + id + "', 'toolbar=0,scrollbars=1,location=0,status=0,menubar=0,resizable=1,width=600,height=500');");
}

PS.Window.Search = function()
{
   var s = escape(EC.DOM.getElement('tbHeadSearch').value);
 
   document.location.href = '/Search' + (s == '' || s == 'Search%20Playstation.com' ? '' : '?search&s=' + s);
}


PS.Events = new Object();

PS.Events.OnSearch = function(obj, e)
{
   var ee = new EC.Event(e);

   EC.Events.OnClick(obj, e, function () { PS.Window.Search() });
   EC.Events.OnEnterKey(obj, e, function () { PS.Window.Search() });
}

PS.Events.OnEnterClickButton = function(obj, e, id)
{
   EC.Events.OnEnterKey(obj, e, function () { EC.DOM.getElement(id).ecClick() });
}

function shellFix()
{
   var shellDiv = document.getElementById('shell');

   if (shellDiv) {
      var currentWidth = document.body.clientWidth;

      shellDiv.style.width = "100%";
      shellDiv.style.backgroundPosition = (((currentWidth - 1150) / 2) + "px -30px");
   }
}


PS.asyncPostBackNotifications = new Array();

PS.asyncPostBackNotify = function()
{
   for (i = 0; i < PS.asyncPostBackNotifications.length; i++) {
      try {
         PS.asyncPostBackNotifications[i]();
      }
      catch (err) {
      }
   }
}

PS.addAsyncPostBackNotification = function(f)
{
   PS.asyncPostBackNotifications[PS.asyncPostBackNotifications.length] = f;
}

