
function isVoted(){
  return false;
}

function saveVote(p, note, name){
  var post = 'note='+note+'&name='+name;
  dhtmlxAjax.post('http://www.berliner-lions-adventskalender.de/level9_cms/layout/phpscript/saveVote.php?'+sessionHeader, post);
  for(var i=1; i<6; i++){
    if( el = document.getElementById('Note'+p+i.toString())){
      el.onclick = new function(){return false;};
      el.onmouseover = new function(){return false;};
      el.onmouseout = new function(){return false;};
      el.href = "javascript:function(){return false;}";
    }
  }
  if(el = document.getElementById('Infotext'+p)){
    el.innerHTML = 'Danke f&uuml;r<br>Ihre Stimme';
  }
  if(el = document.getElementById('countVotes'+p)){
    var c = parseInt(el.innerHTML,10);
    el.innerHTML = ++c;
  }
}

function nextQuestion(key){
  document.getElementById('question'+key).style.display = 'none';
  document.getElementById('question'+(key+1)).style.display = 'block';
}

function prevQuestion(key){
  document.getElementById('question'+key).style.display = 'none';
  document.getElementById('question'+(key-1)).style.display = 'block';
}

function setActiv(item){
  item = item.toString();
  var p = item.substr(0, item.length-1);
  var c = item.substr(item.length-1, 1);
  c = parseInt(c, 10);

  for(var i=1; i<=c; i++){
    if( el = document.getElementById('Note'+p+i.toString())){
      el.style.borderLeft = "1px solid #e3007a";
      el.style.backgroundPosition = "7px center";
    }
  }
}

function setInactiv(p){
  for(var i=1; i<6; i++){
    if( el = document.getElementById('Note'+p+i.toString())){
      el.style.borderLeft = "1px solid #0F315E";
      el.style.backgroundPosition = "-17px center";
    }
  }
}
