// A general-purpose popup window function
function popupWindow(uri, width, height) {

    var windowName = 'popup';
    if(arguments.length > 3) {
        windowName = arguments[3];
    }
    var popUp = window.open(uri, windowName, 'width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes,menubar=no,toolbar=no');
    if (typeof popUp == 'object') { popUp.focus(); }
}

function popupWindow(uri, width, height,conf) {
	if (conf) {
		if (!confirm('NOTE: If you have changed any information on this page, and have not hit the "Save" or "Apply" buttons below, those changes will be lost if you choose "OK". Continue?')) {
			return false;
		} 
	}
    var windowName = 'popup';
    if(arguments.length > 3) {
        windowName = arguments[3];
    }
    var popUp = window.open(uri, windowName, 'width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes,menubar=no,toolbar=no');
    if (typeof popUp == 'object') { popUp.focus(); }
}

function ResizeIFrameToContent(iframe) {
	if (iframe.contentDocument && iframe.contentDocument.body.offsetHeight) //ns6 syntax
		iframe.height = iframe.contentDocument.body.offsetHeight; 
	else if (iframe.Document && iframe.Document.body.scrollHeight) //ie5+ syntax
		iframe.height = iframe.Document.body.scrollHeight;
		
}