Subnet calculator in javascript to help out