function popup(p,w,h){
	var left = (screen.availWidth/2) - (w/2);
	var top = (screen.availHeight/2) - (h/2);
	window.open(p,'Insert','width='+w+',height='+h+',s crollbars=0,status=0, left='+left+', top='+top)
}

function TabbedPane(pane, tabs, args) {
	for (id in tabs) {
		Event.observe(id, 'click', function(e) {
			if (typeof(args.onClick) == 'function')
				args.onClick(e);
			
			for (id in tabs) $(id).removeClassName('active');
			Event.element(e).addClassName('active');
			
			new Ajax.Updater(pane, tabs[Event.element(e).id], $H({
					asynchronous: true, 
					method: 'get'
				}).merge(args));
			Event.stop(e);
		});
	}
}