/**
 *	History:	1.1.0	Tom Polchowski	July 14, 2003
 * 			1.2.0	Tom Polchowski	November 2, 2007
*/

function ObjectHandlerCollection(){
	/*	Create an array of tabs. */
	var objectHandlerArray = new Array();
	
	
	this.add = function (handler){
		/*	If there is no handler, return. */
		if(handler == null) return -1;
		
		/*	If the handler is invalid, return. */
		if(!handler.valid()) return -1;
	
		var arrayLength = objectHandlerArray.length;
		objectHandlerArray[arrayLength] = handler;
		
		/*	Return the new position. */
		return arrayLength;
	};

	
	this.noDisplayAll = function (){
		/*	Set the display property. */
		for(ObjectHandlerCollectionIndex = 0; ObjectHandlerCollectionIndex < objectHandlerArray.length; ObjectHandlerCollectionIndex++){
			objectHandlerArray[ObjectHandlerCollectionIndex].noDisplay();
		}
	}


	this.displayAll = function (){
		/*	Set the display property. */
		for(ObjectHandlerCollectionIndex = 0; ObjectHandlerCollectionIndex < objectHandlerArray.length; ObjectHandlerCollectionIndex++){
			objectHandlerArray[ObjectHandlerCollectionIndex].display();
		}
	}


	this.displaySingle = function (position){
		/*	Set the display property. */
		for(ObjectHandlerCollectionIndex = 0; ObjectHandlerCollectionIndex < objectHandlerArray.length; ObjectHandlerCollectionIndex++){
			if(ObjectHandlerCollectionIndex == position) objectHandlerArray[ObjectHandlerCollectionIndex].display();
			else objectHandlerArray[ObjectHandlerCollectionIndex].noDisplay();
		}
	};
	
	this.displaySingleById = function (id){
		/*	Set the display property. */
		for(ObjectHandlerCollectionIndex = 0; ObjectHandlerCollectionIndex < objectHandlerArray.length; ObjectHandlerCollectionIndex++){
			if(objectHandlerArray[ObjectHandlerCollectionIndex].getId() == id) objectHandlerArray[ObjectHandlerCollectionIndex].display();
			else objectHandlerArray[ObjectHandlerCollectionIndex].noDisplay();
		}
	};
}




