﻿/* Copyright Bridgeline Digital, Inc. An unpublished work created in 2009. All rights reserved. This software contains the confidential and trade secret information of Bridgeline Digital, Inc. ("Bridgeline").  Copying, distribution or disclosure without Bridgeline's express written permission is prohibited */
$(function () {
    IntializeFormDatePicker();
});

function IntializeFormDatePicker()
{
    $('[objectType="datepicker"]').each
        (function (index) {
            var format = $(this).attr("customFormat");
            if (!format || format == "")
                format = $(this).attr("format");
            format = format.replace("yyyy", "yy");

            var yRange = '-10:+10';
            if ($("input#datePickerYearRange").length > 0)
                yRange = "-" + $("input#datePickerYearRange").val() + ":+" + $("input#datePickerYearRange").val();

            $(this).children('IMG').hide();
            $(this).children('INPUT').datepicker(
                    {
                        showOn: 'button',
                        buttonImage: $(this).children('IMG').attr("src"),
                        buttonImageOnly: true,
                        buttonText: frmSelDateText,
                        dateFormat: format,
                        changeMonth: true,
                        changeYear: true,
                        yearRange: yRange
                    }
                );
        }
        )
}
