function confirmPatches() {
	$('confirmer').style.display = 'block';
	
	var shapes = document.form2.shape;
	var details = document.form2.details;
	
	if (shapes.length != 16) {
		doBox(0);
	} else {
		writeBoxHTML(shapes.value, details.value, 0, 1);
	}
}

function doBox(id) {
	var shapes = document.form2.shape;
	var details = document.form2.details;
	
	if (shapes.length != 16 && id < shapes.length) {
		writeBoxHTML(shapes[id].value, details[id].value, id, shapes.length);
	} else {
		finish();
	}
}

function writeBoxHTML(shape_val, detail_val, id, shapes_length) {
		$('confirm-box').innerHTML = '';
		$('confirm-box').innerHTML += '<div style="width: 100%; margin-bottom: 20px;"><img src="images/verify-patches.gif" /></div>';
		$('confirm-box').innerHTML += '<div style="width: 100%; padding-bottom: 5px; margin-bottom: 25px; border-bottom: 1px solid #960c13;"><span style="font-size: 20px; font-weight: bold; color: #960c13;">Patch ' + (id+1) + ' of ' + shapes_length + '</span></div>';
		$('confirm-box').innerHTML += '<div style="float: left; width: 135px; margin-right: 25px;"><img src="images/patches/shape' + shape_val + '.jpg" alt="Patch Shape" align="left" /></div>';
		$('confirm-box').innerHTML += '<div style="float: left; width: 200px; margin-right: 20px;"><strong>Patch Lettering:</strong><br />' + detail_val + '</div>';
		$('confirm-box').innerHTML += '<div style="float: left; width: 120px;"><a href="javascript: void(0);" onclick="doBox(' + (id+1) + ');" class="clean"><img src="images/btn-verify-correct.gif" alt="correct" /></a><br /><br /><a href="javascript: void(0);" onclick="closeBox();" class="clean"><img src="images/btn-verify-change.gif" alt="make changes" /></a></div>';
		$('confirm-box').innerHTML += '<br style="clear: both;" />';
}

function closeBox() {
	$('confirmer').style.display = 'none';
}

function finish() {
	closeBox();
	showPage('step3');
}