﻿var LightboxForm=new Class({
	initialize:function (name,properties,lightboxProperties) {
		this.name=name;
		this.properties=properties;
		this.lightboxProperties=$merge(LightboxForm.lightboxProperties,lightboxProperties);
	},
	show:function (name,callback) {
		Mantis.FormGenerator.FormGeneratorService.GetFormSource(this.name,this.properties || null,function (source) {
			var form=Element.fromMarkup(source,{ callback:function () {
				new Lightbox(form,this.lightboxProperties).show();
				if (callback) callback();
			}.bind(this) });
		}.bind(this));
	}
});
$extend(LightboxForm,{
	show:function (name,properties,lightboxProperties) { new LightboxForm(name,properties,lightboxProperties).show(); }
});

LightboxForm.lightboxProperties={ };
