﻿function Customization()
{
	var badchars = '+!';
	var str = '';
	var hf = document.ProductInfo.hfatt.value;
	var qArray = hf.split("|");

	for (var i=0;i<qArray.length;i++)
	{
		var zArray = qArray[i].split("=");
		if (zArray[1]=='0')
		{
			if (document.getElementById('Attribute' + zArray[0]).value=='')
			{
				str += zArray[2] + ' cannot be blank.\n';
			} else {
				var input = document.getElementById('Attribute' + zArray[0]).value;

				for (var a=0;a<input.length;a++)
				{
					for (var ii=0;ii<badchars.length;ii++)
					{
						if (input.charCodeAt(a)==badchars.charCodeAt(ii))
						{
							str += 'Invalid character: ' + input.substring(a, a+1) +'\n'; 
						}
					}
				}
			}
		}
	}
	if (str=='')
	{
		return confirm('Is the information you entered for customization correct?\n\nPlease note that we do not perform spell checks and information is customized exactly as entered.');
		void('');
		return false;
	} else {
		alert(str);
		return false;
	}
}
