	function getPollId() {
		var id = '0';
		var poll = document.forms['quickpoll-form'].pollId;
		id = poll.value;
		return id;
	}

	function trackVote() {
		var pollId = getPollId();
		s.eVar14=pollId;
		s.linkTrackVars='eVar14,events';
		s.events='event18';
		s.linkTrackEvents='event18';
		s.tl(this, 'o', 'Custom Link - Poll Taken');	
	}
	
	function getOption(options) {
		var option = 'NO_RESPONSE';
		for(var i = 0; i < options.length; i++) {
			if(options[i].checked == true) {
				option = options[i].value;
			}
		}
		return option;
	}
	
	function getUniqueElements() {
		var uniqueElements = new Array();
		for(var i = 0; i < document.forms['quickpoll-form'].elements.length; i++) {
			var element = document.forms['quickpoll-form'].elements[i];
			if(!(element.name in objectConverter(uniqueElements))) {
				uniqueElements.push(element.name);  
			}
		}
		return uniqueElements;
	}
	
	function objectConverter(a) {
	  var o = {};
	  for(var i = 0; i < a.length; i++) {
	   o[a[i]]='';
	  }
	  return o;
	}
	
	function validate(mode) {
		var responseReturned = false;
		var uniqueElements = getUniqueElements();
		for(var i = 0; i < uniqueElements.length; i++) {
			if(uniqueElements[i].indexOf("option_") >= 0) {
				var element = eval("document.forms['quickpoll-form']." + uniqueElements[i]);
				var option = getOption(element);
				if(option == 'NO_RESPONSE') {
					if(mode == ALL_RESPONSES_REQUIRED) {
						return false;
					}
				} else {
					responseReturned = true;
				}
			}
		}
		
		if(responseReturned) {
			return true;
		} else {
			return false;
		}
	}
	
	/*	0 = only one question must have a response
	 *	1 = all questions must have a response
	 */	
	var ONE_RESPONSE_REQUIRED = 0;
	var ALL_RESPONSES_REQUIRED = 1;
	
	function vote() {		
		if(validate(ONE_RESPONSE_REQUIRED)) {
			trackVote();
			setTimeout("void(0)", 250);
			return true;
		} else {
			var error = document.getElementById('error-message');
			error.style.display='block';
			return false;
		}	

	}

	//function moveit() {
	//	var magazine = document.getElementById('latest-issue');	
	//	var secondQuestion = document.getElementById('quickPoll-question2');
	//	magazine.style.top = (firstQuestion.offsetHeight+10)+"px";
		
		

function moveit() {

	var ads = document.getElementById('ads');
	var magazine = document.getElementById('latest-issue');
	var secondQuestion = document.getElementById('quickPoll-question2');
	var throwawayNode = (ads.removeChild(magazine));
	var parentDiv = secondQuestion.parentNode;
	parentDiv.insertBefore(throwawayNode,secondQuestion);
}