function drawCandidatesCOP()

in pysteve/www/htdocs/js/steve_cop.js [57:108]


function drawCandidatesCOP() {
    var box = document.getElementById('candidates')
    box.innerHTML = "<h3>Candidates:</h3>"
    var pname = null
    var pli = null;
    for (i in candidates) {
        var name = candidates[i]
        if (pname != name['pname']) {
            pname = name['pname']
            var char = name['pletter']
            pli = document.createElement('ol')
            pli.setAttribute("class", "showList")
            pli.style.marginTop = "20px"
            var outer = document.createElement('div')
            var inner = document.createElement('span')
            inner.style.fontFamily = "monospace"
            inner.style.fontWeigth = "bold"
            inner.innerHTML = name['pname'];
            outer.setAttribute("class", "ballotbox_clist_DH")
            if (char == vote_COP) {
                outer.setAttribute("class", "ballotbox_clist_selectedDH")
            }
            outer.setAttribute("id", name)
            outer.setAttribute("onclick", "vote_COP = '"+char+"'; drawCandidatesCOP();")
            outer.appendChild(inner)
            outer.setAttribute("title", "Click to select "  + name + " as your preference")
            pli.appendChild(outer)
            box.appendChild(pli)
            
        }
        var char = name['letter']
        var li = document.createElement('li')
        var outer = document.createElement('div')
        var inner = document.createElement('span')
        inner.style.fontFamily = "monospace"
        li.style.marginLeft = "30px"
        li.style.marginBottom = "10px"
        inner.innerHTML = name['name'];
        outer.setAttribute("class", "ballotbox_clist_DH")
        if (char == vote_COP) {
            outer.setAttribute("class", "ballotbox_clist_selectedDH")
        }
        outer.setAttribute("id", name)
        outer.setAttribute("onclick", "vote_COP = '"+char+"'; drawCandidatesCOP();")
        outer.appendChild(inner)
        outer.setAttribute("title", "Click to select "  + name + " as your preference")
        li.appendChild(outer)
       
        pli.appendChild(li)
        
    }
}