function centeredWindow(url, popW, popH, features, returnWindowHandle) {
	
	if(!features)
	{
		features = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1";
	}	
	var w = 800, h = 600;
		
	try {
		if(screen.availWidth) {
  			w = screen.availWidth;
  			h = screen.availHeight;
		}
	}
	catch(e) {}
	
	var leftPos = (w-popW)/2;
	var topPos = (h-popH)/2;
	features += ",width=" + popW + ",height=" + popH + ",top=" + topPos + ",left=" + leftPos;	
	var link = window.open(url, "link", features);
	try {
		link.focus();
	}
	catch(e) {}
	
	if(returnWindowHandle)
	{
		return link;
	}
}

function centeredDiffWindow(url, popW, popH, windowName) {
	
	var features
	var returnWindowHandle
	if(!features)
	{
		features = "toolbar=0,status=0,menubar=0,scrollbars=1,resizable=1";
	}	
	var w = 800, h = 600;
		
	try {
		if(screen.availWidth) {
  			w = screen.availWidth;
  			h = screen.availHeight;
		}
	}
	catch(e) {}

	var leftPos = (w-popW)/2;
	var topPos = (h-popH)/2;
	features += ",width=" + popW + ",height=" + popH + ",top=" + topPos + ",left=" + leftPos;	
	
	var link = window.open(url, windowName, features);
	
	try {
		link.focus();
	}
	catch(e) {}
	
	if(returnWindowHandle)
	{
		return link;
	}
}

function centeredWindowSettings(url, popW, popH, popScroll) {
	var w = 800, h = 600;
		
	try {
		if(screen.availWidth) {
  			w = screen.availWidth;
  			h = screen.availHeight;
		}
	}
	catch(e) {}

	var leftPos = (w-popW)/2;
	var topPos = (h-popH)/2;

	var link = window.open(url, "link", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + popScroll + ",resizable=0,width=" + popW + ",height=" + popH + ",top=" + topPos + ",left=" + leftPos);
	try {
		link.focus();
	}
	catch(e) {}
}
