Ext.onReady(function(){
	var share = Ext.get('share');
	var scont = Ext.get('share-container');
	var xy = share.getXY();
	xy[0] = xy[0] - 430 + share.getWidth();
	scont.setXY(xy);
	share.on('click',function(){
		scont.slideIn();
	});
	
	var btns = Ext.select('input[type="image"]');
	btns.on('mouseover',function(){
		this.src = this.src.replace('_off.gif','_on.gif');
	});
	btns.on('mouseout',function(){
		this.src = this.src.replace('_on.gif','_off.gif');
	});
	
	var cancel = Ext.get('cancel');
	var inputs = Ext.select('#share-container input[type="text"], #share-container textarea');
	var invite = Ext.get('invite');
	invite.on('click',function(){
		var params = {};
		inputs.each(function(){
			params[this.dom.name] = this.dom.value;
		});

		// put the ajaxey stuff here

		inputs.each(function(){
			this.dom.value = '';
		});
	});
	var closeFn = function(){scont.slideOut()}
	cancel.on('click',closeFn);
	var close = Ext.select('div.close a');
	close.on('click',closeFn);
});

