﻿/*Hides and shows tha panel*/
function ExpandCollapseWindow(panel)
{
    var cntrID = document.getElementById(panel);
    if (cntrID != null)
    {
        if(cntrID.style.display == "none")
        {
            cntrID.style.display = "";
        }
        else
        {
            cntrID.style.display = "none";
        }
    }
}



/*
!Extended for show/hide panel only!
Hides and shows tha panel*/
function ExpandCollapseWindowExt(panel, hIsCollapsed)
{
    var cntrID = document.getElementById(panel);
    var hIsCollapsedID = document.getElementById(hIsCollapsed);
    if (cntrID != null)
    {
        if(cntrID.style.display == "none")
        {
            cntrID.style.display = "";
            hIsCollapsedID.value = false;
        }
        else
        {
            cntrID.style.display = "none";
            hIsCollapsedID.value = true;
        }
    }
}

/*
!Extended for show/hide panel only!
Hides the one panel and shows the other one (looses their styles/classes)
This function also change the hidden value that represent the IsCollapsed filed
*/
function HideOneShowOtherPanelExt(panel1, panel2, hIsCollapsed)
{
    var panel1ID = document.getElementById(panel1);
    var panel2ID = document.getElementById(panel2);  
    var hIsCollapsedID = document.getElementById(hIsCollapsed); 
    if (panel1ID != null && panel2ID != null)
    {  
        if(panel1ID.style.display == "none")
        {
            panel1ID.style.display = "";
            panel2ID.style.display = "none";
            hIsCollapsedID.value = false;
        }
        else
        {
            panel1ID.style.display = "none";
            panel2ID.style.display = "";
            hIsCollapsedID.value = true;
        }
    }
}


/*Hides the one panel and shows the other one (looses their styles/classes)*/
function HideOneShowOtherPanel(panel1, panel2)
{
    var panel1ID = document.getElementById(panel1);
    var panel2ID = document.getElementById(panel2);  
    if (panel1ID != null && panel2ID != null)
    {  
        if(panel1ID.style.display == "none")
        {
            panel1ID.style.display = "";
            panel2ID.style.display = "none";
        }
        else
        {
            panel1ID.style.display = "none";
            panel2ID.style.display = "";
        }
    }
}
/*Changes the control css class*/
function ChangeCssClass(controlID, newCssClass)
{
    var control = document.getElementById(controlID);
    if (control != null)
        control.className = newCssClass;
}