(function () {
  if(window.addEventListener) {
    window.addEventListener("load",init,false);
  }

  else if(window.attachEvent) {
    window.attachEvent("onload",init);
  }

  function init() {
    var city = document.getElementById('city'),
        schedule = document.getElementById('schedule'),
        url = "http://shows.ctv.ca/Schedule.aspx?mode=week&localstation=";

        schedule.onchange = function() {
              location.href = this.options[this.selectedIndex].value;
        }

        city.onchange = function() {
              location.href = url + this.options[this.selectedIndex].value;
        }
  }
})();

