

function ShowSurfaceArea(){
	var wfHeight, wfWidth, wfQty
	var SurfaceArea
	
	wfHeight = parseFloat( document.PriceCalc.WideSize1.value );
	wfWidth = parseFloat( document.PriceCalc.WideSize2.value );
	
	wfQty = parseInt( document.PriceCalc.WideQty.value );
	
	if( isNaN( wfHeight ) || isNaN( wfWidth ) || isNaN( wfQty ) ){
		SurfaceArea = 0;
	}else{
		wfHeight = wfHeight * 0.01;
		wfWidth = wfWidth * 0.01;
		SurfaceArea = NumToString( wfHeight * wfWidth * wfQty, 4 );
	}
	document.getElementById("WideSurface").innerHTML = SurfaceArea;
}

function ShowPageSize(){
	var idSize, stringSize
	var PgDim1 = new Array(4)

	var PgDim2 = new Array(4)

	PgDim1[17] = 59.4;
	PgDim2[17] = 42;
	PgDim1[18] = 84.1;
	PgDim2[18] = 59.4;
	PgDim1[19] = 118.9;
	PgDim2[19] = 84.1;
	PgDim1[20] = 100;
	PgDim2[20] = 50;


	idSize = parseInt( document.PriceCalc.WidePageSize.value );
	stringSize = document.PriceCalc.WidePageSize.options[document.PriceCalc.WidePageSize.selectedIndex].text

	if( stringSize == "Custom" || stringSize == "Custom size" ){
		document.PriceCalc.WideSize1.readOnly = false;
		document.PriceCalc.WideSize2.readOnly = false;
		document.PriceCalc.WideSize1.style.backgroundColor = "transparent";
		document.PriceCalc.WideSize2.style.backgroundColor = "transparent";		
	}else{
		document.PriceCalc.WideSize1.readOnly = true;
		document.PriceCalc.WideSize2.readOnly = true;
		document.PriceCalc.WideSize1.style.backgroundColor = "lightblue";
		document.PriceCalc.WideSize2.style.backgroundColor = "lightblue";		

		document.PriceCalc.WideSize1.value = PgDim1[ idSize ];
		document.PriceCalc.WideSize2.value = PgDim2[ idSize ];
	}
	ShowSurfaceArea();
	quoteGenerate();
}

ShowPageSize();

