
// Class :: View

var View = Class.create( EventDispatcher, {

	
	page_container : undefined,
	
	
	initialize : function(){
	
		
	},
	
		
	
	createContainer : function( type, containerid, parentContainerId, index ){
	   
		//TODO: create indexing feature - insert at index
		
	  try{
	  	
	  	var container = ContainerFactory.createContainer( type, containerid );
	  
		var parent_container = undefined;
		
		if( parent_container = this.getElement( parentContainerId ) ){
		   
		   parent_container.appendChild( container.toElement() );
		   
		}else{   
		   
		   this.page_container.getContainer().appendChild( container.toElement() );
		}
		
		return container;
		
	   }catch( e ){
	   	
	   	   console.error( e );
	   	   return false;
	   }

	}


})


