// ----------------------------------------------
// Author: (c) Andreas 'decoman' Fay
// ----------------------------------------------
// Version:    1.7.2
// ----------------------------------------------
// Functionindex
// ----------------------------------------------
// v0.1 - hideContent
// v0.1 - showContent
// v0.1 - showContentHiding
// v0.1 - swapContent
// v0.1 - swapContent_withImage
// v0.2 - swapContentHiding
// v0.2 - swapContentHiding_withImage
// ----------------------------------------------


// ----------------------------------------------
// Function
// ----------------------------------------------
// Name:        hideContent
// Description:
// Input:       Id
// Output:
// ----------------------------------------------
// Version:     0.1
// ----------------------------------------------
// ChangeLog
// ----------------------------------------------
// v0.1 (10.04.2007)
// ----------------------------------------------
function hideContent(strId)
{
    document.getElementById(strId).style.display =  "none";
}


// ----------------------------------------------
// Function
// ----------------------------------------------
// Name:        showContent
// Description:
// Input:       Id
// Output:
// ----------------------------------------------
// Version:     0.1
// ----------------------------------------------
// ChangeLog
// ----------------------------------------------
// v0.1 (10.04.2007)
// ----------------------------------------------
function showContent(strId)
{
    document.getElementById(strId).style.display =  "block";
}


// ----------------------------------------------
// Function
// ----------------------------------------------
// Name:        showContentHiding
// Description: Hides certain blocks before swapping
//              (s.a. swapContentHiding())
// Input:       Id,
//              Ids of blocks to hide
// Output:
// ----------------------------------------------
// Version:     0.1
// ----------------------------------------------
// ChangeLog
// ----------------------------------------------
// v0.1 (24.04.2007)
// ----------------------------------------------
function showContentHiding(strId, arrHideId)
{
    for (var intKey in arrHideId)
    {
        if (arrHideId[intKey] != strId)
        {
            document.getElementById(arrHideId[intKey]).style.display
                                                 =  "none";
        }
    }

    showContent(strId);
}


// ----------------------------------------------
// Function
// ----------------------------------------------
// Name:        swapContent
// Description:
// Input:       Id
// Output:
// ----------------------------------------------
// Version:     0.1
// ----------------------------------------------
// ChangeLog
// ----------------------------------------------
// v0.1 (11.01.2007)
// ----------------------------------------------
function swapContent(strId)
{
    var newDisplay;

    if (document.getElementById(strId).style.display == "none")
        newDisplay                               =  "block";
    else
        newDisplay                               =  "none";

    document.getElementById(strId).style.display =  newDisplay;
}


// ----------------------------------------------
// Function
// ----------------------------------------------
// Name:        swapContent_withImage
// Description: Swaps images combined with swapContent()
// Input:       Id,
//              Image_maximize,
//              Image_minimize
// Output:
// ----------------------------------------------
// Version:     0.1
// ----------------------------------------------
// ChangeLog
// ----------------------------------------------
// v0.1 (28.02.2007)
// ----------------------------------------------
function swapContent_withImage(strId, strImageMax, strImageMin)
{
    strImageId                                   =  strId + "_image";

    swapContent(strId);

    if (document.getElementById(strId).style.display == "none")
        document.getElementById(strImageId).src  =  strImageMax;
    else
        document.getElementById(strImageId).src  =  strImageMin;
}


// ----------------------------------------------
// Function
// ----------------------------------------------
// Name:        swapContentHiding
// Description: Hides certain blocks before swapping
//              (s.a. swapContent())
// Input:       Id,
//              Ids of blocks to hide
// Output:
// ----------------------------------------------
// Version:     0.2
// ----------------------------------------------
// ChangeLog
// ----------------------------------------------
// v0.1 (11.01.2007)
// v0.2 (03.03.2007)
// ----------------------------------------------
function swapContentHiding(strId, arrHideId)
{
    for (var intKey in arrHideId)
    {
        if (arrHideId[intKey] != strId)
        {
            document.getElementById(arrHideId[intKey]).style.display
                                                 =  "none";
        }
    }

    swapContent(strId);
}

// ----------------------------------------------
// Function
// ----------------------------------------------
// Name:        swapContentHiding_withImage
// Description: Hides certain blocks before swapping;
//              also swaps images
//              (s.a. swapContent())
// Input:       Id,
//              Ids of blocks to hide
//              Defaultimage_maximize
//              Image_maximize,
//              Image_minimize
// Output:
// ----------------------------------------------
// Version:     0.2
// ----------------------------------------------
// ChangeLog
// ----------------------------------------------
// v0.1 (28.02.2007)
// v0.2 (03.03.2007)
// ----------------------------------------------
function swapContentHiding_withImage(strId, arrHideId, strDfImageMax, strImageMin, strImageMax)
{
    for (var intKey in arrHideId)
    {
        if (arrHideId[intKey] != strId)
        {
            document.getElementById(arrHideId[intKey]).style.display
                                                 =  "none";
            document.getElementById(arrHideId[intKey]+"_image").src
                                                 =  strDfImageMax;
        }
    }

    swapContent_withImage(strId, strImageMax ? strImageMax : strDfImageMax, strImageMin);
}