function haveOption(option) {
	var checked = false;
	var i=0;
  for (i = 0; i<option.length;i++) {
		if (option[i].checked) {
			checked = true;
			break;
		}
	}
	return ( checked );
}
function validateRequiredOptions(PageForm,colorOnly,dividerHeight) {
  var errors='';
	if ( !haveOption(PageForm.color) ) {
		errors += '- Color\n';
	}
	// for blinds and shades, only check for color
  if ( colorOnly ) {
	  if ( errors ) {
			alert('Please select a color.');
			return false;
		}
		else
			return true;
	}
	if ( !haveOption(PageForm.LouverSize_Shutters) ) {
		errors += '- Size of Louvers\n';
	}
	if ( !haveOption(PageForm.mount_type) ) {
		errors += '- Mount\n';
	}
	if ( PageForm.RearTilt_Option_Shutters ) {
		if ( !haveOption(PageForm.RearTilt_Option_Shutters) ) {
			errors += '- Tilt\n';
		}
	}
	if ( !haveOption(PageForm.CafeShutterSelection_Shutters) ) {
		errors += '- Full Height or Cafe Height\n';
	}
	if ( !haveOption(PageForm.HingeColor_Shutters) ) {
		errors += '- Hinge Color\n';
	}
	if ( !haveOption(PageForm.WindowDepth_Shutters) ) {
		errors += '- Window Depth\n';
	}
	if ( !haveOption(PageForm.WindowSill_Shutters) ) {
		errors += '- Window Sill\n';
	}
	if ( !haveOption(PageForm.Cartwright_WindowTIlt_Shutter) ) {
		errors += '- Does the window tilt inward for cleaning?\n';
	}
	// have to check list selection is not 0
  if ( PageForm.Configuration_Blindscom_Shutters.value == '0' ) {
		errors += '- Shutter Configurations\n';
	}
	nheight= Number(PageForm.height.value);
  if (( nheight >= dividerHeight   ) &&
   ( !PageForm.Shutters_BlindsCom_Divider_Checkbox.checked )) {
		errors += '- Divider Rail\n';
	}
	if (errors)  {
		alert('Please select an option for the following:\n'+errors);
		return false;
	}
	else {
		return true; 
	}
}

