// JavaScript Document
function initShowHideMods(a)
{
	var vis = a;
	
	var divs = document.getElementsByTagName('DIV');
	var hed;
	var divCounter = 1;
	var hCounter = 1;
	
	for(var no=0;no<divs.length;no++){
		if(divs[no].className=='BoxPatternA')
		{
			hed=divs[no].getElementsByTagName('h3')
			lst=divs[no].getElementsByTagName('ul')
			for(var mo=0;mo<hed.length;mo++){
				hed[mo].onclick = showHideModule;
				hed[mo].style.cursor = "pointer";
				hed[mo].id = 'hd'+hCounter;
				lst[mo].id = 'lst'+hCounter;
				
				sublst=lst[mo].getElementsByTagName('li')
				var sCounter = 1;
				for(var po=0;po<sublst.length;po++){
					
				if (vis==false)
				{
					if (sCounter>3)
					{
						hed[mo].style.backgroundImage = "url('http://www.hds.com/assets/img/down_arrow.gif')";
						hed[mo].style.backgroundRepeat = "no-repeat";
						hed[mo].style.backgroundPosition = "0px 4px";
						hed[mo].style.paddingLeft = "15px";
					}
					if (sCounter==1 || sCounter==2 || sCounter==3)
					{
						sublst[po].style.display="block";
					}
					else
					{
						sublst[po].style.display="none";
					}
					}
				else if(sCounter<=3)
				{
					sublst[po].style.display="block";
					hed[mo].style.backgroundImage = "none";
				}
				else
				{
					lst[mo].style.display="block";
					hed[mo].style.backgroundImage = "url('http://www.hds.com/assets/img/up_arrow.gif')";
					hed[mo].style.backgroundRepeat = "no-repeat";
					hed[mo].style.backgroundPosition = "0px 4px";
					hed[mo].style.paddingLeft = "15px";
					}
					sCounter++;
				}
			
				hCounter++;
			}
		}
			divCounter++;
	}	
}
	
function showHideModule()
{
	
	var inputId=this.id
	var numericId = inputId.replace(/[^0-9]/g,'');
	var hdid=document.getElementById('hd'+numericId);
	var lstid=document.getElementById('lst'+numericId);

	var sublst=document.getElementById(lstid.id).getElementsByTagName('li')
	var sCounter = 1;
	for(var po=0;po<sublst.length;po++){
		
	if (sCounter>3)
		{
			if (sublst[po].style.display=="none")
			{
			sublst[po].style.display="block";
			hdid.style.backgroundImage = "url('http://www.hds.com/assets/img/up_arrow.gif')";
			hdid.style.backgroundRepeat = "no-repeat";
			hdid.style.backgroundPosition = "0px 4px";
			hdid.style.paddingLeft = "15px";
			}
			else
			{
			sublst[po].style.display="none";
			hdid.style.backgroundImage = "url('http://www.hds.com/assets/img/down_arrow.gif')";
			hdid.style.backgroundRepeat = "no-repeat";
			hdid.style.backgroundPosition = "0px 4px";
			hdid.style.paddingLeft = "15px";
			}
		}
		sCounter++;
	
	}

	}
