X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.js;fp=phpfspot.js;h=706d6423e417f778019edcaaaee74ace8a4c85b3;hp=f705e8813f117e5a2604d55c89af0554ae9b9ab2;hb=a8265bdc6dae2cac67d7ef6d6eefc6b7aeb38c1f;hpb=5bc4f09805223539cd593ccbe7ed49955dd58775;ds=sidebyside diff --git a/phpfspot.js b/phpfspot.js index f705e88..706d642 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -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';