main javascript