/*global jQuery*/
/*jslint browser: true, devel: true, maxlen: 100 */

jQuery.noConflict();

var DGI = {};

// closure to avoid globals and to support minification
(function (DGI, jQuery, document) {
    // log method, doing nothing if log not available
    DGI.log = (function () {
        if (typeof console === "undefined" || !console || !console.log) {
            return jQuery.noop;
        }
        return function () {
            if (console.log.apply) {
                console.log.apply(console, arguments);
            } else {
                console.log(Array.prototype.slice.call(arguments, 0));
            }
        };
    }());

    // nodes
    DGI.body = jQuery(document.body);

    // flags
    DGI.speed = "fast"; // jQuery animations
    DGI.isIE6 = document.all && navigator.userAgent.toLowerCase().indexOf("msie 6.") > -1;

    // plugins
    jQuery(".datepicker").datepicker({
        dateFormat: "dd.mm.yy"
    });

    // submit via styled span instead of input type="submit"
    jQuery(".submit-form").click(function () {
        jQuery(this).parents("form").eq(0).submit();
    });

    DGI.log("Start the lightnin, Igor!");

}(DGI, jQuery, document));

