function changeText(textElement) { var l = document.getElementsByTagName('input'); var i for (i=0; i < l.length; i++) { if (textElement != l.item(i) && l.item(i).getAttribute('name') != '' && l.item(i).getAttribute('name') == textElement.getAttribute('name')) { l.item(i).value = textElement.value; } } } function changeOption(optionElement) { var check = optionElement.getElementsByTagName('input').item(0) if (check.checked) { optionElement.style.color="#000000" optionElement.setAttribute('class', 'attivato') } else { optionElement.style.color="#AAAAAA" optionElement.setAttribute('class', 'disattivato') } } function changeAlt(altElement) { var l = document.getElementsByTagName(altElement.tagName); var i var check for (i=0; i < l.length; i++) { if (l.item(i).getAttribute('name') == altElement.getAttribute('name')) { check = l.item(i).getElementsByTagName('input').item(0) if (check.checked) { l.item(i).style.color="#000000" l.item(i).setAttribute('class', 'attivato') } else { l.item(i).style.color="#AAAAAA" l.item(i).setAttribute('class', 'disattivato') } } } } function openPopupNota(numeronota, event) { var el = document.getElementById('nota-di-compilazione' + numeronota) var pointerX = event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)) var pointerY = event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) el.style.left = pointerX + 'px' el.style.top = pointerY + 'px' if (pointerX > document.body.clientWidth - 200) { el.style.left = (pointerX - 200) + 'px' } var l = document.getElementsByTagName('span'); var i for (i=0; i < l.length; i++) { if (l.item(i).getAttribute('name') == 'nota-di-compilazione') { l.item(i).style.zIndex = '1' } } el.style.zIndex = '2' el.style.visibility = 'visible' return true } function closePopupNota(numeronota) { el = document.getElementById('nota-di-compilazione' + numeronota) el.style.visibility = 'hidden' return true } function init() { var l = document.getElementsByTagName('span'); var i for (i=0; i < l.length; i++) { if (l.item(i).hasAttribute('name') && l.item(i).getAttribute('name').substr(0, 11) == 'alternative') { changeAlt(l.item(i)) } } l = document.getElementsByTagName('tr'); for (i=0; i < l.length; i++) { if (l.item(i).hasAttribute('name') && l.item(i).getAttribute('name').substr(0, 11) == 'alternative') { changeAlt(l.item(i)) } } }