﻿var returnedContent = "";
	function setPrefs() {
	// We're just displaying the returned value in a text box.
	document.appointment.eventDate.value = dialogWin.returnedValue;
	//textContent = document.contentForm.pageContent.value;
	returnedContent =  dialogWin.returnedValue;
	//document.appointment.eventDate.value = returnedContent+textContent;
	//document.write("retval = "+returnedContent);
	return false;
	
	}
	
	var winObject = null;
	function calendarDialog(pPid)
	{
   		var dateString = null;
   		var alignVal = null;
   		var altText = null;
   		//showModalDialog("imageFrame.html",window,"status:false;dialogWidth:30em;dialogHeight:18em");
		winObject = openDialog("/User_Calendar.aspx?mn=<%=memberno%>&pid="+pPid, 600, 500, setPrefs) ;
	}
		var Nav4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))	;
		var dialogWin = new Object();


function openDialog(url, width, height, returnFunc, args) {
	if (!dialogWin.win || (dialogWin.win && dialogWin.win.closed)) {
		// Initialize properties of the modal dialog object.
		dialogWin.returnFunc = returnFunc;
		dialogWin.returnedValue = "";
		dialogWin.args = args;
		dialogWin.name = "Calendar";
		dialogWin.url = url;
		dialogWin.width = width;
		dialogWin.height = height;
		// Keep name unique so Navigator doesn't overwrite an existing dialog.
		//dialogWin.name = (new Date()).getSeconds().toString();
		// Assemble window attributes and try to center the dialog.
		if (Nav4) {
			// Center on the main window.
			dialogWin.left = window.screenX + 
			   ((window.outerWidth - dialogWin.width) / 2)
			dialogWin.top = window.screenY + 
			   ((window.outerHeight - dialogWin.height) / 2)
			var attr = "screenX=" + dialogWin.left + 
			   ",screenY=" + dialogWin.top + ",resizable=no,width=" + 
			   dialogWin.width + ",height=" + dialogWin.height
		} else {
			// The best we can do is center in screen.
			dialogWin.left = (screen.width - dialogWin.width) / 2
			dialogWin.top = (screen.height - dialogWin.height) / 2
			var attr = "left=" + dialogWin.left + ",top=" + 
			   dialogWin.top + ",resizable=no,width=" + dialogWin.width + 
			   ",height=" + dialogWin.height
		}
		
		// Generate the dialog and make sure it has focus.

		dialogWin.win=window.open(dialogWin.url, dialogWin.name, attr)
		dialogWin.win.focus()
	} else {
		dialogWin.win.focus()
	}
	
	
}
