function SBPanelToggle(panelId, openImg, closeImg, func){
	if ('off' == getCookie(panelId)) {
		SBPanelShow(panelId, openImg, closeImg);
	} else {
		SBPanelHide(panelId, openImg, closeImg);
	}
	
	if (func) {
		func();
	}
}

function SBPanelShow(panelId, openImg, closeImg) {
	var panel = document.getElementById(panelId);
	var img = document.getElementById(panelId + '_image');
	var hidden = document.getElementById(panelId + '_hidden');
	
	hidden.value = 'true';
	img.src = closeImg;
	panel.rows[1].style.display = (document.all) ? 'block' : 'table-row';
	setCookie(panelId, 'on', '', '/');
}

function SBPanelHide(panelId, openImg, closeImg) {
	var panel = document.getElementById(panelId);
	var img = document.getElementById(panelId + '_image');
	var hidden = document.getElementById(panelId + '_hidden');
	
	hidden.value = 'false';
	img.src = openImg;
	panel.rows[1].style.display = 'none';
	setCookie(panelId, 'off', '', '/');
}

function IsSBPanelHidden(panelId) {
	var hidden = document.getElementById(panelId + '_hidden');
	return (hidden.value == 'false');
}