function newsBox()
{
    var curentSpRepIndex = -1;
    var curentSpIntIndex = -1;
    var curentPhotoRepIndex = -1;
    var curentResNewsIndex = -1;
    function changeNewsBoxContent(contentBoxId, contentListId, contentIndex)
    {
        var contentImageId = $(contentBoxId).getElementsByTagName("img")[0].id;
        var contentImage = document.images[contentImageId];
        var contentLink = $(contentBoxId).getElementsByTagName("a")[0];
        var contentData = $(contentListId).getElementsByTagName("div")[contentIndex].getElementsByTagName("p");
        
        contentImage.src = contentData[0].innerHTML;
        contentImage.alt = contentData[1].innerHTML;
        contentLink.innerHTML = contentData[2].innerHTML;
        contentLink.href = contentData[3].innerHTML;
    }
    this.nextContent = function (contentBoxId, contentListId, box)
    {
        var index;
        var indexShowBox;
        var countShowBox;
        switch (box)
        {
            case 1://Spetial Report Tab
                index = curentSpRepIndex;
                indexShowBox = $("SpRepIndex");
                countShowBox = $("SpRepCount");
                break;
            case 2://Spetial Interview Tab
                index = curentSpIntIndex;
                indexShowBox = $("SpIntIndex");
                countShowBox = $("SpIntCount");
                break;
            case 3://Photo Report Tab
                index = curentPhotoRepIndex;
                indexShowBox = $("PhotoRepIndex");
                countShowBox = $("PhotoRepCount");
                break;
            case 4://Research News Tab
                index = curentResNewsIndex;
                indexShowBox = $("ResNewsIndex");
                countShowBox = $("ResNewsCount");
                break;
        }
        index++;
        var contentDataLength = $(contentListId).getElementsByTagName("div").length;
        if (index >= contentDataLength)
            index = 0;
        changeNewsBoxContent(contentBoxId, contentListId, index);
        indexShowBox.innerHTML = index + 1;
        countShowBox.innerHTML = contentDataLength;
        
        switch (box)
        {
            case 1://Spetial Report Tab
                curentSpRepIndex = index;
                break;
            case 2://Spetial Interview Tab
                curentSpIntIndex = index;
                break;
            case 3://Photo Report Tab
                curentPhotoRepIndex = index;
                break;
            case 4://Research News Tab
                curentResNewsIndex = index;
                break;
        }
    }
    ///
    this.prevContent = function (contentBoxId, contentListId, box)
    {
        var index;
        var indexShowBox;
        var countShowBox;
        switch (box)
        {
            case 1://Spetial Report Tab
                index = curentSpRepIndex;
                indexShowBox = $("SpRepIndex");
                countShowBox = $("SpRepCount");
                break;
            case 2://Spetial Interview Tab
                index = curentSpIntIndex;
                indexShowBox = $("SpIntIndex");
                countShowBox = $("SpIntCount");
                break;
            case 3://Photo Report Tab
                index = curentPhotoRepIndex;
                indexShowBox = $("PhotoRepIndex");
                countShowBox = $("PhotoRepCount");
                break;
            case 4://Research News Tab
                index = curentResNewsIndex;
                indexShowBox = $("ResNewsIndex");
                countShowBox = $("ResNewsCount");
                break;
        }
        index--;
        var contentDataLength = $(contentListId).getElementsByTagName("div").length;
        if (index < 0)
            index = contentDataLength - 1;
        changeNewsBoxContent(contentBoxId, contentListId, index);
        indexShowBox.innerHTML = index + 1;
        countShowBox.innerHTML = contentDataLength;
        
        switch (box)
        {
            case 1://Spetial Report Tab
                curentSpRepIndex = index;
                break;
            case 2://Spetial Interview Tab
                curentSpIntIndex = index;
                break;
            case 3://Photo Report Tab
                curentPhotoRepIndex = index;
                break;
            case 4://Research News Tab
                curentResNewsIndex = index;
                break;
        }
    }
}
var NewsBox = new newsBox();
