function PopUp(url, height, width)
{
	var x = (screen.width - width)/2;
	var y = (screen.height - height)/2;
	window.open(url, null, 'width=' + width + ', height=' + height + ', left=' + x + ', top=' + y + ',status=0,toolbar=0,menubar=0,location=0');
}

function PopUpNome(url, nome , height, width)
{
	var x = (screen.width - width)/2;
	var y = (screen.height - height)/2;
	window.open(url, nome, 'width=' + width + ', height=' + height + ', left=' + x + ', top=' + y + ',status=0,toolbar=0,menubar=0,location=0,resizable=1');
}

function PopUpScroll(url, height, width, scroll)
{
	var x = (screen.width - width)/2;
	var y = (screen.height - height)/2;
	window.open(url, null, 'width=' + width + ', height=' + height + ', left=' + x + ', top=' + y + ',status=yes,toolbar=no,menubar=no,location=no,scrollbars=' + scroll);
}

function PopUpFullScreen(url)
{
	//var x = (screen.width - 900)/2;
	//var y = (screen.height - 900)/2;
	//window.open(url, null, 'left=' + x + ', top=' + y + ',fullscreen=no,status=yes,toolbar=no,menubar=no,location=no,scrollbars=no');
	window.open(url, 'base',"left=0,top=0,scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no");
	//window.open(url, null,'fullscreen=yes','scrollbars=no');
	if (window.name != 'base') {
		//window.location = "../";
		window.opener=self;
		window.close();
	}	
}

function PopUpModal(url, height, width){ // by Ultima v1.2 
	var isBlocked=false;
	var myWin = null;
	var x = (screen.width - width)/2;
	var y = (screen.height - height)/2;
	if (document.layers){
		document.captureEvents(Event.MOUSEDOWN);
		document.onmousedown = checkFocus();
		isBlocked=true;
		
		myWin = window.open(url, null, 'width=' + width + ', height=' + height + ', left=' + x + ', top=' + y + ',status=yes,toolbar=no,menubar=no,location=no');
		myWin.focus();
	}	
	if (document.all)
	{
		myWin = window.open(url, null, 'width=' + width + ', height=' + height + ', left=' + x + ', top=' + y + ',status=yes,toolbar=no,menubar=no,location=no');
		myWin.focus();	
	}
}

function PopUpModalNome(url, nome, height, width){ // by Ultima v1.2 
	var isBlocked=false;
	var myWin = null;
	var x = (screen.width - width)/2;
	var y = (screen.height - height)/2;
	if (document.layers){
		document.captureEvents(Event.MOUSEDOWN);
		document.onmousedown = checkFocus();
		isBlocked=true;
		
		myWin = window.open(url, nome, 'width=' + width + ', height=' + height + ', left=' + x + ', top=' + y + ',status=yes,toolbar=no,menubar=no,location=no');
		myWin.focus();
	}	
	if (document.all)
	{
		myWin = window.open(url, nome, 'width=' + width + ', height=' + height + ', left=' + x + ', top=' + y + ',status=yes,toolbar=no,menubar=no,location=no');
		myWin.focus();	
	}
}

function checkFocus(){
	if (myWin && !myWin.closed){
		myWin.focus();
		return false;			
	}else if (isBlocked) {
		document.releaseEvents(Event.MOUSEDOWN);
		document.onmousedown=null;			
		return true;	
	}
}
function PopUpNomeScroll(url, nome , height, width)
{
	var x = (screen.width - width)/2;
	var y = (screen.height - height)/2;
	window.open(url, nome, 'width=' + width + ', height=' + height + ', left=' + x + ', top=' + y + ',status=0,toolbar=0,menubar=0,location=0,scrollbars=yes');
}