/*
   SHOW & HIDE ERROR MESSAGES WITHIN <SPAN> TAGS
	To display and then hide errors within multiple span tags, make sure the following is added to <body> tag;
	onLoad="showErrorMsgs();hideErrorMsgs();"
*/
function showErrorMsgs() {
	var divCnt = 0;
	if (document.all) 
		divColl = document.all.tags("span");
	else if (document.layers)
		divColl = document.layers.length
	else if (document.getElementById)
		divColl = document.getElementsByTagName("span")
         
	if (divColl != null) {
		for (i=0; i < divColl.length; i++) {
			//  Must make sure the error messages are within <span> tags that have
			//  an id='errorDIV_*' where * is a number starting at zero
			if (divColl[i].id == 'errorDIV_' + divCnt) {
				switchDiv(divColl[i].id, true);
				divCnt += 1;
			}
		}
	}
}

// Variables objTimer, timeFromUser, intTimeout are for hideErrorMsgs() function
objTimer = new Object();
timeFromUser = parseInt("15"); // Number of seconds to display error messages
intTimeout = new Number(timeFromUser * 1000);

function hideErrorMsgs() {
	var divCnt = 0;
	if (document.all) 
		divColl = document.all.tags("span");
	else if (document.layers)
		divColl = document.layers.length
	else if (document.getElementById)
		divColl = document.getElementsByTagName("span")
	if (divColl != null) {
		clearTimeout(intTimeout); //objTimer
		for (i = 0; i < divColl.length; i++) {
			//  Must make sure the error messages are within <span> tags that have
			//  an id='errorDIV_*' where * is a number starting at zero
			if (divColl[i].id == 'errorDIV_' + divCnt) {
				objTimer = setTimeout('switchDiv(\''+divColl[i].id+'\', false);',intTimeout);
				divCnt += 1;
			}
		}
	}
}
