var nPageIndex = 1;
var nPageCounter = 1;

function SetPaging()
{   
    if (nPageCounter > 1)
    {
        if (nPageIndex > 1)
        {
            document.getElementById("leftcontent_image").onmouseout = function(){this.src = '/Portals/2/Skins/Pieper/images/content_arrow_left2.png'};
            document.getElementById("leftcontent_image").onmouseover = function(){this.src = '/Portals/2/Skins/Pieper/images/content_arrow_left2_ov.png'};
            document.getElementById("leftcontent_image").src = "/Portals/2/Skins/Pieper/images/content_arrow_left2.png";
        }
        else
        {
            document.getElementById("leftcontent_image").onmouseout = function(){};
            document.getElementById("leftcontent_image").onmouseover = function(){};
            document.getElementById("leftcontent_image").src = "/Portals/2/Skins/Pieper/images/Paging_deact_links.png";
        }
            
        if (nPageIndex < nPageCounter)
        {
            document.getElementById("rightcontent_image").onmouseout = function(){this.src = '/Portals/2/Skins/Pieper/images/content_arrow_right2.png'};
            document.getElementById("rightcontent_image").onmouseover = function(){this.src = '/Portals/2/Skins/Pieper/images/content_arrow_right2_ov.png'};
            document.getElementById("rightcontent_image").src = "/Portals/2/Skins/Pieper/images/content_arrow_right2.png";
        }
        else
        {
            document.getElementById("rightcontent_image").onmouseout = function(){};
            document.getElementById("rightcontent_image").onmouseover = function(){};
            document.getElementById("rightcontent_image").src = "/Portals/2/Skins/Pieper/images/Paging_deact_rechts.png";
        }
    }
}

function MovePage(nIndex)
{
    
    var nNewPageIndex = nPageIndex + nIndex;
    
    if (nNewPageIndex > 0 && nNewPageIndex <= nPageCounter)
    {
        var elm = document.getElementById("page" + nNewPageIndex);
        if (typeof(elm) != "undefined" && elm != null)
        {
            var elmOld = document.getElementById("page" + nPageIndex);
            elmOld.style.display = "none";
                                    
            elm.style.display = "block";
            nPageIndex = nNewPageIndex;
            
            SetPaging();
        }
    }
}

function setPage(page)
{
    var nNewPageIndex = page;
    
    if (nNewPageIndex > 0 && nNewPageIndex <= nPageCounter)
    {
        var elm = document.getElementById("page" + nNewPageIndex);
        if (typeof(elm) != "undefined" && elm != null)
        {
            var elmOld = document.getElementById("page" + nPageIndex);
            elmOld.style.display = "none";
                                    
            elm.style.display = "block";
            nPageIndex = nNewPageIndex;
            
            SetPaging();
        }
    }
}
