window.addEvent("domready", function() {
  var t0 = (new Date()).getTime();
  Landing.init();
  var t1 = (new Date()).getTime();
  log("landing.domready finished in " + (t1 - t0) + "msecs");
});

var Landing = {
  init: function() {
    // Add our event handler to the radio buttons
    $$("#subpanel-galeus input").each(function(item, index) {
      item.addEvent("click", Landing.radioSelected);
      if (item.checked) {
        // At the moment of the "onload" event, the wick objects SHOULD be already initialized
        window.addEvent("load", function() { Landing.setDestination(item.value) });
      }
    });
  },
  radioSelected: function(item) {
    Landing.setDestination(item.target.value);
  },
  setDestination: function(val) {
    var tokens = val.split(",");
    $("txtDestText").set("style", "display:none");
    $("textDestination").wick.setText(tokens[0]);
  }
};