var x = 0, y=0;

if (document.all) {
  x = window.screenTop + 100;
  y = window.screenLeft + 50; 
}
else if (document.layers)  {
 x = window.screenX + 100;
 y = window.screenY + 50;   
}

if (window.EVENT)
     window.captureEvents(Event.UNLOAD);
window.onunload = DoMessages;

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;
}
function FixDate(date)  {
  	var base = new Date(0);
	var skew = base.getTime();
	if (skew > 0)
 	   date.setTime(date.getTime() - skew);
}
function GetCookie(name)  {
	var dc = document.cookie;
  	var prefix = name + "=";
  	var begin = dc.indexOf("; " + prefix);
     if (begin == -1) {
          begin = dc.indexOf(prefix);
	     if (begin != 0) return null;
    } else
      begin += 2;
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
       end = dc.length;
    return unescape(dc.substring(begin + prefix.length, end));
  }
function GotCookies()  {
	document.cookie = "testcookie=idocookies";
    	var testval = GetCookie('testcookie');
	if (testval == 'idocookies') return 1;
	else return null;
     }
function DoMessages() {
    if (GetCookie('MESSAGES') > 0)    {
        var window_handle;
        window_handle = window.open('https://www.brisnet.com/java-bris/servlet/ShowMessage','msgwind','scrollbars=yes,width=560,height=560');
    }
}

