
<!-- //Function that prints the given data in a popup window -->

function PrintInfo() {
  var srctag = "<img src=" + PrintInfo.arguments[0] + ">";
  var label = PrintInfo.arguments[1];
  var status = "width=750,height=" + PrintInfo.arguments[2] + ",toolbar=0,menubar=0,scrollbars=0,resizable=1,location=0,directories=0,status=0";
  var infowindow = window.open("", label, status);
  infowindow.document.writeln("<html>");
  infowindow.document.writeln("<body>");
  
  infowindow.document.writeln("<table align='center' border='2' cellpadding='5'>");
  infowindow.document.writeln("<tr>");
  infowindow.document.writeln("<td>");

  infowindow.document.writeln(srctag);
  infowindow.document.writeln("</td>");
  infowindow.document.writeln("<td>");

  var length = PrintInfo.arguments.length;
  var i;

  for (i=3; i<length; i=i+2) {
    key = PrintInfo.arguments[i] + ":";
    val = "<b>" + PrintInfo.arguments[i+1] + "</b><br>";

    infowindow.document.writeln(key);
    infowindow.document.writeln(val);
  }

  infowindow.document.writeln("</td>");
  infowindow.document.writeln("</tr>");
  infowindow.document.writeln("</table>");
  infowindow.document.writeln("<center>");
  infowindow.document.writeln("<form><input type='button' value='close' onClick='self.close()'></form>");
  infowindow.document.writeln("</center>");
  infowindow.document.writeln("</body>");
  infowindow.document.writeln("</html>");
}



<!-- //Function that prints the object info in a popup window -->
function PopupInfo() {
  var pagelocation = PopupInfo.arguments[0];
  var label = PopupInfo.arguments[1];
  var status = "width=750,height=" + PopupInfo.arguments[2] + ",toolbar=0,menubar=0,scrollbars=1,resizable=1,location=0,directories=0,status=0";
  var infowindow2 = window.open(pagelocation, label, status)
}


<!-- //------------------------------------------------- -->

<!-- //Functions to turn textboxes visible and invisible -->

function ShowPop(id) {
  document.getElementById(id).style.visibility = "visible";
}
 
function HidePop(id) {
  document.getElementById(id).style.visibility = "hidden";
}


<!-- 
 //------------------------------------------------- 
 //------------------------------------------------- 
 //------------------------------------------------- 
-->

<!-- 
 //Functions that are used to grab the relevant location in the images 
 //from user input.
-->

var l_coords = new Array(0);
var t_coords = new Array(0);


<!-- 
 //getElementCoor() returns the coordinates of the element with given id 
-->

function getElementCoord(el) {
  var elem;
  if(document.getElementById) {
    elem = document.getElementById(el);
  } else if (document.all) {
    elem = document.all[el];
  }
  
  var xPos = elem.offsetLeft;
  var tempEl = elem.offsetParent;
  while (tempEl != null) {
    xPos += tempEl.offsetLeft;
    tempEl = tempEl.offsetParent;
  }
  
  var yPos = elem.offsetTop;
  tempEl = elem.offsetParent;
  while (tempEl != null) {
    yPos += tempEl.offsetTop;
    tempEl = tempEl.offsetParent;
  }
  var array = [xPos,yPos]
    return array;
}

<!-- 
 //The following functions set the given "+" marker visible, and set the 
 //corresponding checkbox checked or unchecked.
-->

function setMarkerVisible(id) {
  var marker = document.getElementById("rel_marker_id_"+id);
  marker.style.visibility = "visible";
  
  var cbox = document.getElementById("rel_marker_active_"+id);
  cbox.checked=true;
}

function setMarkerHidden(id) {
  var marker = document.getElementById("rel_marker_id_"+id);
  marker.style.visibility = "hidden";

  var cbox = document.getElementById("rel_marker_active_"+id);
  cbox.checked=false;
}

<!--
 //Grabs the position on the image that the user just clicked.
 //Sets values for some variables according to the location.
-->

function grabMarkerLocation(event, id) {

  while(l_coords.length <= id) { l_coords[l_coords.length] = 0 }
  while(t_coords.length <= id) { t_coords[t_coords.length] = 0 }

  var imgcoords = getElementCoord("image_id_"+id);
  var imgx = event.pageX-imgcoords[0];
  var imgy = event.pageY-imgcoords[1];

  var marker = document.getElementById("rel_marker_id_"+id);
  var markercoords = getElementCoord("rel_marker_id_"+id);

  l_coords[id] = l_coords[id] - markercoords[0] + event.pageX-6;
  t_coords[id] = t_coords[id] - markercoords[1] + event.pageY-12;

  marker.style.left = l_coords[id]+"px";
  marker.style.top = t_coords[id]+"px";
  setMarkerVisible(id);

  var f = document.getElementById("f_id");
  eval("f.coordinates_x_"+id+".value=imgx");
  eval("f.coordinates_y_"+id+".value=imgy");
}


<!--
 //Sets the marker visible or invisible (visible, if the checkbox was checked).
-->
function handleCheckBoxEvent(id) {
  var cbox = document.getElementById("rel_marker_active_"+id);
  if( cbox.checked ) {
    setMarkerVisible(id);
  } else {
    setMarkerHidden(id);
  }
}

<!--
 //Sets the marker location (defined in the thumbnail image coordinates)
-->

function setMarkerLocation(id, imgx, imgy) {

  while(l_coords.length <= id) { l_coords[l_coords.length] = 0 }
  while(t_coords.length <= id) { t_coords[t_coords.length] = 0 }  

  var imgcoords = getElementCoord("image_id_"+id);

  var marker = document.getElementById("rel_marker_id_"+id);
  var markercoords = getElementCoord("rel_marker_id_"+id);

  l_coords[id] = l_coords[id] - markercoords[0] + imgx + imgcoords[0]-6;
  t_coords[id] = t_coords[id] - markercoords[1] + imgy + imgcoords[1]-12;

  marker.style.left = l_coords[id]+"px";
  marker.style.top = t_coords[id]+"px";

  var f = document.getElementById("f_id");
  eval("f.coordinates_x_"+id+".value=imgx");
  eval("f.coordinates_y_"+id+".value=imgy");

}

<!-- 
 //------------------------------------------------- 
 //------------------------------------------------- 
 //------------------------------------------------- 
-->

<!-- 
 // Functions that are used to handle feature aliases:
-->

<!-- 
 // toggleCheckboxes(bool, featurename1, [featurename2, ...]);
 // Sets the checkbox status of all the checkboxes with given IDs.
-->
function toggleCheckboxes() {
  var checkboxstatus = arguments[0];
  for(var i=1; i<arguments.length; i++) {
    var cb = document.getElementById(arguments[i]);
    if(cb)
      cb.checked = checkboxstatus;
  }
}

