﻿Type.registerNamespace("Pacem.UI");

Pacem.UI.SectionType = function() { };
Pacem.UI.SectionType.prototype = {
    photogalleries: 0,
    photos: 1,
    videogalleries: 2,
    videos: 3,
    video: 4
}
Pacem.UI.SectionType.registerEnum("Pacem.UI.SectionType");

Pacem.UI.NavigationManager = function(element) {
    Pacem.UI.NavigationManager.initializeBase(this, [element]);
    // fields
    if (!element.tagName || element.tagName != "IFRAME")
        throw Error.argument("element", "Element is not an IFrame.");

    this._section = null;
    this._sectionID = null;
    this._baseUrl = "/";
}
Pacem.UI.NavigationManager.prototype = {
    initialize: function() {
        Pacem.UI.NavigationManager.callBaseMethod(this, 'initialize');
    },
    dispose: function() {

        Pacem.UI.NavigationManager.callBaseMethod(this, 'dispose');
    },
    get_section: function() {
        return this._section;
    },
    set_section: function(v) {
        this._section = v;
    },
    get_baseUrl: function() {
        if (this._baseUrl.endsWith("/")) return this._baseUrl;
        return this._baseUrl + "/";
    },
    set_baseUrl: function(v) {
        this._baseUrl = v;
    },
    get_sectionID: function() {
        return this._sectionID;
    },
    set_sectionID: function(v) {
        this._sectionID = v;
    },
    navigate: function() {
        this.get_element().src = String.format("{0}pages/navigation.aspx?section={1}&sectionID={2}", this.get_baseUrl(), this.get_section(), this.get_sectionID());
    }
}
Pacem.UI.NavigationManager.registerClass('Pacem.UI.NavigationManager', Sys.UI.Behavior);
