// Pula para o próximo campo.
function check(obj1, obj2, num)
{
	var letters = obj1.value.length +1;
	if( letters <= num )
	{
		obj1.focus()
	}
	else
	{
		obj2.focus()
	}
} 
		
// Valida tamanho do texto.
function verificaTamanho(target, maximo, cont)
{
	var strLen = 0;
	var contador = cont;
	
	if( target.value != ""  )
	{
		strLen = strLen + target.value.length;
	}
	
	if( strLen == 1 && target.value.substring(0,1) == " " )
    {
        target.value = "";
		strLen = strLen - 1;
    }
    
    if( strLen > maximo )
	{
		target.value = target.value.substring(0,maximo);
		strLen = strLen - 1;
	}
		
	contador.value = maximo - strLen;			
}

function redirectToUrl(object)
{
	url = object.value; 
	
	if(url != '')
	{
		if(url != 'javascript:tela();')
		{ 
			window.open(url,'','');
			object.selectedIndex = 0;
		}
		else
			if(screen.height == '600')
				window.open('http://www.fundacaobradesco.org.br/museu/museu.asp','Museu','fullscreen=yes');
			else
				window.open('http://www.fundacaobradesco.org.br/museu/museu.asp','','width=800, height=600, top=5, left=0,scrollbars=0, noresize');
		}
}

function OpenUrl(url,x,y)
{	
	var parametros = "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=" + x + ", height= " + y;
	window.open(url,"new",parametros);
}
