var selector = Class.create({
	initialize: function()
	{
		this.links = $$('a.iframe');
		this.frames = $$('iframe');
		if (this.frames.length == 0) {
			return;
		}
		this.active = null;
		this.frames.each(function(frame) {
			frame.setStyle({display: 'none'});
		}.bind(this));
		this.links.each(function(link, i) {
			link.observe('click', function(event, i) {
				event.stop();
				this.frames[i].setStyle({display: 'block'});
				if (this.active) {
					this.active.setStyle({display: 'none'});
				}
				this.active = this.frames[i];
			}.bindAsEventListener(this, i));
		}.bind(this));
	}
});