var debugMode=false;
self.focus();

//-------------  Resize and position   -----------------

try
{
	var isIE = (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0);
	var newX;
	var newY;
	var x = 810;
	var y = 645;
	var xMax = screen.availWidth;
	var yMax = screen.availHeight;
	if (x>xMax) {x=xMax}
	if (y>yMax) {y=yMax}
	newX=x;
	newY=y;
	top.resizeTo(x,y);
	top.moveTo((xMax-x)/2,0);
}
catch(err){if (debugMode) {alert(err.description)}}
//------------------------------------------


function centerIt(desiredClientWidth,desiredClientHeight) 
{
	try
	{
		// adjust client viewing area if needed if true viewing area is too small
		var addX = desiredClientWidth - document.body.clientWidth;
		var addY = desiredClientHeight - document.body.clientHeight;
		newX += addX;
		newY += addY;
		if (!isIE) {
			newX+=-8;
			newY+=10;
		}
		if (newX>xMax) {newX=xMax}
		if (newY>yMax) {newY=yMax}
		top.resizeTo(newX,newY);
		
		var xpos=(screen.availWidth-newX)/2;
		top.moveTo(xpos,0);
		top.focus();
	}
	catch(err){if (debugMode) {alert('centerIt: ' + err.description)}}
}

function goBack()
{
	try{var objWin=top.opener;objWin.focus();}
	catch(err){if (debugMode) {alert('goBack: ' + err.description)}}
}