// JavaScript Document
window.onload = function(){
		
	if (!e) var e = window.event;
	mensure = new unitsWindow();
	mensure.load();
	SA.create();
	SAWait.create();
	SA2.create();
	SA2Wait.create();
	SA3.create();
	SA3Wait.create();
	qtdeConteudo();
	
}

votarEnquete = function(opcao){
	
	if(opcao==null){
		SA.open('Alerta!', 'Favor escolha uma opção para votar na enquete.', null, 1, 1);		
	}else{
		var xml = new xmlConnection();
		if (xml.create()){
			xml.setURL('/enquetes/votar/');
			xml.setMethod('POST');
			xml.addParameters('nocache',nocache());
			xml.addParameters('opcao',opcao);		
			
		}
		xml.onComplete = function() {
			this.setChildName('return');
			if( this.getAttByName('votou',0)=="1"){
				//alert('votou na opcao:'+opcao);	
				SA.open('Voto computado!', 'Obrigado pela participação', null, 1, 1);	
				//$('verresultados').style.display = 'block';
			}else if(this.getAttByName('votou',0)=="2"){
				SA.open('Alerta!', 'Você já participou desta enquete.', null, 1, 1);	
			}
		}
		xml.execute();	
	}
}