function mailWebmaster()
{
    var mail1 = 'admin';
    var mail2 = '@fg-quintessenz.de';
    window.location.href = 'mailto:' + mail1 + mail2;
}

function mailRedaktion()
{
    var mail1 = 'redaktion';
    var mail2 = '@fg-quintessenz.de';
    window.location.href = 'mailto:' + mail1 + mail2;
}

function mailAds()
{
    var mail1 = 'anzeigen';
    var mail2 = '@fg-quintessenz.de';
    window.location.href = 'mailto:' + mail1 + mail2 + '?subject=Anzeige%20in%20der%20QuintessenZ';
}

function switchContentSection(id, link)
{
    var table = document.getElementById('news_box');
    var news_div = document.getElementById('news_box_' + id);
    if (table && news_div)
    {
        var divs = document.getElementsByTagName('div');
        for (div in divs)
            if (typeof divs[div] == 'object' && divs[div].id)
                if (divs[div].id.substr(0, 9) == 'news_box_')
                    divs[div].style.display = 'none';
        news_div.style.display = '';
        var tabs = table.getElementsByTagName('a');
        for (tab in tabs)
            if (typeof tabs[tab] == 'object' && tabs[tab].className)
                if (tabs[tab].className == 'active')
                    tabs[tab].className = '';
        link.className = 'active';
    }
}

function fadeOut(el_id, heightSubtraction)
{
    var el = document.getElementById(el_id);
    if (el)
    {
        var opacity, height;
        if (typeof el.style.opacity == 'undefined' || el.style.opacity == '')
            opacity = 1.0;
        else
            opacity = parseFloat(el.style.opacity);
        if (el.style.height == '')
        {
            height = el.offsetHeight;
            heightSubtraction = Math.round(height / 20);
        }
        else
            height = parseInt(el.style.height);
        if (!heightSubtraction)
            heightSubtraction = Math.round(height / 20);
        el.style.overflow = 'hidden';
        el.style.opacity = (opacity - 0.05);
        el.style.height = (height - heightSubtraction) + "px";
        if (opacity > 0.05 && height > 2)
            setTimeout("fadeOut('" + el.id + "', " + heightSubtraction + ");", 25);
        else
            el.style.display = 'none';
    }
}

function fadeIn(el_id, endHeight)
{
    var el = document.getElementById(el_id);
    if (el)
    {
        var opacity, height;
        if (typeof el.style.opacity == 'undefined' || el.style.opacity == '')
            opacity = 0;
        else
            opacity = parseFloat(el.style.opacity);
        if (el.style.height == '')
        {
            el.style.display = '';
            endHeight = el.offsetHeight;
            el.style.display = 'none';
            height = 0;
            el.style.height = '0px';
        }
        else
            height = parseInt(el.style.height);
        if (!endHeight)
            endHeight = height;
        el.style.overflow = 'hidden';
        el.style.display = '';
        el.style.opacity = (opacity + 0.05);
        if (height + Math.round(endHeight / 30) < endHeight)
            el.style.height = (height + Math.round(endHeight / 30)) + "px";
        else
            el.style.height = (endHeight - 2) + 'px';
        if (opacity < 1.95)
            setTimeout("fadeIn('" + el.id + "', " + endHeight + ");", 25);
        else
        {
            el.style.overflow = '';
            el.style.opacity = 1.0;
            el.style.height = '';
        }
    }
}