/*
 * popupAddNotif(u)
 * pops up the add notification window
 */
function popupAddNotif(u) {
	var width=344, height=253;
	var x = event.screenX - width;
	var y = event.screenY - height + 100;
	var w = window.open(u,'add_notif','status=yes,scrollbars=no,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	w.focus();
}

/*
 * popupCalendar(u)
 * pops up the calendar window
 */
function popupCalendar(u) {
	var width=243, height=176;
	var x = event.screenX-width-20;
	var y = event.screenY;
	var w = window.open(u,'date_chooser','status=yes,scrollbars=no,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	w.focus();
}

/*
 * popupTimePicker(u)
 * pops up the timer picker window
 */
function popupTimePicker(u)
{
	var width=100, height=80;
	var x = event.screenX-width-20;
	var y = event.screenY;
	var w = window.open(u,'date_chooser','status=yes,scrollbars=no,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	w.focus();
}

/*
 * popupTextEditor(u)
 * pops up the text editor window for contents and netpages 
 */
function popupTextEditor(u)
{
	var width=450, height=310;
	var x = width-50;
	var y = height;
	var w = window.open(u,'date_chooser','status=yes,scrollbars=no,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	w.focus();
}

/*
 * popupLinkEditor(u)
 * pops up the  editor window for links 
 */
function popupLinkEditor(u)
{
	var width=346, height=263;
	var x = width-50;
	var y = height;
	var w = window.open(u,'date_chooser','status=yes,scrollbars=no,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	w.focus();
}

/*
 * popupStatistics(u)
 * pops up the  statistic window for links 
 */
function popupStatistics(u)
{
	var width=301, height=278;
	var x=width-50;
	var y=height;
	var w=window.open(u,'date_chooser','status=yes,scrollbars=yes,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	w.focus();
}

/*
Function open popup window with name
*/
function OpenCenterPopup(file, name, width, height, scroll)
{
	var maxY = screen.availHeight;
	var maxX = screen.availWidth;  
	var x = (maxX - width) / 2;
	var y = (maxY - height) / 2;
	if (!scroll) scroll = 'no'; else scroll = 'yes';
	var w = window.open(file, name, 'status=yes,scrollbars='+scroll+',width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	if (w != null)
		w.focus();

	return w;
}