// Copyright (c) 2008 Isos Media Ltd.

var cmsPopup = {
	dialog: function(url, title) {
		window.Shadowbox.open({
			player:  'iframe',
			content: url,
			title:   title,
			width:   550,
			height:  450
		});
		return 0;
	},
	dialogBig: function(url, title) {
		window.Shadowbox.open({
			player:  'iframe',
			content: url,
			title:   title,
			width:   600,
			height:  625
		});
		return 0;
	},
	dialogSmall: function(url, title) {
		window.Shadowbox.open({
			player:  'iframe',
			content: url,
			title:   title,
			width:   450,
			height:  300
		});
		return 0;
	},
	dialogFull: function(url, title) {
		window.Shadowbox.open({
			player:  'iframe',
			content: url,
			title:   title
		});
		return 0;
	},
	dialogPreview: function(url, title) {
		window.Shadowbox.open({
			player:  'iframe',
			content: url,
			title:   title,
			width:	 550	// PanelMainWidth plus a bit 
		});
		return 0;
	},
	imgLib: function(title, opts) {
		var q = '';
		if(opts) {
			var x = [ ];
			for(var k in opts)
				x.push(k + '=' + encodeURIComponent(opts[k]));
			q = '?' + x.join(';');
		}
		window.Shadowbox.open({
			player:  'iframe',
			content: '/cms/picture/browser' + q,
			title:   title,
			width:   500,
			height:  500
		});
		return 0;
	},
	profilePreview: function(title) {
		cmsPopup.dialogPreview('/cms/person/create/preview', title);
		return 0;
	},
	groupPreview: function(title, id) {
		cmsPopup.dialogPreview('/cms/group/create/preview?id=' + id, title);
		return 0;
	},
	uViewPreview: function(title, key) {
		cmsPopup.dialogPreview('/cms/uview/create/preview?key=' + key, title);
		return 0;
	}
};

// $HeadURL: http://localhost/svn/isos/tmpl/static/cms/popup.js $
// $Id: popup.js 5772 2010-07-11 18:46:46Z mu $
