/// <reference path="jQuery-vsdoc.js" />
//wrap the $ in a anonymous function the prevent faults with other libraries an run everything in ithis scope
(function($)
{
    //start initial functionality
    $(document).ready(function()
    {
        fn.init();

    });
    //function object instead of annonymous functions (profilers give you the function names => better to debug )
    var fn = {
        //initial functionality
        init: function()
        {
            var $item = $("#subnav>ul:eq(0)>li");
            $("#subnav ul li a").append("<img src='/sites/main/templates/img/pijl_active_2.png' class='pijl' />");
            $item.wrapInner("<div class='subnavContent'></div>");
            $item.prepend("<div class='subnavTop'></div>");
            $item.append("<div class='subnavBottom'></div>");
            $("#subnav ul li[class^=active]:has('li[class^=active]')").removeClass();
            
        }
    };
    //make input react on enter click
    function makeButtonsEnterSearchable()
    {
        $(".searcher :text,.searcher :password").unbind("keydown");
        $(".searcher :text,.searcher :password").keydown(
        function(evt)
        {
            var evt = (evt) ? evt : ((event) ? event : null);
            if (evt.keyCode == 13)
            {
                eval($(this).parents(".searcher:eq(0)").find("a.searchButton").attr("href").replace("javascript:", ""));
                return false;
            }
        }
    );
    }
})(jQuery);


/* solves the firebug console calls in browsers without firebug */
if (!('console' in window) || !('firebug' in console))
{
    var names = ['log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml', 'group', 'groupEnd', 'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd'];
    window.console = {};
    for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() { };
}

//for the scriptmanager needs to be at the end of the script
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
