        function coordCallBack(x, y) {
            var xmin, xmax;
	    var xValue = x;
	    b=-1;
	    for (var i=0; i<IRinfo.length; i++) {
		xmin=IRinfo[i].xpos-IRinfo[i].width;
		xmax=IRinfo[i].xpos+IRinfo[i].width;
   		if ((xValue>=xmin) && (xValue<=xmax) ) {
			b=i;
			break;
		}
	    }
	    if (b>=0) {
		document.getElementById("JSVApplet").removeAllHighlights();
		document.getElementById("JSVApplet").addHighlight(xmin,xmax,241,111,171,200);
		  if (ShowDesc=="T") {
		      message=IRinfo[b].desc;
		      document.theform.VibModeDesc.value = message;
		  }
	 	loadMol(IRinfo[b].script);
	    }
  	    else {
	   	alert("That region not annotated");
	   	document.getElementById("JSVApplet").removeAllHighlights();
		_jms= "frame 1; vibration off";
		jmolScript(_jms,"JMtarget");
	  	if (ShowDesc=="T") {
                     document.theform.VibModeDesc.value = "";
           	}
	    }
        }

	function loadMol(MolName) {
                jmolScript("frame "+MolName+"; vibration on;vibration scale .06","JMtarget");
	}

	function toggleGrid() {
		coord = document.getElementById("JSVApplet").toggleGrid();
	}

	function toggleCoordinate() {
		coord = document.getElementById("JSVApplet").toggleCoordinate();
	}

	function reversePlot() {
		coord = document.getElementById("JSVApplet").reversePlot();
	}

	function highlightRegion() {
		var x1 = document.theform.x1.value;
		var x2 = document.theform.x2.value;
		if(x1 != "" && x2 != "")
			document.getElementById("JSVApplet").addHighlight(x1, x2, 255, 255, 0, 100);
	}

	function showAllHighlightedRegions() {
		for (var i=0; i<IRinfo.length; i++) {
			xmin=IRinfo[i].xpos-IRinfo[i].width;
			xmax=IRinfo[i].xpos+IRinfo[i].width;
			document.getElementById("JSVApplet").addHighlight(xmin,xmax,241,111,171,200);
		}
	}

	function removeAllHighlights() {
	      _jms= "frame 1; vibration off";
		jmolScript(_jms,"JMtarget");
		document.getElementById("JSVApplet").removeAllHighlights();
  	        if (ShowDesc=="T") {
                 	document.theform.VibModeDesc.value = "";
          	}
	}

        function resetAll() {
              document.theform.reset()
              document.getElementById("JSVApplet").removeAllHighlights();
              jmolScript("frame 1; background white; vibration off; spin off; vectors off; wireframe 0.15; spacefill 0.4","JMtarget");
        }

