determine server url based on window's location