function openWindow(url,ww,wh) {  var windowName = "infoPopup";  var w = screen.width;  var h = screen.height;  var x = (w/2) - (ww/2);  var y = (h/2) - (wh/2);  settings = "scrollbars=yes,toolbar = no,location=no,directories=no,status=no,menubar=no,width=" + ww + ",height=" + wh +",top=" + y + ",left="+ x;  newWindow = window.open(url, windowName, settings);}function openPhoto(url,ww,wh) {  var windowName = "photoPopup";  var w = screen.width;  var h = screen.height;  var x = (w/2) - (ww/2);  var y = (h/2) - (wh/2);  settings = "toolbar = no,location=no,directories=no,status=no,menubar=no,width=" + ww + ",height=" + wh +",top=" + y + ",left="+ x;  newWindow = window.open(url, windowName, settings);}function confirmation(message,url) {  if(confirm('Are you sure you wish to delete this ' + message +'?'))    window.location=url;}function toggleEndTime() {  if(document.newEntryForm.noEndTime.checked)    document.newEntryForm.endTime.disabled = true;  else    document.newEntryForm.endTime.disabled = false;}function resizeMainContent() {  var mainDiv = document.getElementById("mainContent");  if(screen.height > 768) {    mainDiv.style.height = screen.availHeight - 255;  }}function toggleSection(identifier, isVisible) {  var targetDiv = document.getElementById(identifier);  targetDiv.style.display = isVisible ? "block" : "none";}function checkSearchForm() {  var searchTextBox = document.getElementById("searchTextBox");  if(searchTextBox.value.length == 0) {    alert("Please enter something to search for");    return false;  } else {    return true;  }}function getNewsletterMonth() {    var d = new Date();    var month = new Array(12);  month[0]="January";  month[1]="February";  month[2]="March";  month[3]="April";  month[4]="May";  month[5]="June";  month[6]="July";  month[7]="August";  month[8]="September";  month[9]="October";  month[10]="November";  month[11]="December";    var nextMonth = d.getMonth();  nextMonth++;    if(nextMonth == 12)    nextMonth = 0;    return month[nextMonth];}function refreshOpener(page,querystring) {  if (!(window.focus && window.opener))    return true;  window.opener.focus();  window.opener.location = page + '?' + querystring;  window.close();  return false;}function highlightMenuItem(elementId,mouseIsOver) {  var thisContainer = document.getElementById(elementId + "_linkContainer");  var thisLink = document.getElementById(elementId + "_link");  if(mouseIsOver) {    thisContainer.style.backgroundColor = "#4B9661";    thisLink.style.color = "#B9FFB9";  } else {    thisContainer.style.backgroundColor = "#B9FFB9";    thisLink.style.color = "#4B9661";  }}function highlightPageLink(elementId,mouseIsOver) {  var thisContainer = document.getElementById(elementId + "_linkContainer");  var thisLink = document.getElementById(elementId + "_link");  if(mouseIsOver) {    thisContainer.style.backgroundColor = "#B9FFB9";    thisLink.style.color = "#4B9661";  } else {    thisContainer.style.backgroundColor = "#4B9661";    thisLink.style.color = "white";  }}function saveScheduleItem(scheduleId) {  document.getElementById("scheduleId").value = scheduleId;  document.getElementById("submitAction").value = "editSchedule";  document.getElementById("editScheduleForm").submit();}//Get the x/y position of a DOM elementfunction getXYpos(elem) {   if (!elem) {      return {"x":0,"y":0};   }   var xy={"x":elem.offsetLeft,"y":elem.offsetTop}   var par=getXYpos(elem.offsetParent);   for (var key in par) {      xy[key]+=par[key];   }   return xy;}var currentCalendarDate;function showCalendar(fieldId,posTop,posLeft) {  currentCalendarDate = document.getElementById(fieldId);  var coords = getXYpos(currentCalendarDate);  //alert("X: " + coords["x"] + ", Y: " + coords["y"]);  var dateParts = currentCalendarDate.value.split("/");  var usDate = new Date();  if(dateParts.length == 3)    var usDate = new Date(dateParts[1] + "/" + dateParts[0] + "/" + dateParts[2]);  $('#calendar').datepicker('setDate',usDate);  var cal = document.getElementById("calendar");  cal.style.top = coords["y"];  cal.style.left = coords["x"];  cal.style.display = "block";}function calendarDateSelected(newDate) {  currentCalendarDate.value = newDate;  document.getElementById("calendar").style.display = "none";}