
var parenttbody = new Array();
var tbody       = new Array();
var aftertbody  = new Array();

function doShowHide(showItemID, hideItemID) {

	var showItem=document.getElementById(showItemID);
	var hideItem=document.getElementById(hideItemID);	
	
	showItem.style.display = "block";
	hideItem.style.display = "none";
	
}

function showTBodyArea(category) {
	parenttbody[category].insertBefore(tbody[category],aftertbody[category]);

	var imgname  = category+"openclose";
	var linkname = category+"opencloselink";

	var imgel = document.getElementById(imgname);
	//imgel.setAttribute("src","sites/localsite/collect/lomdemo-e/images/open.gif");
	imgel.setAttribute("src",imgel.getAttribute("data-img-path")+"open.gif");

	var linkel = document.getElementById(linkname);
	linkel.setAttribute("href","javascript:hideTBodyArea('"+category+"')");
}

function hideTBodyArea(category) {

	tbody[category] = document.getElementById(category);
	parenttbody[category] = tbody[category].parentNode;
	aftertbody[category] = tbody[category].nextSibling;
	parenttbody[category].removeChild(tbody[category]);

	var imgname  = category+"openclose";
	var linkname = category+"opencloselink";

	var imgel = document.getElementById(imgname);
	//imgel.setAttribute("src","sites/localsite/collect/lomdemo-e/images/close.gif");
	imgel.setAttribute("src",imgel.getAttribute("data-img-path")+"close.gif");

	var linkel = document.getElementById(linkname);
	linkel.setAttribute("href","javascript:showTBodyArea('"+category+"')");
}

