﻿Type.registerNamespace("KMDA.Babyolifant");

// Constructor
KMDA.Babyolifant.Layout = function(layout) {
    this.Name = layout.name;
    this.StartDate = new Date(layout.startdate);
    this.EndDate = new Date(layout.enddate);
    this.Sections = new Array();
    for (var i = 0; i < layout.section.length; i++) {
        this.Sections.push(new KMDA.Babyolifant.Section(layout.section[i]));
    }


}

KMDA.Babyolifant.Layout.prototype = {
    Name: "",
    StartDate: new Date(),
    EndDate: new Date(),
    Sections: new Array(),
    ContainsSection: function(sectionname) {
        for (var i = 0; i < this.Sections.length; ++i) {
            if (sectionname == this.Sections[i].Name) {
                return true;
            }
        }
    },
    RetrieveSection: function(sectionname) {
        for (var i = 0; i < this.Sections.length; ++i) {
            if (sectionname == this.Sections[i].Name) {
                return this.Sections[i];
            }
        }
    }
}

KMDA.Babyolifant.Layout.registerClass('KMDA.Babyolifant.Layout', null ,Sys.IDisposable);


// Notify ScriptManager that this is the end of the script.
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
