/*
	About the web developer for this website.
    Muslum Torun -> Interactive Art Director of Mavi Ajans
	Personal Site: http://muslumtorun.com
	Contact: info@muslumtorun.com
*/

(function ($) {
    $.fn.menu = function () {
        var $this;
        var $sub;

        $(this).bind("mouseover", function () {
            $this = $(this);
            $sub = $this.children(".submenu");
            hideAll();
            show($sub);
        });

        $(this).bind("mouseleave", function () {
            hide($sub);
        });

        function hideAll() {
            $(".submenu").hide();
            $this.css("background-color", "");
        };

        function show(obj) {
            hideAll();
            $this.css("background-color", "#1F1F1F");
            obj.show();
        };

        function hide(obj) {
            obj.hide();
            $this.css("background-color", "");
        };
    };

    $.fn.dropdown = function () {
        var $this = $(this);
        var $sub = $this.children(".dropdown-menu-content");

        $(this).bind("click", function () {
            $sub.slideToggle();
        });

        $this.find("ul li").each(function () {
            if ($(this).children("a").text() == $this.children("h2").text())
                $(this).remove();
        });
    }
})(jQuery);
