function get_poll_value()
{
    //now get value
    radioObj=document.forms['POLL_FORM'].elements['theOption'];
    var theValue;
    if(radioObj)
    {
	    var radioLength = radioObj.length;
	    if(radioLength == undefined)
        {
		    if(radioObj.checked)
            {
			    theValue=radioObj.value;
		    }
        }else{
	        for(var i = 0; i < radioLength; i++)
            {
		        if(radioObj[i].checked) {
			        theValue=String(radioObj[i].value);
		        }
	        }
        }
    }
    if(theValue==null){
        return false;
    }else{
        //disable submit
        //old way 
        //document.getElementById('pollSubmit').disabled=true;
        //replace id
        document.getElementById('submitBlock').innerHTML='<b>Thanks for voting</b>';
        
        return theValue;
    }
}

function launch_poll_popup(theUrl,pollId)
{
    var pollValue=get_poll_value();
    
    if(pollValue==false){
        alert('Please select an option first!');
    }else{
        TB_show('Poll Results',theUrl+'index.php?c=view&m=vote&action=popup&poll_id='+pollId+'&theOption='+pollValue+'&width=400&height=500','');
    }
}