﻿var renderDate = function (idx, pfld) {
    var fldClasses = pfld.className.replace("datefld ", "").split(" ");
    var oDate = (arguments.length > 2) ? arguments[2] : new Date();
    var outputDate = "";
    for (var iParam = 0; iParam < fldClasses.length; iParam++) {
        switch (fldClasses[iParam]) {
            case "DD":
                outputDate += oDate.getDate() + " ";
                break;
            case "MMM":
                outputDate += oDate.getMonth() + " ";
                break;
            case "YYYY":
                outputDate += oDate.getFullYear() + " ";
                break;
        }
    }
    pfld.innerHTML = outputDate;
};


$(document).ready(function () {
    $(".datefld").each(renderDate);
});

$(document).ready(function () {
    $(".menu li").hover(function (event) {

        $(this).css({
            "position": "relative",
            "z-index": 200
        });

        $("ul.sub", this).css({
            'left': '2px',
            'top': '45px',
            'right': '2px',
            'background': '#f1e9f2',
            'padding': '3px 0',
            'border': '1px solid #999999',
            'white-space': 'nowrap',
            'width': '210px',
            'height': 'auto'
        });

        $("ul.sub li", this).css({
            'display': 'block',
            'height': '20px',
            'position': 'relative',
            'float': 'left',
            'width': '250px'
        });

        $("ul.sub li a", this).css({
            'font-weight': 'normal',
            'display': 'block',
            'font-size': '11px',
            'height': '20px',
            'width': '192px',
            'line-height': '20px',
            'text-indent': '5px',
            'color': '#502462',
            'text-decoration': 'none'
        });
    }, function (event) {

        $("ul", this).css({
            'position': 'absolute',
            'left': '-9999px',
            'top': '-9999px',
            'width': '0',
            'height': '0',
            'margin': '0',
            'padding': '0',
            'list-style': 'none',
            'text-align': 'left'
        });

    });
});
