Do not scroll over the document top edge

With this simple if statement datepicker div will not appear
over the document top edge. 
It was happening especially when working with small iframes.