/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Jim Stiles | www.jdstiles.com */

function calc(){
  one = document.fcform2.price.value;
  two = document.fcform2.qty.value; 
  document.getElementById('total').innerHTML = "R " + (one * 1) * (two * 1) + ".00";
}

// Check that the key pressed is a digit
// Note: this method must be called from a keyDown event - keyPress event returns different event.which values.
function checkdigit(e){
	if(!e) var e = window.event;
	if(e){
		var key = e.which?e.which:e.keyCode;
		// be paranoid - if the user's browser doesn't understand this, they must still be able to type.
		if(key){
			// false if the shift key is pressed
			// In FF, navigation keys and certain shift keys return the same values
			if(e.shiftKey || ((e.modifiers & 4) == 4)) return false;
			/* check that the key is either a number (48-57) or a navigation key:
			   8 = backspace; 35 = home; 36 = end; 37 = left; 39 = right; 46 = delete */
			return ((key >= 48 && key <= 57) || (key >= 96 && key <= 105) || (key==8 || key==35 || key==36 || key==37 || key==39 || key==46));
		}
	}
	return true;
}

