$(document).ready(function(){
  doRedirect = function(){
    //    alert($("#myCountry").children("option:selected").attr("value"));
    location.href = $("#myCountry").children("option:selected").attr("value");     
  }
//  alert(location.hostname.indexOf('eqcaen', 0));
  if (location.hostname.indexOf('eqcaen', 0) != -1) {
    $("#myCountry").selectOptions('http://eqcaen.canada.travel/');
  }
  else if (location.hostname.indexOf('eqcafr', 0) != -1) {
    $("#myCountry").selectOptions('http://eqcafr.canada.travel/');
  }
  else if (location.hostname.indexOf('equs', 0) != -1) {
    $("#myCountry").selectOptions('http://equs.canada.travel/');
  }
  else if (location.hostname.indexOf('eqgb', 0) != -1) {
//    alert(location.hostname.indexOf('eqgb', 0));
    $("#myCountry").selectOptions('http://eqgb.canada.travel/');
  }
  else if (location.hostname.indexOf('eqjp', 0) != -1) {
    $("#myCountry").selectOptions('http://eqjp.canada.travel/');
  }
  $("#myCountry").change(doRedirect);
  
});

