make calendar better looking
[phpfspot.git] / phpfspot.js
index f705e8813f117e5a2604d55c89af0554ae9b9ab2..706d6423e417f778019edcaaaee74ace8a4c85b3 100644 (file)
@@ -534,8 +534,23 @@ function hidePhotoDetails(mode)
  */
 function showCalendar(date_box, click_obj)
 {
-   var calendar = document.getElementById('calendar');
-   var userdate = document.getElementById('date_' + date_box).value;
+   var calendar;
+   var userdate;
+
+   calendar = document.getElementById('calendar');
+   if(calendar == undefined) {
+      window.alert("Can not find element 'calendar'");
+      return;
+   }
+
+   userdate = document.getElementById('date_' + date_box);
+
+   if(userdate == undefined) {
+      window.alert("Can not find element 'date_'" + date_box);
+      return;
+   }
+
+   userdate = userdate.value;
 
    if(date_box == 'from') {
       var xpos = document.getElementById('frompic').offsetLeft;
@@ -548,7 +563,7 @@ function showCalendar(date_box, click_obj)
       calendar_mode = 'to';
    }
    calendar.style.left = xpos + 100 + 'px';
-   calendar.style.top = ypos + 80 + 'px';
+   calendar.style.top = ypos + 120 + 'px';
 
    if(calendar.style.visibility == "" || calendar.style.visibility == 'hidden') {
       calendar.style.visibility = 'visible';