function radioClick2(name, id) {
  var previous;
  eval('previous = ' + name + '_on_id;');
  if (previous != id) {
    document.getElementById(name + previous).className = 'radioOff2';
    document.getElementById(name + id).className = 'radioOn2';
    eval( name + '_on_id = ' + id +';');
  }
}

function answerClick(locale, context) {
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null){
    alert ("Browser does not support HTTP Request");
    return;
  } 
  var url = context + '/servanswers';
  
  var param = 'id='+ answer_on_id;
  param = param + '&locale='+locale;
  param = param + '&questionId='+question_id;  
  xmlHttp.onreadystatechange=stateChangedQ;
  xmlHttp.open("POST",url,true);
  xmlHttp.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded; charset=utf-8" );
  xmlHttp.setRequestHeader("Content-length", param.length);
  xmlHttp.send(param);
}

function stateChangedQ() { 
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  {    
    eval(xmlHttp.responseText);   
    if (voted) {
      alert(allready_voted);
    }
    var votes_number = 0;
    for (var i=0; i<votes.length; i++) {
      votes_number += votes[i]; 
    }
    var percent = '';
    for (var i=0; i<answers.length; i++) {
      percent = '';
      if (Math.round((votes[i]/votes_number)*100) != 0) {
        percent = Math.round((votes[i]/votes_number)*100) + '&nbsp%';  
      }      
      document.getElementById('answerCont' + i).innerHTML = '<div class="answerBarCont"><div class="answerBar" style="width:'+ Math.round((votes[i]/votes_number)*100) +'%">' + percent + '</div></div>'+
                                                            '<div class="answerText">'+answers[i]+'</div>';
    }
    document.getElementById('answers').style.margin = '4px 0px 0px 0px;';
    document.getElementById('button').innerHTML = '';    
  } 
}