﻿function PrepareWindow(window, windowOpen, windowClose, windowTop, windowResize) {
    $('#' + windowOpen).bind(
        'click',
        function() {
            $('#' + window).show();
            this.blur();
            return false;
        }
    );

    $('#' + windowClose).bind(
        'click',
        function() {
            $('#' + window + ',:input').val("")
            $('#' + window).hide();
        }
    );

    $('#' + window).Resizable(
    {
        minWidth: 200,
        minHeight: 60,
        maxWidth: 700,
        maxHeight: 400,
        dragHandle: '#' + windowTop,
        handlers: {
            se: '#' + windowResize
        }/*,
        onResize: function(size, position) {
            $('#windowBottom, #windowBottomContent').css('height', size.height - 33 + 'px');
            var windowContentEl = $('#windowContent').css('width', size.width - 25 + 'px');
            if (!document.getElementById(window).isMinimized) {
                windowContentEl.css('height', size.height - 48 + 'px');
            }
        }*/
    }); 
}
