<script language=JavaScript>

var _PSDebugWindow = null;
var _PSDebug = true;

function PSDebugWindow(funct, l1, v1, l2, v2, l3, v3)
{{
   if (!_PSDebug)
      return;

   if (_PSDebugWindow == null || _PSDebugWindow.closed)
      _PSDebugWindow = window.open("", "PSOGSDebug", "width=600,height=200,resizable=yes,scrollbars=yes");

   if (_PSDebugWindow != null && !_PSDebugWindow.closed) {{
      var doc = _PSDebugWindow.document;

      doc.open("text/html", "replace");
      doc.write("<html><head><title>");
      doc.write("{0}");
      doc.write("</title></head><body><table>");
      doc.write("<tr><td><b>Game:</b></td>");
      doc.write("<td>{1}</td></tr>");
      doc.write("<tr><td><b>Root:</b></td>");
      doc.write("<td></td></tr>");
      doc.write("<tr><td><b>Function:</b></td>");
      doc.write("<td>" + funct + "</td></tr>");
      if (l1 != null) {{
         doc.write("<tr><td><b>" + l1 + "</b></td>");
         doc.write("<td>" + v1 + "</td></tr>");
         if (l2 != null) {{
            doc.write("<tr><td><b>" + l2 + "</b></td>");
            doc.write("<td>" + v2 + "</td></tr>");
         }}
      }}
      doc.write("</table></body></html>");
      doc.close();
   }}
}}

function _PSUrl(funct, url)
{{
   PSDebugWindow(funct, "URL:", url);
   return url;
}}

function PSHomeUrl()
{{
   return _PSUrl("PSHomeUrl", "http://www.us.playstation.com/");
}}

function PSGameUrl()
{{
   return _PSUrl("PSGameUrl", "http://www.us.playstation.com/PS2/Games/{0}");
}}

function PSWhereToBuyUrl()
{{
   return _PSUrl("PSWhereToBuyUrl", "http://www.us.playstation.com/Store/Games/{0}");
}}

function PSMessageBoardsUrl(boardid)
{{
   return _PSUrl("PSMessageBoardsUrl", "http://boardsus.playstation.com/playstation/board");
}}

function _PSNavigate(funct, url)
{{
   PSDebugWindow(funct, "URL:", url);
   window.location.href = url;
}}

function _PSOpen(funct, url)
{{
   PSDebugWindow(funct, "URL:", url);

   var features = "toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,top=0,left=0,width=800";
   var name = "PS_COM";

   window.open(url, name, features);
}}

function PSNavigateHome()
{{
   _PSNavigate("PSNavigateHome", "http://www.us.playstation.com/");
}}

function PSOpenHome()
{{
   _PSOpen("PSOpenHome", "http://www.us.playstation.com/");
}}

function PSNavigateGame()
{{
   _PSNavigate("PSNavigateGame", "http://www.us.playstation.com/PS2/Games/{0}");
}}

function PSOpenGame()
{{
   _PSOpen("PSOpenGame", "http://www.us.playstation.com/PS2/Games/{0}");
}}

function PSNavigateWhereToBuy()
{{
   _PSNavigate("PSNavigateWhereToBuy", "http://www.us.playstation.com/Store/Games/{0}");
}}

function PSOpenWhereToBuy()
{{
   _PSOpen("PSOpenWhereToBuy", "http://www.us.playstation.com/Store/Games/{0}");
}}

function PSNavigateMessageBoards(boardid)
{{
   _PSNavigate("PSNavigateMessageBoards", "http://boardsus.playstation.com/playstation/board");
}}

function PSOpenMessageBoards(boardid)
{{
   _PSOpen("PSOpenMessageBoards", "http://boardsus.playstation.com/playstation/board");
}}

function PSTrackPage(page, category)
{{
   page = page.replace(/[\/\.]/g, "-");
   page = page.replace(/[^ \-\w]/g, "");
   page = page.replace(/\s/g, "+");

   category = category.replace(/[\/\.]/g, "-");
   category = "/Legacy/OGS/" + "{0} {1}" + "/" + category;
   category = category.replace(/[^ \-\w\/]/g, "");
   category = category.replace(/\s/g, "+");
   

   PSDebugWindow("PSTrackPage", "Page:", page, "Category:", category);

   
}}

function PSTrackMusic(music)
{{
   music = music.replace(/[\/\.]/g, "-");
   music = music.replace(/[^ \-\w]/g, "");
   music = music.replace(/\s/g, "+");

   var category = "{0}";
   

   PSDebugWindow("PSTrackMusic", "Page:", music, "Category:", category);

   
}}

function PSGetGameData(field)
{{
return "{0}"
}}

</script>