  var NN = "";
	var apptformwin = null;
                     
                     // set up event name
                     var ev_name = window.document.title;
                     var ev_date = "no date specified";
                     
                     function convertSpaces(str) {
                        var out = "", flag = 0;
                        for (i = 0; i < str.length; i++) {
                           if (str.charAt(i) != " ") {
                              out += str.charAt(i);
                              flag = 0;
                           }
                           else {
                              if(flag == 0) {
                                 out += "%20";
                                 flag = 1;
                              }
                           }
                        }
                        return out;
                     }
                     
function openEventForm(NN) {
	
	if (apptformwin == null || apptformwin.closed) {
	
 formURL = "http://www.einstein.edu/ssi/eventappt.html?ref=event";
	if (NN = "") {
	gotoURL = formURL + '&name=' + ev_name + '&date=' + ev_date ;
	} else {
	gotoURL = formURL + '&name=' + ev_name + '&date=' + ev_date + NN ;
	}
   newURL = convertSpaces(gotoURL);

		if (navigator.appVersion.substring(0,1) < 4) {
			apptwinObj = window.open(newURL, 'apptwin', 'height=500,width=450,directories=0,menubar=0,resizable=1,scrollbars=1,status=1,location=0,toolbar=1');
			} else {
			apptwinObj = window.open(newURL, 'apptwin', 'height=500,width=450,directories=0,menubar=0,resizable=1,scrollbars=1,status=1,location=0,toolbar=0');
			}

	apptformwin = apptwinObj;
	} else {
		apptformwin.focus();
	}
}
                     