﻿
function setActiveTab(tabon, onclass)
{
    if(document.getElementById(tabon) != null)
    {
    
        if (document.getElementById) /* DOM3 = IE5, NS6 */
        { 
            document.getElementById(tabon).className = onclass;
        }
        else 
        {
            if (document.layers) /* Netscape 4*/
            { 
	            document.tabon.className = onclass;;
            }
            else /* IE 4*/
            { 
	            document.all.tabon.className = onclass;;
            }
        }
        
    }

}


function updateVideoFrame(videoFrameID, videoURL) {
    if (document.getElementById(videoFrameID) != null) {

        if (document.getElementById) /* DOM3 = IE5, NS6 */
        {
            document.getElementById(videoFrameID).src = videoURL;
        }
        else {
            if (document.layers) /* Netscape 4*/
            {
                document.videoFrameID.src = videoURL;
            }
            else /* IE 4*/
            {
                document.all.videoFrameID.src = videoURL;
            }
        }

    }

}
 
function autoPlayVideoFrame(videoFrameID,autoPlay) {
    if (document.getElementById(videoFrameID) != null) {

        if (document.getElementById) /* DOM3 = IE5, NS6 */
        {
            document.getElementById(videoFrameID).autoStart = autoPlay;
        }
        else {
            if (document.layers) /* Netscape 4*/
            {
                document.videoFrameID.autoStart = autoPlay;
            }
            else /* IE 4*/
            {
                document.all.videoFrameID.autoStart = autoPlay;
            }
        }

    }

}

function updateVideoFrameSummary(currentVideoFrameSummary, srcVideoFrameSummary, currentVideoCompany,srcVideoFrameCompany) {
    if (document.getElementById(currentVideoFrameSummary) != null) {

        if (document.getElementById) /* DOM3 = IE5, NS6 */
        {
            // mozilla
            if (document.getElementById(currentVideoCompany).textContent != null) {
                document.getElementById(currentVideoCompany).textContent = document.getElementById(srcVideoFrameCompany).textContent;
                document.getElementById(currentVideoFrameSummary).textContent = document.getElementById(srcVideoFrameSummary).textContent;
            }
            // IE
            else {
                document.getElementById(currentVideoCompany).innerText = document.getElementById(srcVideoFrameCompany).innerText;
                document.getElementById(currentVideoFrameSummary).innerText = document.getElementById(srcVideoFrameSummary).innerText;
            }
            
        }
        else {
            if (document.layers) /* Netscape 4*/
            {
                document.currentVideoCompany.innerText = document.srcVideoFrameCompany.innerText;
                document.currentVideoFrameSummary.innerText = document.srcVideoFrameSummary.innerText;
                
            }
            else /* IE 4*/
            {
                document.all.currentVideoCompany.innerText = document.all.srcVideoFrameCompany.innerText;
                document.all.currentVideoFrameSummary.innerText = document.all.srcVideoFrameSummary.innerText;
            }
        }

    }

}

function loadSelectedVideo(prefix) {
    var videoLink = "";

    if (prefix != '') {
        if (document.getElementById) /* DOM3 = IE5, NS6 */
        {
            // mozilla
            if (document.getElementById(prefix + "Link").textContent != null) {
                videoLink = document.getElementById(prefix + "Link").textContent;
            }
            // IE
            else {
                videoLink = document.getElementById(prefix + "Link").innerText;
            }

        }

        updateVideoFrameSummary('CurrentVideoText', prefix + 'Summary', 'CurrentVideoCompany', prefix);
        updateVideoFrame('videoframe', videoLink);
    }
}
