function confirm(title, text, okFunc, okArg, cancelFunc, cancelArg, okText, cancelText) {

        var overlay = Y.one('#confirm-overlay');
        var underlay = Y.one('#confirm-underlay');
        var ok = overlay.one('#confirm-ok');
        var cancel = overlay.one('#confirm-cancel');
        var close = overlay.one('#confirm-close');

        ok.setContent(okText || 'Ok');
        cancel.setContent(cancelText || 'Cancel');

        overlay.one('#confirm-title').setContent(title);
        overlay.one('#confirm-text').setContent(text);
        overlay.removeClass('hide');
        overlay.addClass('show');
        underlay.removeClass('hide');
        underlay.addClass('show');

        function dismiss() {
            overlay.addClass('hide');
            overlay.removeClass('show');
            underlay.addClass('hide');
            underlay.removeClass('show');

            Y.Event.purgeElement(ok);
            Y.Event.purgeElement(cancel);
            Y.Event.purgeElement(close);
        }

        function doOk(e2) {
            dismiss();
            if (okFunc) {
                okFunc(okArg);
            }
        }

        function doCancel(e2) {
            dismiss();
            if (cancelFunc) {
                cancelFunc(cancelArg);
            }
        }

        ok.on('click', doOk);
        cancel.on('click', doCancel);
        close.on('click', doCancel);
    }
// might be better, more flexibly, to pass in an array of objects with text, func, and arg
might be better, more flexibly, to pass in an array of objects with text, func, and arg
might be better more flexibly to pass in an array of objects with text func and arg
function confirm(title, text, okFunc, okArg, cancelFunc, cancelArg, okText, cancelText) {
        var overlay = Y.one('#confirm-overlay');
        var underlay = Y.one('#confirm-underlay');
        var ok = overlay.one('#confirm-ok');
        var cancel = overlay.one('#confirm-cancel');
        var close = overlay.one('#confirm-close');
        ok.setContent(okText || 'Ok');
        cancel.setContent(cancelText || 'Cancel');
        overlay.one('#confirm-title').setContent(title);
        overlay.one('#confirm-text').setContent(text);
        overlay.removeClass('hide');
        overlay.addClass('show');
        underlay.removeClass('hide');
        underlay.addClass('show');
        function dismiss() {
            overlay.addClass('hide');
            overlay.removeClass('show');
            underlay.addClass('hide');
            underlay.removeClass('show');
            Y.Event.purgeElement(ok);
            Y.Event.purgeElement(cancel);
            Y.Event.purgeElement(close);
        }
        function doOk(e2) {
            dismiss();
            if (okFunc) {
                okFunc(okArg);
            }
        }
        function doCancel(e2) {
            dismiss();
            if (cancelFunc) {
                cancelFunc(cancelArg);
            }
        }
        ok.on('click', doOk);
        cancel.on('click', doCancel);
        close.on('click', doCancel);
    }
function confirm ( title , text , okFunc , okArg , cancelFunc , cancelArg , okText , cancelText ) { var overlay = Y . one ( '#confirm-overlay' ) ; var underlay = Y . one ( '#confirm-underlay' ) ; var ok = overlay . one ( '#confirm-ok' ) ; var cancel = overlay . one ( '#confirm-cancel' ) ; var close = overlay . one ( '#confirm-close' ) ; ok . setContent ( okText || 'Ok' ) ; cancel . setContent ( cancelText || 'Cancel' ) ; overlay . one ( '#confirm-title' ) . setContent ( title ) ; overlay . one ( '#confirm-text' ) . setContent ( text ) ; overlay . removeClass ( 'hide' ) ; overlay . addClass ( 'show' ) ; underlay . removeClass ( 'hide' ) ; underlay . addClass ( 'show' ) ; function dismiss ( ) { overlay . addClass ( 'hide' ) ; overlay . removeClass ( 'show' ) ; underlay . addClass ( 'hide' ) ; underlay . removeClass ( 'show' ) ; Y . Event . purgeElement ( ok ) ; Y . Event . purgeElement ( cancel ) ; Y . Event . purgeElement ( close ) ; } function doOk ( e2 ) { dismiss ( ) ; if ( okFunc ) { okFunc ( okArg ) ; } } function doCancel ( e2 ) { dismiss ( ) ; if ( cancelFunc ) { cancelFunc ( cancelArg ) ; } } ok . on ( 'click' , doOk ) ; cancel . on ( 'click' , doCancel ) ; close . on ( 'click' , doCancel ) ; }
might be better, more flexibly, to pass in an array of objects with text, func, and arg
might be better more flexibly to pass in an array of objects with text func and arg