CDatePickerIE5.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| BI and PM: prmt
  5. *| (C) Copyright IBM Corp. 2002, 2020
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. /*
  13. CDatePickerIE5.js
  14. This script provides interactivity for the date prompt control
  15. */
  16. /*
  17. Constructor to create a new Date Picker Dialog / inline calendar
  18. oSubmit: the submit form control
  19. oForm: a hidden form control to store the date
  20. oEditBox: the edit box that the user interacts with
  21. oDialog: the date picker dialog
  22. sRef: string, the name of this object
  23. sDefaultDate: a date to start the control
  24. iInline: integer, 0= popup , 1= inline calendar
  25. iType: integer, 0= gregorian, 1= japanese imperial
  26. //sInputOrder: YMD, DMY, ...
  27. //iStartOfWeek: start day of the week. sunday = 0, monday = 1, ..., saturday = 6
  28. iDateTimeType: 0 = datetime e.g. yyyy-mm-dd 00:00:00.000, 1 = date e.g. yyyy-mm-dd
  29. sFirstDate: the minimum acceptable date
  30. sLastDate: the maximum acceptable date
  31. bRequired: boolean, specify if user input is required
  32. sSubmitType: 'default' will submit as a standard form
  33. 'XML' will convert the submission to XML and submit
  34. */
  35. function CDatePicker(oSubmit, oForm, oEditBox, oDialog, sRef, sDefaultDate, iInline, iType, sInputOrder, iStartOfWeek, iDateTimeType, sFirstDate, sLastDate, bRequired, sSubmitType, oImgCheck, sCVId, popupZIndex)
  36. {
  37. this.setCVId(sCVId);
  38. this.m_oSubmit = oSubmit;
  39. this.m_oForm = oForm;
  40. this.m_oEditBox = oEditBox;
  41. this.m_oDialog = oDialog;
  42. this.m_sRef = sRef;
  43. this.m_popupZIndex = popupZIndex;
  44. //check to see if a valid date was supplied
  45. this.m_sInputOrder = g_dateOrder;
  46. //restore a default value
  47. if (sDefaultDate)
  48. {
  49. //split off any time portions
  50. var sTestDate = sDefaultDate.split("T");
  51. //default date is in SQL format, yyyy-mm-dd
  52. this.m_dDate = dParseDate(sTestDate[0], "YMD");
  53. if ((this.m_dDate === false) || (!this.m_dDate))
  54. {
  55. this.m_dDate = new Date();
  56. }
  57. }
  58. else
  59. {
  60. this.m_dDate = new Date();
  61. }
  62. //render the calendar inline
  63. //0 = no --use edit box and pop up picker dialog
  64. //1 = yes -- render inline on the page
  65. this.m_iInline = iInline;
  66. //sunday = 0, monday = 1, ..., saturday = 6
  67. this.m_iStartOfWeek = g_startDayOfWeek;
  68. //Calendar Type: 0=gregorian, 1=emperor
  69. this.m_iType = iType;
  70. //what the control should return to the form field
  71. //0 = datetime e.g. yyyy-mm-dd 00:00:00.000
  72. //1 = date e.g. yyyy-mm-dd
  73. this.m_iDateTimeType = iDateTimeType;
  74. //check to see if a valid first date was supplied
  75. if (sFirstDate)
  76. {
  77. this.m_dFirstDate = dParseDate(sFirstDate,"YMD");
  78. if (this.m_dFirstDate > this.m_dDate)
  79. {
  80. //the date is less than the first date,
  81. //reset to the first date
  82. this.m_dDate = this.m_dFirstDate;
  83. }
  84. }
  85. //check to see if a valid last date was supplied
  86. if (sLastDate)
  87. {
  88. this.m_dLastDate = dParseDate(sLastDate,"YMD");
  89. if (this.m_dLastDate < this.m_dDate)
  90. {
  91. //the date is greater than the last date,
  92. //reset to the last date
  93. this.m_dDate = this.m_dLastDate;
  94. }
  95. }
  96. //specify whether the user must enter a date or not
  97. this.m_bRequired = bRequired;
  98. this.m_bDisabled = false;
  99. //indicate whether the control has valid data
  100. this.m_bValid = false;
  101. //submit as XML or as a standard html form
  102. this.m_sSubmitType = sSubmitType;
  103. //determine browser for DHTML type
  104. this.m_isNS7 = browserIsNS7();
  105. //skin folder
  106. this.m_sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  107. //images for handling errors
  108. this.m_oImgCheckDate = oImgCheck;
  109. if (!this.m_oImgCheckDate)
  110. {
  111. this.m_oImgCheckDate = document.getElementById('imgTest'+sRef);
  112. }
  113. if (this.m_oImgCheckDate)
  114. {
  115. this.m_oImgErrorFalse= new Image();
  116. this.m_oImgErrorFalse.src = this.m_sSkin + "/prompting/images/error_timed_small_off.gif";
  117. this.m_oImgErrorTrue = new Image();
  118. this.m_oImgErrorTrue.src = this.m_sSkin + "/prompting/images/error_timed_small.gif";
  119. }
  120. this.updateFormVariable(this.m_oForm, this.m_dDate);
  121. this.drawDate();
  122. //check to see if we have a valid default
  123. this.checkDate(this.m_oEditBox);
  124. if ( iInline === 0 )
  125. {
  126. this.m_bIsBux = this.f_isBUX();
  127. }
  128. //create the dialog object
  129. this.m_oDatePickerDialog = new CDatePickerDialog(this.m_oDialog, this, sRef, iInline, iType, this.m_iStartOfWeek, sCVId, this.m_popupZIndex);
  130. this.m_oDatePickerDialog.m_bIsBux = this.m_bIsBux;
  131. }
  132. CDatePicker.prototype = new CPromptControl();
  133. //take the current date and update it
  134. function CDatePicker_updateFormVariable(oForm, dNewDate)
  135. {
  136. //Is there a date?
  137. if (dNewDate)
  138. {
  139. //convert to the new value and update the form
  140. //note that this value needs to be properly formatted
  141. //where dates need to be fully specified
  142. var sNewYear = dNewDate.getFullYear();
  143. //add extra 0(s) if necessary
  144. sNewYear = "0000" + sNewYear;
  145. sNewYear = sNewYear.substring(sNewYear.length-4, sNewYear.length);
  146. var sNewMonth = (parseInt(dNewDate.getMonth(), 10) + 1).toString();//+need to add one;
  147. //add an extra 0 if necessary
  148. if (sNewMonth.length == 1)
  149. {
  150. sNewMonth = "0" + sNewMonth;
  151. }
  152. var sNewDay = (dNewDate.getDate()).toString();
  153. //add an extra 0 if necessary
  154. if (sNewDay.length == 1)
  155. {
  156. sNewDay = "0" + sNewDay;
  157. }
  158. var sNewValue = sNewYear + "-" + sNewMonth + "-" + sNewDay;
  159. //note that this value needs to be properly formatted
  160. //where dates need to be fully specified
  161. if (this.m_iDateTimeType === 0)
  162. {
  163. sNewValue += "T00:00:00.000";
  164. }
  165. //update the form
  166. this.m_oForm.value = sNewValue;
  167. }
  168. else
  169. {
  170. //remove the value from the form
  171. this.m_oForm.value = K_PRMT_sEMPTY;
  172. }
  173. this.notify(gUPDATE, this);
  174. }
  175. //render the date in the proper format
  176. function CDatePicker_drawDate()
  177. {
  178. var sFormatDate = K_PRMT_sEMPTY;
  179. if (this.m_dDate)
  180. {
  181. //update the edit box
  182. sFormatDate = getFormatDate (this.m_dDate, this.m_iType, this.m_sInputOrder);
  183. }
  184. if (this.m_iInline === 0)
  185. {
  186. this.m_oEditBox.value = sFormatDate;
  187. }
  188. }
  189. //show/hide the picker dialog
  190. function CDatePicker_toggleDialogDatePicker(oObj)
  191. {
  192. //set the current date on the picker dialog
  193. if (this.m_dDate)
  194. {
  195. this.m_oDatePickerDialog.refreshDate(this.m_dDate);
  196. }
  197. else
  198. {
  199. //there is no current date, use today's date
  200. var dToday = new Date();
  201. this.m_dDate = dToday;
  202. //update the form control
  203. this.updateFormVariable(this.m_oForm, this.m_dDate);
  204. //draw the new date
  205. this.drawDate();
  206. this.m_oDatePickerDialog.refreshDate(dToday);
  207. }
  208. if ( !oObj.m_bSetOnBody )
  209. {
  210. document.body.appendChild( this.m_oDatePickerDialog.m_oDialog.parentNode.removeChild( this.m_oDatePickerDialog.m_oDialog ) );
  211. oObj.m_bSetOnBody = true;
  212. }
  213. //set the position for the dialog based on the togglebutton
  214. if ( (!this.m_oDatePickerDialog.isVisible()) )
  215. {
  216. this.positionDialog(oObj);
  217. }
  218. //reset the user day selection
  219. this.m_oDatePickerDialog.m_iUserDay = this.m_dDate.getDate();
  220. //show/hide date picker
  221. this.m_oDatePickerDialog.toggleDatePicker();
  222. }
  223. function CDatePicker_positionDialog(v_oObj)
  224. {
  225. var v_oDialog = this.m_oDatePickerDialog.m_oDialog;
  226. var v_sDisplayVal = v_oDialog.style.display;
  227. v_oDialog.style.display = "inline";
  228. var v_elRVReport = document.documentElement.querySelector(".RVReport") || document.documentElement;
  229. var v_oPageOffset;
  230. if (window.edge === true){
  231. v_oPageOffset = {x: v_elRVReport.scrollLeft, y: document.body.scrollTop};
  232. }
  233. else{
  234. v_oPageOffset = {x: v_elRVReport.scrollLeft, y: v_elRVReport.scrollTop};
  235. }
  236. var v_oObjRect = v_oObj.getBoundingClientRect();
  237. var v_oDialogRect = v_oDialog.getBoundingClientRect();
  238. var v_oClientRect = v_elRVReport.getBoundingClientRect();
  239. v_oDialog.style.display = v_sDisplayVal;
  240. var v_oPos = {x: v_oPageOffset.x, y: v_oPageOffset.y};
  241. if (v_oObjRect.top > 0)
  242. {
  243. if (v_oObjRect.top + v_oDialogRect.height <= v_oClientRect.height)
  244. {
  245. v_oPos.y += v_oObjRect.top;
  246. }
  247. else if (v_oObjRect.top + v_oDialogRect.height - v_oClientRect.height < v_oObjRect.top)
  248. {
  249. v_oPos.y += v_oClientRect.height - v_oDialogRect.height;
  250. }
  251. }
  252. if (v_oObjRect.left > 0)
  253. {
  254. if (v_oObjRect.left + v_oDialogRect.width <= v_oClientRect.width)
  255. {
  256. v_oPos.x += v_oObjRect.left;
  257. }
  258. else if (v_oObjRect.left + v_oDialogRect.width - v_oClientRect.width < v_oObjRect.left)
  259. {
  260. v_oPos.x += v_oClientRect.width - v_oDialogRect.width;
  261. }
  262. }
  263. if (this.m_isNS7 === true || window.edge === true)
  264. {
  265. v_oDialog.style.left = v_oPos.x + "px";
  266. v_oDialog.style.top = v_oPos.y + "px";
  267. }
  268. else
  269. {
  270. v_oDialog.style.pixelLeft = v_oPos.x;
  271. v_oDialog.style.pixelTop = v_oPos.y;
  272. }
  273. }
  274. //render date test pass
  275. function CDatePicker_checkDatePass(oEditBox)
  276. {
  277. if (this.m_oImgCheckDate && (this.m_oImgCheckDate.src != this.m_oImgErrorFalse.src))
  278. {
  279. this.m_oImgCheckDate.src = this.m_oImgErrorFalse.src;
  280. }
  281. if (oEditBox)
  282. {
  283. oEditBox.className = "clsSelectDateEditBox";
  284. PRMTUtils.f_showARIAPass(oEditBox, this.m_sRef);
  285. }
  286. this.notify(gPASS, this);
  287. this.checkData();
  288. }
  289. //render date test failure
  290. function CDatePicker_checkDateFail(oEditBox)
  291. {
  292. if (this.m_oImgCheckDate && (this.m_oImgCheckDate.src != this.m_oImgErrorTrue.src))
  293. {
  294. this.m_oImgCheckDate.src = this.m_oImgErrorTrue.src;
  295. }
  296. if (oEditBox)
  297. {
  298. oEditBox.className = "clsSelectDateEditBoxParseError";
  299. var v_emptyValue = sStripNonAlphanumerics(oEditBox.value) === K_PRMT_sEMPTY;
  300. var v_errorMsg = v_emptyValue ? PMT_UIM_MISSING_VALUE : PMT_UIM_INVALID_INPUT;
  301. PRMTUtils.f_showARIAFail(oEditBox, this.m_sRef, this.m_sSkin, v_errorMsg);
  302. }
  303. this.notify(gFAIL, this);
  304. this.checkData();
  305. }
  306. //test the date
  307. function CDatePicker_checkDate(oEditBox)
  308. {
  309. var bTestResult = true;
  310. //remove any non alpha numeric data
  311. var sTestDateStrip = sStripNonAlphanumerics(oEditBox.value).f_trim();
  312. //remove the time if it is part of the string
  313. if (this.m_iDateTimeType === 0)
  314. {
  315. // There are some months that have a T like July in Turkish -> 擳em? // Splits on 'T' when it's followed by digits:
  316. var arSplitValue = sTestDateStrip.split(/T(?=\d)/);
  317. sTestDateStrip = arSplitValue[0];
  318. }
  319. //is the field required? If not, a value does not have to be specified
  320. if ( this.m_bRequired === false && sTestDateStrip === K_PRMT_sEMPTY)
  321. {
  322. this.m_dDate = null;
  323. this.updateFormVariable(this.m_oForm, this.m_dDate);
  324. this.m_bValid = true;
  325. this.checkDatePass(oEditBox);
  326. return;
  327. }
  328. var iTestDate = false;
  329. //Fix for bug# 482564 - If this object is used for Date/Time dialog, specifically use YMD as date format
  330. var tempInputOrder = this.m_sInputOrder;
  331. if(oEditBox == this.m_oForm)
  332. {
  333. tempInputOrder = "YMD";
  334. }
  335. if (this.m_iType === 1)
  336. {
  337. iTestDate = dParseEra(sTestDateStrip, tempInputOrder);
  338. }
  339. else
  340. {
  341. iTestDate = dParseDate(sTestDateStrip,tempInputOrder);
  342. }
  343. //check to see if this is a valid date
  344. if (!iTestDate) //it is a number
  345. {
  346. bTestResult = false;
  347. }
  348. //see if an acceptable date was supplied
  349. if (bTestResult === false)
  350. {
  351. this.m_bValid = false;
  352. this.checkDateFail(oEditBox);
  353. return;
  354. }
  355. else
  356. {
  357. //var dTestDate = new Date(dTestDate);
  358. var dTestDate = iTestDate;
  359. //check to see if this date less than the first date
  360. //if so, then this is not a valid date
  361. if (this.m_dFirstDate)
  362. {
  363. if (dTestDate < this.m_dFirstDate)
  364. {
  365. this.m_bValid = false;
  366. this.checkDateFail(oEditBox);
  367. return;
  368. }
  369. }
  370. //check to see if this date is greater than the last date
  371. //if so, then this is not a valid date
  372. if (this.m_dLastDate)
  373. {
  374. if (dTestDate > this.m_dLastDate)
  375. {
  376. this.m_bValid = false;
  377. this.checkDateFail(oEditBox);
  378. return;
  379. }
  380. }
  381. this.m_dDate = dTestDate;
  382. this.m_bValid = true;
  383. this.updateFormVariable(this.m_oForm, this.m_dDate);
  384. this.checkDatePass(oEditBox);
  385. return;
  386. }
  387. }
  388. //catch the backspace key
  389. //some browsers (IE5.5 don't capture this event)
  390. function CDatePicker_keyPress(evt)
  391. {
  392. //trap the tab key and shift-tab
  393. evt = (evt) ? evt : ((event) ? event : null);
  394. if (evt)
  395. {
  396. var keyCode = (evt.keyCode) ? evt.keyCode : evt.which;
  397. if (keyCode=='8')
  398. {
  399. //check the data that has been typed in
  400. this.checkDate(this.m_oEditBox);
  401. }
  402. }
  403. return true;
  404. }
  405. //handle focus to the edit box
  406. function CDatePicker_gotFocus()
  407. {
  408. //hide the date picker control if it is showing
  409. this.m_oDatePickerDialog.hidePicker();
  410. }
  411. //handle lost focus to the edit box
  412. function CDatePicker_lostFocus()
  413. {
  414. this.checkDate(this.m_oEditBox);
  415. //reformat the date in the manner specified
  416. //by the input order
  417. if (this.m_bValid === true)
  418. {
  419. this.drawDate();
  420. }
  421. }
  422. //perform any special processing for the server.
  423. function CDatePicker_preProcess()
  424. {
  425. if (this.m_sSubmitType == K_PRMT_sXML)
  426. {
  427. var sURLValues = K_PRMT_sEMPTY;
  428. if ((this.m_oEditBox.value !== K_PRMT_sEMPTY) && (this.m_bDisabled!==true))
  429. {
  430. sURLValues += '<selectOption';
  431. sURLValues += ' displayValue="' + sXmlEncode(this.sGetFormatValue()) +'"';
  432. sURLValues += ' useValue="' + sXmlEncode(this.sGetValue()) +'"';
  433. sURLValues += ' selected="true" />';
  434. }
  435. addSelectChoices(this.m_oSubmit, sURLValues);
  436. }
  437. else
  438. {
  439. if (this.m_bDisabled !== true)
  440. {
  441. this.m_oSubmit.value = this.m_oForm.value;
  442. }
  443. else
  444. {
  445. //this control is disabled
  446. this.m_oSubmit.value = K_PRMT_sEMPTY;
  447. }
  448. }
  449. }
  450. //return a valid value
  451. function CDatePicker_sGetValue()
  452. {
  453. this.checkDate(this.m_oEditBox);
  454. if (this.m_bValid === true)
  455. {
  456. return this.m_oForm.value;
  457. }
  458. else
  459. {
  460. return false;
  461. }
  462. }
  463. function CDatePicker_enable()
  464. {
  465. this.m_bDisabled = false;
  466. this.m_oDialog.style.filter = "none";
  467. this.m_oEditBox.style.filter = "none";
  468. PRMTUtils.f_removeClass( this.m_oDialog, "clsClockDisabled" );
  469. PRMTUtils.f_removeClass( this.m_oEditBox, "clsClockDisabled" );
  470. }
  471. function CDatePicker_disable()
  472. {
  473. this.m_bDisabled = true;
  474. this.m_oDialog.style.filter = "alpha(opacity=75)";
  475. this.m_oEditBox.style.filter = "alpha(opacity=75)";
  476. PRMTUtils.f_addClass( this.m_oDialog, "clsClockDisabled" );
  477. PRMTUtils.f_addClass( this.m_oEditBox, "clsClockDisabled" );
  478. }
  479. function CDatePicker_toggleDisable(bState)
  480. {
  481. if (this.isRequired() === false)
  482. {
  483. if (bState === false)
  484. {
  485. this.disable();
  486. }
  487. else
  488. {
  489. this.enable();
  490. }
  491. }
  492. }
  493. //call this method to redraw the position of the
  494. //calendar dialog if the page is resized
  495. function CDatePicker_handleResize()
  496. {
  497. var o = document.getElementById(this.m_sRef + "imgPicker");
  498. if (o)
  499. {
  500. this.positionDialog(o);
  501. }
  502. }
  503. //return the content locale formatted value
  504. function CDatePicker_sGetFormatValue()
  505. {
  506. if (this.isValid() === true)
  507. {
  508. return getFormatDate (this.m_dDate, this.m_iType, this.m_sInputOrder);
  509. }
  510. else
  511. {
  512. return false;
  513. }
  514. }
  515. //set the value of the control
  516. function CDatePicker_setValue(s)
  517. {
  518. //parse the date
  519. this.m_dDate = dParseDate(s, "YMD");
  520. //update the calendar
  521. this.m_oDatePickerDialog.refreshDate(this.m_dDate);
  522. //update the edit box if there is one
  523. this.drawDate();
  524. this.checkDate(this.m_oEditBox);
  525. }
  526. function CDatePicker_hasValue()
  527. {
  528. if (this.m_oForm.value === K_PRMT_sEMPTY)
  529. {
  530. return false;
  531. }
  532. else
  533. {
  534. return true;
  535. }
  536. }
  537. //used to clean up date picker dialogs
  538. function CDatePicker_handleNotify()
  539. {
  540. //hide if this is an edit box date picker
  541. if (this.m_iInline === 0)
  542. {
  543. this.m_oDatePickerDialog.hidePicker();
  544. }
  545. }
  546. function CDatePicker_checkFail()
  547. {
  548. this.checkDateFail(this.m_oEditBox);
  549. }
  550. //Prototypes to assign methods to new instances of the object
  551. CDatePicker.prototype.drawDate = CDatePicker_drawDate;
  552. CDatePicker.prototype.toggleDialogDatePicker= CDatePicker_toggleDialogDatePicker;
  553. CDatePicker.prototype.updateFormVariable = CDatePicker_updateFormVariable;
  554. CDatePicker.prototype.checkDate = CDatePicker_checkDate;
  555. CDatePicker.prototype.checkDateFail = CDatePicker_checkDateFail;
  556. CDatePicker.prototype.checkDatePass = CDatePicker_checkDatePass;
  557. CDatePicker.prototype.keyPress = CDatePicker_keyPress;
  558. CDatePicker.prototype.gotFocus = CDatePicker_gotFocus;
  559. CDatePicker.prototype.lostFocus = CDatePicker_lostFocus;
  560. CDatePicker.prototype.preProcess = CDatePicker_preProcess;
  561. CDatePicker.prototype.sGetValue = CDatePicker_sGetValue;
  562. CDatePicker.prototype.enable = CDatePicker_enable;
  563. CDatePicker.prototype.disable = CDatePicker_disable;
  564. CDatePicker.prototype.toggleDisable = CDatePicker_toggleDisable;
  565. CDatePicker.prototype.positionDialog = CDatePicker_positionDialog;
  566. CDatePicker.prototype.handleResize = CDatePicker_handleResize;
  567. CDatePicker.prototype.sGetFormatValue = CDatePicker_sGetFormatValue;
  568. CDatePicker.prototype.setValue = CDatePicker_setValue;
  569. CDatePicker.prototype.hasValue = CDatePicker_hasValue;
  570. CDatePicker.prototype.handleNotify = CDatePicker_handleNotify;
  571. CDatePicker.prototype.checkFail = CDatePicker_checkFail;
  572. CDatePicker.prototype.checkData = function()
  573. {
  574. if (this.m_oParent && !this.m_oParent.m_bisGetValuesCall) {
  575. this.m_oParent.checkData();
  576. }
  577. };
  578. CDatePicker.prototype.f_getPosY = function(v_oObj, v_bCC_offset)
  579. {
  580. var iYpos = 0;
  581. if (this.m_isNS7 && !v_bCC_offset)
  582. {
  583. iYpos = v_oObj.y;
  584. // adds relative elements offsets
  585. var oParent = v_oObj;
  586. while (oParent = oParent.offsetParent)
  587. {
  588. if (oParent.style && oParent.style.position == "relative")
  589. {
  590. iYpos += oParent.offsetTop;
  591. }
  592. }
  593. if (!iYpos) {
  594. iYpos = iOffsetFromBodyY(v_oObj);
  595. }
  596. }
  597. else
  598. {
  599. iYpos = iOffsetFromBodyY(v_oObj);
  600. }
  601. return iYpos;
  602. };