// JavaScript Document
// Widgets is a way to initialize widgets in the ARIA examples


function Widgets() {
  this.widgets = new Array();
}

/**
* add is member of the Widgets Object 
* and used add a widget ot the list of widgets to be intitialized 
* as part of the onload event
* The controls array is the list of controls to initialize
* @member Enable
* @return none
*/

Widgets.prototype.add = function(obj) {
  this.widgets[this.widgets.length] = obj;
}

/**
* init is member of the Widgets Object 
* and is called by the onload event to initialize widgets in the web resource
* The controls array is the list of controls to initialize
* @member Enable
* @return none
*/

Widgets.prototype.init = function() {
    for(var i = 0; i < this.widgets.length; i++ ) {
	    try {
			this.widgets[i].init();
		}catch(err) {}
	}
}

var widgets = new Widgets();

function initApp() {
  widgets.init();
}
