function toggleLeftPanel(openImg, closeImg){
	
	var panelId = 'LeftPanelDiv';
	var barHideClass = 'sb-edit-panel-hidebackground';
	var barOpenClass = 'sb-edit-panel-showbackground';
	
    var panel=document.getElementById(panelId);
    var img=document.getElementById(panelId+"_bullet");
    var border=document.getElementById(panelId+"_border");
    var hidden=document.getElementById(panelId+"_hidden");
    var bar=document.getElementById(panelId+"_Bar");
    var text=document.getElementById(panelId+"_Text");
    if (hidden.value=="true"){
        hidden.value="false";
        img.src=closeImg;
		text.src=setPanelText(SbGetLocaleByKey('HIDE-SITE-MAP'));
        panel.style.display="block";
        bar.className=barHideClass;
        setCookie('WizardEditSiteMapPanel', 'on', '', '/');
        var tree = document.getElementById('edit');
        tree.onResize();
    } else{
        hidden.value="true";
        img.src=openImg;
		text.src=setPanelText(SbGetLocaleByKey('SHOW-SITE-MAP'));
        panel.style.display="none";
        bar.className=barOpenClass;
        setCookie('WizardEditSiteMapPanel', 'off', '', '/');
    }
}

function toggleRightPanel(openImg, closeImg){
	
	var panelId = 'RightPanelDiv';
	var barHideClass = 'sb-edit-panel-hidebackground';
	var barOpenClass = 'sb-edit-panel-showbackground';
	
    var panel=document.getElementById(panelId);
    var img=document.getElementById(panelId+"_bullet");
    var border=document.getElementById(panelId+"_border");
    var hidden=document.getElementById(panelId+"_hidden");
    var bar=document.getElementById(panelId+"_Bar");
    var text=document.getElementById(panelId+"_Text");

    if (hidden.value=="true"){
        hidden.value="false";
        img.src=openImg;
		text.src=setPanelText(SbGetLocaleByKey('HIDE-AVAILABLE-MODULES'));
		panel.style.display="block";        
        bar.className=barOpenClass;
        setCookie('WizardEditBlockModulesPanel', 'on', '', '/');
        setModulePanelHeight();
    } else{
        hidden.value="true";
        img.src=closeImg;
		text.src=setPanelText(SbGetLocaleByKey('SHOW-AVAILABLE-MODULES'));
      	panel.style.display="none";
        bar.className=barHideClass;
        setCookie('WizardEditBlockModulesPanel', 'off', '', '/');
    }
}

function initModulePanel() {
	addEvent(window, 'load', function(event) { setModulePanelHeight(); });
	addEvent(window, 'resize', function(event) { setModulePanelHeight(); });
}

function setModulePanelHeight() {
	var panel_td = document.getElementById('ModulePanel_Td');
	var panel_div = document.getElementById('ModulePanel_Div');
	height = panel_td.clientHeight - 5;
	panel_div.style.height = height+'px';
	panel_div.style.display = 'block';
}

function setPanelText(text) {
	return '/localizedimage.php?text='+text;
}