﻿JamieLynnDesigns = window.JamieLynnDesigns || {};
JamieLynnDesigns.Common = function() {
    function _init_navigation() {
        $('#navigation > ul > li > a.navitem').hover(
        //over
            function() {
                //$(this).css('background-position', '0 -33px');
                $(this).css('background-color', '#fff'); //hack to make background color work in IE7
                $(this).css('color', '#f5458c'); //hack to make background color work in IE7
                var menu = $(this).parent().find('.sub-nav:first');
                if (menu.length) {
                    $('.sub-nav').css('display', 'none');
                    $(menu).css('display', 'block');
                }

            },
        //out
			function() {
			    //$(this).css('background-position', '0 0');
            $(this).css('background-color', '#f5458c'); //hack to make background color work in IE7
            $(this).css('color', '#fff'); //hack to make background color work in IE7
			    var menu = $(this).parent().find('.sub-nav:first');
			    if (menu.length) {
			        $(menu).css('display', 'none');
			    }
			}
        );

        $('#navigation .sub-nav').hover(
        //over
        function() {
            $(this).css('display', 'block');
        }
        ,
        //out
        function() {
            $(this).css('display', 'none');
        }
        );

        $('#navigation .sub-nav a').hover(
        function() {
            $(this).css('background-color', '#fff'); //hack to make background color work in IE7
            $(this).css('color', '#f5458c'); //hack to make background color work in IE7
        },
        function() {
            $(this).css('background-color', '#f5458c'); //hack to make background color work in IE7
            $(this).css('color', '#fff'); //hack to make background color work in IE7
        }
        );
    }

    return {
        init: function() {
            _init_navigation();
        }
    }

} ();

$(function() {
    JamieLynnDesigns.Common.init();
});