If Else in JavaScript

<script type="text/javascript">
var country = "Germany";
if (country=="Spain")
  {
  x="I am in Spain";
  }
else
  {
  x="I am not in Spain";
  }
document.write(x);
</script>