function datenewwin(frm, el) {

	var rightedge=document.body.clientWidth-event.clientX;
	var bottomedge=document.body.clientHeight-event.clientY;
	
	var winwidth = 150;
	var winheight = 150;
	
	if (rightedge<parseInt(winwidth)) {
		xoffset = ((-1) * parseInt(winwidth));
	}
	else {
		xoffset = -10;
	}
	
	if (bottomedge < parseInt(winheight)) {
		yoffset = ((-1) * parseInt(winheight));
	}
	else {
		yoffset = -10;
	}

	x = (event.screenX + xoffset).toString(10);
	y = (event.screenY + yoffset).toString(10);
	
	var datenewwin = window.open("/calendar/?opnfrm=" + frm + "&opnel=" + el, el, "location=no,menubar=no,width=" + winwidth.toString() + ",height=" + winheight.toString() + ",top=" + y + ",left=" + x);
	datenewwin.focus();
}

function datenewwinm(frm, el) {
	var datenewwin = window.open("/calendar/?monthly=1&opnfrm=" + frm + "&opnel=" + el, el, "location=no,menubar=no,width=150,height=150");
	datenewwin.focus();
}