﻿function MM_openBrWindow(theURL, winName, features) { //v2.0
    window.open(theURL, winName, features);
}

function openpopup(url) {
    MM_openBrWindow(url, 'popup', 'toolbar=no,status=yes,scrollbars=yes,location=no,menubar=no,directories=no,resizable=no,width=675,height=500');
}

(function($) {

    $.fn.popup = function(options) {

        var defaults = {
            url: '',
            name: '',
            scrollbars: false,
            toolbar: false,
            status: false,
            location: false,
            menubar: false,
            directories: false,
            resizable: true,
            width: 675,
            height: 500,
            showmodal: false
        };

        if (defaults.name == '')
            defaults.name = defaults.url;

        var opts = $.extend(defaults, options);

        var features = 'toolbar=' + ((opts.toolbar) ? 'yes' : 'no');
        features += ',status=' + ((opts.status) ? 'yes' : 'no');
        features += ',scrollbars=' + ((opts.scrollbars) ? 'yes' : 'no');
        features += ',location=' + ((opts.location) ? 'yes' : 'no');
        features += ',menubar=' + ((opts.menubar) ? 'yes' : 'no');
        features += ',directories=' + ((opts.directories) ? 'yes' : 'no');
        features += ',resizable=' + ((opts.resizable) ? 'yes' : 'no');
        features += ',width=' + (opts.width);
        features += ',height=' + (opts.height);

        if (opts.showmodal) {

        } else {
            window.open(opts.url, opts.name, features);
        }

    };

})(jQuery);

$(document).ready(function() {

});
