// JavaScript Document

var nlist;

if (nlist==null)

	{

		nlist=3;

	}



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=='related-contents-module')

		{

			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>nlist)

					{

					hed[mo].style.backgroundImage = "url('/assets/img/down_arrow.gif')";

					hed[mo].style.backgroundRepeat = "no-repeat";

					hed[mo].style.backgroundPosition = "140px 2px";

					}

					if (sCounter<=nlist)

					{

					sublst[po].style.display="block";

					}

					else

					{

					sublst[po].style.display="none";

					}

					}

				else

				{

					lst[mo].style.display="block";

					hed[mo].style.backgroundImage = "url('/assets/img/up_arrow.gif')";

					hed[mo].style.backgroundRepeat = "no-repeat";

					hed[mo].style.backgroundPosition = "140px 2px";

					}

					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>nlist)

		{

			if (sublst[po].style.display=="none")

			{

			sublst[po].style.display="block";

			hdid.style.backgroundImage = "url('/assets/img/up_arrow.gif')";

			hdid.style.backgroundRepeat = "no-repeat";

			hdid.style.backgroundPosition = "140px 2px";

			}

			else

			{

			sublst[po].style.display="none";

			hdid.style.backgroundImage = "url('/assets/img/down_arrow.gif')";

			hdid.style.backgroundRepeat = "no-repeat";

			hdid.style.backgroundPosition = "140px 2px";

			}

		}

		sCounter++;

	

	}



	}
