/* **********  Drop Down JS ********** */

function setClass(id) {
	var theLink = eval('document.getElementById("'+id+'_link")');
	if (!theLink.className) {
		theLink.className = 'drop_Active';
	} else if (theLink.className == '') {
		theLink.className = 'drop_Active';
	} else if (theLink.className == 'drop_Active') {
		theLink.className = '';
	}
}

function swapIconSrc(id,action) {
	var theIcon 	= eval('document.getElementById("'+id+'_icon")');
	var openSrc 	= '/images/icon_Opendrop.gif';
	var closedSrc = '/images/icon_Closeddrop.gif';
	if (action == 'open') {
		theIcon.src = openSrc;
	} else if (action == 'close') {
		theIcon.src = closedSrc;
	}
}

function showdrop(id) {
	var thedrop = eval('document.getElementById("'+id+'")');
	if (thedrop.style.display == 'none') {
		thedrop.style.display = 'inline';
		//swapIconSrc(id,'open');
		setClass(id);
	} else if (thedrop.style.display == 'inline') {
		thedrop.style.display = 'none';
		//swapIconSrc(id,'close');
		setClass(id);
	}
}
/* 
Note:
When adding a new item to the list, change the value in this line:
for (var i=1; i<23; i++) {
If you have 22 items in the list, then it should state i<23
If you have 23 items in the list, then it should state i<24
etc...
*/
function OpenCloseAll(action) {
	for (var i=1; i<2; i++) {
		var theId  = "drop"+i;
		var theObj = eval('document.getElementById("'+theId+'")');
		if(theObj) {
			if (action == 'open' && theObj.style.display == 'none') {
				showdrop(theId);
			}
			if (action == 'close' && theObj.style.display == 'inline') {
				showdrop(theId);
			}
		}
	}
}