	function showPopup(popupName) {

		width = 300;
		height = 300;

		var docWidth = document.body.clientWidth;
		var docHeight = document.body.clientHeight;

		var posx = Math.ceil((docWidth - width) / 2);
		var posy = Math.ceil((docHeight - height) / 2);

		myFrame = document.getElementById('adminframe');
		iFrame = document.getElementById(popupName);

		myFrame.style.left = posx;
		myFrame.style.top = posy;

		myFrame.style.width = width;
		myFrame.style.height = height;
		
		iFrame.style.width = width;
		iFrame.style.height = height;		

		dimbackground();

		myFrame.style.display='';

	}

	function setPopupSize(width, height, popupName) {

		myFrame.style.display='none';

		var docWidth = document.body.clientWidth;
		var docHeight = document.body.clientHeight;

		var posx = Math.ceil((docWidth - width) / 2);
		var posy = Math.ceil((docHeight - height) / 2);

		myFrame = document.getElementById('adminframe');
		iFrame = document.getElementById(popupName);

		myFrame.style.left = posx;
		myFrame.style.top = posy;

		myFrame.style.width = width;
		myFrame.style.height = height;

		iFrame.style.width = width;
		iFrame.style.height = height;		

		myFrame.style.display='';

	}	

	function setTitle(title) {
		document.getElementById('popupTitle').innerHTML = title;
	}
	
	function dimbackground() {
		content = document.getElementById("mainbox");
//		content.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); progid:DXImageTransform.Microsoft.Alpha(opacity=30)";
	}
	
	function closePopup(url) {

		content = document.getElementById("mainbox");
//		content.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=0)";

		document.getElementById('adminframe');		
		document.getElementById('adminframe').style.display='none';

		if (url != null) {
			window.location = url;
		}
		
	}
