//<script language="JavaScript"> 
//<!-- Hide the script from old browsers -- 
function updateuser() { 
var myindex=SelectFile.disk.selectedIndex 
var command = "http://hal.chem.uwm.edu/cgi-bin/webplot/webplot.pl?disk="
if (SelectFile.disk.options[myindex].value != "") { 
var query=SelectFile.disk.options[myindex].value;
top.location.href=command+query;
} 
} 
function ShowHref() {
href = document.links[1].href

document.form3.text.value = href
}
function WinRes() {
xpix = window.innerWidth;
ypix = window.innerHeight;
document.form3.text.value = xpix;
}
function viewvalue(coord) {
//width = document.images['spectrum'].width;
//height = document.images['spectrum'].height;
width=612
leftmarg = 41
rightmarg= 45
count = document.form3.clickcount.value;
sf = document.form3.sf.value;
//xcoord = event.x
//ycoord = event.y
//var node = document.images['spectrum'];
//var left = node.offsetLeft
// var top = node.offsetTop
//while (node.parentNode) {
//    node = node.parentNode
//    if (node.offsetLeft) {
//       left = left + node.offsetLeft
//       top = top + offsetTop
//} }
//x = xcoord-left;
x = coord;
if (x > leftmarg & x < width-rightmarg) {
   pl1 = document.form3.plotf2pl1.value;
   pl2 =  document.form3.plotf2pl2.value;
   lastppm = document.form2.plotf2pl1.value;
   var xfract = (x-leftmarg)/(width-leftmarg-rightmarg);
   deltappm = pl1 - pl2;
   var ppm = pl1 - (xfract * deltappm);
   var hz = ppm * sf;
   expon = 5-(Math.round(Math.log(Math.abs(deltappm))*Math.LOG10E)); accppm=Math.pow(10,expon);
   if (count == "0") { 
      document.form3.curppm.value=Math.round(ppm*accppm)/accppm;
      document.form3.dppm.value="-";
      document.form3.hz.value=Math.round(hz*accppm/100)/(accppm/100);
      document.form3.dhz.value="-";
      document.form3.text.value="Click on Spectrum to set left plot limit";}
   if (count == "1") {
      document.form3.curppm.value=Math.round(ppm*accppm)/accppm;
      document.form3.dppm.value = lastppm - ppm;
      document.form3.hz.value=Math.round(hz*accppm/100)/(accppm/100);;
      document.form3.dhz.value= lastppm*sf - hz;
      document.form3.text.value="Click on Spectrum to set right plot limit";}
 }
else { 
 document.form3.text.value="Cursor outside spectrum"; }
}
function putvalue() {
x = document.form3.curppm.value;
count=document.form3.clickcount.value;
if (count == "0") {
   document.form3.clickcount.value="1";
   document.form2.plotf2pl1.value=x;
   document.form3.text.value="Click on Spectrum to set right plot limit";
   document.form3.dppm.value=0;
   document.form3.dhz.value=0;
}
if (count == "1") {
   document.form3.clickcount.value="0";
   document.form2.plotf2pl2.value=x;
   document.form3.text.value="Click [Set new Plot Limits] to expand";
   document.form3.dppm.value="-";
   document.form3.dhz.value="-";
}
}
function drawtext(phrase) {
document.form3.text.value = phrase;
//document.form3.curppm.value="---";
//document.form3.dppm.value="---";
}
function none() {
}
function setselection(submitvalue) {
document.form3.selection.value=submitvalue
document.form3.submit()
}
//--> 
//</SCRIPT>
