﻿$(window).load(function () {
    $('.definition, .lightbox').each(function () {
        $(this).dialog({
            autoOpen: false,
            resizable: false,
            dialogClass: 'definition-container ' + $(this).attr('id') + ' ' + $(this).attr('class'),
            title: $(this).attr('title') != null && $(this).attr('title') != '' ? $(this).attr('title') : 'Definition',
            close: function () {
                $(this).find('[id$=ResetInterface]').click();
            }
        });
        $("a[href='#" + $(this).attr('id') + "']").live('click',function (event) {
            event.preventDefault();
            $($(this).attr('href')).dialog('open');
        });
        $(this).dialog('close');
    }).parent().appendTo($('form:first'));

    
    if (window.location.hash == '#request_pass') {
        $("a[href='#request_password']").click();
    }
    
});

function bindCvvWhatsThis() {
    setTimeout(function() {
        $("a[href$='#cvv']").click(function(evt) {
            evt.preventDefault();
            $('#cvv').dialog('open');

        });
    },750);
}
