function initPrivacy() { var footer = document.getElementById("footer"); if (footer) { var _links = footer.getElementsByTagName("a"); for (i = 0; i < _links.length; i++) { if (_links[i].rel && _links[i].rel == "popup" && _links[i].href != "#") { _links[i].onclick = function() { window.open(this.href, "privacy", 'width=800,height=600,toolbar=no,status=no,scrollbars=yes,menubar=no,resizable=yes'); return false; }; } } } } function initTables() { var _tables = document.getElementsByTagName("tr"); for (i = 0; i < _tables.length; i++) { _tables[i].onmouseover = function() { if (this.className.indexOf("hover") == -1) { this.className += " hover"; } }; _tables[i].onmouseout = function() { this.className = this.className.replace("hover", ""); }; } } function initForm() { var mform = document.getElementById("main-form"); if (mform) { var _links = document.getElementsByTagName("a"); for (i = 0; i < _links.length; i++) { if ((_links[i].className.indexOf("button") != -1) && (_links[i].parentNode.className.indexOf("selector") != -1)) { _links[i].onmouseover = function() { if (this.parentNode.parentNode.className.indexOf("selectorhover") == -1) { this.parentNode.parentNode.className += " selectorhover"; } }; _links[i].onmouseout = function() { this.parentNode.parentNode.className = this.parentNode.parentNode.className.replace("selectorhover", ""); }; _links[i].onclick = function() { return false; }; } } } } function initQuestions() { var inputs = document.getElementsByTagName("input"); for (i = 0; i < inputs.length; i++) { if (inputs[i].type == 'radio') { inputs[i].onclick = function() { var inputs = document.getElementsByTagName("input"); for (i = 0; i < inputs.length; i++) { if (inputs[i].type == 'radio' && inputs[i].name == this.name) { if (inputs[i].alt && inputs[i].alt == 'other') { if (inputs[i].checked) { if (inputs[i].parentNode.parentNode.parentNode.className.indexOf("show") == -1) { inputs[i].parentNode.parentNode.parentNode.className += " show"; } document.getElementById('radio2texthold').style.display = 'none'; document.getElementById('radio3texthold').style.display = 'none'; document.getElementById('radio1texthold').style.display = 'block'; break; } else { inputs[i].parentNode.parentNode.parentNode.className = inputs[i].parentNode.parentNode.parentNode.className.replace("show", ""); } } if (inputs[i].alt && inputs[i].alt == 'other2') { if (inputs[i].checked) { if (inputs[i].parentNode.parentNode.parentNode.className.indexOf("show") == -1) { inputs[i].parentNode.parentNode.parentNode.className += " show"; } document.getElementById('radio1texthold').style.display = 'none'; document.getElementById('radio3texthold').style.display = 'none'; document.getElementById('radio2texthold').style.display = 'block'; break; } else { inputs[i].parentNode.parentNode.parentNode.className = inputs[i].parentNode.parentNode.parentNode.className.replace("show", ""); } } if (inputs[i].alt && inputs[i].alt == 'other3') { if (inputs[i].checked) { if (inputs[i].parentNode.parentNode.parentNode.className.indexOf("show") == -1) { inputs[i].parentNode.parentNode.parentNode.className += " show"; } document.getElementById('radio1texthold').style.display = 'none'; document.getElementById('radio2texthold').style.display = 'none'; document.getElementById('radio3texthold').style.display = 'block'; break; } else { inputs[i].parentNode.parentNode.parentNode.className = inputs[i].parentNode.parentNode.parentNode.className.replace("show", ""); } } } } } } } } function deletecourse() { confirm1 = confirm('Are you sure you want to remove this course?') if(confirm1) { confirm2 = confirm("AFTER YOU CLICK OK THE COURSE WILL BE DELETED"); } return confirm2; } if (window.addEventListener) { window.addEventListener("load", initForm, false); window.addEventListener("load", initQuestions, false); window.addEventListener("load", initPrivacy, false); } else if (window.attachEvent && !window.opera) { window.attachEvent("onload", initTables); window.attachEvent("onload", initForm); window.attachEvent("onload", initQuestions); window.attachEvent("onload", initPrivacy); }