<!--
function getForm(sForm) {
	var nFormCount = document.forms.length;
	for (nForm=0; nForm<nFormCount; ++nForm)
		if (document.forms[nForm].name == sForm)
			return document.forms[nForm];
	return 0;
}

function getElement(objForm,sElem) {
	var nElemCount = objForm.elements.length;
	for (nElem=0; nElem<nElemCount; ++nElem)
		if (objForm.elements[nElem].name == sElem)
			return objForm.elements[nElem];
	return 0;
}

function getA(aID) {
	for (i=0;i<document.links.length;++i)
		if (document.links[i].id==aID)
			return document.links[i];
	return 0;
}

function getImage(sImg) {
	var nImgCount = document.images.length;
	for (nImg=nImgCount-1; nImg>=0; --nImg)
		if (document.images[nImg].name == sImg)
			return document.images[nImg];
	return 0;
}

function calcLicCosts(sLicType, nLicCount) {

	// Switch for license type.
	switch (sLicType)
	{
		case 'pl' : // Personal License
			var rgMultiLicPrices = [
				 { nPrice:2495, nUBound:   1 }
				,{ nPrice:1495, nUBound:   5 }
				,{ nPrice:1245, nUBound:  10 }
				,{ nPrice: 945, nUBound:  30 }
				,{ nPrice: 745, nUBound:  75 }
				,{ nPrice: 645, nUBound: 125 }
				,{ nPrice: 499, nUBound:1000 }
			];
			break;

		case 'fl' : // Family License
			var rgMultiLicPrices = [
				 { nPrice:4495, nUBound:  1 }
			];
			break;

		case 'bl' : // Business License
			var rgMultiLicPrices = [
				 { nPrice:3345, nUBound:   1 }
				,{ nPrice:1850, nUBound:  10 }
				,{ nPrice:1350, nUBound:  30 }
				,{ nPrice:1000, nUBound:  75 }
				,{ nPrice: 850, nUBound: 125 }
				,{ nPrice: 650, nUBound:1000 }
			];
			break;

		case 'fbl': // Family + Business License
			var rgMultiLicPrices = [
				 { nPrice:5995, nUBound:  1 }
			];
			break;

		case 'sl' : // Site License
			var rgMultiLicPrices = [
				 { nPrice:   0, nUBound:  1 }
			];
			break;

		default:
			alert('Invalid license type selection!');
			break;
	}

	// Determine whether only a single license purchase is allowed.
	this.bSingleLic = (rgMultiLicPrices.length==1 && rgMultiLicPrices[0].nUBound==1);
	if (this.bSingleLic)
		nLicCount=1;

	// Calculate cost for multiple licenses.
	this.nCosts=0;
	var nRange=0;
	do {
		if (nLicCount <= rgMultiLicPrices[nRange].nUBound) {
			this.nCosts += rgMultiLicPrices[nRange].nPrice * (nLicCount-(nRange ? rgMultiLicPrices[nRange-1].nUBound : 0));
			break;
		}
		else {
			this.nCosts += rgMultiLicPrices[nRange].nPrice * (rgMultiLicPrices[nRange].nUBound-(nRange ? rgMultiLicPrices[nRange-1].nUBound : 0));
			nRange++;
		}
	} while(nRange < rgMultiLicPrices.length);

	// FAIL if license count is out of defined range.
	if (nRange >= rgMultiLicPrices.length)
		this.nCosts=0;

	// Calculate discount percentage.
	this.nDiscountPerc = Math.floor(100 - (this.nCosts * 100 / (rgMultiLicPrices[0].nPrice * nLicCount)));
}

function formatLicCosts(nCosts) {
		var sLicCosts=nCosts+"";
		while (sLicCosts.length<3) sLicCosts="0"+sLicCosts;
		return sLicCosts.substr(0,sLicCosts.length-2) + "." + sLicCosts.substr(sLicCosts.length-2,2);
}

//-->