// JavaScript Document

function validateForm(frm)
{
	with(frm)
	{
		if(trim(firstName.value) == "" || trim(firstName.value) == null)
		{
			alert("-Please enter your first name.")
			firstName.focus();
			return false;
		}
		
		if(trim(email.value) == "" || trim(email.value) == null)
		{
			alert("-Please enter your email address.")
			email.focus();
			return false;
		}
		
		if(trim(message.value) == "" || trim(message.value) == null)
		{
			alert("-Please enter your comments/questions.")
			message.focus();
			return false;
		}
	}
	
}

function trim(str)
{
    if(!str || typeof str != 'string')
        return null;

    return str.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
}

function calculate()
{
	
	var prod1 = document.order.QuantityGRS-O-1.value;
    var prod2 = document.loandata.QuantityGRS-R-1.value;
	
	alert(prod1); 
	
	
	/* with(frm)
	{
		//var prod1 = parseInt(QuantityGRS-O-1.value);
		//var prod2 = parseInt(QuantityGRS-R-1.value);
		
		//var total = prod1+prod2;
		
		
		
	} */
}
