Added javascript to work out if page is too long