var ResumeSlider = Class.create({
	initialize:function(target){
		this.target = target;
		this.pastearea = this.target.down('.pastearea');
		this.pastelink = this.target.down('.pastelink');
		this.pastelink.observe('click', this.toggle.bind(this));
		this.target.down('input[type=file]').observe('focus', function(){if (this.pastelink.hasClassName('active')) this.toggle()}.bind(this));
		if (this.pastearea && this.pastearea.down('textarea').innerHTML != ''){
			this.pastearea.show();
			this.pastelink.addClassName('active');
		}
		this.broadcastSize();
		if (parent && parent.document)
			Event.observe(window, 'resize', this.broadcastSize.bind(this));
		this.active = false;
	},
	toggle : function(){
		if (this.active) return;
		this.active = true;
		this.pastelink.toggleClassName('active');
		Effect.toggle(this.pastearea, 'blind', {afterFinish:function(){
			this.active = false;
			this.broadcastSize();
		}.bind(this)});
	},
	broadcastSize : function(){
		if (parent && parent.document){
			parent.document.fire("pop:resized", this.target.up('body').getHeight());
		}
	}
});
var form = $$('form.resumeform').first();
if (form)
	new ResumeSlider(form);

