$.fn.pause = function(duration) { $(this).animate({ dummy: 1 }, duration); return this; }; function showSpirivaSurvey() { // first check to see if the user has a cookie var cookie = readCookie('spiriva_already_seen_survey'); if (cookie == null) { // now display the survey var srcC = '/consumer/exitSurvey/ExitSurveyController.jpf'; setTimeout(function() { $.modal({width:667, height:538, src: srcC}).open() }, 5000); // and then create the cookie so the user doesn't see it again createCookie('spiriva_already_seen_survey', 'y', 30); } } $(document).ready(function() { showSpirivaSurvey(); }); /** * When the open event is called, this function will be used to 'open' * the overlay, container and data portions of the modal dialog. * * onOpen callbacks need to handle 'opening' the overlay, container * and data. */ function modalOpen (dialog) { dialog.overlay.fadeIn('fast', function () { dialog.container.fadeIn('fast', function () { dialog.data.hide().slideDown('fast'); }); }); } /** * When the close event is called, this function will be used to 'close' * the overlay, container and data portions of the modal dialog. * * The SimpleModal close function will still perform some actions that * don't need to be handled here. * * onClose callbacks need to handle 'closing' the overlay, container * and data. */ function simplemodal_close (dialog) { dialog.data.fadeOut('fast', function () { dialog.container.hide('fast', function () { dialog.overlay.slideUp('fast', function () { $.modal.close(); }); }); }); }