﻿function redirectchannel(obj) {
    if (obj != "javascript:none()" && obj != "") {
        window.location.href = obj;
    }
}

function ShowTab(index, stop) {
    for (var i = 1; i <= 5; i++) {
        document.getElementById("channelstab" + i).style.display = "none";
        document.getElementById("tab" + i).style.backgroundPosition = "bottom left";
        document.getElementById("tab" + i).className = "";
    }

    document.getElementById("channelstab" + index).style.display = "block";
    document.getElementById("tab" + index).style.backgroundPosition = "top left";
    document.getElementById("tab" + index).className = "current";

    if (stop) {
        window.clearTimeout(tabshow);
    }
}

function SetBackground(obj, top) {
    if (obj.className != "current") {
        if (top) {
            obj.style.backgroundPosition = "top left";
        }
        else {
            obj.style.backgroundPosition = "bottom left";
        }
    }
}


// Tab Slide Show
var speed = 5000; // in miliseconds
var nbItems = 5;
var tabshow;

var tabId = 1;
function TabSlideShow() {
    ShowTab(tabId);
    if (tabId < nbItems)
        tabId++;
    else
        tabId = 1;
    tabshow = setTimeout("TabSlideShow()", speed);
}