Event.observe( window, "load", init );

function init() { 
	if ($F("hiddenSellingPrice") != 'NotApplicable' ) {
		showHideRecalcQuotes($F("hiddenSellingPrice"));
	}
}

function showHideRecalcQuotes(sellingPrice) {
	for (i = 0; i < 3; i++){
	var currentDivID="displayPrice" + i;	
	var currentQuoteValue="quotePrice" + i;	
	var numYearProtection=0;
	
	if (document.protectionForm.protectionRadio[i].checked == true){
			document.getElementById(currentDivID).style.display="block";
			sellingPrice=parseFloat(sellingPrice) + parseFloat(document.getElementById(currentQuoteValue).value);
			document.getElementById('numYearProtection').value=document.protectionForm.protectionRadio[i].id;
		 }
	else
		{
			document.getElementById(currentDivID).style.display="none";
		}
	}	
	
	document.getElementById('totalPrice').innerHTML="&pound;"+sellingPrice.toFixed(2);
}