﻿Type.registerNamespace("Explorica");

Explorica.Product = function () {
    this._productID = 0;
    this._title = "";
    this._price = "";
    this._productLength = 0;
    this._extensionLength = 0;
    this._mostPopular = false;
    this._bestForTeacher = false;
    this._featuredDeals = false;
    this._productThemeIDs = [];
    this._productCityIDs = [];

    this._isVisible = true;

    this._productHolder = null;
}
Explorica.Product.prototype = {
    initialize: function () { },
    get_productID: function () { return this._productID; },
    get_title: function () { return this._title; },
    get_price: function () { return this._price; },
    get_productLength: function () { return this._productLength; },
    get_extensionLength: function () { return this._extensionLength; },
    get_productHolder: function () { return this._productHolder; },
    get_productThemeIDs: function () { return this._productThemeIDs; },
    get_productCityIDs: function () { return this._productCityIDs; },
    get_mostPopular: function () { return this._mostPopular; },
    get_bestForTeacher: function () { return this._bestForTeacher; },
    get_featuredDeals: function () { return this._featuredDeals; },
    set_productID: function (value) { this._productID = value; },
    set_title: function (value) { this._title = value; },
    set_price: function (value) { this._price = value; },
    set_productLength: function (value) { this._productLength = value; },
    set_extensionLength: function (value) { this._extensionLength = value; },
    set_productHolder: function (value) { this._productHolder = value; },
    set_productThemeIDs: function (value) { this._productThemeIDs = value; },
    set_productCityIDs: function (value) { this._productCityIDs = value; },
    set_mostPopular: function (value) { this._mostPopular = value; },
    set_bestForTeacher: function (value) { this._bestForTeacher = value; },
    set_featuredDeals: function (value) { this._featuredDeals = value; },

    isVisible: function () {
        return this._isVisible;
    },
    setVisible: function (value) {
        this._productHolder.style.display = (value) ? "block" : "none";
        this._isVisible = value;
    }
}
Explorica.Product.registerClass('Explorica.Product', Sys.Component, Sys.IDisposable);

Explorica.ProductFilterControl = function () {
    this._txtActivity = null;
    this._suggestHolder = null;
    this._ddlMinLength = null;
    this._ddlMaxLength = null;
    this._ddlCities = null;
    this._ddlThemes = null;
    this._ddlGTD = null;
    this._chkPopular = null;
    this._chkBest = null;
    this._chkDeals = null;

    this._lengthList = [];

    this._selectedMinLength = null;
    this._selectedMaxLength = null;
    this._selectedThemeID = null;
    this._selectedCityID = null;
    this._selectedGTD = null;
    this._selectedActivityText = null;

    this._dlgOnFilterChange = null;
    this._dlgOnActivityFilterChange = null;
    this._dlgPreSubmit = null;
    this._dlgOnSuggestionClear = null;
    this._activityValueHandler = null;
}
Explorica.ProductFilterControl.prototype = {
    initialize: function () { },
    initControls: function (controls) {
        this._dlgOnFilterChange = Function.createDelegate(this, this._onFilterChange);
        this._txtActivity = controls.txtActivity;
        this._suggestHolder = controls.suggestHolder;
        this._ddlMinLength = controls.ddlMinLength;
        Sys.UI.DomEvent.addHandler(this._ddlMinLength, "change", this._dlgOnFilterChange);
        this._ddlMaxLength = controls.ddlMaxLength;
        Sys.UI.DomEvent.addHandler(this._ddlMaxLength, "change", this._dlgOnFilterChange);
        if ((controls.ddlCities != null) && (controls.ddlCities != 'undefined')) {
            this._ddlCities = controls.ddlCities;
            Sys.UI.DomEvent.addHandler(this._ddlCities, "change", this._dlgOnFilterChange);
        }
        if ((controls.ddlThemes != null) && (controls.ddlThemes != 'undefined')) {
            this._ddlThemes = controls.ddlThemes;
            Sys.UI.DomEvent.addHandler(this._ddlThemes, "change", this._dlgOnFilterChange);
        }
        this._ddlGTD = controls.ddlGTD;
        Sys.UI.DomEvent.addHandler(this._ddlGTD, "change", this._dlgOnFilterChange);
        if ((controls.chkPopular != null) && (controls.chkPopular != 'undefined')) {
            this._chkPopular = controls.chkPopular;
            Sys.UI.DomEvent.addHandler(this._chkPopular, "click", this._dlgOnFilterChange);
        }
        if ((controls.chkBest != null) && (controls.chkBest != 'undefined')) {
            this._chkBest = controls.chkBest;
            Sys.UI.DomEvent.addHandler(this._chkBest, "click", this._dlgOnFilterChange);
        }
        if ((controls.chkDeals != null) && (controls.chkDeals != 'undefined')) {
            this._chkDeals = controls.chkDeals;
            Sys.UI.DomEvent.addHandler(this._chkDeals, "click", this._dlgOnFilterChange);
        }
        var url = String.format("/Ajax/Lookup.aspx?mode=activitysearch&languageID={0}&tsID={1}&limit=50", ExploricaPage.LanguageID, ExploricaPage.TsID);
        this._dlgPreSubmit = Function.createDelegate(this, this._setActivityRequestValue);
        this._dlgOnActivityFilterChange = Function.createDelegate(this, this._onActivityFilterChange);
        this._txtActivity.sg = $create(Explorica.UI.SuggestionBox, { "url": url,
            "suggestionBoxCss": "suggestions", "dataTextField": "Title", "dataValueField": "ActivityID", "preSubmitFunc": this._dlgPreSubmit,
            "formInputName": "postalCodeInputName", "filters": null, "noSuggestionsText": "no activity"
        }, { "valueChange": this._dlgOnActivityFilterChange }, null, this._txtActivity);
        this._suggestHolder.appendChild(this._txtActivity.sg._sb);
        this._suggestHolder.style.position = "relative";
        //this._txtActivity.sg._sb.style.maxHeight = "200px";
        //this._txtActivity.sg._sb.style.overflow = "auto";
        this._txtActivity.sg._sb.style.top = "0px";
        this._dlgOnSuggestionClear = Function.createDelegate(this, this._onSuggestionClear);
        this._txtActivity.sg.add_onTextClear(this._dlgOnSuggestionClear);
        for (var i = 0; i < this._ddlMinLength.options.length; i++) {
            this._lengthList[i] = parseInt(this._ddlMinLength.options[i].value);
        }
        /****
        if (Sys.Browser.agent == Sys.Browser.InternetExplorer) {
            Sys.UI.DomEvent.addHandler(this._ddlThemes, "mousedown", Function.createDelegate(this, this._resizeThemeToAuto));
            Sys.UI.DomEvent.addHandler(this._ddlThemes, "blur", Function.createDelegate(this, this._resizeThemeToNormal));
            Sys.UI.DomEvent.addHandler(this._ddlThemes, "change", Function.createDelegate(this, this._resizeThemeToNormal));
        }
        *****/
    },

    getSelectedMinLength: function () { return this._selectedMinLength; },
    getSelectedMaxLength: function () { return this._selectedMaxLength; },
    getSelectedThemeID: function () { return this._selectedThemeID; },
    getSelectedCityID: function () { return this._selectedCityID; },
    getSelectedGTD: function () { return this._selectedGTD; },
    getSelectedActivityText: function () { return this._selectedActivityText; },
    isPopularChecked: function () { if (this._chkPopular != null) { return this._chkPopular.checked; } else { return false } },
    isDealsChecked: function () { if (this._chkDeals != null) { return this._chkDeals.checked; } else { return false } },
    isBestChecked: function () { if (this._chkBest != null) { return this._chkBest.checked; } else { return false } },

    _resizeThemeToAuto: function () {
        this._ddlThemes.style.width = "auto";
    },
    _resizeThemeToNormal: function () {
        this._ddlThemes.style.width = "150px";
    },
    setDisable: function (value) {
        this._txtActivity.disabled = value;
        this._ddlMinLength.disabled = value;
        this._ddlMaxLength.disabled = value;
        if (this._ddlCities != null) { this._ddlCities.disabled = value; }
        if (this._ddlThemes != null) { this._ddlThemes.disabled = value; }
        this._ddlGTD.disabled = value;
        if (this._chkPopular != null) { this._chkPopular.disabled = value; }
        if (this._chkDeals != null) { this._chkDeals.disabled = value; }
        if (this._chkBest != null) { this._chkBest.disabled = value; }
    },
    _onFilterChange: function (sender, args) {
        var senderControl = sender.target;
        var eventName = "";
        switch (senderControl) {
            case this._ddlMinLength:
                this._selectedMinLength = parseInt(this._ddlMinLength.value);
                this._minLengthChanged();
                eventName = "MinimumLengthChange";
                break;
            case this._ddlMaxLength:
                this._selectedMaxLength = parseInt(this._ddlMaxLength.value);
                this._maxLengthChanged();
                eventName = "MaximumLengthChange";
                break;
            case this._ddlCities:
                this._selectedCityID = parseInt(this._ddlCities.value);
                eventName = "CityIDChange";
                break;
            case this._ddlThemes:
                this._selectedThemeID = parseInt(this._ddlThemes.value);
                eventName = "ThemeIDChange";
                break;
            case this._ddlGTD:
                this._selectedGTD = this._ddlGTD.value;
                eventName = "GTDChange";
                break;
            case this._chkPopular:
                eventName = "Most Popular";
                break;
            case this._chkBest:
                eventName = "Best For Teacher";
                break;
            case this._chkDeals:
                eventName = "Current Deals";
                break;
        }
        var h = this.get_events().getHandler("FilterChanged");
        if (h) {
            var evArgs = new Sys.EventArgs();
            evArgs.eventName = eventName;
            evArgs.minLength = this._selectedMinLength;
            evArgs.cityID = this._selectedCityID;
            evArgs.themeID = this._selectedThemeID;
            evArgs.maxLength = this._selectedMaxLength
            evArgs.gtd = this._selectedGTD;
            evArgs.popular = this.isPopularChecked();
            evArgs.deals = this.isDealsChecked();
            evArgs.best = this.isBestChecked();
            h(this, evArgs);
        }
    },
    add_onFilterChange: function (handler) { this.get_events().addHandler("FilterChanged", handler); },

    _minLengthChanged: function () {
        if (this._ddlMaxLength.value < this._selectedMinLength) {
            for (var i = 0; i < this._ddlMaxLength.options.length; i++) {
                if (this._ddlMaxLength.options[i].value == this._selectedMinLength) {
                    this._ddlMaxLength.options[i].selected = true;
                    this._selectedMaxLength = this._selectedMinLength;
                    break;
                }
            }
        }
    },

    _maxLengthChanged: function () {
        if (this._ddlMinLength.value > this._selectedMaxLength) {
            for (var i = 0; i < this._ddlMinLength.options.length; i++) {
                if (this._ddlMinLength.options[i].value == this._selectedMaxLength) {
                    this._ddlMinLength.options[i].selected = true;
                    this._selectedMinLength = this._selectedMaxLength;
                    break;
                }
            }
        }
    },

    _setActivityRequestValue: function (v) {
        if (this._activityValueHandler != null) {
            return this._activityValueHandler(v);
        }
        return v;
    },
    attachActivityValueHandler: function (handler) {
        this._activityValueHandler = handler;
    },

    _onActivityFilterChange: function (sender, args) {
        this._selectedActivityText = this._txtActivity.value;
        this._txtActivity.value = this._selectedActivityText.replace("&amp;", "&");
        var h = this.get_events().getHandler("ActivityChanged");
        if (h) {
            var evArgs = new Sys.EventArgs();
            evArgs.selectedActivityID = sender.getSelectedValue();
            h(this, evArgs);
        }
    },
    add_onActivityFilterChange: function (handler) { this.get_events().addHandler("ActivityChanged", handler); },

    _onSuggestionClear: function (sender, args) {
        this._txtActivity.sg.clearCache();
        this._txtActivity.sg._lv = "";
        var h = this.get_events().getHandler("ActivityFilterTextCleared");
        if (h) {
            if (h) h(this, Sys.EventArgs.Empty);
        }
    },
    add_onActivitySuggestionClear: function (handler) { this.get_events().addHandler("ActivityFilterTextCleared", handler); }
}
Explorica.ProductFilterControl.registerClass('Explorica.ProductFilterControl', Sys.Component, Sys.IDisposable);

Explorica.ProductCollectionControl = function () {
    this._products = [];
    this._productIDs = [];
    this._filteredProductIDs = [];

    this._filteredIDsByActiviy = null;
    this._filteredIDsBySelActiviy = null;
    this._filteredIDsGTD = null;

    this._holder = null;
    this._collectionHolder1 = null;
    this._collection1InfoHolder = null;
    this._collectionHolder2 = null;
    this._collection2InfoHolder = null;
    this._productFilterControl = null;
    this._sortByPriceHolder = null;
    this._sortByTitleHolder = null;
    this._sortByLengthHolder = null;
    this._noProductInfoHolder = null;
    this._filterInfoHolder = null;
    this._filterInfoFormatString = null;
    this._collection1Info = '<b>Following products itinerary include <i>"{0}"</i> </b>';
    this._collection2Info = '<b>Following products have options to add <i>"{0}"</i> in its itinerary</b>';

    this._ajaxReq = null;
    this._activityValueHandler = null;

    this._dlgOnActivityValueChange = null;
    this._dlgOnActivityFilterClear = null;
    this._dlgOnFilterChange = null;
    this._dlgProductIDsByAtvReqCbk = null;
    this._dlgProductIDsByGTD = null;
}

Explorica.ProductCollectionControl.prototype = {
    initialize: function () {
    },
    get_holder: function () { return this._holder; },
    get_collectionHolder1: function () { return this._collectionHolder1; },
    get_collection1InfoHolder: function () { return this._collection1InfoHolder; },
    get_collectionHolder2: function () { return this._collectionHolder2; },
    get_collection2InfoHolder: function () { return this._collection2InfoHolder; },
    get_collection1Info: function () { return this._collection1Info; },
    get_collection2Info: function () { return this._collection2Info; },
    get_sortByPriceHolder: function () { return this._sortByPriceHolder; },
    get_sortByTitleHolder: function () { return this._sortByTitleHolder; },
    get_sortByLengthHolder: function () { return this._sortByLengthHolder; },
    get_noProductInfoHolder: function () { return this._noProductInfoHolder; },
    get_filterInfoHolder: function () { return this._filterInfoHolder; },
    get_filterInfoFormatString: function () { return this._filterInfoFormatString; },
    set_holder: function (value) { this._holder = value; },
    set_sortByPriceHolder: function (value) { this._sortByPriceHolder = value; },
    set_sortByTitleHolder: function (value) { this._sortByTitleHolder = value; },
    set_sortByLengthHolder: function (value) { this._sortByLengthHolder = value; },
    set_collectionHolder1: function (value) { this._collectionHolder1 = value; },
    set_collection1InfoHolder: function (value) { this._collection1InfoHolder = value; },
    set_collectionHolder2: function (value) { this._collectionHolder2 = value; },
    set_collection2InfoHolder: function (value) { this._collection2InfoHolder = value; },
    set_collection1Info: function (value) { this._collection1Info = value; },
    set_collection2Info: function (value) { this._collection2Info = value; },
    set_noProductInfoHolder: function (value) { this._noProductInfoHolder = value; },
    set_filterInfoHolder: function (value) { this._filterInfoHolder = value; },
    set_filterInfoFormatString: function (value) { this._filterInfoFormatString = value; },

    _getAjaxUrl: function (mode) {
        return String.format("/Ajax/Lookup.aspx?mode={0}&languageID={1}&tsID={2}", mode, ExploricaPage.LanguageID, ExploricaPage.TsID);
    },

    setupFilterControl: function (controls) {
        for (var i = 0; i < this._products.length; i++) {
            this._filteredProductIDs[i] = this._products[i].get_productID();
            this._productIDs[i] = this._products[i].get_productID();
        }
        this._productFilterControl = $create(Explorica.ProductFilterControl, { "id": "productFilterControl" }, null);
        this._productFilterControl.initControls(controls);
        this._dlgOnFilterChange = Function.createDelegate(this, this._onFilterChange);
        this._productFilterControl.add_onFilterChange(this._dlgOnFilterChange);
        this._activityValueHandler = Function.createDelegate(this, this._setActivitySubmitValue);
        this._productFilterControl.attachActivityValueHandler(this._activityValueHandler);
        this._dlgOnActivityValueChange = Function.createDelegate(this, this._onActivityValueChange);
        this._productFilterControl.add_onActivityFilterChange(this._dlgOnActivityValueChange);
        this._dlgOnActivityFilterClear = Function.createDelegate(this, this._onActivityFilterChange);
        this._productFilterControl.add_onActivitySuggestionClear(this._dlgOnActivityFilterClear);
    },

    addProduct: function (product) {
        Array.add(this._products, product);
    },

    _onFilterChange: function (sender, args) {
        if (args.eventName == "GTDChange") {
            if (args.gtd != "") {
                this._onGTDChange(sender, args);
            }
            else {
                this._filteredIDsGTD = null;
                this._filterProduct();
            }
        }
        else {
            this._filterProduct();
        }
    },

    _filterProduct: function () {
        var show = true;
        var pObj = null;
        var pfc = this._productFilterControl;
        for (var i = 0; i < this._products.length; i++) {
            show = true;
            pObj = this._products[i];
            if ((this._filteredIDsByActiviy != null) || (this._filteredIDsBySelActiviy != null)) {
                if (this._filteredIDsByActiviy != null) {
                    show = Array.contains(this._filteredIDsByActiviy, pObj.get_productID());
                }
                if ((!show || this._filteredIDsByActiviy == null) && (this._filteredIDsBySelActiviy != null)) {
                    show = Array.contains(this._filteredIDsBySelActiviy, pObj.get_productID());
                }
            }
            if (show && this._filteredIDsGTD != null) {
                show = Array.contains(this._filteredIDsGTD, pObj.get_productID());
            }
            if (show && (pfc.getSelectedMinLength() != null)) {
                show = pObj.get_productLength() >= pfc.getSelectedMinLength();
            }
            if (show && (pfc.getSelectedMaxLength() != null)) {
                show = pObj.get_productLength() <= pfc.getSelectedMaxLength();
            }
            if (show && (pfc.getSelectedThemeID() != null) && (pfc.getSelectedThemeID() > 0)) {
                show = Array.contains(pObj.get_productThemeIDs(), pfc.getSelectedThemeID().toString());
            }
            if (show && (pfc.getSelectedCityID() != null) && (pfc.getSelectedCityID() > 0)) {
                show = Array.contains(pObj.get_productCityIDs(), pfc.getSelectedCityID().toString());
            }
            if (show && pfc.isPopularChecked()) { show = pObj.get_mostPopular(); }
            if (show && pfc.isDealsChecked()) { show = pObj.get_featuredDeals(); }
            if (show && pfc.isBestChecked()) { show = pObj.get_bestForTeacher(); }
            if (show) {
                if (!Array.contains(this._filteredProductIDs, pObj.get_productID())) {
                    Array.add(this._filteredProductIDs, pObj.get_productID());
                }
            }
            else {
                if (Array.contains(this._filteredProductIDs, pObj.get_productID())) {
                    Array.remove(this._filteredProductIDs, pObj.get_productID());
                }
            }
            pObj.setVisible(show);
        }
        this._noProductInfoHolder.style.display = (this._filteredProductIDs.length > 0) ? "none" : "block";
        this._updateCollectionUI();
        this._filterInfoHolder.innerHTML = String.format(this._filterInfoFormatString, this._filteredProductIDs.length);
    },

    _setActivitySubmitValue: function (v) {
        if (v == "") {
            this._filteredIDsByActiviy = null;
            this._filteredIDsBySelActiviy = null;
            this._filterProduct();
        }
        return v + " - " + this._productIDs.join(",");
    },

    _onActivityFilterChange: function (sender, args) {
        this._filteredIDsByActiviy = null;
        this._filteredIDsBySelActiviy = null;
        this._filterProduct();
    },

    _onActivityValueChange: function (sender, args) {
        if (this._dlgProductIDsByAtvReqCbk == null) {
            this._dlgProductIDsByAtvReqCbk = Function.createDelegate(this, this._filterProductByIDs);
        }
        var x, d;
        if (this._ajaxReq !== null) {
            x = this._ajaxReq.get_executor();
            if (x.get_started() && !x.get_aborted())
                x.abort();
        }
        d = { "activityID": args.selectedActivityID, "productIDs": this._productIDs.join(",") };
        this._ajaxReq = Explorica.makeWebRequest(this._getAjaxUrl("getproductsbyactivity"), d, this._dlgProductIDsByAtvReqCbk, null, true);
        this._setUpdating(true);
    },
    _filterProductByIDs: function (data, context) {
        if (data && typeof (data._error == "undefined")) {
            this._filteredIDsByActiviy = null;
            this._filteredIDsBySelActiviy = null;
            if (data.IDsWithSelectedActivity != "undefined" && data.IDsWithSelectedActivity != null) {
                this._filteredIDsByActiviy = Array.clone(data.IDsWithSelectedActivity);
            }
            if (data.IDsWithAvailableActivity != "undefined" && data.IDsWithAvailableActivity != null) {
                this._filteredIDsBySelActiviy = Array.clone(data.IDsWithAvailableActivity);
            }
            this._filterProduct();
        }
        this._setUpdating(false);
    },
    _onGTDChange: function (sender, args) {
        if (args.gtd == "") {
            this._filteredIDsGTD = null;
            this._filterProduct();
        }
        else {
            if (this._dlgProductIDsByGTD == null) {
                this._dlgProductIDsByGTD = Function.createDelegate(this, this._filterProductByGTD);
            }
            var x, d;
            if (this._ajaxReq !== null) {
                x = this._ajaxReq.get_executor();
                if (x.get_started() && !x.get_aborted())
                    x.abort();
            }
            d = { "gtd": args.gtd, "productIDs": this._productIDs.join(",") };
            this._ajaxReq = Explorica.makeWebRequest(this._getAjaxUrl("getproductbygtd"), d, this._dlgProductIDsByGTD, null, true);
            this._setUpdating(true);
        }
    },
    _filterProductByGTD: function (data, context) {
        if (data && typeof (data._error == "undefined")) {
            this._filteredIDsGTD = Array.clone(data);
            this._filterProduct();
        }
        this._setUpdating(false);
    },

    sortProduct: function (sortby) {
        var control = null;
        switch (sortby) {
            case "price":
                this._products.sort(this._compareByPrice);
                control = this._sortByPriceHolder;
                this._sortByTitleHolder.className = "sort";
                this._sortByLengthHolder.className = "sort";
                break;
            case "length":
                this._products.sort(this._compareByLength);
                control = this._sortByLengthHolder;
                this._sortByTitleHolder.className = "sort";
                this._sortByPriceHolder.className = "sort";
                break;
            case "title":
                this._products.sort(this._compareByTitle);
                control = this._sortByTitleHolder;
                this._sortByPriceHolder.className = "sort";
                this._sortByLengthHolder.className = "sort";
                break;
        }
        if (control.className.indexOf("sortAsc") != -1) {
            this._products.reverse();
            control.className = "sort sortDesc";
        }
        else {
            control.className = "sort sortAsc";
        }
        this._updateCollectionUI();
    },
    _compareByPrice: function (product1, product2) {
        return product1.get_price() - product2.get_price();
    },
    _compareByTitle: function (product1, product2) {
        var title1 = product1.get_title().toLowerCase();
        var title2 = product2.get_title().toLowerCase();
        if (title1 < title2)
            return -1
        if (title1 > title2)
            return 1
        return 0
    },
    _compareByLength: function (product1, product2) {
        var val = product1.get_productLength() - product2.get_productLength();
        if (val == 0)
            val = product1.get_extensionLength() - product2.get_extensionLength();
        return val;
    },
    _updateCollectionUI: function () {
        var productObj = null;
        var pID = 0, visibleC1Count = 0, visibleC2Count = 0;
        var tempArr1Ref = [], tempArr2Ref = [];
        tempArr1Ref = (this._filteredIDsByActiviy != null) ? this._filteredIDsByActiviy : [];
        tempArr2Ref = (this._filteredIDsBySelActiviy != null) ? this._filteredIDsBySelActiviy : [];
        var showCol1 = (tempArr1Ref.length > 0);
        var showCol2 = (tempArr2Ref.length > 0);

        var holder = null;
        for (var i = 0; i < this._products.length; i++) {
            productObj = this._products[i];
            pID = productObj.get_productID();
            holder = this._collectionHolder1
            if (showCol2 && !Array.contains(tempArr1Ref, pID) && Array.contains(tempArr2Ref, pID)) {
                holder = this._collectionHolder2
                if (productObj.isVisible()) {
                    visibleC2Count++;
                }
            }
            else {
                if (productObj.isVisible()) {
                    visibleC1Count++;
                }
            }
            holder.appendChild(productObj.get_productHolder());
        }
        this._collection1InfoHolder.style.display = ((visibleC1Count > 0) && (visibleC2Count > 0) && showCol2 && showCol1) ? "block" : "none";
        this._collectionHolder2.style.display = ((visibleC2Count > 0) && showCol2) ? "block" : "none";
        this._collection2InfoHolder.style.display = ((visibleC2Count > 0) && showCol2) ? "block" : "none";
        if (showCol2) {
            this._collection2InfoHolder.innerHTML = "<b>"+ String.format(this._collection2Info, "<i>"+ this._productFilterControl.getSelectedActivityText() +"</i>") + "</b>";
            if (showCol1) {
                this._collection1InfoHolder.innerHTML = "<b>" + String.format(this._collection1Info, "<i>" + this._productFilterControl.getSelectedActivityText() + "</i>") + "</b>";
            }
        }
    },
    _setUpdating: function (value) {
        this._productFilterControl.setDisable(value);
        document.body.style.cursor = (value) ? "wait" : "default";
    }
}
Explorica.ProductCollectionControl.registerClass('Explorica.ProductCollectionControl', Sys.Component, Sys.IDisposable);

