Little changes to get dinamically the document to attach the datepiker (when possible).
Added faster way to get the left and top positions to show the calendar. (Solves problem when the field is inside a div with vertical scroll)