<!--
/*********************************************************
*	Validation
*/

// test for empty string...
function isEmpty( str ) {
	strRE = /^[\s ]*$/gi;
	return strRE.test( str.value );
}

// test for valid numbers - test for format "nn.nn" ...
function notValidNum( str ) {
	numRE = /^[0-9]{1,2}[\.]*[0-9]{0,2}$/gi;
	if ((numRE.test( str.value ))==true)  return false;
	if ((numRE.test( str.value ))==false) return true;
}

// function to show/hide extra step related questions...
function stepCheck(stepSelect) {
	// if customer chose 'Yes', they have a step...
	if (stepSelect.selectedIndex == 1) {
		document.getElementById('stepExtraQuestions').style.display = 'block';
	// if customer chose 'No', they don't have a step...
	} else {
		document.getElementById('stepExtraQuestions').style.display = 'none';
		// reset width and length to 0.00 each, just in case they changed them...
		stepSelect.form.stepWidthA1.value = '0.00';
		stepSelect.form.stepLengthB1.value = '0.00';
	}
}

// function to unhide blanket prices options if pool sizes validate ok...
function showBlanketPrices(form) {
	document.getElementById('blanketSeries').style.display = 'block';
}

// function to validate pool sizes entered...
function validateForm(form) {
	var errors = "";
	var errNo = 1;
	var errField = '';
	
	// if no pool width entered or pool width is still "0.00" or pool width is not in format "nn.nn"...
	if ( isEmpty(form.poolWidthA) || form.poolWidthA.value == '0.00' || notValidNum(form.poolWidthA) ) {
		errors += "\n" + errNo + ". Either you did not enter a pool width or the pool width you entered is not valid. \n     Please enter the pool width in metres with a maximum of 2 decimal places. \n     E.g. 4 metres would be 4.00";
		errNo ++;
		if (errField == '') {
			errField = 'poolWidthA';
		}
	}

	// if no pool length entered or pool length is still "0.00" or pool length is not in format "nn.nn"...
	if ( isEmpty(form.poolLengthB) || form.poolLengthB.value == '0.00' || notValidNum(form.poolLengthB) ) {
		errors += "\n" + errNo + ". Either you did not enter a pool length or the pool length you entered is not valid. \n     Please enter the pool length in metres with a maximum of 2 decimal places. \n     E.g. 15 metres would be 15.00";
		errNo ++;
		if (errField == '') {
			errField = 'poolLengthB';
		}
	}
		
	// if pool is over maximum accepted length or width...
	var widthFloat = parseFloat(form.poolWidthA.value);
	var lengthFloat = parseFloat(form.poolLengthB.value);
	if ( widthFloat > 6.7 || lengthFloat > 20 ) {
		errors += "\n" + errNo + ". Your pool is larger than a normal domestic pool (Max width is 6.70m, max length is 20.00m).     \n     Please check that you have entered your pool dimensions correctly. \n     If they are correct, please contact Daisy Pool Covers for details of the range \n     of Solar Pool Blanket and Roller options we can offer you.";
		errNo ++;
		if (errField == '') {
			errField = 'poolWidthA';
		}
	}

	// if pool is above ground, maximum accepted length or width is smaller - recheck for this...
	var aboveWidthFloat = parseFloat(form.poolWidthA.value);
	var aboveLengthFloat = parseFloat(form.poolLengthB.value);
	if ( form.aboveGround.value == 'yes' && (widthFloat > 6.1 || lengthFloat > 12) ) {
		errors += "\n" + errNo + ". Your pool is larger than the maximum size for above ground pools that our rollers will fit.\n     (Max width is 6.10m, max length is 12.00m). \n     Please check that you have entered your pool dimensions correctly. \n     If they are correct, please contact Daisy Pool Covers for details of the range \n     of Solar Pool Blanket and Roller options we can offer you.";
		errNo ++;
		if (errField == '') {
			errField = 'poolWidthA';
		}
	}
	
	// if customer indicated their pool has a step, check step sizes entered...
	if (form.hasStep.selectedIndex == 1) {
		// if no step width entered or step width is still "0.00" or step width is not in format "nn.nn"...
		if ( isEmpty(form.stepWidthA1) || form.stepWidthA1.value == '0.00' || notValidNum(form.stepWidthA1) ) {
			errors += "\n" + errNo + ". Either you did not enter a step width or the step width you entered is not valid. \n     Please enter the step width in metres with a maximum of 2 decimal places. \n     E.g. 1 metre would be 1.00";
			errNo ++;
			if (errField == '') {
				errField = 'stepWidthA1';
			}
		}
			
		// if no step length entered or step length is still "0.00" or step length is not in format "nn.nn"...
		if ( isEmpty(form.stepLengthB1) || form.stepLengthB1.value == '0.00' || notValidNum(form.stepLengthB1) ) {
			errors += "\n" + errNo + ". Either you did not enter a step length or the step length you entered is not valid. \n     Please enter the step length in metres with a maximum of 2 decimal places. \n     E.g. 2 metres would be 2.00";
			errNo ++;
			if (errField == '') {
				errField = 'stepLengthB1';
			}
		}
	}
	
	// check if there were any errors and show error message in //alert box if applicable...
	if (errors != "") {
		errors += "\n\nPlease make these changes now.";
		alert(errors);
		return eval('form.' + errField + '.focus()');
	// if no errors, calculate the blanket prices...
	} else {
		calculateBlanketPrice(form);
	}
}




/*************************************************************
* Processing
*/

function calculateBlanketPrice(form) {

	// get pool width and pool length supplied in form...
	var poolWidth = parseFloat(form.poolWidthA.value);
	var poolLength = parseFloat(form.poolLengthB.value);
	
	//alert( "You entered Width: " + poolWidth + "\nLength: " + poolLength );
	
	// round up inputs
	poolWidth=Math.ceil(poolWidth * 10) / 10;
	poolLength=Math.ceil(poolLength * 10) / 10
	//alert( "Rounded up pool width: " + poolWidth + "\nLength: " + poolLength );
	
	// set padding amounts to use...
	var widthExt = 0.15;
	var lengthExt = 0.3;
	var rollerWidthExt = 0.0;
	// set standard panel width...
	var panelWidth = 1.27;

	/*
	//alert( "width padding = 0.15;\n"
		+ "length padding = 0.3;\n"
		+	"rollerWidth padding = 0.0;\n"
		+ "standard panel width = 1.27;");
	*/
	
	// add padding to pool inputs
	poolWidth=poolWidth+widthExt;
	poolLength=poolLength+lengthExt;
	//alert( "Padded pool width: " + poolWidth + "\nLength: " + poolLength );

	// add appropriate padding to width, then divide it to see how many panels are required:
	var calcWidth = poolWidth / panelWidth;
	var rollerWidth = poolWidth + rollerWidthExt;
	/*
	//alert( "padded width / standard panel width = " + calcWidth 
		+ "\n" + poolWidth + "/" + panelWidth + " = " + calcWidth
	);
	*/
	
	// make variable to hold value of rounded up panel width...
	var finalPanelWidth = 0;

	// add appropriate padding to length...
	//var finalPanelLength = (poolLength + lengthExt); //already done earlier
	var finalPanelLength = poolLength;

	// variables to hold blanket prices...
	var s3_blanketPrice = 0;
	var s4_blanketPrice = 0;
	var s5_blanketPrice = 0;
	var s8_blanketPrice = 0;

	// variable to hold final calculation of lineal metres of blanket required...
	var linealMetres = 0;
	
	if ( calcWidth <= 2 ) {
		finalPanelWidth = 2;
	} else if ( calcWidth > 2 && calcWidth <= 2.33 ) {
		finalPanelWidth = 2.33;
	} else if ( calcWidth > 2.33 && calcWidth <= 2.5 ) {
		finalPanelWidth = 2.5;
	} else if ( calcWidth > 2.5 && calcWidth <= 2.66 ) {
		finalPanelWidth = 2.66;
	} else if ( calcWidth > 2.66 && calcWidth <= 3 ) {
		finalPanelWidth = 3;
	} else if ( calcWidth > 3 && calcWidth <= 3.33 ) {
		finalPanelWidth = 3.33;
	} else if ( calcWidth > 3.33 && calcWidth <= 3.5 ) {
		finalPanelWidth = 3.5;
	} else if ( calcWidth > 3.5 && calcWidth <= 3.66 ) {
		finalPanelWidth = 3.66;
	} else if ( calcWidth > 3.66 && calcWidth <= 4 ) {
		finalPanelWidth = 4;
	} else if ( calcWidth > 4 && calcWidth <= 4.33 ) {
		finalPanelWidth = 4.33;
	} else if ( calcWidth > 4.33 && calcWidth <= 4.5 ) {
		finalPanelWidth = 4.5;
	} else if ( calcWidth > 4.5 && calcWidth <= 4.66 ) {
		finalPanelWidth = 4.66;
	} else if ( calcWidth > 4.66 && calcWidth <= 5 ) {
		finalPanelWidth = 5;
	} else if ( calcWidth > 5 && calcWidth <= 5.33 ) {
		finalPanelWidth = 5.33;
	} else if ( calcWidth > 5.33 && calcWidth <= 5.5 ) {
		finalPanelWidth = 5.5;
	} else if ( calcWidth > 5.5 && calcWidth <= 5.66 ) {
		finalPanelWidth = 5.66;
	} else if ( calcWidth > 5.66 && calcWidth <= 6 ) {
		finalPanelWidth = 6;
	}
	finalPanelWidth = (poolWidth == 2.40) ? 2 : finalPanelWidth;
	
	//alert('Width (after custom filtering) = ' + finalPanelWidth	+ '\nLength = ' + finalPanelLength);

	//calc lineal meters
	linealMeters = (finalPanelWidth * finalPanelLength);
	//alert('lineal meters = ' + linealMeters);
	
	if(form.stepWidthA1.value > 0){
		// get step width and step length supplied in form, then work out lineal metres for step...
		var stepWidth = parseFloat(form.stepWidthA1.value);
		var stepLength = parseFloat(form.stepLengthB1.value);
		
		// round up inputs
		stepWidth=Math.ceil(stepWidth * 10) / 10;
		stepLength=Math.ceil(stepLength * 10) / 10
		//alert( "Rounded up step width: " + stepWidth + "\nLength: " + stepLength );
		
		//Divide step width by panel width (1.27m)
		stepWidth = stepWidth/panelWidth;
		//alert("Step width / Panel Width = " + stepWidth);
	
			// do some custom rounding up
			stepWidth=Math.ceil(stepWidth * 100) / 100;
			//alert("Step width = "+ stepWidth);
				
			foobar=stepWidth.toString();
			//alert("step width = " + foobar);
				
			foo=foobar.substr(0,foobar.lastIndexOf('.'));
			////alert("foo = " + foo);
			
			bar=foobar.substr(foobar.lastIndexOf('.')+1,2);
			////alert("bar = " + bar);
			
			if(bar>00 && bar<33){
				foobar=foo+'.33';
			}else if(bar<50){
				foobar=foo+'.50';
			}else if(bar<66){
				foobar=foo+'.66';
			}else{
				foobar=(foo * 1) + 1;
			}
			stepWidth = foobar.toString();
	
		//alert("Custom-rounded up step width = " + stepWidth);	
		
		stepLength += 0.3;
		//alert( "step length + 0.3 = " + stepLength );
		
		var stepLinealMetres = stepWidth * stepLength;
		
		/*
		alert( "step width = " + stepWidth
			+ "\nstep length = " + stepLength
			+ "\nstep lineal metres (step width * step length) = " + stepLinealMetres
		);
		*/
		
	// calculate blanket prices...
	linealMeters = linealMeters + stepLinealMetres;
	}else{
		var stepLinealMetres=0;
	}
	
	/*
	alert ('Lineal Meters + step lineal metres = ' + linealMeters
		+ "\n(" + finalPanelWidth + " * " + finalPanelLength + ")" + " + " + stepLinealMetres + " = " + linealMeters
	);
	*/
	
	s3_blanketPrice = linealMeters * 9.70;
	s4_blanketPrice = linealMeters * 12.10;
	s5_blanketPrice = linealMeters * 14.40;
	s8_blanketPrice = linealMeters * 16.90;
	
	s3_blanketPrice = (s3_blanketPrice < 52) ? 52 : s3_blanketPrice;
	s4_blanketPrice = (s4_blanketPrice < 65) ? 65 : s4_blanketPrice;
	s5_blanketPrice = (s5_blanketPrice < 78) ? 78 : s5_blanketPrice;
	s8_blanketPrice = (s8_blanketPrice < 91) ? 91 : s8_blanketPrice;

	// insert blanket prices into form...
	form.series3Price.value = s3_blanketPrice.toFixed(2);
	form.series4Price.value = s4_blanketPrice.toFixed(2);
	form.series5Price.value = s5_blanketPrice.toFixed(2);
	form.series8Price.value = s8_blanketPrice.toFixed(2);

	// display blanket prices...
	showBlanketPrices(form);
	
	// call showRollers() to work out which rollers to display...
	showRollers(form,rollerWidth,poolLength);
}

// function hideRollers to unset and hide any previous rollers chosen...
function doReset(form) {
	
	// make sure no blankets are already chosen from any previous calculations...
	for (a=0; a<form.blanket.length; a++) {
		form.blanket[a].checked = false;
	}
	
	// make sure no rollers options are already chosen from any previous calculations...
	for (b=0; b<form.blanket.length; b++) {
		form.roller[b].checked = false;
	}	// also hide any roller divs already in view...
	var rollerArray = new Array();
	var i = 0;
	

	// Updated by Shane <shane@bam.com.au>, 27 June 2005; and Adam (@bam.com.au), 20 July 2006.
	rollerArray[i] = 'No Roller is Required - $0'; i++;
	rollerArray[i] = 'Buddy Roller ($225) - Also requires Buddy Above Ground Kit ($109) - $334'; i++;
	rollerArray[i] = 'UTC 75 ($371) - Also requires UTC Above Ground Kit ($109) - $480'; i++;
	rollerArray[i] = 'UTC 100 ($443) - Also requires UTC Above Ground Kit ($109) - $552'; i++;
	rollerArray[i] = 'Buddy Roller - $225'; i++;
	rollerArray[i] = 'UTC 75 - $371'; i++;
	rollerArray[i] = 'UTC 100 - $443'; i++;
	rollerArray[i] = '5 Star 40 ST (Stationary) - $504'; i++;
	rollerArray[i] = '5 Star 40 LP (Low Profile) - $573'; i++;
	// Added by Adam <adam@bam.com.au>, 20 July 2006.
	rollerArray[i] = '5 Star 40 AGA - $784'; i++;
	rollerArray[i] = '5 Star 43 AGA - $784'; i++;
	rollerArray[i] = '5 Star 46 AGA - $784'; i++;
	rollerArray[i] = '5 Star 49 AGA - $784'; i++;
	rollerArray[i] = '5 Star 52 AGA - $784'; i++;
	rollerArray[i] = '5 Star 55 AGA - $829'; i++;
	rollerArray[i] = '5 Star 58 AGA - $829'; i++;
	rollerArray[i] = '5 Star 61 AGA - $829'; i++;
	rollerArray[i] = '5 Star 64 AGA - $829'; i++;
	//
	rollerArray[i] = '5 Star 40101MKII (Directional Mobile) - $524'; i++;
	rollerArray[i] = '5 Star 40 FM (Fully Mobile) - $588'; i++;
	rollerArray[i] = '5 Star 40125 ST (Stationary) - $727'; i++;
	rollerArray[i] = '5 Star 40125 FM (Fully Mobile) - $752'; i++;
	rollerArray[i] = '5 Star 40MAXI - $1221'; i++;
	rollerArray[i] = '5 Star 43 ST (Stationary) - $504'; i++;
	rollerArray[i] = '5 Star 43101 MKII (Directional Mobile) - $524'; i++;
	rollerArray[i] = '5 Star 43 LP (Low Profile) - $573'; i++;
	rollerArray[i] = '5 Star 43 FM (Fully Mobile) - $588'; i++;
	rollerArray[i] = '5 Star 43125 ST (Stationary) - $727'; i++;
	rollerArray[i] = '5 Star 43125 FM (Fully Mobile) - $752'; i++;
	rollerArray[i] = '5 Star 43 MAXI - $1221'; i++;
	rollerArray[i] = '5 Star 46 ST (Stationary) - $504'; i++;
	rollerArray[i] = '5 Star 46101 MKII (Directional Mobile) - $524'; i++;
	rollerArray[i] = '5 Star 46 LP (Low Profile) - $573'; i++;
	rollerArray[i] = '5 Star 46 FM (Fully Mobile) - $588'; i++;
	rollerArray[i] = '5 Star 46125 ST (Stationary) - $727'; i++;
	rollerArray[i] = '5 Star 46125 FM (Fully Mobile) - $752'; i++;
	rollerArray[i] = '5 Star 46 MAXI - $1221'; i++;
	rollerArray[i] = '5 Star 49 ST (Stationary) - $504'; i++;
	rollerArray[i] = '5 Star 49101 MKII (Directional Mobile) - $524'; i++;
	rollerArray[i] = '5 Star 49 LP (Low Profile) - $573'; i++;
	rollerArray[i] = '5 Star 49 FM (Fully Mobile) - $588'; i++;
	rollerArray[i] = '5 Star 49125 ST (Stationary) - $752'; i++;
	rollerArray[i] = '5 Star 49125 FM (Fully Mobile) - $752'; i++;
	rollerArray[i] = '5 Star 49 MAXI - $1221'; i++;
	rollerArray[i] = '5 Star 52 ST (Stationary) - $504'; i++;
	rollerArray[i] = '5 Star 52101 MKII (Directional Mobile) - $524'; i++;
	rollerArray[i] = '5 Star 52 LP (Low Profile) - $573'; i++;
	rollerArray[i] = '5 Star 52 FM (Fully Mobile) - $588'; i++;
	rollerArray[i] = '5 Star 52125 ST (Stationary) - $727'; i++;
	rollerArray[i] = '5 Star 52125 FM (Fully Mobile) - $752'; i++;
	rollerArray[i] = '5 Star 52 MAXI - $1221'; i++;
	rollerArray[i] = '5 Star 55 ST (Stationary) - $550'; i++;
	rollerArray[i] = '5 Star 55101 MKII (Directional Mobile) - $569'; i++;
	rollerArray[i] = '5 Star 55 LP (Low Profile) - $618'; i++;
	rollerArray[i] = '5 Star 55 FM (Fully Mobile) - $635'; i++;
	rollerArray[i] = '5 Star 55125 ST (Stationary) - $807'; i++;
	rollerArray[i] = '5 Star 55125 FM (Fully Mobile) - $832'; i++;
	rollerArray[i] = '5 Star 55 MAXI - $1301'; i++;
	rollerArray[i] = '5 Star 58 ST (Stationary) - $550'; i++;
	rollerArray[i] = '5 Star 58101 MKII (Directional Mobile) - $569'; i++;
	rollerArray[i] = '5 Star 58 LP (Low Profile) - $618'; i++;
	rollerArray[i] = '5 Star 58 FM (Fully Mobile) - $635'; i++;
	rollerArray[i] = '5 Star 58125 ST (Stationary) - $807'; i++;
	rollerArray[i] = '5 Star 58125 FM (Fully Mobile) - $832'; i++;
	rollerArray[i] = '5 Star 58 MAXI - $1301'; i++;
	rollerArray[i] = '5 Star 61 ST (Stationary) - $550'; i++;
	rollerArray[i] = '5 Star 61101 MKII (Directional Mobile) - $569'; i++;
	rollerArray[i] = '5 Star 61 LP (Low Profile) - $618'; i++;
	rollerArray[i] = '5 Star 61 FM (Fully Mobile) - $635'; i++;
	rollerArray[i] = '5 Star 61125 ST (Stationary) - $807'; i++;
	rollerArray[i] = '5 Star 61125 FM (Fully Mobile) - $832'; i++;
	rollerArray[i] = '5 Star 61 MAXI - $1301'; i++;
	rollerArray[i] = '5 Star 64 ST (Stationary) - $550'; i++;
	rollerArray[i] = '5 Star 64101 MKII (Directional Mobile) - $569'; i++;
	rollerArray[i] = '5 Star 64 LP (Low Profile) - $618'; i++;
	rollerArray[i] = '5 Star 64 FM (Fully Mobile) - $635'; i++;
	rollerArray[i] = '5 Star 64125 ST (Stationary) - $807'; i++;
	rollerArray[i] = '5 Star 64125 FM (Fully Mobile) - $832'; i++;
	rollerArray[i] = '5 Star 64 MAXI - $1301'; i++;
	rollerArray[i] = '5 Star 67125 ST (Stationary) - $839'; i++;
	rollerArray[i] = '5 Star 67125 FM (Fully Mobile) - $864'; i++;
	rollerArray[i] = '5 Star 67 MAXI - $1333'; i++;
	rollerArray[i] = '5 Star 70125 ST (Stationary) - $839'; i++;
	rollerArray[i] = '5 Star 70125 FM (Fully Mobile) - $864'; i++;
	rollerArray[i] = '5 Star 70 MAXI - $1333'; i++;
	// Added by Adam <adam@bam.com.au>, 20 July 2006.
	rollerArray[i] = '5 Star A75 34A75 (stationary) - $422'; i++;
	rollerArray[i] = '5 Star A75 37A75 (stationary) - $422'; i++;
	rollerArray[i] = '5 Star A75 40A75 (stationary) - $422'; i++;
	rollerArray[i] = '5 Star A75 43A75 (stationary) - $422'; i++;
	rollerArray[i] = '5 Star A75 46A75 (stationary) - $422'; i++;
	//
	
	for (r=0; r<rollerArray.length; r++) {
		if (!document.getElementById(rollerArray[r])) 
		{
			//alert('/!\ ' + rollerArray[r]);
		}
		else
		{
			document.getElementById(rollerArray[r]).style.display = 'none';
		}
	}
	
	// make sure no freight options are already chosen from any previous calculations...
	for (c=0; c<form.freight.length; c++) {
		form.freight[c].checked = false;
	}

	// make sure no total costs are still left from any previous calculations...
	form.blanketChosen.value = '';
	form.blanketCost.value = '';
	form.rollerChosen.value = '';
	form.rollerCost.value = '';
	form.deliveryCost.value = '';
	form.totalCost.value = '';
	
	//return true;
}

// function to work out which rollers to unhide...
function showRollers(form,bWidth,bLength) {
	
	// call doReset() to firstly unset and hide any previous blanket/rollers/freight chosen...
	doReset(form);
	
	var rollerArray = new Array();
	var i = 0;

	// show 'none required' option always...
	rollerArray[i] = 'No_Roller_is_Required____0'; i++;
		
	// ------------------------------------------------------------------------------------------------------------------
	// ABOVE GROUND
	// ------------------------------------------------------------------------------------------------------------------
	// if pool is above ground (we've already checked it's within sizes range)...
	if ( form.aboveGround.value == 'yes') {
		// show buddy rollers for all blankets up to a maximum size of 3.6m wide x 7.3m long...
		if (bWidth <= 3.6 && bLength <= 7.3 ) {
			rollerArray[i] = 'Buddy_Roller___225____Also_requires_Buddy_Above_Ground_Kit___109_____334'; i++;
		}

		// show utc 75 rollers for all blankets up to a maximum size of 4.5m wide x 10m long...
		if (bWidth <= 4.5 && bLength <= 10 ) {
			rollerArray[i] = 'UTC_75___371____Also_requires_UTC_Above_Ground_Kit___109_____480'; i++;
		}

		// show utc 100 rollers for all blankets up to a maximum size of 6.1m wide x 12m long...
		if (bWidth <= 6.1 && bLength <= 12 ) {
			rollerArray[i] = 'UTC_100___443____Also_requires_UTC_Above_Ground_Kit___109_____552'; i++;
		}
		
		// show rollers for pool size: >3.71m and <=18m long...
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( bWidth < 3.7 && bLength <= 18 ) {
			rollerArray[i] = 'i5_Star_40_AGA____784'; i++;
		}

		// show rollers for pool size: >3.71m - <=4m wide and <=18m long...
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( (bWidth > 3.71 && bWidth <= 4) && bLength <= 18 ) {
			rollerArray[i] = 'i5_Star_43_AGA____784'; i++;
		}

		// show rollers for pool size: >4.1m - <=4.3m wide and <=18m long?
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( (bWidth > 4.1 && bWidth <= 4.3) && bLength <= 18 ) {
			rollerArray[i] = 'i5_Star_46_AGA____784'; i++;
		}

		// show rollers for pool size: >4.31m - <=4.6m wide and <=18m long?
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( (bWidth > 4.31 && bWidth <= 4.6) && bLength <= 18 ) {
			rollerArray[i] = 'i5_Star_49_AGA____784'; i++;
		}

		// show rollers for pool size: >4.61m - <=4.9m wide and <=18m long?
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( (bWidth > 4.61 && bWidth <= 4.9) && bLength <= 18 ) {
			rollerArray[i] = 'i5_Star_52_AGA____784'; i++;
		}

		// show rollers for pool size: >4.91m - <=5.2m wide and <=14m long?
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( (bWidth > 4.91 && bWidth <= 5.2) && bLength <= 14 ) {
			rollerArray[i] = 'i5_Star_55_AGA____829'; i++;
		}

		// show rollers for pool size: >5.21m - <=5.5m wide and <=14m long?
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( (bWidth > 5.21 && bWidth <= 5.5) && bLength <= 14 ) {
			rollerArray[i] = 'i5_Star_58_AGA____829'; i++;
		}

		// show rollers for pool size: >5.51m - <=5.8m wide and <=14m long?
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( (bWidth > 5.51 && bWidth <= 5.8) && bLength <= 14 ) {
			rollerArray[i] = 'i5_Star_61_AGA____829'; i++;
		}

		// show rollers for pool size: >5.81m - <=6.1m wide and <=14m long?
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( (bWidth > 5.81 && bWidth <= 6.1) && bLength <= 14 ) {
			rollerArray[i] = 'i5_Star_64_AGA____829'; i++;
		}
	}

	// ------------------------------------------------------------------------------------------------------------------
	// BELOW GROUND
	// ------------------------------------------------------------------------------------------------------------------
	// if pool is below ground (we've already checked it's within sizes range)...
	if ( form.aboveGround.value == 'no') {

		// ------------------------------------------------------------------------------------------------------------------
		// show buddy rollers for all blankets up to a maximum size of 3.6m wide x 7.3m long...
		if (bWidth <= 3.6 && bLength <= 7.3 ) {
			rollerArray[i] = 'Buddy_Roller____225'; i++;
		}

		// ------------------------------------------------------------------------------------------------------------------
		// show utc 75 rollers for all blankets up to a maximum size of 4.5m wide x 10m long...
		if (bWidth <= 4.5 && bLength <= 10 ) {
			rollerArray[i] = 'UTC_75____371'; i++;
		}

		// ------------------------------------------------------------------------------------------------------------------
		// show utc 100 rollers for all blankets up to a maximum size of 6.1m wide x 12m long...
		if (bWidth <= 6.1 && bLength <= 12 ) {
			rollerArray[i] = 'UTC_100____443'; i++;
		}
		
		// ------------------------------------------------------------------------------------------------------------------
		// show rollers for pool size: <=3.1m wide and <=8m long?
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if (bWidth <= 3.1 && bLength <= 8 ) {
			rollerArray[i] = 'i5_Star_A75_34A75__stationary_____422'; i++;
		}
	
		// show rollers for pool size: <=3.7m wide and <=15m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if (bWidth <= 3.7 && bLength <= 15 ) {
			rollerArray[i] = 'i5_Star_40_ST__Stationary_____504'; i++;
			rollerArray[i] = 'i5_Star_40_LP__Low_Profile_____573'; i++;
			rollerArray[i] = 'i5_Star_40101MKII__Directional_Mobile_____524'; i++;
			rollerArray[i] = 'i5_Star_40_FM__Fully_Mobile_____588'; i++;
			rollerArray[i] = 'i5_Star_40125_ST__Stationary_____727'; i++;
			rollerArray[i] = 'i5_Star_40125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_40MAXI____1221'; i++;
		}

		// show rollers for pool size: <=3.7m wide and >15m - <=18m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if (bWidth <= 3.7 && (bLength > 15 && bLength <= 18) ) {
			rollerArray[i] = 'i5_Star_40_ST__Stationary_____504'; i++;
			rollerArray[i] = 'i5_Star_40101MKII__Directional_Mobile_____524'; i++;
			rollerArray[i] = 'i5_Star_40_FM__Fully_Mobile_____588'; i++;
			rollerArray[i] = 'i5_Star_40125_ST__Stationary_____727'; i++;
			rollerArray[i] = 'i5_Star_40125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_40MAXI____1221'; i++;
		}

		// show rollers for pool size: <=3.7m wide and >18m - <=20m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if (bWidth <= 3.7 && (bLength > 18 && bLength <= 20) ) {
			rollerArray[i] = 'i5_Star_40125_ST__Stationary_____727'; i++;
			rollerArray[i] = 'i5_Star_40125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_40MAXI____1221'; i++;
		}

		// ------------------------------------------------------------------------------------------------------------------
		// show rollers for pool size: >3.11m - <=3.4m wide and <=8m long?
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( (bWidth > 3.11 && bWidth <= 3.4) && bLength <= 8 ) {
			rollerArray[i] = 'i5_Star_A75_37A75__Stationary_____422'; i++;
		}

		// show rollers for pool size: >3.41m - <=3.7m wide and <=8m long?
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( (bWidth > 3.41 && bWidth <= 3.7) && bLength <= 8 ) {
			rollerArray[i] = 'i5_Star_A75_40A75__Stationary_____422'; i++;
		}

		// show rollers for pool size: >3.71m - <=4m wide and <=8m long?
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( (bWidth > 3.71 && bWidth <= 4) && bLength <= 8 ) {
			rollerArray[i] = 'i5_Star_A75_43A75__Stationary_____422'; i++;
		}

		// show rollers for pool size: >=4.1m - <=4.3m wide and <=8m long?
		// Updated 20 July 2006 by Adam <adam@bam.com.au>
		if ( (bWidth >= 4.1 && bWidth <= 4.3) && bLength <= 8 ) {
			rollerArray[i] = 'i5_Star_A75_46A75__Stationary_____422'; i++;
		}

		// show rollers for pool size: >3.7m - <=4m wide and <=15m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 3.7 && bWidth <= 4) && bLength <= 15 ) {
			rollerArray[i] = 'i5_Star_43_ST__Stationary_____504'; i++;
			rollerArray[i] = 'i5_Star_43101_MKII__Directional_Mobile_____524'; i++;
			rollerArray[i] = 'i5_Star_43_LP__Low_Profile_____573'; i++;	
			rollerArray[i] = 'i5_Star_43_FM__Fully_Mobile_____588'; i++;
			rollerArray[i] = 'i5_Star_43125_ST__Stationary_____727'; i++;
			rollerArray[i] = 'i5_Star_43125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_43_MAXI____1221'; i++;
		}
		
		// show rollers for pool size: >3.7m - <=4m wide and >15m - <=18m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 3.7 && bWidth <= 4) && (bLength > 15 && bLength <= 18) ) {
			rollerArray[i] = 'i5_Star_43_ST__Stationary_____504'; i++;
			rollerArray[i] = 'i5_Star_43101_MKII__Directional_Mobile_____524'; i++;
			rollerArray[i] = 'i5_Star_43_FM__Fully_Mobile_____588'; i++;
			rollerArray[i] = 'i5_Star_43125_ST__Stationary_____727'; i++;
			rollerArray[i] = 'i5_Star_43125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_43_MAXI____1221'; i++;
		}

		// show rollers for pool size: >3.7m - <=4m wide and >18m - <=20m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 3.7 && bWidth <= 4) && (bLength > 18 && bLength <= 20) ) {
			rollerArray[i] = 'i5_Star_43125_ST__Stationary_____727'; i++;
			rollerArray[i] = 'i5_Star_43125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_43_MAXI____1221'; i++;
		}

		// ------------------------------------------------------------------------------------------------------------------
		// show rollers for pool size: >4m - <=4.3m wide and <=15m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 4 && bWidth <= 4.3) && bLength <= 15 ) {
			rollerArray[i] = 'i5_Star_46_ST__Stationary_____504'; i++;
			rollerArray[i] = 'i5_Star_46101_MKII__Directional_Mobile_____524'; i++;
			rollerArray[i] = 'i5_Star_46_LP__Low_Profile_____573'; i++;	
			rollerArray[i] = 'i5_Star_46_FM__Fully_Mobile_____588'; i++;
			rollerArray[i] = 'i5_Star_46125_ST__Stationary_____727'; i++;
			rollerArray[i] = 'i5_Star_46125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_46_MAXI____1221'; i++;
		}

		// show rollers for pool size: >4m - <=4.3m wide and >15m - <=18m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 4 && bWidth <= 4.3) && (bLength > 15 && bLength <= 18) ) {
			rollerArray[i] = 'i5_Star_46_ST__Stationary_____504'; i++;
			rollerArray[i] = 'i5_Star_46101_MKII__Directional_Mobile_____524'; i++;
			rollerArray[i] = 'i5_Star_46_FM__Fully_Mobile_____588'; i++;
			rollerArray[i] = 'i5_Star_46125_ST__Stationary_____727'; i++;
			rollerArray[i] = 'i5_Star_46125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_46 MAXI____1221'; i++;
		}

		// show rollers for pool size: >4m - <=4.3m wide and >18m - <=20m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 4 && bWidth <= 4.3) && (bLength > 18 && bLength <= 20) ) {
			rollerArray[i] = 'i5_Star_46125_ST__Stationary_____727'; i++;
			rollerArray[i] = 'i5_Star_46125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_46_MAXI____1221'; i++;
		}

		// ------------------------------------------------------------------------------------------------------------------
		// show rollers for pool size: >4.3m - <=4.6m wide and <=15m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 4.3 && bWidth <= 4.6) && bLength <= 15 ) {
			rollerArray[i] = 'i5_Star_49_ST__Stationary_____504'; i++;
			rollerArray[i] = 'i5_Star_49101_MKII__Directional_Mobile_____524'; i++;
			rollerArray[i] = 'i5_Star_49_LP__Low_Profile_____573'; i++;
			rollerArray[i] = 'i5_Star_49_FM__Fully_Mobile_____588'; i++;
			rollerArray[i] = 'i5_Star_49125_ST__Stationary_____752'; i++;
			rollerArray[i] = 'i5_Star_49125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_49_MAXI____1221'; i++;
		}

		// show rollers for pool size: >4.3m - <=4.6m wide and >15m - <=18m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 4.3 && bWidth <= 4.6) && (bLength > 15 && bLength <= 18) ) {
			rollerArray[i] = 'i5_Star_49_ST__Stationary_____504'; i++;
			rollerArray[i] = 'i5_Star_49101_MKII__Directional_Mobile_____524'; i++;
			rollerArray[i] = 'i5_Star_49_FM__Fully_Mobile_____588'; i++;
			rollerArray[i] = 'i5_Star_49125_ST__Stationary_____752'; i++;
			rollerArray[i] = 'i5_Star_49125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_49_MAXI____1221'; i++;
		}

		// show rollers for pool size: >4.3m - <=4.6m wide and >18m - <=20m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 4.3 && bWidth <= 4.6) && (bLength > 18 && bLength <= 20) ) {
			rollerArray[i] = 'i5_Star_49125_ST__Stationary_____752'; i++;
			rollerArray[i] = 'i5_Star_49125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_49_MAXI____1221'; i++;
		}

		// ------------------------------------------------------------------------------------------------------------------
		// show rollers for pool size: >4.6m - <=4.9m wide and <=15m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 4.6 && bWidth <= 4.9) && bLength <= 15 ) {
			rollerArray[i] = 'i5_Star_52_ST__Stationary_____504'; i++;
			rollerArray[i] = 'i5_Star_52101_MKII__Directional_Mobile_____524'; i++;
			rollerArray[i] = 'i5_Star_52_LP__Low_Profile_____573'; i++;	
			rollerArray[i] = 'i5_Star_52_FM__Fully_Mobile_____588'; i++;
			rollerArray[i] = 'i5_Star_52125_ST__Stationary_____727'; i++;
			rollerArray[i] = 'i5_Star_52125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_52_MAXI____1221'; i++;
		}
		
		// show rollers for pool size: >4.6m - <=4.9m wide and >15m - <=18m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 4.6 && bWidth <= 4.9) && (bLength > 15 && bLength <= 18) ) {
			rollerArray[i] = 'i5_Star_52_ST__Stationary_____504'; i++;
			rollerArray[i] = 'i5_Star_52101_MKII__Directional_Mobile_____524'; i++;
			rollerArray[i] = 'i5_Star_52_FM__Fully_Mobile_____588'; i++;
			rollerArray[i] = 'i5_Star_52125_ST__Stationary_____727'; i++;
			rollerArray[i] = 'i5_Star_52125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_52_MAXI____1221'; i++;
		}

		// show rollers for pool size: >4.6m - <=4.9m wide and >18m - <=20m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 4.6 && bWidth <= 4.9) && (bLength > 18 && bLength <= 20) ) {
			rollerArray[i] = 'i5_Star_52125_ST__Stationary_____727'; i++;
			rollerArray[i] = 'i5_Star_52125_FM__Fully_Mobile_____752'; i++;
			rollerArray[i] = 'i5_Star_52_MAXI____1221'; i++;
		}

		// ------------------------------------------------------------------------------------------------------------------
		// show rollers for pool size: >4.9m - <=5.2m wide and <=12m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 4.9 && bWidth <= 5.2) && bLength <= 12 ) {
			rollerArray[i] = 'i5_Star_55_ST__Stationary_____550'; i++;
			rollerArray[i] = 'i5_Star_55101_MKII__Directional_Mobile_____569'; i++;
			rollerArray[i] = 'i5_Star_55_LP__Low_Profile_____618'; i++;	
			rollerArray[i] = 'i5_Star_55_FM__Fully_Mobile_____635'; i++;
			rollerArray[i] = 'i5_Star_55125_ST__Stationary_____807'; i++;
			rollerArray[i] = 'i5_Star_55125_FM__Fully_Mobile_____832'; i++;
			rollerArray[i] = 'i5_Star_55_MAXI____1301'; i++;
		}

		// show rollers for pool size: >4.9m - <=5.2m wide and >12m - <=14m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 4.9 && bWidth <= 5.2) && (bLength > 12 && bLength <= 14) ) {
			rollerArray[i] = 'i5_Star_55_ST__Stationary_____550'; i++;
			rollerArray[i] = 'i5_Star_55101_MKII__Directional_Mobile_____569'; i++;
			rollerArray[i] = 'i5_Star_55 FM__Fully_Mobile_____635'; i++;
			rollerArray[i] = 'i5_Star_55125_ST__Stationary_____807'; i++;
			rollerArray[i] = 'i5_Star_55125_FM__Fully_Mobile_____832'; i++;
			rollerArray[i] = 'i5_Star_55_MAXI____1301'; i++;
		}

		// show rollers for pool size: >4.9m - <=5.2m wide and >14m - <=18m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 4.9 && bWidth <= 5.2) && (bLength > 14 && bLength <= 18) ) {
			rollerArray[i] = 'i5_Star_55125_ST__Stationary_____807'; i++;
			rollerArray[i] = 'i5_Star_55125_FM__Fully_Mobile_____832'; i++;
			rollerArray[i] = 'i5_Star_55_MAXI____1301'; i++;
		}

		// ------------------------------------------------------------------------------------------------------------------
		// show rollers for pool size: >5.2m - <=5.5m wide and <=12m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 5.2 && bWidth <= 5.5) && bLength <= 12 ) {
			rollerArray[i] = 'i5_Star_58_ST__Stationary_____550'; i++;
			rollerArray[i] = 'i5_Star_58101_MKII__Directional_Mobile_____569'; i++;
			rollerArray[i] = 'i5_Star_58_LP__Low_Profile_____618'; i++;	
			rollerArray[i] = 'i5_Star_58_FM__Fully_Mobile_____635'; i++;
			rollerArray[i] = 'i5_Star_58125_ST__Stationary_____807'; i++;
			rollerArray[i] = 'i5_Star_58125_FM__Fully_Mobile_____832'; i++;
			rollerArray[i] = 'i5_Star_58_MAXI____1301'; i++;
		}

		// show rollers for pool size: >5.2m - <=5.5m wide and >12m - <=14m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 5.2 && bWidth <= 5.5) && (bLength > 12 && bLength <= 14) ) {
			rollerArray[i] = 'i5_Star_58_ST__Stationary_____550'; i++;
			rollerArray[i] = 'i5_Star_58101_MKII__Directional_Mobile_____569'; i++;
			rollerArray[i] = 'i5_Star_58_FM__Fully_Mobile_____635'; i++;
			rollerArray[i] = 'i5_Star_58125_ST__Stationary_____807'; i++;
			rollerArray[i] = 'i5_Star_58125_FM__Fully_Mobile_____832'; i++;
			rollerArray[i] = 'i5_Star_58_MAXI____1301'; i++;
		}

		// show rollers for pool size: >5.2m - <=5.5m wide and >14m - <=18m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 5.2 && bWidth <= 5.5) && (bLength > 14 && bLength <= 18) ) {
			rollerArray[i] = 'i5_Star_58125_ST__Stationary_____807'; i++;
			rollerArray[i] = 'i5_Star_58125_FM__Fully_Mobile_____832'; i++;
			rollerArray[i] = 'i5_Star_58_MAXI____1301'; i++;
		}

		// ------------------------------------------------------------------------------------------------------------------
		// show rollers for pool size: >5.5m - <=5.8m wide and <=12m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 5.5 && bWidth <= 5.8) && bLength <= 12 ) {
			rollerArray[i] = 'i5_Star_61_ST__Stationary_____550'; i++;
			rollerArray[i] = 'i5_Star_61101_MKII__Directional_Mobile_____569'; i++;
			rollerArray[i] = 'i5_Star_61_LP__Low_Profile_____618'; i++;	
			rollerArray[i] = 'i5_Star_61_FM__Fully_Mobile_____635'; i++;
			rollerArray[i] = 'i5_Star_61125_ST__Stationary_____807'; i++;
			rollerArray[i] = 'i5_Star_61125_FM__Fully_Mobile_____832'; i++;
			rollerArray[i] = 'i5_Star_61_MAXI____1301'; i++;
		}

		// show rollers for pool size: >5.5m - <=5.8m wide and >12m - <=14m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 5.5 && bWidth <= 5.8) && (bLength > 12 && bLength <= 14) ) {
			rollerArray[i] = 'i5_Star_61_ST__Stationary_____550'; i++;
			rollerArray[i] = 'i5_Star_61101_MKII__Directional_Mobile_____569'; i++;
			rollerArray[i] = 'i5_Star_61_FM__Fully_Mobile_____635'; i++;
			rollerArray[i] = 'i5_Star_61125_ST__Stationary_____807'; i++;
			rollerArray[i] = 'i5_Star_61125_FM__Fully_Mobile_____832'; i++;
			rollerArray[i] = 'i5_Star_61_MAXI____1301'; i++;
		}

		// show rollers for pool size: >5.5m - <=5.8m wide and >14m - <=18m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 5.5 && bWidth <= 5.8) && (bLength > 14 && bLength <= 18) ) {
			rollerArray[i] = 'i5_Star_61125_ST__Stationary_____807'; i++;
			rollerArray[i] = 'i5_Star_61125_FM__Fully_Mobile_____832'; i++;
			rollerArray[i] = 'i5_Star_61_MAXI____1301'; i++;
		}

		// ------------------------------------------------------------------------------------------------------------------
		// show rollers for pool size: >5.8m - <=6.1m wide and <=12m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 5.8 && bWidth <= 6.1) && bLength <= 12 ) {
			rollerArray[i] = 'i5_Star_64_ST__Stationary_____550'; i++;
			rollerArray[i] = 'i5_Star_64101_MKII__Directional_Mobile_____569'; i++;
			rollerArray[i] = 'i5_Star_64_LP__Low_Profile_____618'; i++;	
			rollerArray[i] = 'i5_Star_64_FM__Fully_Mobile_____635'; i++;
			rollerArray[i] = 'i5_Star_64125_ST__Stationary_____807'; i++;
			rollerArray[i] = 'i5_Star_64125_FM__Fully_Mobile_____832'; i++;
			rollerArray[i] = 'i5_Star_64_MAXI____1301'; i++;
		}

		// show rollers for pool size: >5.8m - <=6.1m wide and >12m - <=14m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 5.8 && bWidth <= 6.1) && (bLength > 12 && bLength <= 14) ) {
			rollerArray[i] = 'i5_Star_64)_ST__Stationary_____550'; i++;
			rollerArray[i] = 'i5_Star_64101_MKII__Directional_Mobile_____569'; i++;
			rollerArray[i] = 'i5_Star_64_FM__Fully_Mobile_____635'; i++;
			rollerArray[i] = 'i5_Star_64125_ST__Stationary_____807'; i++;
			rollerArray[i] = 'i5_Star_64125_FM__Fully_Mobile_____832'; i++;
			rollerArray[i] = 'i5_Star_64_MAXI____1301'; i++;
		}

		// show rollers for pool size: >5.8m - <=6.1m wide and >14m - <=18m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 5.8 && bWidth <= 6.1) && (bLength > 14 && bLength <= 18) ) {
			rollerArray[i] = 'i5_Star_64125_ST__Stationary_____807'; i++;
			rollerArray[i] = 'i5_Star_64125_FM__Fully_Mobile_____832'; i++;
			rollerArray[i] = 'i5_Star_64_MAXI____1301'; i++;
		}

		// ------------------------------------------------------------------------------------------------------------------
		// show rollers for pool size: >6.1m - <=6.4m wide and <=18m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 6.1 && bWidth <= 6.4) && bLength <= 18 ) {
			rollerArray[i] = 'i5_Star_67125_ST__Stationary_____839'; i++;
			rollerArray[i] = 'i5_Star_67125_FM__Fully_Mobile_____864'; i++;
			rollerArray[i] = 'i5_Star_67_MAXI____1333'; i++;
		}

		// ------------------------------------------------------------------------------------------------------------------
		// show rollers for pool size: >6.4m - <=6.7m wide and <=18m long...
		// Updated 27 June 2005 by Shane <shane@bam.com.au>
		if ( (bWidth > 6.4 && bWidth <= 6.7) && bLength <= 18 ) {
			rollerArray[i] = 'i5_Star_70125_ST__Stationary_____839'; i++;
			rollerArray[i] = 'i5_Star_70125_FM__Fully_Mobile_____864'; i++;
			rollerArray[i] = 'i5_Star_70_MAXI____1333'; i++;
		}
	}

	// unhide all relevant roller option divs...
	for (n=0; n<rollerArray.length; n++) {
		document.getElementById(rollerArray[n]).style.display= 'block';
	}
	
	// If there are no rollers for this pool size, display an error message asking the customer to contact Daisy.
	if (rollerArray.length == 1) {
		alert("Your pool seems to be larger than a normal domestic pool.\nPlease check that you have entered your pool dimensions correctly.\nIf they are correct, please contact Daisy Pool Covers for details of the range\nof Solar Pool Blanket and Roller options we can offer you.");
	}
}

// function to insert chosen blanket details into totals at bottom...
function updateBlanketTotal(blanket,price) {
	blanket.form.blanketChosen.value = blanket.value;
	blanket.form.blanketCost.value = price;
	// update total cost at bottom
	updateTotalCost();
}

// function to insert chosen blanket details into totals at bottom...
function updateRollerTotal(roller) {
	// work out position of '$' in roller description...
	var dollarPos = roller.value.lastIndexOf(' - $');
	// work out length of roller description...
	var descLength = roller.value.length;
	// insert description without $price into rollerChosen...
	roller.form.rollerChosen.value = roller.value.substring(0,dollarPos);
	// insert price into rollerCost...
	roller.form.rollerCost.value = roller.value.substring(dollarPos+4,descLength);
	// update total cost at bottom
	updateTotalCost();
}

// function to insert chosen freight details into totals at bottom...
function updateFreightTotal(freight) {
	freight.form.deliveryCost.value = freight.value;
	// update total cost at bottom
	updateTotalCost();
}

// function to work out total at bottom...
function updateTotalCost() {
	

	blanketPart = parseInt(document.blanketQuoteForm.blanketCost.value);
	if (isNaN(blanketPart)) {
		blanketPart = 0;
	}
	rollerPart = parseInt(document.blanketQuoteForm.rollerCost.value);
	if (isNaN(rollerPart)) {
		rollerPart = 0;
	}
	freightPart = parseInt(document.blanketQuoteForm.deliveryCost.value);
	if (isNaN(freightPart)) {
		freightPart = 0;
	}
	
	document.blanketQuoteForm.totalCost.value = blanketPart + rollerPart + freightPart;
}

// function to post off order to Daisy...
function proceedOrder(orderButton) {

	var toForm = document.submitForm;

	if (orderButton.form.blanketChosen.value=="" || orderButton.form.rollerChosen.value=="") {
		return false;
	}

	toForm.NAME0.value = orderButton.form.blanketChosen.value;
	toForm.PRICE0.value = orderButton.form.blanketCost.value;
	toForm.OPT10.value = orderButton.form.blanketChosen.value;

	toForm.NAME1.value = orderButton.form.rollerChosen.value;
	toForm.PRICE1.value = orderButton.form.rollerCost.value;
	toForm.OPT11.value = orderButton.form.rollerChosen.value;

	toForm.PRICE2.value = orderButton.form.deliveryCost.value;
//	toForm.OPT12.value = orderButton.form.deliveryChosen.value;

	var poolString = "POOL";
	poolString += " Width "  + orderButton.form.poolWidthA.value  + 'm,';
	poolString += " Length " + orderButton.form.poolLengthB.value + 'm';

	if (orderButton.form.hasStep.value == 'yes') {
		poolString += " + STEP ";
		poolString += " Side " + orderButton.form.stepSide.value;
		poolString += ", Width " + orderButton.form.stepWidthA1.value + 'm,';
		poolString += " Length " + orderButton.form.stepLengthB1.value + 'm';
	}

	if (orderButton.form.aboveGround.value == 'yes') {
		poolString += " + Above Ground";
	}

	toForm.OPT20.value = poolString;

	toForm.QTY0.value = ((toForm.PRICE0.value-0)>0) ? 1 : 0;
	toForm.QTY1.value = ((toForm.PRICE1.value-0)>0) ? 1 : 0;
	toForm.QTY2.value = ((toForm.PRICE2.value-0)>0) ? 1 : 0;

	toForm.submit();

}
//-->