var loc = document.location.toString()
var matches;

if (matches = loc.match(/[?&]arrival_date=([^&]+)/))
  document.getElementById('arrival_date').value = unescape(matches[1]);

if (matches = loc.match(/[?&]departure_date=([^&]+)/))
  document.getElementById('departure_date').value = unescape(matches[1]);

