            function pegarTotalVotos(){
                if(typeof(window.frames['enquete01'].document.getElementById('totalVotes'))!="undefined"){
                    if(window.frames['enquete01'].document.getElementById('totalVotes').innerHTML!=""){
                        document.getElementById('totalVotes').innerHTML=window.frames['enquete01'].document.getElementById('totalVotes').innerHTML;
                    }else{
                        setTimeout("pegarTotalVotos()",1000);
                    }
                }else{
                    setTimeout("pegarTotalVotos()",1000);
                }
            }
            function enqueteVotar(){
                iframeReload="No"; /*Faz com que os iframes das enquetes tenham o #r depois do voto*/
                v="";
                for(var i=1;i<=window.frames.length;i++){
                    selects=window.frames['enquete0'+i].document.formEnquete.getElementsByTagName('select');
                    for(var j=0;j<selects.length;j++){
                        if(selects[j][selects[j].selectedIndex].value==0) v="ERRO";
                    }
                }
                if(v=="ERRO"){
                    alert('Você precisa votar em todos');
                }else{
                    document.location="#r";
                    document.getElementById('btVotar').style.display="none";
                    document.getElementById('verResultado').style.display="none";
                    document.getElementById('verTotalVotos').style.display="block";
                    for(var i=1;i<=window.frames.length;i++) window.frames['enquete0'+i].enqueteVotar();
                    pegarTotalVotos();
                }
            }
            function enqueteVerResultado(t){
                if(t=='c'){
                for(var i=1;i<=window.frames.length;i++){
                    if(window.frames['enquete0'+i].location.href.indexOf('#r')==-1){
                        window.frames['enquete0'+i].location=window.frames['enquete0'+i].location+"#r";
                        window.frames['enquete0'+i].location.reload();
                    }
                }
                document.location="#r";
                }
                document.getElementById('verResultado').style.display="none";
                document.getElementById('verTotalVotos').style.display="block";
                pegarTotalVotos();
            }
	    /*function regulaFrame() {
	    	document.domain="uol.com.br"; 
	    	document.getElementsByTagName('iframe')[0].height=window.frames[0].document.body.offsetHeight+10;
	    
	    	if(document.getElementsByTagName('iframe')[0].height<50)
	    	{
	    		setTimeout("regulaFrame()",1000);	
	    	}
	    }*/
	    function regulaFrame() {
	    	document.domain="uol.com.br"; 
	    	altura=0;
	    	
	    	for(i=0;i<window.frames.length;i++)
	    	{
	    		altura=(window.frames[i].document.body.offsetHeight>altura)?window.frames[i].document.body.offsetHeight:altura;
	    	}
	    	
	    	if(altura<50)
	    	{
	    		setTimeout("regulaFrame()",1000);	
	    	}	    	
	    	else
	    	{
	    		altura=altura+10;
	    		
	    		for(i=0;i<document.getElementsByTagName('iframe').length;i++)
	    		{
	    			document.getElementsByTagName('iframe')[0].height=altura
	    		}
	    	}
	    
	    }	    