initial javascript split through pages