/*
Created By: Law
Website: http://www.ranknoodle.com
Date: 2/20/2020

Inspired by the lightbox implementation found at http://www.huddletogether.com/projects/lightbox/
*/

/*-------------------------------GLOBAL VARIABLES------------------------------------*/


function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}


function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}



function switchMenu(obj, num) {
	
	for (start = 0; start < num; start++) {
		nums = start+''
		text = 'myvar' + nums
		var el = document.getElementById(text);
		if (el.style.display != "none") {
			el.style.display = 'none';
		}
		else {
			el.style.display = '';
		}
	}
}

function collapseAll(objs) {
var i;
for (i=0; i < objs.length; i++ ) {
var ob = objs[i];
var el = document.getElementById(ob);
el.style.display = 'none';
}
}

	
function switchMenu2(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != "none" ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}


addLoadEvent(function() {
	var array = ['myvar0','myvar1','myvar2', 'myvar3', 'myvar4'];
    collapseAll(array);
})



//-->
