Pure javascript screen resolution calculator