/*IE6 and below Hover fix below*/
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

/*Lesson Javascript below*/

function toggle(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}

function open_win(url_add)
   {
   window.open(url_add,"vocabulary","width=140,height=25,menubar=no,status=no,location=no,toolbar=no,scrollbars=no");
   }

/*Toggle Checkboxes for vocab lists*/
function setAllCheckboxes(group, state) {
    var els = document.getElementById(group);
    var i;
	
    for (i = 0; i < els.childNodes.length; i += 1) {
        if (els.childNodes[i].type === 'checkbox') {
            els.childNodes[i].checked = state;
        }
    }
}
 
 function setGroup0() {
    setAllCheckboxes('group0', this.checked);
}
function setGroup1() {
    setAllCheckboxes('group1', this.checked);
}
function setGroup2() {
    setAllCheckboxes('group2', this.checked);
}
function setGroup3() {
    setAllCheckboxes('group3', this.checked);
}
function setGroup4() {
    setAllCheckboxes('group4', this.checked);
}
function setGroup5() {
    setAllCheckboxes('group5', this.checked);
}
function setGroup6() {
    setAllCheckboxes('group6', this.checked);
}
function setGroup7() {
    setAllCheckboxes('group7', this.checked);
}
function setGroup8() {
    setAllCheckboxes('group8', this.checked);
}
function setGroup9() {
    setAllCheckboxes('group9', this.checked);
}

/* Toggle Save Options for /vocabulary/word_selection.php */

function hideSaveOptions() {
	var el = document.getElementById("save_options");
	el.style.display = 'none';
}

function showSaveOptions() {
	var el = document.getElementById("save_options");
	el.style.display = 'inline';
}

function showSaveCurrentList() {
	document.getElementById("save_current_list").disabled = false;
	document.getElementById("save_new_list").disabled = true;
	document.getElementById("viewable_id").disabled = true;
}

function showSaveNewList() {
	document.getElementById("save_current_list").disabled = true;
	document.getElementById("save_new_list").disabled = false;
	document.getElementById("viewable_id").disabled = false;
}
	
	
