function spoll_button (id, im_path) {
    var button = document.getElementById("spoll_option_"+id);
    $("img.spoll_button_image").attr("src", im_path+"but_radio_off.gif");       
    button.src = im_path+"but_radio_on.gif";
    document.getElementById("spoll_fancy_option_id").value = id;
}

function validate_vote() {
	poll_id = get_object('poll_id').value;
	vote_value = get_object('poll_option_'+poll_id).value;
	if(vote_value=="") alert("You need to make a choice before you can vote!");
	return (vote_value!="");
}

function mpoll_toggle_radio(control_name, value) {
	var im = document.images;
	var no_allow_change=false;
	var cur_im = get_object(control_name+"_"+value);
	var a = control_name.split("_");
	var v = get_object(control_name);

	for( var i=0;i<im.length; i++) {
		if(im[i].name!=null) {
			if(im[i].name.substr(0, control_name.length)==control_name) {
				var rex = new RegExp("but_radio_o");
				var m = rex.exec(im[i].src);
				if(m=="but_radio_o") {
					im[i].src = img_path + "but_radio_" + ((im[i].name.substr(control_name.length+1)==value) ? "on" : "off")+ ".gif";
				} else {
					im[i].className = "qb_option_image_" + ((im[i].name.substr(control_name.length+1)==value) ? "on" : "off");
				}
				v.value = value;
			}
		}
	}
}

$(document).ready(function(){
	$('#ui .row .col').mouseenter(function(){ $(this).find('.ico img').effect('bounce',350) });
});
