imgout=new Image(9,9);
imgin=new Image(9,9);
imgout.src="/home/webmedia/1137461547335/expand_small.jpg";
imgin.src="/home/webmedia/1137461569844/collapse_small.jpg";


/////////////////BEGIN USER EDITABLE///////////////////////////////

///////////////END USER EDITABLE///////////////////////////////////


//this switches expand collapse icons
function filter(imagename,objectsrc)
{
	if (document.images)
	{
		document.images[imagename].src=eval(objectsrc+".src");
	}
}

//show OR hide funtion depends on if element is shown or hidden
function shoh(id) 
{ 
	if (document.getElementById) 
	{ // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none")
		{
			document.getElementById(id).style.display = 'block';
			filter(("img"+id),'imgin');			
		} 
		else 
		{
			filter(("img"+id),'imgout');
			document.getElementById(id).style.display = 'none';			
		}	
	}
	else 
	{ 
		if (document.layers) 
		{	
			if (document.id.display == "none")
			{
				document.id.display = 'block';
				filter(("img"+id),'imgin');
			} 
			else 
			{
				filter(("img"+id),'imgout');	
				document.id.display = 'none';
			}
		} 
		else 
		{
			if (document.all.id.style.visibility == "none")
			{
				document.all.id.style.display = 'block';
			} 
			else 
			{
				filter(("img"+id),'imgout');
				document.all.id.style.display = 'none';
			}
		}
	}
}





var length = 0;
var count = 0;

function forwardid(num)
{
	var temp;
	length = num;
	hideallids(length);
	if (count < length - 1)
	{
		count++;
	}
	else
	{
		count = 0;
	}
	eval(temp = "div" + count);
	showdiv(temp);
}

function backwardid(num)
{
	var temp;
	length = num;
	hideallids(length);
	if (count <= 0)
	{
		count = length - 1;
	}
	else
	{
		count--;
	}
	eval(temp = "div" + count);	
	showdiv(temp);
}

function hideallids(num)
{
	var temp;
	//loop through the array and hide each element by id
	for (var i=0;i<num;i++)
	{
		eval(temp = "div" + i);
		hidediv(temp);
	}		  
}

function hidediv(id) 
{
	//safe function to hide an element with a specified id
	if (document.getElementById) 
	{ // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else 
	{
		if (document.layers) 
		{ // Netscape 4
			document.id.display = 'none';
		}
		else 
		{ // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) 
{
	//safe function to show an element with a specified id  
	if (document.getElementById) 
	{ // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else 
	{
		if (document.layers) 
		{ // Netscape 4
			document.id.display = 'block';
		}
		else 
		{ // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

function Expand(id)
{

	if (document.getElementById) 
	{ // DOM3 = IE5, NS6

		document.getElementById(id).style.display = 'block';
		filter(("img"+id),'imgin');			

	}
	else 
	{ 
		if (document.layers) 
		{	
			document.id.display = 'block';
			filter(("img"+id),'imgin');

		} 
		else 
		{
			document.all.id.style.display = 'block';
		}
	}	
}

function Collapse(id)
{
	if (document.getElementById) 
	{ // DOM3 = IE5, NS6
		filter(("img"+id),'imgout');
		document.getElementById(id).style.display = 'none';			
	}
	else 
	{ 
		if (document.layers) 
		{	
			filter(("img"+id),'imgout');	
			document.id.display = 'none';
		} 
		else 
		{
			filter(("img"+id),'imgout');
			document.all.id.style.display = 'none';
		}
	}
}

function ExpandControl(total)
{	
	for (i = 1; i <= total; i++)
	{
		Expand(i);
	}
}

function CollapseControl(total)
{	
	for (i = 1; i <= total; i++)
	{
		Collapse(i);
	}
}
