﻿UI = function() {
    $.ui.dialog.defaults.bgiframe = true;
}
UI.prototype =
{
    dialog: function(link, elem, options) {
       
    $(function() {
    
            $(elem).dialog($.extend({autoOpen: false}, options));
            $(link).click(function() {
                $(elem).dialog('open');
            });

        });
    }
}
var ui = new UI();



//ContentTree = function() {

//}

//ContentTree.prototype =
//{
//    doExpandable: function(e) {
//        e.find("a.expand").live("click",
//            function() {
//                var $this = $(this);
//                $this.parent().append('loading...');
//                $.ajax({
//                    type: 'get',
//                    url: $this.attr('href'),
//                    success: function(res) {
//                        $res = $(res);
//                        $($this.parents('div.item')[0]).replaceWith(res);
//                        //tree.doExpandable($('div.item & div.content_'));
//                    }
//                });
//                return false;
//            });
//        doCollabsable: function(e) {
//        e.find("a.collapse").live("click",
//            function() {
//                var $this = $(this);
//                $this.parent().append('collapsing...');
//                $.ajax({
//                    type: 'get',
//                    url: $this.attr('href'),
//                    success: function(res) {
//                        $res = $(res);
//                        $($this.parents('div.item')[0]).replaceWith(res);
//                        //tree.doExpandable($('div.item & div.content_'));
//                    }
//                });
//                return false;
//            });
//    }
//}