/**
 * Controller.js
 * This file is lisenced under LGPL
 * Copyright (C) 2006 nightlabs
 * author : khaled at nightlabs dot de
 **/
function Controller(container)
{
	this.container = container;
	util = Util.getInstance();
	
		this.init = function (){
		
			// to make it resizable if needed
		    util.crossBrowserAddEventListener(window,"resize",util.createMethodReference(this,"resizer"));
		 	this.image1 = new Image();
			this.image1.src = "../images/gnu.jpg";
			
			// to call the Scrollbars layout method
			util.crossBrowserAddEventListener(this.image1,"load",util.createMethodReference(this,"imageLoader"));
			this.scrollpane = new Scrollpane(this.container,this.image1);
	}
		this.init()
}
 /** the imageLoader ensures that the Scroll Layout is set after an Image has been sucessfully loaded.
  *  Note that other Objects/Elements usually donīt need this onLoad listener, but thats how you could do dynamic content
  **/
Controller.prototype.imageLoader = function (){
	this.scrollpane.layout();
}
Controller.prototype.resizer = function (){
	this.scrollpane.layout();
}