function toggleDisplay(id)
{
	var obj = document.getElementById(id);
	obj.style.display = obj.style.display=="none"?"block":"none";
}

function showElement(id, bshow)
{
	var obj = document.getElementById(id);
	obj.style.display = bshow?"block":"none";
}

function setElementContent(id, html)
{
	var obj = document.getElementById(id);
	obj.innerHTML = html;
}


function showTextContentForItem(textItemId)
{
	//build text
	var txt = document.getElementById(textItemId).innerHTML;
	txt += "<br /><br />";
	txt += "<a href='javascript:showElement(\"collectionthumbs\",true);showElement(\"textitemcontent\",false);' class='function'>sluiten</a><br /><br />";
	setElementContent("textitemcontent", txt);
	//show/hide elements
	showElement("collectionthumbs",false);
	showElement("textitemcontent",true);
}


//soundmanager wrapper functions

function playSound(audioFile)
{
	if (!soundManagerReady) return;
	stopAllSound();
	soundManager.destroySound(audioFile);
	var file = "./audio/"+audioFile;
	soundManager.createSound({id: audioFile,  url: file, autoPlay: true });
}

function stopSound(audioFile)
{
	soundManager.stop(audioFile);
	soundManager.destroySound(audioFile);
}

function stopAllSound()
{
	soundManager.stopAll();
}
