
/*
function geshiExpand(div_geshiwrapper) 
{
	div_geshitop = div_geshiwrapper.getElementsByTagName('div')[0];
	div_geshimain = div_geshiwrapper.getElementsByTagName('div')[1];
	
	// If we weren't using geshimainboxed then don't do anything
	if (div_geshimain.className == 'geshimainboxed')
	{
		div_geshimain.style.height = '100%';
	}
}
*/

function geshiExpand(node) 
{
	div_geshitop = node.parentNode;
	div_geshimain = div_geshitop.nextSibling;
	
	// First sibling will either be geshimain or geshimainboxed
	if (div_geshimain.nodeName === 'DIV' && div_geshimain.className === 'geshimainboxed')
	{
		div_geshimain.style.height = '100%';

		// Hide this node and display nextSibling (Collapse)
		node.style.display = "none";
		node.nextSibling.style.display = "";
	}
}

function geshiCollapse(node) 
{
	div_geshitop = node.parentNode;
	div_geshimain = div_geshitop.nextSibling;
	
	// First sibling will either be geshimain or geshimainboxed
	if (div_geshimain.nodeName === 'DIV' && div_geshimain.className === 'geshimainboxed')
	{
		div_geshimain.style.height = '250px';

		// Hide this node and display nextSibling (Collapse)
		node.style.display = "none";
		node.previousSibling.style.display = "";
	}
}

function geshiPopup(node) 
{
	div_geshitop = node.parentNode;
	div_geshimain = div_geshitop.nextSibling;

	// First sibling will either be geshimain or geshimainboxed
	if (div_geshimain.nodeName === 'DIV' && (div_geshimain.className === 'geshimainboxed' || div_geshimain.className === 'geshimain'))
	{
		// Remove html formatting and change <br /> into \r\n
		text = div_geshimain.lastChild.innerHTML;
		text = text.replace(/<br.?\/?>/g, "\r\n");
		text = text.replace(/<\/?[^>]+(>|$)/g, "");

		//node = '<textarea name="code" cols="80" rows="40" width="100%">' + text + "</textarea>";
		node = '<pre>' + text + "</pre>";
		popup = window.open("", "window", "width=800,height=600,scrollbars=yes,resizable=yes");
		popup.document.write(node);
		popup.document.close();
	}
}
