function UGAdminCommon(g_text, g_settingsObj){

    var g_minHeight = 280, g_maxCatHeight = 450;

    var ugCategories, ugItems;

    this.g_selectedCatID = -1;
    this.updateGlobalHeight = updateGlobalHeight;
    this.debugLineDrag = debugLineDrag;
    this.getItemCategoryType = getItemCategoryType;
    this.setHtmlListCombo = setHtmlListCombo;
    this.g_itemsMaxHeight = 0;

    function ___________GENERAL_FUNCTIONS________________(){}	//sap for outline


    /**
     * write something to debug line
     */
    function debugLine(html){
        jQuery("#debug_line").show().html(html);
    }

    /**
     * debug drag object
     */
    function debugLineDrag(){
        var str = "";
        for(key in g_objDrag){
            var value = g_objDrag[key];
            str += key += " : " + value+" ";
        }

        debugLine(str);
        trace(g_objDrag, true);
    }


    /**
     * get type, item or category of some item
     */
    function getItemCategoryType(item){
        if(item == null || typeof item == "string")
            return("unknown");

        var parentID = item.parent().prop("id");
        switch(parentID){
            case "list_items":
                return("item");
                break;
            case "list_cats":
                return("category");
                break;
            default:
                return("unknown");
                break;
        }
    }

    /**
     * set combo lists from response
     */
    function setHtmlListCombo(response){
        var htmlItems = response.htmlItems;
        var htmlCats = response.htmlCats;

        this.ugItems.setHtmlListItems(htmlItems);
        this.ugCategories.setHtmlListCats(htmlCats);
    }

    /**
     * update global height, by of categories and items
     */
    function updateGlobalHeight(catHeight, itemsHeight){

        if(!catHeight)
            var catHeight = ugCategories.getCatsHeight();

        if(!itemsHeight)
            var itemsHeight = this.g_itemsMaxHeight;

        if(catHeight > g_maxCatHeight)
            catHeight = g_maxCatHeight;

        var maxHeight = catHeight;

        if(itemsHeight > maxHeight)
            maxHeight = itemsHeight;

        maxHeight += 20;

        if(maxHeight < g_minHeight)
            maxHeight = g_minHeight;

        //set list height
        jQuery("#items_list_wrapper").css("height",maxHeight+"px");
        jQuery("#cats_section").css("height",maxHeight+"px");
    }

    /**
     * init gallery view
     */
    this.initGalleryView = function(selectedCatID){

        if(!g_ugAdmin)
            g_ugAdmin = new UniteAdminUG();

        this.ugCategories = ugCategories = new UGAdminCategories(this, g_text, g_settingsObj);
        this.ugItems = ugItems = new UGAdminItems(this, g_text);

        this.ugCategories.init();
        this.ugItems.init();

        updateGlobalHeight();

        //check first item select
        if(selectedCatID)
            this.ugCategories.selectCategory(selectedCatID);
        else
            this.ugCategories.checkSelectFirstCategory();
    };

};