/*******************************************************/ /* Modal Window /*******************************************************/ function showModalWindow2(targetelement) { $(targetelement).fadeIn(200); $('body').prepend('
 
'); $(".rbc-modalwindow-mask").stop().animate({ opacity: .5 }, 100, function() { }); $("#rbc-dialog-title").focus(); $("#rbc-dialog-title2").focus(); jQuery(document).bind('keypress keydown', function (e) { if (e.which === 9) { console.log(document.activeElement); if(document.activeElement.id == "continue" || document.activeElement.id == "submitCard" || document.activeElement.id == "goOLB" || document.activeElement.id == "continueOLB" || document.activeElement.id == "skipThisStep" || document.activeElement.id == "hardRight" || document.activeElement.id == "cardPage" || document.activeElement.id == "cardPage_fr"){ $("#rbc-dialog-title").focus(); $("#rbc-dialog-title2").focus(); } } }); } function hideModalWindow2(targetelement) { $(".rbc-modalwindow-mask").stop().animate({ opacity: 0 }, 100, function() { $(".rbc-modalwindow-mask").remove(); }); $(targetelement).fadeOut(200); } $('.rbc-modalwindow-trigger').click(function(event) { var triggerelement = $(this); var targetelement = $(triggerelement).metadata().targetelement; var closebutton = $(targetelement+' .rbc-modalwindow-close'); var closebuttonhidden = $(targetelement+' .rbc-modalwindow-close-hidden'); function showModalWindow() { $(targetelement).fadeIn(200); $('body').prepend('
 
'); $(".rbc-modalwindow-mask").stop().animate({ opacity: .5 }, 100, function() { }); $(closebutton).focus(); } function hideModalWindow() { $(".rbc-modalwindow-mask").stop().animate({ opacity: 0 }, 100, function() { $(".rbc-modalwindow-mask").remove(); }); $(targetelement).fadeOut(200); $(triggerelement).focus(); } if ($(targetelement).css('display') == 'block') { hideModalWindow(); return false; } if ($(targetelement).css('display') == 'none') { showModalWindow(); } $('body').click(function(event) { if ((!$(event.target).closest('.rbc-modalwindow-inner2').length) && ($(targetelement).css('display') == 'block')) { hideModalWindow(); }; }); $(closebutton).click(function(){ hideModalWindow(); return false; }); $(closebuttonhidden).click(function(){ hideModalWindow(); return false; }); $(closebuttonhidden).blur(function(){ hideModalWindow(); return false; }); return false; });