var newwindow;
function popup(url,name,scrollbars)
{
	if(!name) { name = 'name'; }
	if(!scrollbars) { scrollbars = 'no'; }
	newwindow=window.open(url,name,'height=610,width=815,scrollbars='+scrollbars);
	if (window.focus) {newwindow.focus()}
}

function popupdimensions(url,width,height,name,scrollbars)
  {
	if(!name) { name = 'name'; }
	if(!scrollbars) { scrollbars = 'no'; }
	newwindow=window.open(url,name,'height='+height+',width='+width+',scrollbars='+scrollbars);
	if (window.focus) {newwindow.focus()}
}


function setClientSize(W, H)
{
    if (!document.all)
    {
		// it is important to resize the window to the
		// wanted values first, even if we won't get them.
		window.resizeTo(W, H);

		// create the checkpoint element
		var cp = document.createElement("div");
		cp.style.position = "absolute";
		cp.style.width = "0px";
		cp.style.height = "0px";
		cp.style.right = "0px";
		cp.style.bottom = "0px";

		// we can only read it's position after we
		// insert it into the document
		
		document.body.appendChild(div);
		
		// here we get the actual client size
		var current_width = cp.offsetLeft;
		var current_height = cp.offsetTop;

		// here we find out how much more we need
		// in order to get to the needed W x H size
		// (or in other words, we compute the size of
		// window decorations: border, scroll bars, title)
		var dw = W - current_width;
		var dh = H - current_height;

		// and _finally_ we get what we need
		window.resizeBy(dw, dh);

		// we can safely delete the checkpoint now
		
		document.body.removeChild(cp);
		
		// for the curious, return to see how much
		// did IE miss it
		return { missed_width: dw, missed_height: dh };
	}
}
