function cw(action, winwidth, winheight) {
        var cw = null;
        cw =  window.open ("", "", "toolbar=no,width="+winwidth+",height="+winheight+",directories=no,status=no,scrollbars=yes,resize=no,menubar=no");
	if (cw != null) {
               if (cw.opener == null) {
                   cw.opener = self;
                   }
               cw.location.href = action;
               }

}

function aw(action, winwidth, winheight) {
        var aw = null;
        aw =  window.open ("", "", "toolbar=no,width="+winwidth+",height="+winheight+",directories=no,status=yes,scrollbars=yes,resize=yes,menubar=no,screenX=10,screenY=10");
	if (aw != null) {
               if (aw.opener == null) {
                   aw.opener = self;
                   }
               aw.location.href = action;
               }

}

function pw(action, winwidth, winheight) {
        var pw = null;
        pw =  window.open ("", "", "toolbar=no,width="+winwidth+",height="+winheight+",directories=no,status=no,scrollbars=no,resize=no,menubar=no");
	if (pw != null) {
               if (pw.opener == null) {
                   pw.opener = self;
                   }
               pw.location.href = action;
               }

}

function ow(action,winwidth,winheight, windowname) {
        var ow = null;
        ow =  window.open (action, windowname, "toolbar=no,width="+winwidth+",height="+winheight+",directories=no,status=no,scrollbars=yes,resize=no,menubar=no");
	if (ow != null) {
               if (ow.opener == null) {
                   ow.opener = self;
                   }
               ow.location.href = action;
               }
}

function show_chat(action,winwidth,winheight) {
        var PROFILE = null;
        PROFILE =  window.open ("", "ChatWindow", "toolbar=no,width="+winwidth+",height="+winheight+",directories=no,status=no,scrollbars=yes,resize=no,menubar=no,screenX=10,screenY=10");
	if (PROFILE != null) {
               if (PROFILE.opener == null) {
                   PROFILE.opener = self;
                   }
               PROFILE.location.href = action;
               }
}

function setCookie(name, value) {
  document.cookie = name + "=" + escape(value);
}

function setPermCookie(name, value) {
  document.cookie  = name+"="+escape(value)+"; EXPIRES=Tuesday, 01-Jun-32 11:21:30 GMT; PATH=/; DOMAIN=.khmer.cc";
}

function getCookie(name) {
  var find = name + "=";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(find);
    if (offset > 0) {
      offset += find.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      return unescape(document.cookie.substring(offset, end));
    }
  }
}

document.cookie = "TZ=" + (new Date()).getTimezoneOffset() + "; path=/; expires=Mon, 16 Aug 2010 10:20:00 UTC;";
