code: function(inst, offset, isFixed) {
  		var dpWidth = inst.dpDiv.outerWidth();
  		var dpHeight = inst.dpDiv.outerHeight();
  		var inputWidth = inst.input ? inst.input.outerWidth() : 0;
  		var inputHeight = inst.input ? inst.input.outerHeight() : 0;
  		var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft();
  		var viewHeight = document.documentElement.clientHeight + $(document).scrollTop();
  
  		offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);
  		offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;
  		offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
  
  		// now check if datepicker is showing outside window viewport - move to a better place if so.
  		offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
  			Math.abs(offset.left + dpWidth - viewWidth) : 0);
  		offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
  			Math.abs(dpHeight + inputHeight) : 0);
  
  		return offset;
  	}
docs: /* Check positioning to remain on screen.