var Email = Class.create ({
	initialize: function (debug) {
		this.debug = debug;

		if (!Prototype)
			this._dbug ("Protype n'est pas chargé");
		if (!Window)
			this._dbug ("Window n'est pas chargé");
		
		this._initWin ();
	},
	
	open: function (to, from, qsa) {
		var url = '?tpl=ajaxmsg&to=' + to + '&np=1&from=' + from + qsa;
		this._win.setAjaxContent (url);
	},

	destroy: function () {
		this._win.close ();
	},
	
	_initWin: function () {
		this._win = new Window ({
			'title': "Envoyer un message mail", 
			'className': "alphacube",
			'top':185, 
			'left':15, 
			'width':618, 
			'height':338, 
			'destroyOnClose':false,
			'resizable':false,
			'maximizable':false,
    	'minimizable':false
		});
	},

	_dbug: function (msg) {
		if (this.debug)
			alert (msg);
	},
	onException: function (res, e) {
		alert ("Erreur script : " + e );
	}
});
