JavaScript viewport splitter