function calc()
{
low=document.forms["form1"].lowValue.value
high=document.forms["form1"].highValue.value

if(high=="") 
{alert("Please enter your High Value"); document.forms["form1"].highValue.focus();return;}

if(low=="") 
{alert("Please enter your Low Value"); document.forms["form1"].lowValue.focus();return;}

if( (parseFloat(low)) > (parseFloat(high)) ) 
{alert("Please make sure your Low Value is smaller than your High Value"); document.forms["form1"].lowValue.focus();return;}

r61=parseFloat(low)+0.618*(high-low)
r50=parseFloat(low)+0.5*(high-low)
r38=parseFloat(low)+0.382*(high-low)

rf61=(Math.round(r61*10000)/10000)
rf50=(Math.round(r50*10000)/10000)
rf38=(Math.round(r38*10000)/10000)

document.form1.retracement61.value=rf61
document.form1.retracement50.value=rf50
document.form1.retracement38.value=rf38

}
