/*******************************************************************************
 * Copyright (c) 2007 The Montecito Journal
 *
 * TERMS OF USE
 * By using this program, the user agrees to abide by the following terms:
 *
 * 1. The code in this script is provided "as is". The Montecito Journal will
 *    not be held responsible for any damages which may result from the
 *    execution of any code contained within this file.
 *
 * 2. This code may be modified to suit the specific needs of the user, but no
 *    part of the code, or any software derived from this code, may be sold -
 *    either as a stand-alone product or as a part of a larger product.
 *
 * 3. That is all! Enjoy working with the software, and good luck!
 *
 ******************************************************************************/
var _POPUP_FEATURES = 'location=0,statusbar=0,menubar=0,width=400,height=300';

function raw_popup(url, target, features) {
	if (isUndefined(features)) {
		features = _POPUP_FEATURES;
	}
	if (isUndefined(target)) {
		target = '_blank';
	}
	var theWindow = window.open(url, target, features);
	theWindow.focus();
	return theWindow;
}

function link_popup(src, features) {
	return raw_popup(src.getAttribute('href'), src.getAttribute('target') || '_blank', features);
}