selected = new Array();

function highlight(target) {
  // cancel previous highlight
  var listing = target.substr(0, target.indexOf("-"));
  var hithumb = target.substr(1 + target.indexOf("-"));
  if (selected[listing]) {
    document.getElementById("thm" + listing + "-" + selected[listing]).style.borderColor = "#3366CC";
  }
  document.getElementById("thm" + target).style.borderColor = "#FFFF00";
  selected[listing] = hithumb;
}

function change(target, value) {
  if (target.indexOf("pic") == 0) { // if this is a property picture
    document.getElementById(target).style.visibility = "hidden";
    document.getElementById(target).src = value;
    //highlight(target + "-" + value);
      if (navigator.appName.indexOf("Microsoft Internet") == -1) { // non-IE handles onload like ondata
        document.getElementById(target).onload = function() {
        document.getElementById(target).style.visibility = "visible";
      }
    } else { // IE onload causes a loop; bypass function
      document.getElementById(target).style.visibility = "visible";
      document.getElementById("body").style.width = trueWidth + "px";
    }
  } else { // for any other graphic
    document.getElementById(target).src = value; 
  }
}

function email() {
  var sequence = "109097114116104097064097115107109097114116104097105110109097105110101046099111109"
  var string = ""; var index = 0;
  while (sequence.charAt(index) != "") {
    var code = parseFloat(sequence.substr(index, 3));
    string += String.fromCharCode(code);
    index += 3;
  }
  return string;
}