/**
 * popups.js
 * definitions for popup windows used on the site, and a function to be used to
 * open the popups.
 * @author Peter Edwards <tech@e-2.org>
 * @version 1.0
 * @package intoart
 */

/**
 * the following object will contain definitions for the names, URLS and features
 * of each popup window
 */
var popups = new Object();
/**
 * each popup should have values defined for the window name, width, height, and
 * other window features (scrollbars, resizeable, menubar, 
 */
 
// rathbone weblog popup (label - 'rathbone')
popups.rathbone = {name: 'rathbone', url: 'http://www.intoart.org.uk/rathbone/index.html', width: 791, height: 594, features: ''};
// grange weblog popup (label - 'grange')
popups.grange = {name: 'grange', url: 'http://www.intoart.org.uk/grange/index.html', width: 748, height: 544, features: ''};
// current weblog popup (label - 'currentweblog')
popups.currentweblog = {name: 'currentweblog', url: 'http://www.intoart.org.uk/currentweblog/index.html', width: 748, height: 544, features: ''};





/**
 * function for popping up windows
 * usage:
 * <a href="[URL]" onclick="popup('[label]'); return false;">Link text/image</a>
 * where:
 * [URL] is the URL of the page which is being loaded in the popup window
 * [label] is a text label defined above, which points to definitions of the size, url and name of the popup
 */
function popup(which)
{
		if (typeof popups[which] == "object") {
        if (popups[which].features != '') {
				     popups[which].features += ',';
				}
    		popups[which].window = window.open(popups[which].url, popups[which].name, popups[which].features + 'width=' + popups[which].width + ',height=' + popups[which].height);
        if (popups[which].window.focus) {
            popups[which].window.focus();
        }
		}
}
