﻿
$(function () {

    // Main-Navigation Animation
    $("#mainnav > li > a").mouseenter(function () {
        $(this).stop().animate(
			{ backgroundPosition: "0px -57px", color: "#fff" },
			{ duration: 700 })
    }).mouseleave(function () {
        if ($(this).parent().children(".subnav").html() == null) {
            $(this).stop().animate(
        		{ backgroundPosition: "0px 0px", color: "#fff" },
        		{ duration: 400 })
        };
    });

    $(".subnav").each(function () {
        $(this).parent().eq(0).hover(function () {
            $(".subnav:eq(0)", this).stop().slideDown(0);
        }, function () {
            $(".subnav:eq(0)", this).stop().fadeOut(0);
            $("a:eq(0)", this).stop().animate(
			    { color: "#fff" },
			    { duration: 400 })
        });
    });

    $(".subnav a").css({ paddingLeft: "10px"
    }).mouseenter(function () {
        $(this).stop().animate(
			{ paddingLeft: "20px" },
			{ duration: 700 })
    }).mouseleave(function () {
        $(this).stop().animate(
			{ paddingLeft: "10px" },
			{ duration: 400 })
    });

});

function _OpenShadowbox(URL, _T, _W, _H) {
    Shadowbox.open({
        content: URL,
        player: "iframe",
        title: _T,
        height: _H,
        width: _W
    });
};
