//The following line needs to be included on the objects page
//var countryID = "[$gui.COUNTRYID/]";

//checks countryID and preselects in country dropdown
for (i=0; i<document.ccauth.elements.length; i++) {
  if (document.ccauth.elements[i].value == "S15") {
    for (n=0; n<document.ccauth.elements[i+1].options.length; n++) {
      if (document.ccauth.elements[i+1].options[n].value == countryID) {
        document.ccauth.elements[i+1].options[n].selected = true;
      }
    }
  }
}

//checks IP address & will preselect "NON US" for countries outside of US/CA
if (countryID == "US" || countryID == "CA") {
//do nothing
} else {
  for (i=0; i<document.ccauth.elements.length; i++) {
    if (document.ccauth.elements[i].value == "S14") {
      document.ccauth.elements[i+1].options[document.ccauth.elements[i+1].length-1].selected = true;
    }
  }
}
