
//on dom ready...
 window.addEvent('domready', function() {

 	/* vote in poll */
 	$('votepoll').addEvent('click', function(event) {
		//prevent the page from changing
 		event.stop();
 		//make the ajax call, replace text
 		var req = new Request.HTML({
 			method: 'get',
 			url: 'poll/frontpage_ajax.php?&rand=%time%',
 			onRequest: function() { loading(); },
 			update: 'ajaxpanel'
		
 		}).send();
 	});
 });

function ajax(href) {

		//make the ajax call, replace text
		var req = new Request.HTML({
			method: 'get',
			url: href,
			onRequest: function() { loading() },
			update: 'ajaxpanel'
			}).send();

}

function getRadio(fldName) {		
	return $$('input[name='+fldName+']:checked')[0].get('value');
}

function submitpoll() {

	//make the ajax call, replace text
	var req = new Request.HTML({
		method: 'post',
		url: 'poll/frontpage_ajax.php',
		data: { 'option_id' : getRadio('option_id'), 'action' : 'vote', 'poll_ident' : $('poll_ident').value },
		onRequest: function() { loading() },
		update: 'ajaxpanel'
		}).send();
	
}
  