<!--
function validate(chk){
  if (chk.checked == 1){
    return true;}
  else 
    {alert("You must check the 'I have read and agree to the Service Provider Agreement' checkbox to continue.");
    return false; }
}
function calculate() {
	//alert(_currency.value);
	//alert(_product.value);
	//alert(_licenseType.value);
	//alert(_quantity.value);
	//alert(_totalAmount.value);
	
	var productCost = parseProductCost();
	var quantity = _quantity.value;
	var amount = productCost * quantity;
	var productv = _product.value;
	var licrow = document.getElementById("trlicensetype");
	var agreerow = document.getElementById("trserviceagreement");
	_totalAmount.value = formatAmount(amount);
//	if(productv=="DOVICO Timesheet Online"){
//	licrow.style.display='none';
//	agreerow.style.display='';
//	}
//	else {licrow.style.display='';
//	agreerow.style.display='none'};
	
}

function parseProductCost() {
	var currency = _currency.value;
	var productIndex = getProductIndex();
	var cost = _products[1][productIndex];
	var quantity = _quantity.value;
	
	if (quantity > 99 && quantity < 1000)
		cost = (cost * .8);
    else
    if (quantity > 999)
	cost = (cost * .6);
	
	return cost;
}

function getProductIndex() {
	var productIndex = 0;
	var productName = 'DOVICO Timesheet Hosted'; // 'DOVICO Track-IT Suite';
	var licenseType = _licenseType.value;  //'additional license';
	var currency = 'usd';  //'usd';
	var productItem = productName + '|' + licenseType + '|' + currency;
	
	for (var i = 0; i < _products[0].length; i++) {
		if (_products[0][i] == productItem) {
			productIndex = i;
			break;
		}
	}	

	return productIndex;
}

function parseCurrencySymbol() {
	var currency = _currency.options[_currency.selectedIndex].innerHTML;
	var symbol = currency.substr(currency.indexOf('(') + 1, 1);
	return symbol;
}

function parseSuffix() {
	var currency = _currency.value;
	if (currency == 'usd') 
		return 'US';
	else if (currency == 'cdn')
		return 'CDN';
	
	return '';
}

function formatAmount(amount) {
	var symbol = parseCurrencySymbol();
	var suffix = parseSuffix();

	if (amount > 0)
		return symbol + formatCurrency(amount, symbol) + ' ' + suffix;
	else
		return '';
}

function formatCurrency(num) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
	num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
	cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + num + '.' + cents);
}

function numbersOnly(e, allowDecimalPoint) 
{ 
    var charCode = (e.which) ? e.which : event.keyCode;
    if (charCode == 110 && allowDecimalPoint)
        return true;
	if (charCode == 32)
		return false; 
    if (charCode > 32 && (charCode < 48 || charCode > 57))
       return false;
    return true;
}



-->