Add: // Global Variables
var size = window.outerWidth;
Change:
bgImage.hide().bind('load', function () { _ht = $(this).height(); });
to
bgImage.hide().bind('load', function () { _ht = $(this).width(); });
and change:
if (-(current) == _ht) _finishNRot = true;
to
if ((size-current) > _ht) _finishNRot = true;