﻿animAttributes = {
    opacity: { to: 1 }
};

cAnimAttributes = {
    opacity: { to: 0 }  
};

textFader = {

    currentContent: null,
    currentLink: null,
    origColor: null,

    section: function(i) {

        if (this.currentContent != null) {

            var c_el = YAHOO.util.Dom.get(this.currentContent);
            c_el.style.zIndex = '1';

            var textanimf = new YAHOO.util.ColorAnim(c_el, cAnimAttributes);
            textanimf.animate();

            var c_lk = YAHOO.util.Dom.get(this.currentLink);
            c_lk.style.color = this.origColor;
        }

        var el = YAHOO.util.Dom.get('content' + i);
        YAHOO.util.Dom.setStyle(el, 'opacity', '0');
        el.style.display = 'block';
        el.style.zIndex = '2';
        el.scrollTop = 0;

        var textanim = new YAHOO.util.Anim(el, animAttributes);
        textanim.animate();

        var lk = YAHOO.util.Dom.get('link' + i);
        this.origColor = lk.style.color;

        lk.style.color = '#000';

        this.currentLink = lk;
        this.currentContent = el;

        try {
            YAHOO.util.Dom.get('scrollArrows').style.visibility = 'visible';
            contentScroller.init(el, 'scrollUp', 'scrollDown');
        }
        catch (oError) {
        
        }

        return false;
    }
};