var Sum = 190; // The Initial amount  //
var Amt = 0;
var Index = 0;

//SumArray = new Array(0,190,0,0,0,0,0,0,0,0,0,0,0,0); // The prices of products that are selected by default when the page opens //
//SelectedIndexes = Array(0,0,0,0,0,0,0,1,1,1,1,1,1,1); // The selected Indexes of all Radio Buttons Starting From 0 //

function CreateModelNumber(RadioIndex, SelectedIndex)
{
	Q = document.form1.qty.selectedIndex+1;
	if(RadioIndex==1)
	{
		if(SelectedIndex==0)
		{
			Code="QLS-1";
			Sum=190;
			Amt = Sum*Q;
		}
		if(SelectedIndex==1)
		{
			Code="QLS-2";
			Sum=220;
			Amt = Sum*Q;

		}
	}
	
	document.getElementById('ModelNumber').innerHTML = Code; // Write the generated Code to the Table at the end of the page //
	document.getElementById('BasicPrice').innerHTML = Sum; // Write the Sum to the Table at the end of the page //
	document.getElementById('OrderQuantity').innerHTML = Q; // Write the Quantity to the Table at the end of the page //
	document.getElementById('OrderTotal').innerHTML = Amt; // Write the Entended Price to the Table at the end of the page //
	document.getElementById('ModelConfig').value = Code; // Set the value of hidden field 'ModelConfig' to the generated Code //
	document.forms.form1.PricePerModel.value = Sum; // Set the value of hidden field 'PricePerModel' to Price Per Model //
	document.forms.form1.hdnQuantity.value = Q; // Set the value of hidden field 'hdnQuantity' to the Quantity //
}

function calculateTotal() // This function is called when the Quantity is changed //
{
	Q = document.form1.qty.selectedIndex+1;
	Amt = Sum*Q;
	
	document.getElementById('BasicPrice').innerHTML = Sum;
	document.getElementById('OrderQuantity').innerHTML = Q;
	document.getElementById('OrderTotal').innerHTML = Amt;

	document.forms.form1.PricePerModel.value = Sum;
	document.forms.form1.hdnQuantity.value = Q;
}

window.onload = function()
{
	document.getElementById('ModelNumber').innerHTML = Code;
	document.getElementById('ModelConfig').value = Code;
	document.forms.form1.PricePerModel.value = 190;
	document.forms.form1.hdnQuantity.value = 1;
}