//Create a new Imanager Manager, needs the directory where the manager is
//and which language translation to use.
var manager = new ImageManager('/admin/lib/editor/plugins/ImageManager','en');

//Image Manager wrapper. Simply calls the ImageManager
ImageSelector = {
	//This is called when the user has selected a file
	//and clicked OK, see popManager in IMEStandalone to 
	//see the parameters returned.
	update : function(params,imageFrame,stringlength) {
		if(this.field && this.field.value != null){
			this.field.value = params.f_url.substring(stringlength); //params.f_url
			document.getElementById(imageFrame).innerHTML = '<img src="'+params.f_url+'" width="'+params.f_width+'" height="'+params.f_height+'" />';
		}
	},
	//open the Image Manager, updates the textfield
	//value when user has selected a file.
	select: function(textfieldID,imageFrame,stringlength)
	{
		this.field = document.getElementById(textfieldID);
		manager.popManager(this,imageFrame,stringlength);	
	}
};	
