﻿// This is HiLite script to turn RED color selected PlayList Item 

var currentHighlight=null;
    
    function removeHighLight(theDiv)
    {
        if (theDiv!=currentHighlight)
            document.getElementById(theDiv).className='Block';
    }    
   // function to highlite selected video onMouse Event in the Ooyala video playlist //
var highlightLink= function() {
        var active = null, colour = '#FF0000';
        if (this.attachEvent) this.attachEvent('onunload', function () {
            active = null;
            currentHighlight=null;
        });
        return function (element) {
            if ((active != element) && element.style) {
                if (active) {
                    active.style.color = '';
                    if (active.previousSibling!=null)
                    {                 
                        active.previousSibling.className = 'Block';
                        active.parentNode.nextSibling.className = 'imageOutline';
                    }
                }              
                
                if (element.previousSibling!=null)
                {
                    element.previousSibling.className = 'redBlockBox'
                    element.parentNode.nextSibling.className = 'imageOutline0';
                    currentHighlight=element.previousSibling.id;
                }
                element.style.color = colour;
                active = element;
                
            }
        };
    }();

/* End of original code for Highlight */

     var hiliteChannels = function () {
        var activeCh = null, colr = 'btnChannelRed';
        if (this.attachEvent) this.attachEvent('onunload', function () {
            activeCh = null;
        });
        return function (element) {
            if ((activeCh != element) && element.className) {
                if (activeCh) activeCh.className = 'btnText';
                element.className= colr;
                activeCh = element;
            }
        };
    }();