var Share = stdClass.extend({
	//constructor
	constructor: function(el, settings) {
		this.base();
		// initialize settings
		Object.extend(this.s, {
			moduleName: 'Share',
			ceid: null,
			json: {
				ver: '0.1',
				meta: {},
				data: {},
				requests: []
			}
			/* put extensions to collections here */
		});
		
		// initialize nodes
		Object.extend(this.n, {
			el: el,
			form: null,
			submitButton: null,
			dialog: null
			/* put extensions to nodes here */
		});
		
		// initialize collections
		Object.extend(this.c, {
			requests: []
			/* put extensions to collections here */
		});
		this._attachEvents();

	},
	
	
	elOnClick: function(e) {
		Event.stop(e);
		var shareFormDialog = new FormDialog({
			'+zones': {
				heading: 'Loading...',
				text: 'Loading...'
			},
			position: {  
				exemplarAnchor: 'center middle',
				selfAnchor: 'center middle',
				exemplar: 'viewport',
				offsetY: 0,
				offsetX: 0
			},
			groupId: 'InviteDialogs',
			groupLimit: 1,
			startHidden: true,
			moduleName: this.s.moduleName,
			parentThis: this,
			ceID: this.s.ceid,
			params: {
				url: this.n.el.href.substr(this.n.el.href.indexOf('url=')+4),
				theclass: this.n.el.className
			}
		});
	},
	
	_attachEvents: function() {
		this.eObserve(this.n.el, 'click', this.elOnClick.bind(this));
	}
	
});

EventSelectors.register({
	'a.share': function(el, index) {
		new Share(el);
	}
}, true);
