/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$(document).ready(function() {
    
    $('#formpesquisa').validate({
        errorLabelContainer: $("#erroformpesquisa")
    });

    $('#EnqVerResult').click(function(){
        window.open($('#EnqVerResult').val(), '_self');
        //alert($('#EnqVerResult').val());
    });
    
    $("#pikame").PikaChoose();

});

$(function() {
    $('#gallery a').lightBox({fixedNavigation:true});

});

$(function() {
    $('#galeriaimagens a').lightBox({fixedNavigation:true});
});



function VotaEnquete(NumAlts){
    var nomeform = document.enquete;
    var obj = nomeform.COD_ENQUETE_ALT;
    var COD_ENQUETE_ALT = 0;

    for (i=0; i<obj.length; i++) {
        if (obj[i].checked) {
            COD_ENQUETE_ALT = obj[i].value;
        }
    }
    if (COD_ENQUETE_ALT == 0){
        alert("Selecione uma alternativa!");
    } else {
        nomeform.submit();
    }
}

//funcção  para abrir janela popup
function novajanela(arq,myname,w,h) {

	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	
	var settings ='height='+h+',';
	settings +='width='+w+',';
	settings +='top='+wint+',';
	settings +='status=yes,';		
	settings +='left='+winl+',';
	settings +='resizable=yes,';
	settings +='scrollbars=yes';

	window.open(arq,myname,settings);
}

