function calculate_fibonacci()
{
	var F = document.forms["form1"];
	
	low = F.lowValue.value
	high = F.highValue.value

	if(high=="") 
	{alert("Please enter High Value"); F.highValue.focus();return;}

	if(low=="") 
	{alert("Please enter Low Value"); F.lowValue.focus();return;}

	if( (parseFloat(low)) > (parseFloat(high)) ) 
	{alert("Please make sure the Low Value is smaller than the High Value"); F.lowValue.focus();return;}

	p61 = parseFloat(low)+0.618*(high-low)
	p50 = parseFloat(low)+0.5*(high-low)
	p38 = parseFloat(low)+0.382*(high-low)

	pr61 = (Math.round(p61*10000)/10000)
	pr50 = (Math.round(p50*10000)/10000)
	pr38 = (Math.round(p38*10000)/10000)

	F.retracement61.value = pr61
	F.retracement50.value = pr50
	F.retracement38.value = pr38
}

function calculate_pivotpoint() 
{
	var F = document.forms["form1"];
	var pivot,re1,re2,re3,su1,su2,su3,High,Close,Low;
	
	High = parseFloat(F.H.value);
	Low = parseFloat(F.L.value);
	Close = parseFloat(F.C.value);

	pivot = (1*High+1*Low+1*Close)/3;
	re1 = 2*pivot-Low;
	su1 = 2*pivot-High;
	re2 = pivot+(re1-su1);
	su2 = pivot-(re1-su1);
	re3 = 2*pivot + ( High - 2 * Low)
	su3 = 2*pivot - (2 * High - Low)

	F.P.value = Math.round(pivot*10000)/10000;
	F.R1.value = Math.round(re1*10000)/10000;
	F.S1.value = Math.round(su1*10000)/10000;
	F.R2.value = Math.round(re2*10000)/10000;
	F.S2.value = Math.round(su2*10000)/10000;
	F.R3.value = Math.round(re3*10000)/10000;
	F.S3.value = Math.round(su3*10000)/10000;
	return;
}