function abrejanela(){
	
	check = false;
	for(i=0;i<=document.frmenquete.resposta.length-1;i++)
	{
		if(document.frmenquete.resposta[i].checked == true)
			check = true;
	}
	if(!check){
		alert("Você deve selecionar uma resposta!");
		return false;
	}

	document.frmenquete.acao.value = "votar";

	nj = window.open("","miniwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=320,height=280");
	nj.document.open();
}

function textCounter(campo, countcampo, maxlimit) {
if (campo.value.length > maxlimit) 
	campo.value = campo.value.substring(0, maxlimit); 
else
	countcampo.value = maxlimit - campo.value.length; 
}

// Função de saudação por horário
function saudacao()
{
    meses = new Array("Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro");
	
    diasSemana = new Array("Domingo", "Segunda-Feira", "Terça-Feira", "Quarta-Feira", "Quinta-Feira", "Sexta-Feira", "Sábado");

    time = new Date();
    hours = time.getHours();
    minutes = time.getMinutes();
    seconds = time.getSeconds();
    diasMes = time.getDate();
    years = time.getFullYear();
    day = time.getDay();
    nameofday = diasSemana[day];
    month = time.getMonth();
    nameofmonth = meses[month];
    
	if (hours >= 1)
    {
        if (hours < 12)
        {
            ampm = "AM";
            hours = hours;
            sauda = "Bom dia! ";
        } // end if
    } // end if
    
	if (hours >= 12)
    {
        if (hours < 18)
        {
            ampm = "PM";
            hours = hours;
            sauda = "Boa tarde! ";
        } // end if
    } // end if
    
	if (hours >= 18)
    {
        if (hours <= 23)
        {
            ampm = "PM";
            hours = hours;
            sauda = "Boa noite!  ";
        } // end if
        if (hours == 0)
        {
            ampm = "AM";
            hours = hours;
            sauda = "Boa noite! ";
        } // end if
    } // end if
    
	if (hours < 10)
    {
        hours = "0" + hours;
    } // end if
    if (minutes < 10)
    {
        minutes = "0" + minutes;
    } // end if
    if (seconds < 10)
    {
        seconds = "0" + seconds;
    } // end if

//	all = sauda + dates + " de " + nameofmonth + " de " + years + ".";
	document.write('<strong>'+sauda +'</strong> Hoje é ' + diasMes + " de " + nameofmonth + " de " + years + ".");
}

