var ids=new Array('element1','elemente2','sidebar','contentainer');

function switchIdClass(id) {
	var className = $(id).className;
	
	if (className=='minimize') 
	{
		className='maximize'
	}
	else if (className=='maximize') {
		className='minimize'
	}
	$(id).className = className;
}

function switchId(id)
{	
	hideAllIds();
	showElement(id);
}

function toggleIds(id1, id2)
{
	hideElement(id1);
	showElement(id2);
}

function hideAllIds()
{
	for (var i=0;i<ids.length;i++) //Loop through the array and hide each element by id
	{
		hideElement(ids[i]);
	}		  
}

//Safe function to hide an element with a specified id
function hideElement(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';
		}
	}
}

//Safe function to show an element with a specified id
function showElement(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';
		}
	}
}
