/*
//
// APUS JS package, last modified $Date: 2005/04/13 14:53:59 $ by $Author: stamina $
//
// This script contains the logic for creating popup windows.
//
*/

// default values
var _POPUP_FEATURES = 'location=0,statusbar=0,menubar=0,width=772,height=500,scrollbars=1,resizable';

/*
// 	Function:		raw_popup
// 	Arguments:		-
// 	Description:	This function will be used by the
//					link_popup function. It's a nice wrapper
//					around the standard window.open functionality.
//	Returns:		-
// 	Historie
// 	Who		When		What
// 	BasB	24/03/2004	Creation
*/
function raw_popup(aUrl, aTarget, aFeatures) {
	if (isUndefined(aFeatures)) {
		aFeatures = _POPUP_FEATURES;
	}
	if (isUndefined(aTarget)) {
		aTarget = '_blank';
	}
	var theWindow = window.open(aUrl, aTarget, aFeatures);
	theWindow.focus(); // nicely focus windows left behind
	return theWindow;
}
/*
// 	Function:		link_popup
// 	Arguments:		-
// 	Description:	This function gets fired from direct
//					<a> onclick handlers
//	Returns:		-
// 	Historie
// 	Who		When		What
// 	BasB	24/03/2004	Creation
*/
function link_popup(aSrc, aFeatures) {
  return raw_popup(aSrc.getAttribute('href'), aSrc.getAttribute('target') || '_blank', aFeatures);
}

// helper func
function isUndefined(v) {
    var undef;
    return v===undef;
}


