function TextScroll(scrollname, div_name, up_name, down_name)
{
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 5;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;

{
        if (document.getElementById) {
            div_obj = document.getElementById(this.div_name);
            if (div_obj) {
                this.div_obj = div_obj;
                this.div_obj.style.overflow = 'hidden';
            }
            div_up_obj = document.getElementById(this.up_name);
            div_dn_obj = document.getElementById(this.dn_name);
            if (div_up_obj && div_dn_obj) {
            //alert(div_up_obj);
div_up_obj.onmouseover = function (TextScrollObj) { return function () { TextScrollObj.scrollUp(); }} (this);
div_up_obj.onmouseout = function (TextScrollObj) { return function () { TextScrollObj.stopScroll(); }} (this); 

div_dn_obj.onmouseover = function (TextScrollObj) { return function () { TextScrollObj.scrollDown(); }} (this); 
div_dn_obj.onmouseout = function (TextScrollObj) { return function () { TextScrollObj.stopScroll(); }} (this);
            }
        }
    }

this.stopScroll = function() {
        clearTimeout(this.timeoutID);
    }

this.scrollUp = function() {
        if (this.div_obj) {
            this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
        }
    }

this.scrollDown = function() {
        if (this.div_obj && (this.div_obj.scrollTop < (document.getElementById('entryContent').offsetHeight - this.div_obj.offsetHeight))) {
            this.scrollCursor += this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
        }
    }

this.resetScroll = function() {
        if (this.div_obj) {
            this.div_obj.scrollTop = 0;
            this.scrollCursor = 0;
        }
    }
}

var firstImgLoad = true;
var currentImg = -1;

function setImage(num) {
    var bigImage = document.getElementById('bigImage');
    bigImage.style.cssFloat = "none";
    bigImage.style.styleFloat = "none";//max-height:385px
    bigImage.style.maxHeight = "385px";
    document.getElementById('imageNav').style.display = "block";
    document.getElementById('loader').style.display = "";
    bigImage.style.display = "none";
    bigImage.src = "images/gallery/large/" + srcArray[num] + ".jpg";
    //alert(titleArray[num]);
    bigImage.title = titleArray[num];
    bigImage.alt = titleArray[num];
    currentImg = num;
}

function imageLoaded() {
    if (firstImgLoad) {
        firstImgLoad = false;        
    }else{
        document.getElementById('loader').style.display = "none";
        document.getElementById('bigImage').style.display = "";
    }
}

function nextImage() {
    if (currentImg == srcArray.length) {
        return false;
    }
    currentImg++;
    setImage(currentImg)
}

function prevImage() {
    if (currentImg == -1) {
        return false;
    }
    currentImg--;
    setImage(currentImg)
}