(function($){
    $.fn.extend({
        //plugin name - animatemenu
        webtoolkitMenu: function(options) {
           
            return this.each(function() {
                //Assign current element to variable, in this case is UL element
                var obj = $(this);
                
                $("li div ul", obj).each(function(i) {
                    //$(this).css('left', $(this).parent().outerWidth());
                    //$(this).css('top', $(this).parent().outerHeight()+112);
                    //$(this).css('top', 0);
                })


                    /*function() { $(this).addClass('over'); }
                );*/
                
                $("li div", obj).hover(function () {$(this).addClass('over');},  function () {$(this).removeClass('over');});
                //alert($("li", obj).mouseover);

                $("li div", obj).click(function(){
                    var url = $("a", $(this)).attr('href');
                    var target = $("a", $(this)).attr('target');
                    if (target == "") target = "_self";
                    window.open(url, target);
                });
                
                $("li div a", obj).click(function(){
                    if ($(this).attr('target') == "_blank")
                    {
                        window.open($(this).attr('href'), "_blank");
                        return false;
                    }
                });
            });
        }
    });
})(jQuery);
