﻿//Declaring HoverIntent for Cable and Customer Service
$(document).ready(function() {
    $("#CableBox").hoverIntent({
        over: GrowCable,
        timeout: 200,
        out: ShrinkCable
    });

    $("#CustomerBox").hoverIntent({
        over: GrowCustomer,
        timeout: 200,
        out: ShrinkCustomer
    });
    $("#ChannelBox").hoverIntent({
        over: GrowChannel,
        timeout: 200,
        out: ShrinkChannel
    });
});

//Cable Menu
function GrowCable() {
    $("#CableMenu").css({ "display": "block" });
    $("#CableMenu").animate({ "margin-top": "0px", "opacity": "1" }, 500);
}
function ShrinkCable() {
    $("#CableMenu").animate({ "margin-top": "80px", "opacity": "0" }, 200).animate({ "margin-top": "-20px" }, 1).fadeOut(1);
    $("#CableMenu");
}

//Customer Service Menu
function GrowCustomer() {
    $("#CustomerMenu").css({ "display": "block" });
    $("#CustomerMenu").animate({ "margin-top": "0px", "opacity": "1" }, 500);
}
function ShrinkCustomer() {
    $("#CustomerMenu").animate({ "margin-top": "80px", "opacity": "0"}, 200).animate({ "margin-top": "-20px" }, 1).fadeOut(1);
}

//ChannelList Menu
function GrowChannel() {
    $("#ChannelMenu").css({ "display": "block" });
    $("#ChannelMenu").animate({ "margin-top": "0px", "opacity": "1" }, 500);
}
function ShrinkChannel() {
    $("#ChannelMenu").animate({ "margin-top": "80px", "opacity": "0" }, 200).animate({ "margin-top": "-20px" }, 1).fadeOut(1);
}


//Navigation
function goHome() {
    window.location.href = "/";
}

function goOrderForm() {
    window.location.href = "/orderService/";
}
function goDigitalChan() {
    window.location.href = "/channel/digital/";
}
function goPremChan() {
    window.location.href = "/channel/premium/";
}

function goMusic() {
    window.location.href = "/channel/music/";
}

function goBasicChan() {
    window.location.href = "/channel/";
}
