<!--
function popupPage(pageURL)
        {
        xposition=0; yposition=0;
        args = "width=" + 178 + ","
        + "height=" + 500 + ","
        + "location=0,"
         + "menubar=0,"
         + "resizable=0,"
         + "scrollbars=1,"
         + "status=0,"
         + "titlebar=0,"
         + "toolbar=0,"
          + "hotkeys=0,"
          + "fullscreen=0,"
           + "left=" + xposition + ","
           + "top=" + yposition;
           aPopup=window.open(pageURL,"LoginWindow",args);
           if ((document.window != null) && (!aPopup.opener))
                  aPopup.opener = document.window;
        if (parseInt(navigator.appVersion) >= 4) { aPopup.window.focus(); }
        }

function popupLobby(pageURL)
        {
        xposition=50; yposition=50;
        args = "width=" + 604 + ","
        + "height=" + 480 + ","
        + "location=0,"
         + "menubar=0,"
         + "resizable=0,"
         + "scrollbars=0,"
         + "status=0,"
         + "titlebar=0,"
         + "toolbar=0,"
          + "hotkeys=0,"
          + "fullscreen=0,"
           + "left=" + xposition + ","
           + "top=" + yposition;
           aPopup=window.open(pageURL,"Shockwave_Games",args);
        if (parseInt(navigator.appVersion) >= 4) { aPopup.window.focus(); }
        }

function popupPage2(pageURL)
        {
        xposition=50; yposition=50;
        args = "width=" + 480 + ","
        + "height=" + 360 + ","
        + "location=0,"
         + "menubar=0,"
         + "resizable=1,"
         + "scrollbars=0,"
         + "status=0,"
         + "titlebar=0,"
         + "toolbar=0,"
          + "hotkeys=0,"
          + "fullscreen=0,"
           + "left=" + xposition + ","
           + "top=" + yposition;
           aPopup=window.open(pageURL,"Shockwave_Games",args);
        if (parseInt(navigator.appVersion) >= 4) { aPopup.window.focus(); }
        }

function popupPage3(pageURL)
        {
        xposition=50; yposition=50;
        args = "width=" + 750 + ","
        + "height=" + 560 + ","
        + "location=0,"
         + "menubar=0,"
         + "resizable=1,"
         + "scrollbars=0,"
         + "status=0,"
         + "titlebar=0,"
         + "toolbar=0,"
          + "hotkeys=0,"
          + "fullscreen=0,"
           + "left=" + xposition + ","
           + "top=" + yposition;
           aPopup=window.open(pageURL,"Shockwave_Games",args);
        if (parseInt(navigator.appVersion) >= 4) { aPopup.window.focus(); }
        }

function chatPopup(pageURL)
        {
        xposition=50; yposition=50;
        args = "width=" + 624 + ","
        + "height=" + 427 + ","
        + "location=0,"
         + "menubar=0,"
         + "resizable=1,"
         + "scrollbars=0,"
         + "status=0,"
         + "titlebar=0,"
         + "toolbar=0,"
          + "hotkeys=0,"
          + "fullscreen=0,"
           + "left=" + xposition + ","
           + "top=" + yposition;
           aPopup=window.open(pageURL,"chat",args);
        if (parseInt(navigator.appVersion) >= 4) { aPopup.window.focus(); }
        }

function popupPage5(pageURL)
        {
        xposition=50; yposition=50;
        args = "width=" + 750 + ","
        + "height=" + 650 + ","
        + "location=0,"
         + "menubar=0,"
         + "resizable=1,"
         + "scrollbars=0,"
         + "status=0,"
         + "titlebar=0,"
         + "toolbar=0,"
          + "hotkeys=0,"
          + "fullscreen=0,"
           + "left=" + xposition + ","
           + "top=" + yposition;
           aPopup=window.open(pageURL,"Shockwave_Games",args);
        if (parseInt(navigator.appVersion) >= 4) { aPopup.window.focus(); }
        }

function javapopup(pageURL,width,height)
        {
        xposition=50; yposition=50;
        args = "width=" + width + ","
        + "height=" + height + ","
        + "location=0,"
         + "menubar=0,"
         + "resizable=0,"
         + "scrollbars=0,"
         + "status=0,"
         + "border=0,"
         + "titlebar=0,"
         + "toolbar=0,"
          + "hotkeys=0,"
          + "fullscreen=0,"
           + "left=" + xposition + ","
           + "top=" + yposition;
           aPopup=window.open(pageURL,"Games",args);
        if (parseInt(navigator.appVersion) >= 4) { aPopup.window.focus(); }
        }

function popupBilling(pageURL,width,height)
        {
        xposition=50; yposition=50;
        args = "width=" + width + ","
        + "height=" + height + ","
        + "location=0,"
         + "menubar=0,"
         + "resizable=0,"
         + "scrollbars=1,"
         + "status=0,"
         + "border=0,"
         + "titlebar=0,"
         + "toolbar=0,"
          + "hotkeys=0,"
          + "fullscreen=0,"
           + "left=" + xposition + ","
           + "top=" + yposition;
           aPopup=window.open(pageURL,"Games",args);
        if (parseInt(navigator.appVersion) >= 4) { aPopup.window.focus(); }
        }
				
 function Get_Cookie(name) {
        var start = document.cookie.indexOf(name+"=");
        var len = start+name.length+1;
        if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
        if (start == -1) return null;
        var end = document.cookie.indexOf(";",len);
        if (end == -1) end = document.cookie.length;
        return unescape(document.cookie.substring(len,end));
 } //function ends


function go_chat() {
        username = Get_Cookie("login") ;
        if (username == null) {
               javascript:popupPage('/messenger/login/index.php');
         }
         else {
              javascript:chatPopup('/chat/chat.php');
        }
}//function go_chat

function openLargeWindow(url)
{
  var hWnd = window.open(url,"MessageWindow","width=600,height=500,resizable=no,scrollbars=yes");
  if ((document.window != null) && (!hWnd.opener))
      hWnd.opener = document.window;
      if (parseInt(navigator.appVersion) >= 4) { hWnd.window.focus(); }
}

/*function openWindow(url)
{
    var hWnd = window.open(url,"LoginWindow","width=178,height=440,resizable=no,scrollbars=yes");
    if ((document.window != null) && (!hWnd.opener))
          hWnd.opener = document.window;
          if (parseInt(navigator.appVersion) >= 4) { hWnd.window.focus(); }
}*/

function openWindow(url)
    {
                var xpos = (screen.width/2)-396;
                if(xpos<0) { xpos=0; }
                var ypos = (screen.height/2)-220;
                if(ypos<0) { ypos=0; }
        var hWnd = window.open(url,"LoginWindow","width=178,height=550,resizable=no,scrollbars=yes,left="+xpos+",top="+ypos);
        hWnd.opener = top.opener;
        if (parseInt(navigator.appVersion) >= 4) { hWnd.window.focus(); }
    }

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}


var now = new Date();
 now.setTime(now.getTime() +  24 * 60 * 60 * 1000);

function indexpopup() {
            alertMessage = Get_Cookie("alertMessage") ;
                if (alertMessage == null) {
                  javapopup("alertmsg.html",300,300);
                  setCookie("alertMessage", "yes", now);
               }
 } //function ends

  function check_login() {
        playername = Get_Cookie("login") ;
        if (playername == null) {
               javascript:popupPage('../messenger/login/index.php');
               return false ;
         }
         else {
               return true ;
         }
}//function check_login ends

function mahjonggpopup(pageURL)
        {
        width=750 ;
        height=550 ;
        xposition=50; yposition=50;
        args = "width=" + width + ","
        + "height=" + height + ","
        + "location=0,"
         + "menubar=0,"
         + "resizable=1,"
         + "scrollbars=0,"
         + "status=0,"
         + "titlebar=0,"
         + "toolbar=0,"
          + "hotkeys=0,"
          + "fullscreen=0,"
           + "left=" + xposition + ","
           + "top=" + yposition;
           aPopup=window.open(pageURL,"Games",args);
        if (parseInt(navigator.appVersion) >= 4) { aPopup.window.focus(); }
        }
        //function mahjonggpopup ends

function trim(strText) {
    // this will get rid of leading spaces
    while (strText.substring(0,1) == ' ')
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
}

function checkandsend()
{
 thishead = document.messageform.messtopic.value;
 thisbody = document.messageform.messbody.value;

 thishead = trim(thishead);
 thisbody = trim(thisbody);

 if(thishead.length<1)
     {
     alert("You need to enter a topic!");
     return false;
     }

 if(thisbody.length<1)
     {
     alert("type some text in the message!");
     return false;
     }

document.messageform.submit();
}

var areaname = "topic";
function addsmiley(texttoadd)
     {
     if(areaname=="topic")
          {
          document.messageform.messtopic.value += texttoadd;
          }
     else
          {
          if(areaname=="text")
               {
               document.messageform.messbody.value += texttoadd;
               }
          else
               {
               return false;
               }
          }
     }

function setarea(newarea)
     {
     areaname=newarea;
     }

function donehere()
     {
     location.href='redirect.php'
     }

-->

