// funções auxiliares

function trim(sString)
{
	while (sString.substring(0,1) == ' ')
	{
		sString = sString.substring(1, sString.length);
	}

	while (sString.substring(sString.length-1, sString.length) == ' ')
	{
		sString = sString.substring(0,sString.length-1);
	}

	return sString;
}

function centrarJanela(width,height)
{
	// coordenadas do canto superior esquerdo
	var leftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	var topPosition = (screen.height) ? (screen.height-height)/2 : 0;
	
	window.moveTo(leftPosition,topPosition) ;
}