// Pop up Universal Script
// How-to: call function pop with the following parameters:
// style:  either 'up' or 'under'
// url:  the location of the file to be displayed in the popup/under.
// width: the width of the window
// height: the height of the window
// offset: the number of pixels to offset from the opening window
// other:  other assignables, e.g. screenX, toolbars, etc... left blank for all no's

function pop(style,url,width,height,offset,other) {
	if (other == "") other = "scrollbars=no,resizable=no,toolbar=no,directories=no,status=no,menubar=no";
	other += ",width=" + width + ",height=" + height;
	if (isNaN(offset)) offset = 0;
	if (!document.all) 
	  other += ",screenX=" + (window.screenX + offset) + ",screenY=" + (window.screenY + offset);
	else
	  other += ",top=" + (window.screenTop + offset) + ",left=" + (window.screenLeft + offset);
	
	var popped =  window.open(url,"window" + (new Date()).getTime(),other);
	if (style == "under") {
	  popped.blur();
	  popped.opener.focus();
	}	
}

function getCookie(name) {
  var result = null;
  var cookieX = " " + document.cookie + ";";
  var searchName = " " + name + "=";
  var startOfCookie = cookieX.indexOf(searchName);
  var endOfCookie;
  if (startOfCookie != -1) {
    startOfCookie += searchName.length;
	endOfCookie = cookieX.indexOf(";",startOfCookie);
	result = unescape(cookieX.substring(startOfCookie,endOfCookie));
  }
  return result;
}