// Miscellaneous core Javascript functions for Moodle // Global instance of YUI3 var Y = null; function popupchecker(msg) { var testwindow = window.open('', '', 'width=1,height=1,left=0,top=0,scrollbars=no'); if (!testwindow) { alert(msg); } else { testwindow.close(); } } function checkall() { var inputs = document.getElementsByTagName('input'); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type == 'checkbox') { inputs[i].checked = true; } } } function checknone() { var inputs = document.getElementsByTagName('input'); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type == 'checkbox') { inputs[i].checked = false; } } } function lockoptions(formid, master, subitems) { // Subitems is an array of names of sub items. // Optionally, each item in subitems may have a // companion hidden item in the form with the // same name but prefixed by "h". var form = document.forms[formid]; if (eval("form."+master+".checked")) { for (i=0; i