var curPopupWindow = null;
function openSizedLookup(baseURL,pwidth,pheight)
{
	var top = (screen.height-pheight)/2;
	var left = (screen.width-pwidth)/2;
	openPopup(baseURL, "lookup", pwidth, pheight,"top="+top+",left="+left+",width="+pwidth+",height="+pheight+",toolbar=no,status=no,directories=no,menubar=no,resizable=yes,scrollable=no", false);
}

function openPopup(url, name, pWidth, pHeight, features, snapToLastMousePosition) {
	closePopup();
	if (snapToLastMousePosition) {
		if (lastMouseX - pWidth < 0) {
			lastMouseX = pWidth;
		}
		if (lastMouseY + pHeight > screen.height) {
			lastMouseY -= (lastMouseY + pHeight + 50) - screen.height;
		}
                lastMouseX -= pWidth;
                lastMouseY += 10;
		features +=	"screenX=" + lastMouseX + ",left=" + lastMouseX + "screenY=" + lastMouseY + ",top=" + lastMouseY;
	}
	curPopupWindow = window.open(url, name, features, false);
}

function closePopup() {
	if (curPopupWindow != null) {
		if (!curPopupWindow.closed) {
			curPopupWindow.close();
		}
		curPopupWindow = null;
	}
}

function openPrivacy()
{ 
 openSizedLookup('privacy.html',650,300);
}

function openLegal()
{ 
 openSizedLookup('legal.html',650,550);
}

function openPrivacy2()
{ 
 openSizedLookup('../privacy.html',650,300);
}

function openLegal2()
{ 
 openSizedLookup('../legal.html',650,550);
}


function newWindow(target, X, Y){
  var openCommand = "window.open(\"\", \"" + target + "\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=" + X + ",height=" + Y + "\");";
  eval(openCommand);
}

