var slideContactDivInOutInterval;
var contactDivMinHeigth = 60;
var contactDivMaxHeight = 410;

function slideContactDivInOut() {
    var height = parseInt($get("tab").style.height.replace("px", ""));
    if (height >= contactDivMaxHeight)
        slideContactDivInOutInterval = setInterval("slideContactDiv(false)", 30);
    else
        slideContactDivInOutInterval = setInterval("slideContactDiv(true)", 30);
}

function slideContactDiv(moveUp) {
    var element = $get("tab");
    var height = parseInt(element.style.height.replace("px", ""));
    if (isNaN(height))
        height = contactDivMinHeigth;

    if ((moveUp && height >= contactDivMaxHeight) || (!moveUp && height <= contactDivMinHeigth))
        clearInterval(slideContactDivInOutInterval);
    else {
        var pixel = 30;

        var strecke = contactDivMaxHeight - contactDivMinHeigth;
        var position = height - contactDivMinHeigth;
        if (position < strecke / 6 || position > strecke * 5 / 6)
            pixel = 10;
        else if (position < strecke / 3 || position > strecke * 2 / 3)
            pixel = 20;

        if (!moveUp) pixel = pixel * -1;
        element.style.height = (height + pixel) + "px";
    }
}

function setStyle(pID) {
    if (document.getElementById(pID).className.indexOf("mainlink") >= 0)
        document.getElementById(pID).className = "mainlinkhigh";
    else if (document.getElementById(pID).className.indexOf("sublink") >= 0)
        document.getElementById(pID).className = "sublinkhigh";
}

function resetStyle(pID) {
    if (document.getElementById(pID).className.indexOf("mainlink") >= 0)
        document.getElementById(pID).className = "mainlink";
    else if (document.getElementById(pID).className.indexOf("sublink") >= 0)
        document.getElementById(pID).className = "sublink";
}