/*
 *
 * Copyright (c) 2006-2010 Sam Collett (http://www.texotela.co.uk)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version 2.2.6
 * Demo: http://www.texotela.co.uk/code/jquery/select/
 *
 *
 */
 
;(function($) {
 
/**
 * Adds (single/multiple) options to a select box (or series of select boxes)
 *
 * @name     addOption
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     jQuery
 * @example  $("#myselect").addOption("Value", "Text"); // add single value (will be selected)
 * @example  $("#myselect").addOption("Value 2", "Text 2", false); // add single value (won't be selected)
 * @example  $("#myselect").addOption({"foo":"bar","bar":"baz"}, false); // add multiple values, but don't select
 *
 */
$.fn.addOption = function()
{
	var add = function(el, v, t, sO, index)
	{
		var option = document.createElement("option");
		option.value = v, option.text = t;
		// get options
		var o = el.options;
		// get number of options
		var oL = o.length;
		if(!el.cache)
		{
			el.cache = {};
			// loop through existing options, adding to cache
			for(var i = 0; i < oL; i++)
			{
				el.cache[o[i].value] = i;
			}
		}
		if (index || index == 0)
		{
 			// we're going to insert these starting  at a specific index...
			// this has the side effect of el.cache[v] being the 
			// correct value for the typeof check below
			var ti = option;
			for(var ii =index; ii <= oL; ii++)
			{
				var tmp = el.options[ii];
				el.options[ii] = ti;
				o[ii] = ti;
				el.cache[o[ii].value] = ii;
				ti = tmp;
			}
		}
    
		// add to cache if it isn't already
		if(typeof el.cache[v] == "undefined") el.cache[v] = oL;
		el.options[el.cache[v]] = option;
		if(sO)
		{
			option.selected = true;
		}
	};

	var a = arguments;
	if(a.length == 0) return this;
	// select option when added? default is true
	var sO = true;
	// multiple items
	var m = false;
	// other variables
	var items, v, t, startindex = 0;
	if(typeof(a[0]) == "object")
	{
		m = true;
		items = a[0];
	}
	if(a.length >= 2)
	{
		if(typeof(a[1]) == "boolean")
		{
			sO = a[1];
			startindex = a[2];
		}
		else if(typeof(a[2]) == "boolean")
		{
			sO = a[2];
			startindex = a[1];
		}
		else
		{
			startindex = a[1];
		}
		if(!m)
		{
			v = a[0];
			t = a[1];
		}
	}
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return;
			if(m)
			{
				for(var item in items)
				{
					add(this, item, items[item], sO, startindex);
					startindex += 1;
				}
			}
			else
			{
				add(this, v, t, sO, startindex);
			}
		}
	);
	return this;
};

/**
 * Add options via ajax
 *
 * @name     ajaxAddOption
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     jQuery
 * @param    String url      Page to get options from (must be valid JSON)
 * @param    Object params   (optional) Any parameters to send with the request
 * @param    Boolean select  (optional) Select the added options, default true
 * @param    Function fn     (optional) Call this function with the select object as param after completion
 * @param    Array args      (optional) Array with params to pass to the function afterwards
 * @example  $("#myselect").ajaxAddOption("myoptions.php");
 * @example  $("#myselect").ajaxAddOption("myoptions.php", {"code" : "007"});
 * @example  $("#myselect").ajaxAddOption("myoptions.php", {"code" : "007"}, false, sortoptions, [{"dir": "desc"}]);
 *
 */
$.fn.ajaxAddOption = function(url, params, select, fn, args)
{
	if(typeof(url) != "string") return this;
	if(typeof(params) != "object") params = {};
	if(typeof(select) != "boolean") select = true;
	this.each(
		function()
		{
			var el = this;
			$.getJSON(url,
				params,
				function(r)
				{
					$(el).addOption(r, select);
					if(typeof fn == "function")
					{
						if(typeof args == "object")
						{
							fn.apply(el, args);
						} 
						else
						{
							fn.call(el);
						}
					}
				}
			);
		}
	);
	return this;
};

/**
 * Removes an option (by value or index) from a select box (or series of select boxes)
 *
 * @name     removeOption
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     jQuery
 * @param    String|RegExp|Number what  Option to remove
 * @param    Boolean selectedOnly       (optional) Remove only if it has been selected (default false)   
 * @example  $("#myselect").removeOption("Value"); // remove by value
 * @example  $("#myselect").removeOption(/^val/i); // remove options with a value starting with 'val'
 * @example  $("#myselect").removeOption(/./); // remove all options
 * @example  $("#myselect").removeOption(/./, true); // remove all options that have been selected
 * @example  $("#myselect").removeOption(0); // remove by index
 * @example  $("#myselect").removeOption(["myselect_1","myselect_2"]); // values contained in passed array
 *
 */
$.fn.removeOption = function()
{
	var a = arguments;
	if(a.length == 0) return this;
	var ta = typeof(a[0]);
	var v, index;
	// has to be a string or regular expression (object in IE, function in Firefox)
	if(ta == "string" || ta == "object" || ta == "function" )
	{
		v = a[0];
		// if an array, remove items
		if(v.constructor == Array)
		{
			var l = v.length;
			for(var i = 0; i<l; i++)
			{
				this.removeOption(v[i], a[1]); 
			}
			return this;
		}
	}
	else if(ta == "number") index = a[0];
	else return this;
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return;
			// clear cache
			if(this.cache) this.cache = null;
			// does the option need to be removed?
			var remove = false;
			// get options
			var o = this.options;
			if(!!v)
			{
				// get number of options
				var oL = o.length;
				for(var i=oL-1; i>=0; i--)
				{
					if(v.constructor == RegExp)
					{
						if(o[i].value.match(v))
						{
							remove = true;
						}
					}
					else if(o[i].value == v)
					{
						remove = true;
					}
					// if the option is only to be removed if selected
					if(remove && a[1] === true) remove = o[i].selected;
					if(remove)
					{
						o[i] = null;
					}
					remove = false;
				}
			}
			else
			{
				// only remove if selected?
				if(a[1] === true)
				{
					remove = o[index].selected;
				}
				else
				{
					remove = true;
				}
				if(remove)
				{
					this.remove(index);
				}
			}
		}
	);
	return this;
};

/**
 * Sort options (ascending or descending) in a select box (or series of select boxes)
 *
 * @name     sortOptions
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     jQuery
 * @param    Boolean ascending   (optional) Sort ascending (true/undefined), or descending (false)
 * @example  // ascending
 * $("#myselect").sortOptions(); // or $("#myselect").sortOptions(true);
 * @example  // descending
 * $("#myselect").sortOptions(false);
 *
 */
$.fn.sortOptions = function(ascending)
{
	// get selected values first
	var sel = $(this).selectedValues();
	var a = typeof(ascending) == "undefined" ? true : !!ascending;
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return;
			// get options
			var o = this.options;
			// get number of options
			var oL = o.length;
			// create an array for sorting
			var sA = [];
			// loop through options, adding to sort array
			for(var i = 0; i<oL; i++)
			{
				sA[i] = {
					v: o[i].value,
					t: o[i].text
				}
			}
			// sort items in array
			sA.sort(
				function(o1, o2)
				{
					// option text is made lowercase for case insensitive sorting
					o1t = o1.t.toLowerCase(), o2t = o2.t.toLowerCase();
					// if options are the same, no sorting is needed
					if(o1t == o2t) return 0;
					if(a)
					{
						return o1t < o2t ? -1 : 1;
					}
					else
					{
						return o1t > o2t ? -1 : 1;
					}
				}
			);
			// change the options to match the sort array
			for(var i = 0; i<oL; i++)
			{
				o[i].text = sA[i].t;
				o[i].value = sA[i].v;
			}
		}
	).selectOptions(sel, true); // select values, clearing existing ones
	return this;
};
/**
 * Selects an option by value
 *
 * @name     selectOptions
 * @author   Mathias Bank (http://www.mathias-bank.de), original function
 * @author   Sam Collett (http://www.texotela.co.uk), addition of regular expression matching
 * @type     jQuery
 * @param    String|RegExp|Array value  Which options should be selected
 * can be a string or regular expression, or an array of strings / regular expressions
 * @param    Boolean clear  Clear existing selected options, default false
 * @example  $("#myselect").selectOptions("val1"); // with the value 'val1'
 * @example  $("#myselect").selectOptions(["val1","val2","val3"]); // with the values 'val1' 'val2' 'val3'
 * @example  $("#myselect").selectOptions(/^val/i); // with the value starting with 'val', case insensitive
 *
 */
$.fn.selectOptions = function(value, clear)
{
	var v = value;
	var vT = typeof(value);
	// handle arrays
	if(vT == "object" && v.constructor == Array)
	{
		var $this = this;
		$.each(v, function()
			{
      				$this.selectOptions(this, clear);
    			}
		);
	};
	var c = clear || false;
	// has to be a string or regular expression (object in IE, function in Firefox)
	if(vT != "string" && vT != "function" && vT != "object") return this;
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return this;
			// get options
			var o = this.options;
			// get number of options
			var oL = o.length;
			for(var i = 0; i<oL; i++)
			{
				if(v.constructor == RegExp)
				{
					if(o[i].value.match(v))
					{
						o[i].selected = true;
					}
					else if(c)
					{
						o[i].selected = false;
					}
				}
				else
				{
					if(o[i].value == v)
					{
						o[i].selected = true;
					}
					else if(c)
					{
						o[i].selected = false;
					}
				}
			}
		}
	);
	return this;
};

/**
 * Copy options to another select
 *
 * @name     copyOptions
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     jQuery
 * @param    String to  Element to copy to
 * @param    String which  (optional) Specifies which options should be copied - 'all' or 'selected'. Default is 'selected'
 * @example  $("#myselect").copyOptions("#myselect2"); // copy selected options from 'myselect' to 'myselect2'
 * @example  $("#myselect").copyOptions("#myselect2","selected"); // same as above
 * @example  $("#myselect").copyOptions("#myselect2","all"); // copy all options from 'myselect' to 'myselect2'
 *
 */
$.fn.copyOptions = function(to, which)
{
	var w = which || "selected";
	if($(to).size() == 0) return this;
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return this;
			// get options
			var o = this.options;
			// get number of options
			var oL = o.length;
			for(var i = 0; i<oL; i++)
			{
				if(w == "all" || (w == "selected" && o[i].selected))
				{
					$(to).addOption(o[i].value, o[i].text);
				}
			}
		}
	);
	return this;
};

/**
 * Checks if a select box has an option with the supplied value
 *
 * @name     containsOption
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     Boolean|jQuery
 * @param    String|RegExp value  Which value to check for. Can be a string or regular expression
 * @param    Function fn          (optional) Function to apply if an option with the given value is found.
 * Use this if you don't want to break the chaining
 * @example  if($("#myselect").containsOption("val1")) alert("Has an option with the value 'val1'");
 * @example  if($("#myselect").containsOption(/^val/i)) alert("Has an option with the value starting with 'val'");
 * @example  $("#myselect").containsOption("val1", copyoption).doSomethingElseWithSelect(); // calls copyoption (user defined function) for any options found, chain is continued
 *
 */
$.fn.containsOption = function(value, fn)
{
	var found = false;
	var v = value;
	var vT = typeof(v);
	var fT = typeof(fn);
	// has to be a string or regular expression (object in IE, function in Firefox)
	if(vT != "string" && vT != "function" && vT != "object") return fT == "function" ? this: found;
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return this;
			// option already found
			if(found && fT != "function") return false;
			// get options
			var o = this.options;
			// get number of options
			var oL = o.length;
			for(var i = 0; i<oL; i++)
			{
				if(v.constructor == RegExp)
				{
					if (o[i].value.match(v))
					{
						found = true;
						if(fT == "function") fn.call(o[i], i);
					}
				}
				else
				{
					if (o[i].value == v)
					{
						found = true;
						if(fT == "function") fn.call(o[i], i);
					}
				}
			}
		}
	);
	return fT == "function" ? this : found;
};

/**
 * Returns values which have been selected
 *
 * @name     selectedValues
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     Array
 * @example  $("#myselect").selectedValues();
 *
 */
$.fn.selectedValues = function()
{
	var v = [];
	this.selectedOptions().each(
		function()
		{
			v[v.length] = this.value;
		}
	);
	return v;
};

/**
 * Returns text which has been selected
 *
 * @name     selectedTexts
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     Array
 * @example  $("#myselect").selectedTexts();
 *
 */
$.fn.selectedTexts = function()
{
	var t = [];
	this.selectedOptions().each(
		function()
		{
			t[t.length] = this.text;
		}
	);
	return t;
};

/**
 * Returns options which have been selected
 *
 * @name     selectedOptions
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     jQuery
 * @example  $("#myselect").selectedOptions();
 *
 */
$.fn.selectedOptions = function()
{
	return this.find("option:selected");
};

})(jQuery);

$(document).ready(function(){

    var size = [/*Dependent On: 2_napkin_size */ /* amethyst  */{
        'When': 'amethyst',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'amethyst',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'amethyst',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'amethyst',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /* black*/ {
        'When': 'black',
        'Value': 'beverage_4_3-4inch',
        'Text': 'beverage 4.75" x 4.75"'
    }, {
        'When': 'black',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'black',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'black',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /* burgundy */ {
        'When': 'burgundy',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'burgundy',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'burgundy',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'burgundy',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*candy_pink*/ {
        'When': 'candy_pink',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'candy_pink',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'candy_pink',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'candy_pink',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    },/*caramel*/ {
        'When': 'caramel',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'caramel',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'caramel',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'caramel',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*caribbean*/ {
        'When': 'caribbean',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'caribbean',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'caribbean',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'caribbean',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*celadon*/ {
        'When': 'celadon',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'celadon',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'celadon',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'celadon',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*cherry*/ {
        'When': 'cherry',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'cherry',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'cherry',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'cherry',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*chocolate*/ {
        'When': 'chocolate',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'chocolate',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'chocolate',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'chocolate',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*classic_pink*/ {
        'When': 'classic_pink',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'classic_pink',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'classic_pink',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'classic_pink',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*cranberry*/ {
        'When': 'cranberry',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'cranberry',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'cranberry',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'cranberry',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*dusty_rose*/ {
        'When': 'dusty_rose',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'dusty_rose',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'dusty_rose',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'dusty_rose',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*espresso*/ {
        'When': 'espresso',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'espresso',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'espresso',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'espresso',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*forest*/ {
        'When': 'forest',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'forest',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'forest',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'forest',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*french_blue*/ {
        'When': 'french_blue',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'french_blue',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'french_blue',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'french_blue',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*gold*/ {
        'When': 'gold',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'gold',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'gold',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'gold',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*hot_pink*/ {
        'When': 'hot_pink',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'hot_pink',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'hot_pink',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'hot_pink',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*ivory*/ {
        'When': 'ivory',
        'Value': 'beverage_4_3-4inch',
        'Text': 'beverage 4.75" x 4.75"'
    }, {
        'When': 'ivory',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'ivory',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'ivory',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*kiwi*/ {
        'When': 'kiwi',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'kiwi',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'kiwi',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'kiwi',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*lavender*/ {
        'When': 'lavender',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'lavender',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'lavender',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'lavender',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*leaf*/ {
        'When': 'leaf',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'leaf',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'leaf',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'leaf',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*lilac*/ {
        'When': 'lilac',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'lilac',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'lilac',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'lilac',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*lime_green*/ {
        'When': 'lime_green',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'lime_green',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'lime_green',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'lime_green',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*mimosa*/ {
        'When': 'mimosa',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'mimosa',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'mimosa',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'mimosa',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*navy*/ {
        'When': 'navy',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'navy',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'navy',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'navy',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*orange*/ {
        'When': 'orange',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'orange',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'orange',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'orange',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*peacock*/ {
        'When': 'peacock',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'peacock',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'peacock',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'peacock',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*powder_blue*/ {
        'When': 'powder_blue',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'powder_blue',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'powder_blue',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'powder_blue',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*red*/ {
        'When': 'red',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'red',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'red',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'red',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*rose_pink*/ {
        'When': 'rose_pink',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'rose_pink',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'rose_pink',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'rose_pink',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*royal*/ {
        'When': 'royal',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'royal',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'royal',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'royal',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*seafoam*/ {
        'When': 'seafoam',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'seafoam',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'seafoam',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'seafoam',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*silver*/ {
        'When': 'silver',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'silver',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'silver',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'silver',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*sunflower*/ {
        'When': 'sunflower',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'sunflower',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'sunflower',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'sunflower',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*sky_blue*/ {
        'When': 'sky_blue',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'sky_blue',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'sky_blue',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'sky_blue',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, /*tiffany_blue*/ {
        'When': 'tiffany_blue',
        'Value': 'beverage_4_3-4inch',
        'Text': 'beverage 4.75" x 4.75"'
    }, {
        'When': 'tiffany_blue',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'tiffany_blue',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'tiffany_blue',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*true_blue*/ {
        'When': 'true_blue',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'true_blue',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'true_blue',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'true_blue',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*violet*/ {
        'When': 'violet',
        'Value': 'beverage_5_inch',
        'Text': 'beverage 5" x 5"'
    }, {
        'When': 'violet',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'violet',
        'Value': 'dinner_8_inch',
        'Text': 'dinner 8" x 8"'
    }, {
        'When': 'violet',
        'Value': 'guest_towel_8_inch',
        'Text': 'guest towel 4.25" x 8"'
    }, /*white*/ {
        'When': 'white',
        'Value': 'beverage_4_3-4inch',
        'Text': 'beverage 4.75" x 4.75"'
    }, {
        'When': 'white',
        'Value': 'luncheon_6_1-2_inch',
        'Text': 'luncheon 6.5" x 6.5"'
    }, {
        'When': 'white',
        'Value': 'dinner_8_1-2inch',
        'Text': 'dinner 8.5" x 8.5"'
    }, {
        'When': 'white',
        'Value': 'guest_towel_8_1-2',
        'Text': 'guest towel 4.25" x 8.5"'
    }, ];
    var layout = [/*Dependent On: 2_napkin_size */ /*beverage_5_inch*/{
        'When': 'beverage_5_inch',
        'Value': 'straight',
        'Text': 'straight'
    }, {
        'When': 'beverage_5_inch',
        'Value': 'angle',
        'Text': 'angle'
    }, /*luncheon_6_1-2_inch*/ {
        'When': 'luncheon_6_1-2_inch',
        'Value': 'straight',
        'Text': 'straight'
    }, {
        'When': 'luncheon_6_1-2_inch',
        'Value': 'angle',
        'Text': 'angle'
    }, /*dinner_8_inch*/ {
        'When': 'dinner_8_inch',
        'Value': 'straight',
        'Text': 'straight'
    }, {
        'When': 'dinner_8_inch',
        'Value': 'angle',
        'Text': 'angle'
    }, /*guest_towel_8_inch*/ {
        'When': 'guest_towel_8_inch',
        'Value': 'default',
        'Text': 'default'
    }, /*beverage_4_3-4inch*/ {
        'When': 'beverage_4_3-4inch',
        'Value': 'straight',
        'Text': 'straight'
    }, {
        'When': 'beverage_4_3-4inch',
        'Value': 'angle',
        'Text': 'angle'
    }, /*dinner_8_1-2inch*/ {
        'When': 'dinner_8_1-2inch',
        'Value': 'straight',
        'Text': 'straight'
    }, {
        'When': 'dinner_8_1-2inch',
        'Value': 'angle',
        'Text': 'angle'
    }, /*guest_towel_8_1-2*/ {
        'When': 'guest_towel_8_1-2',
        'Value': 'default',
        'Text': 'default'
    }, ];
    
    
    var icon = [/*Dependent On: 4_design */ /* wedding and engagement  */{
        'When': 'AE-1005',
        'Value': 'bouquet',
        'Text': 'bouquet'
    }, {
        'When': 'AE-1005',
        'Value': 'bubbly',
        'Text': 'bubbly'
    }, {
        'When': 'AE-1005',
        'Value': 'champagne',
        'Text': 'champagne'
    }, {
        'When': 'AE-1005',
        'Value': 'champagne_toast',
        'Text': 'champagne toast'
    }, {
        'When': 'AE-1005',
        'Value': 'dress',
        'Text': 'dress'
    }, {
        'When': 'AE-1005',
        'Value': 'embrace',
        'Text': 'embrace'
    }, {
        'When': 'AE-1005',
        'Value': 'first_dance',
        'Text': 'first dance'
    }, {
        'When': 'AE-1005',
        'Value': 'hearts_1',
        'Text': 'hearts 1'
    }, {
        'When': 'AE-1005',
        'Value': 'hearts_2',
        'Text': 'hearts 2'
    }, {
        'When': 'AE-1005',
        'Value': 'hearts_3',
        'Text': 'hearts 3'
    }, {
        'When': 'AE-1005',
        'Value': 'hearts_4',
        'Text': 'hearts 4'
    }, {
        'When': 'AE-1005',
        'Value': 'hearts_and_doves',
        'Text': 'hearts and doves'
    }, {
        'When': 'AE-1005',
        'Value': 'hearts_united',
        'Text': 'hearts united'
    }, {
        'When': 'AE-1005',
        'Value': 'kiss',
        'Text': 'kiss'
    }, {
        'When': 'AE-1005',
        'Value': 'love_birds',
        'Text': 'love birds'
    }, {
        'When': 'AE-1005',
        'Value': 'mazel_tov',
        'Text': 'mazel tov'
    }, {
        'When': 'AE-1005',
        'Value': 'nesting',
        'Text': 'nesting'
    }, {
        'When': 'AE-1005',
        'Value': 'newlyweds',
        'Text': 'newlyweds'
    }, {
        'When': 'AE-1005',
        'Value': 'ring',
        'Text': 'ring'
    }, {
        'When': 'AE-1005',
        'Value': 'shared_hearts',
        'Text': 'shared_hearts'
    }, {
        'When': 'AE-1005',
        'Value': 'stepping_out',
        'Text': 'stepping out'
    }, {
        'When': 'AE-1005',
        'Value': 'sweethearts',
        'Text': 'sweethearts'
    }, {
        'When': 'AE-1005',
        'Value': 'wedding_bells',
        'Text': 'wedding bells'
    }, {
        'When': 'AE-1005',
        'Value': 'wedding_bells_2',
        'Text': 'wedding bells 2'
    }, {
        'When': 'AE-1005',
        'Value': 'wedding_rings',
        'Text': 'wedding rings'
    }, {
        'When': 'AE-1005',
        'Value': 'wine_toast',
        'Text': 'wine toast'
    },/*anniversary */ {
        'When': 'AE-1006',
        'Value': '10th_anniversary',
        'Text': '10th anniversary'
    }, {
        'When': 'AE-1006',
        'Value': '25th_anniversary',
        'Text': '25th anniversary'
    }, {
        'When': 'AE-1006',
        'Value': '50th_anniversary',
        'Text': '50th anniversary'
    }, {
        'When': 'AE-1006',
        'Value': 'bubbly',
        'Text': 'bubbly'
    }, {
        'When': 'AE-1006',
        'Value': 'champagne',
        'Text': 'champagne'
    }, {
        'When': 'AE-1006',
        'Value': 'champagne_toast',
        'Text': 'champagne toast'
    }, {
        'When': 'AE-1006',
        'Value': 'embrace',
        'Text': 'embrace'
    }, {
        'When': 'AE-1006',
        'Value': 'first_dance',
        'Text': 'first dance'
    }, {
        'When': 'AE-1006',
        'Value': 'hearts_1',
        'Text': 'hearts 1'
    }, {
        'When': 'AE-1006',
        'Value': 'hearts_2',
        'Text': 'hearts 2'
    }, {
        'When': 'AE-1006',
        'Value': 'hearts_3',
        'Text': 'hearts 3'
    }, {
        'When': 'AE-1006',
        'Value': 'hearts_4',
        'Text': 'hearts 4'
    }, {
        'When': 'AE-1006',
        'Value': 'hearts_and_doves',
        'Text': 'hearts and doves'
    }, {
        'When': 'AE-1006',
        'Value': 'hearts_united',
        'Text': 'hearts united'
    }, {
        'When': 'AE-1006',
        'Value': 'kiss',
        'Text': 'kiss'
    }, {
        'When': 'AE-1006',
        'Value': 'nesting',
        'Text': 'nesting'
    }, {
        'When': 'AE-1006',
        'Value': 'newlyweds',
        'Text': 'newlyweds'
    }, {
        'When': 'AE-1006',
        'Value': 'shared hearts',
        'Text': 'shared hearts'
    }, {
        'When': 'AE-1006',
        'Value': 'sweethearts',
        'Text': 'sweethearts'
    }, {
        'When': 'AE-1006',
        'Value': 'wedding_bells',
        'Text': 'wedding bells'
    }, {
        'When': 'AE-1006',
        'Value': 'wedding_bells_2',
        'Text': 'wedding bells 2'
    }, {
        'When': 'AE-1006',
        'Value': 'wedding_rings',
        'Text': 'wedding rings'
    }, {
        'When': 'AE-1006',
        'Value': 'wine_toast',
        'Text': 'wine toast'
    },/*bridal shower*/ {
        'When': 'AE-1007',
        'Value': 'bouquet',
        'Text': 'bouquet'
    }, {
        'When': 'AE-1007',
        'Value': 'bubbly',
        'Text': 'bubbly'
    }, {
        'When': 'AE-1007',
        'Value': 'champagne',
        'Text': 'champagne'
    }, {
        'When': 'AE-1007',
        'Value': 'cupcake',
        'Text': 'cupcake'
    }, {
        'When': 'AE-1007',
        'Value': 'dress',
        'Text': 'dress'
    }, {
        'When': 'AE-1007',
        'Value': 'hearts_1',
        'Text': 'hearts 1'
    }, {
        'When': 'AE-1007',
        'Value': 'hearts_2',
        'Text': 'hearts 2'
    }, {
        'When': 'AE-1007',
        'Value': 'hearts_3',
        'Text': 'hearts 3'
    }, {
        'When': 'AE-1007',
        'Value': 'hearts_4',
        'Text': 'hearts 4'
    }, {
        'When': 'AE-1007',
        'Value': 'hearts_and_doves',
        'Text': 'hearts and doves'
    }, {
        'When': 'AE-1007',
        'Value': 'hearts_united',
        'Text': 'hearts united'
    }, {
        'When': 'AE-1007',
        'Value': 'high_heel',
        'Text': 'high heel'
    }, {
        'When': 'AE-1007',
        'Value': 'kiss',
        'Text': 'kiss'
    }, {
        'When': 'AE-1007',
        'Value': 'love_birds',
        'Text': 'love birds'
    }, {
        'When': 'AE-1007',
        'Value': 'nesting',
        'Text': 'nesting'
    }, {
        'When': 'AE-1007',
        'Value': 'purse',
        'Text': 'purse'
    }, {
        'When': 'AE-1007',
        'Value': 'ring',
        'Text': 'ring'
    }, {
        'When': 'AE-1007',
        'Value': 'shared_hearts',
        'Text': 'shared hearts'
    }, {
        'When': 'AE-1007',
        'Value': 'shopping',
        'Text': 'shopping'
    }, {
        'When': 'AE-1007',
        'Value': 'sweethearts',
        'Text': 'sweethearts'
    },/*bachelor/bachelorette*/ {
        'When': 'AE-1010',
        'Value': 'brew',
        'Text': 'brew'
    }, {
        'When': 'AE-1010',
        'Value': 'bubbly',
        'Text': 'bubbly'
    }, {
        'When': 'AE-1010',
        'Value': 'champagne',
        'Text': 'champagne'
    }, {
        'When': 'AE-1010',
        'Value': 'champagne_toast',
        'Text': 'champagne toast'
    }, {
        'When': 'AE-1010',
        'Value': 'drinks',
        'Text': 'drinks'
    }, {
        'When': 'AE-1010',
        'Value': 'high_heel',
        'Text': 'high heel'
    }, {
        'When': 'AE-1010',
        'Value': 'martini',
        'Text': 'martini'
    }, {
        'When': 'AE-1010',
        'Value': 'purse',
        'Text': 'purse'
    }, {
        'When': 'AE-1010',
        'Value': 'ring',
        'Text': 'ring'
    }, {
        'When': 'AE-1010',
        'Value': 'rock_music',
        'Text': 'rock music'
    }, {
        'When': 'AE-1010',
        'Value': 'shopping',
        'Text': 'shopping'
    }, {
        'When': 'AE-1010',
        'Value': 'smooch',
        'Text': 'smooch'
    }, {
        'When': 'AE-1010',
        'Value': 'wine_toast',
        'Text': 'wine toast'
    }, /*birthday party*/ {
        'When': 'AE-1008',
        'Value': 'all_star',
        'Text': 'all star'
    }, {
        'When': 'AE-1008',
        'Value': 'ballerina',
        'Text': 'ballerina'
    }, {
        'When': 'AE-1008',
        'Value': 'ballet',
        'Text': 'ballet'
    }, {
        'When': 'AE-1008',
        'Value': 'balloons_2',
        'Text': 'balloons 2'
    }, {
        'When': 'AE-1008',
        'Value': 'birthday_cake',
        'Text': 'birthday cake'
    }, {
        'When': 'AE-1008',
        'Value': 'birthday_party',
        'Text': 'birthday party'
    }, {
        'When': 'AE-1008',
        'Value': 'bubbly',
        'Text': 'bubbly'
    }, {
        'When': 'AE-1008',
        'Value': 'butterfly',
        'Text': 'butterfly'
    }, {
        'When': 'AE-1008',
        'Value': 'candy',
        'Text': 'candy'
    }, {
        'When': 'AE-1008',
        'Value': 'carousel',
        'Text': 'carousel'
    }, {
        'When': 'AE-1008',
        'Value': 'castle',
        'Text': 'castle'
    }, {
        'When': 'AE-1008',
        'Value': 'champagne',
        'Text': 'champagne'
    }, {
        'When': 'AE-1008',
        'Value': 'champagne_toast',
        'Text': 'champagne toast'
    }, {
        'When': 'AE-1008',
        'Value': 'clown',
        'Text': 'clown'
    }, {
        'When': 'AE-1008',
        'Value': 'crown',
        'Text': 'crown'
    }, {
        'When': 'AE-1008',
        'Value': 'crown_2',
        'Text': 'crown 2'
    }, {
        'When': 'AE-1008',
        'Value': 'cupcake',
        'Text': 'cupcake'
    }, {
        'When': 'AE-1008',
        'Value': 'dress',
        'Text': 'dress'
    }, {
        'When': 'AE-1008',
        'Value': 'duckie',
        'Text': 'duckie'
    }, {
        'When': 'AE-1008',
        'Value': 'high_heel',
        'Text': 'high heel'
    }, {
        'When': 'AE-1008',
        'Value': 'ice_cream_cone',
        'Text': 'ice cream cone'
    }, {
        'When': 'AE-1008',
        'Value': 'kiss',
        'Text': 'kiss'
    }, {
        'When': 'AE-1008',
        'Value': 'magic_wand',
        'Text': 'magic wand'
    }, {
        'When': 'AE-1008',
        'Value': 'magician',
        'Text': 'magician'
    }, {
        'When': 'AE-1008',
        'Value': 'masquerade',
        'Text': 'masquerade'
    }, {
        'When': 'AE-1008',
        'Value': 'plane',
        'Text': 'plane'
    }, {
        'When': 'AE-1008',
        'Value': 'purse',
        'Text': 'purse'
    }, {
        'When': 'AE-1008',
        'Value': 'rock_music',
        'Text': 'rock music'
    }, {
        'When': 'AE-1008',
        'Value': 'shopping',
        'Text': 'shopping'
    }, {
        'When': 'AE-1008',
        'Value': 'sombrero',
        'Text': 'sombrero'
    }, {
        'When': 'AE-1008',
        'Value': 'sportscar',
        'Text': 'sportscar'
    }, {
        'When': 'AE-1008',
        'Value': 'star_6',
        'Text': 'star 6'
    }, {
        'When': 'AE-1008',
        'Value': 'stream_of_stars',
        'Text': 'stream of stars'
    }, {
        'When': 'AE-1008',
        'Value': 'teddy_bear',
        'Text': 'teddy bear'
    }, {
        'When': 'AE-1008',
        'Value': 'wine_toast',
        'Text': 'wine toast'
    }, /*baby shower*/ {
        'When': 'AE-1009',
        'Value': 'baby_carriage',
        'Text': 'baby carriage'
    }, {
        'When': 'AE-1009',
        'Value': 'baby_rattle',
        'Text': 'baby rattle'
    }, {
        'When': 'AE-1009',
        'Value': 'butterfly',
        'Text': 'butterfly'
    }, {
        'When': 'AE-1009',
        'Value': 'candy',
        'Text': 'candy'
    }, {
        'When': 'AE-1009',
        'Value': 'carousel',
        'Text': 'carousel'
    }, {
        'When': 'AE-1009',
        'Value': 'cupcake',
        'Text': 'cupcake'
    }, {
        'When': 'AE-1009',
        'Value': 'duckie',
        'Text': 'duckie'
    }, {
        'When': 'AE-1009',
        'Value': 'footprints',
        'Text': 'footprints'
    }, {
        'When': 'AE-1009',
        'Value': 'hearts_1',
        'Text': 'hearts 1'
    }, {
        'When': 'AE-1009',
        'Value': 'hearts_2',
        'Text': 'hearts 2'
    }, {
        'When': 'AE-1009',
        'Value': 'kiss',
        'Text': 'kiss'
    }, {
        'When': 'AE-1009',
        'Value': 'koala',
        'Text': 'koala'
    }, {
        'When': 'AE-1009',
        'Value': 'newborn',
        'Text': 'newborn'
    }, {
        'When': 'AE-1009',
        'Value': 'night_sky',
        'Text': 'night sky'
    }, {
        'When': 'AE-1009',
        'Value': 'safari',
        'Text': 'safari'
    }, {
        'When': 'AE-1009',
        'Value': 'star_6',
        'Text': 'star 6'
    }, {
        'When': 'AE-1009',
        'Value': 'teddy_bear',
        'Text': 'teddy bear'
    },/*baptism/christening/communion*/ {
        'When': 'AE-1011',
        'Value': 'angel',
        'Text': 'angel'
    }, {
        'When': 'AE-1011',
        'Value': 'cross',
        'Text': 'cross'
    }, {
        'When': 'AE-1011',
        'Value': 'dove',
        'Text': 'dove'
    }, {
        'When': 'AE-1011',
        'Value': 'heart_3',
        'Text': 'heart 3'
    }, {
        'When': 'AE-1011',
        'Value': 'hearts_1',
        'Text': 'hearts 1'
    }, {
        'When': 'AE-1011',
        'Value': 'hearts_2',
        'Text': 'hearts 2'
    }, {
        'When': 'AE-1011',
        'Value': 'night_sky',
        'Text': 'night sky'
    }, {
        'When': 'AE-1011',
        'Value': 'star_6',
        'Text': 'star 6'
    }, /* bar/bat mitzvah*/ {
        'When': 'AE-1012',
        'Value': 'dreidel',
        'Text': 'dreidel'
    }, {
        'When': 'AE-1012',
        'Value': 'jewish_stars',
        'Text': 'jewish stars'
    }, {
        'When': 'AE-1012',
        'Value': 'menorah',
        'Text': 'menorah'
    }, {
        'When': 'AE-1012',
        'Value': 'scroll',
        'Text': 'scroll'
    }, {
        'When': 'AE-1012',
        'Value': 'star_1',
        'Text': 'star 1'
    }, {
        'When': 'AE-1012',
        'Value': 'star_2',
        'Text': 'star 2'
    }, {
        'When': 'AE-1012',
        'Value': 'star_3',
        'Text': 'star 3'
    }, {
        'When': 'AE-1012',
        'Value': 'torah',
        'Text': 'torah'
    }, {
        'When': 'AE-1012',
        'Value': 'torah_reading',
        'Text': 'torah reading'
    },/*garden/spring*/ {
        'When': 'AE-1013',
        'Value': 'bouquet',
        'Text': 'bouquet'
    }, {
        'When': 'AE-1013',
        'Value': 'butterfly',
        'Text': 'butterfly'
    }, {
        'When': 'AE-1013',
        'Value': 'daisy',
        'Text': 'daisy'
    }, {
        'When': 'AE-1013',
        'Value': 'double_rose',
        'Text': 'double rose'
    }, {
        'When': 'AE-1013',
        'Value': 'nesting',
        'Text': 'nesting'
    }, {
        'When': 'AE-1013',
        'Value': 'rose_3',
        'Text': 'rose 3'
    }, {
        'When': 'AE-1013',
        'Value': 'rose_bloom',
        'Text': 'rose bloom'
    }, {
        'When': 'AE-1013',
        'Value': 'rose_bud',
        'Text': 'rose bud'
    },/*fall*/ {
        'When': 'AE-1014',
        'Value': 'accents_10',
        'Text': 'accents 10'
    }, {
        'When': 'AE-1014',
        'Value': 'accents_11',
        'Text': 'accents 11'
    }, {
        'When': 'AE-1014',
        'Value': 'accents_12',
        'Text': 'accents 12'
    }, {
        'When': 'AE-1014',
        'Value': 'accents_14',
        'Text': 'accents 14'
    }, {
        'When': 'AE-1014',
        'Value': 'thanksgiving',
        'Text': 'thanksgiving'
    },/* beach/nautical */ {
        'When': 'AE-1016',
        'Value': 'anchor',
        'Text': 'anchor'
    }, {
        'When': 'AE-1016',
        'Value': 'beach',
        'Text': 'beach'
    }, {
        'When': 'AE-1016',
        'Value': 'beach_chair',
        'Text': 'beach chair'
    }, {
        'When': 'AE-1016',
        'Value': 'cruise_ship',
        'Text': 'cruise ship'
    }, {
        'When': 'AE-1016',
        'Value': 'dolphins',
        'Text': 'dolphins'
    }, {
        'When': 'AE-1016',
        'Value': 'drinks',
        'Text': 'drinks'
    }, {
        'When': 'AE-1016',
        'Value': 'flip_flops',
        'Text': 'flip flops'
    }, {
        'When': 'AE-1016',
        'Value': 'lobster',
        'Text': 'lobster'
    }, {
        'When': 'AE-1016',
        'Value': 'nautical',
        'Text': 'nautical'
    }, {
        'When': 'AE-1016',
        'Value': 'palm_tree_1',
        'Text': 'palm tree 1'
    }, {
        'When': 'AE-1016',
        'Value': 'palm_tree_2',
        'Text': 'palm tree 2'
    }, {
        'When': 'AE-1016',
        'Value': 'sailboat',
        'Text': 'sailboat'
    }, {
        'When': 'AE-1016',
        'Value': 'sailing',
        'Text': 'sailing'
    }, {
        'When': 'AE-1016',
        'Value': 'seahorse',
        'Text': 'seahorse'
    }, {
        'When': 'AE-1016',
        'Value': 'shell_1',
        'Text': 'shell 1'
    }, {
        'When': 'AE-1016',
        'Value': 'sunglasses',
        'Text': 'sunglasses'
    },/* holiday/winter */ {
        'When': 'AE-1017',
        'Value': 'accents_12',
        'Text': 'accents 12'
    }, {
        'When': 'AE-1017',
        'Value': 'accents_14',
        'Text': 'accents 14'
    }, {
        'When': 'AE-1017',
        'Value': 'angels',
        'Text': 'angels'
    }, {
        'When': 'AE-1017',
        'Value': 'bubbly',
        'Text': 'bubbly'
    }, {
        'When': 'AE-1017',
        'Value': 'candy_canes',
        'Text': 'candy canes'
    }, {
        'When': 'AE-1017',
        'Value': 'christmas',
        'Text': 'christmas'
    }, {
        'When': 'AE-1017',
        'Value': 'cross',
        'Text': 'cross'
    }, {
        'When': 'AE-1017',
        'Value': 'dove',
        'Text': 'dove'
    }, {
        'When': 'AE-1017',
        'Value': 'dreidel',
        'Text': 'dreidel'
    }, {
        'When': 'AE-1017',
        'Value': 'holly_bells',
        'Text': 'holly bells'
    }, {
        'When': 'AE-1017',
        'Value': 'menorah',
        'Text': 'menorah'
    }, {
        'When': 'AE-1017',
        'Value': 'ornaments',
        'Text': 'ornaments'
    }, {
        'When': 'AE-1017',
        'Value': 'poinsettia',
        'Text': 'poinsettia'
    }, {
        'When': 'AE-1017',
        'Value': 'reindeer',
        'Text': 'reindeer'
    }, {
        'When': 'AE-1017',
        'Value': 'santa_claus',
        'Text': 'santa claus'
    }, {
        'When': 'AE-1017',
        'Value': 'snowflake',
        'Text': 'snowflake'
    }, {
        'When': 'AE-1017',
        'Value': 'snowman',
        'Text': 'snowman'
    }, {
        'When': 'AE-1017',
        'Value': 'star_1',
        'Text': 'star 1'
    }, {
        'When': 'AE-1017',
        'Value': 'star_2',
        'Text': 'star 2'
    }, {
        'When': 'AE-1017',
        'Value': 'star_3',
        'Text': 'star 3'
    }, {
        'When': 'AE-1017',
        'Value': 'stocking',
        'Text': 'stocking'
    }, {
        'When': 'AE-1017',
        'Value': 'thanksgiving',
        'Text': 'thanksgiving'
    }, {
        'When': 'AE-1017',
        'Value': 'wreath',
        'Text': 'wreath'
    }, {
        'When': 'AE-1017',
        'Value': 'wreath_2',
        'Text': 'wreath 2'
    }, {
        'When': 'AE-1017',
        'Value': 'xmas_tree',
        'Text': 'xmas tree'
    }, {
        'When': 'AE-1017',
        'Value': 'xmas_tree_2',
        'Text': 'xmas tree 2'
    },/* sports themed */ {
        'When': 'AE-1018',
        'Value': 'auto_race',
        'Text': 'auto race'
    }, {
        'When': 'AE-1018',
        'Value': 'baseball',
        'Text': 'baseball'
    }, {
        'When': 'AE-1018',
        'Value': 'basketball',
        'Text': 'basketball'
    }, {
        'When': 'AE-1018',
        'Value': 'biking',
        'Text': 'biking'
    }, {
        'When': 'AE-1018',
        'Value': 'billiards',
        'Text': 'billiards'
    }, {
        'When': 'AE-1018',
        'Value': 'boarding',
        'Text': 'boarding'
    }, {
        'When': 'AE-1018',
        'Value': 'camping',
        'Text': 'camping'
    }, {
        'When': 'AE-1018',
        'Value': 'fast_ball',
        'Text': 'fast ball'
    }, {
        'When': 'AE-1018',
        'Value': 'fisherman',
        'Text': 'fisherman'
    }, {
        'When': 'AE-1018',
        'Value': 'football',
        'Text': 'football'
    }, {
        'When': 'AE-1018',
        'Value': 'hockey_sticks',
        'Text': 'hockey sticks'
    }, {
        'When': 'AE-1018',
        'Value': 'hole_in_one',
        'Text': 'hole in one'
    }, {
        'When': 'AE-1018',
        'Value': 'plane',
        'Text': 'plane'
    }, {
        'When': 'AE-1018',
        'Value': 'rocket_ship',
        'Text': 'rocket ship'
    }, {
        'When': 'AE-1018',
        'Value': 'soccer_ball',
        'Text': 'soccer ball'
    }, {
        'When': 'AE-1018',
        'Value': 'sportscar',
        'Text': 'sportscar'
    }, {
        'When': 'AE-1018',
        'Value': 'strike',
        'Text': 'strike'
    }, {
        'When': 'AE-1018',
        'Value': 'tennis_rackets',
        'Text': 'tennis_rackets'
    },/*las vegas themed*/ {
        'When': 'AE-1020',
        'Value': 'brew',
        'Text': 'brew'
    }, {
        'When': 'AE-1020',
        'Value': 'bubbly',
        'Text': 'bubbly'
    }, {
        'When': 'AE-1020',
        'Value': 'casino',
        'Text': 'casino'
    }, {
        'When': 'AE-1020',
        'Value': 'champagne',
        'Text': 'champagne'
    }, {
        'When': 'AE-1020',
        'Value': 'champagne_toast',
        'Text': 'champagne toast'
    }, {
        'When': 'AE-1020',
        'Value': 'dice',
        'Text': 'dice'
    }, {
        'When': 'AE-1020',
        'Value': 'drinks',
        'Text': 'drinks'
    }, {
        'When': 'AE-1020',
        'Value': 'martini',
        'Text': 'martini'
    }, {
        'When': 'AE-1020',
        'Value': 'royal_flush',
        'Text': 'royal flush'
    }, {
        'When': 'AE-1020',
        'Value': 'wine_toast',
        'Text': 'wine toast'
    },/* other themed designs */ {
        'When': 'AE-1019',
        'Value': 'accents_1',
        'Text': 'accents 1'
    }, {
        'When': 'AE-1019',
        'Value': 'accents_2',
        'Text': 'accents 2'
    }, {
        'When': 'AE-1019',
        'Value': 'accents_4',
        'Text': 'accents 4'
    }, {
        'When': 'AE-1019',
        'Value': 'blackberry',
        'Text': 'blackberry'
    }, {
        'When': 'AE-1019',
        'Value': 'boot',
        'Text': 'boot'
    }, {
        'When': 'AE-1019',
        'Value': 'cap',
        'Text': 'cap'
    }, {
        'When': 'AE-1019',
        'Value': 'castle',
        'Text': 'castle'
    }, {
        'When': 'AE-1019',
        'Value': 'clef',
        'Text': 'clef'
    }, {
        'When': 'AE-1019',
        'Value': 'coffee_break',
        'Text': 'coffee break'
    }, {
        'When': 'AE-1019',
        'Value': 'cowboy',
        'Text': 'cowboy'
    }, {
        'When': 'AE-1019',
        'Value': 'diploma',
        'Text': 'diploma'
    }, {
        'When': 'AE-1019',
        'Value': 'dolphins',
        'Text': 'dolphins'
    }, {
        'When': 'AE-1019',
        'Value': 'electric_guitar',
        'Text': 'electric guitar'
    }, {
        'When': 'AE-1019',
        'Value': 'happy_face',
        'Text': 'happy face'
    }, {
        'When': 'AE-1019',
        'Value': 'horse',
        'Text': 'horse'
    }, {
        'When': 'AE-1019',
        'Value': 'horseshoe',
        'Text': 'horseshoe'
    }, {
        'When': 'AE-1019',
        'Value': 'hot_peppers',
        'Text': 'hot peppers'
    }, {
        'When': 'AE-1019',
        'Value': 'ipod',
        'Text': 'ipod'
    }, {
        'When': 'AE-1019',
        'Value': 'jukebox',
        'Text': 'jukebox'
    }, {
        'When': 'AE-1019',
        'Value': 'koala',
        'Text': 'koala'
    }, {
        'When': 'AE-1019',
        'Value': 'notes',
        'Text': 'notes'
    }, {
        'When': 'AE-1019',
        'Value': 'parrot',
        'Text': 'parrot'
    }, {
        'When': 'AE-1019',
        'Value': 'piano',
        'Text': 'piano'
    }, {
        'When': 'AE-1019',
        'Value': 'plane',
        'Text': 'plane'
    }, {
        'When': 'AE-1019',
        'Value': 'rock_music',
        'Text': 'rock music'
    }, {
        'When': 'AE-1019',
        'Value': 'rocketship',
        'Text': 'rocketship'
    }, {
        'When': 'AE-1019',
        'Value': 'safari',
        'Text': 'safari'
    }, {
        'When': 'AE-1019',
        'Value': 'shooting_stars',
        'Text': 'shooting stars'
    }, {
        'When': 'AE-1019',
        'Value': 'smooch',
        'Text': 'smooch'
    }, {
        'When': 'AE-1019',
        'Value': 'sombrero',
        'Text': 'sombrero'
    }, {
        'When': 'AE-1019',
        'Value': 'stepping_out',
        'Text': 'stepping out'
    }, {
        'When': 'AE-1019',
        'Value': 'stream_of_stars',
        'Text': 'stream of stars'
    }, {
        'When': 'AE-1019',
        'Value': 'violin',
        'Text': 'violin'
    }, {
        'When': 'AE-1019',
        'Value': 'yin_yang',
        'Text': 'yin & yang'
    },/* corporate */ {
        'When': 'AE-1015',
        'Value': '57_chevy',
        'Text': '57 chevy'
    }, {
        'When': 'AE-1015',
        'Value': 'accents_1',
        'Text': 'accents 1'
    }, {
        'When': 'AE-1015',
        'Value': 'accents_2',
        'Text': 'accents 2'
    }, {
        'When': 'AE-1015',
        'Value': 'accents_4',
        'Text': 'accents 4'
    }, {
        'When': 'AE-1015',
        'Value': 'balloons_2',
        'Text': 'balloons 2'
    }, {
        'When': 'AE-1015',
        'Value': 'blackberry',
        'Text': 'blackberry'
    }, {
        'When': 'AE-1015',
        'Value': 'bubbly',
        'Text': 'bubbly'
    }, {
        'When': 'AE-1015',
        'Value': 'candy',
        'Text': 'candy'
    }, {
        'When': 'AE-1015',
        'Value': 'cell_phone',
        'Text': 'cell phone'
    }, {
        'When': 'AE-1015',
        'Value': 'champagne',
        'Text': 'champagne'
    }, {
        'When': 'AE-1015',
        'Value': 'coffee_break',
        'Text': 'coffee break'
    }, {
        'When': 'AE-1015',
        'Value': 'drinks',
        'Text': 'drinks'
    }, {
        'When': 'AE-1015',
        'Value': 'flag',
        'Text': 'flag'
    }, {
        'When': 'AE-1015',
        'Value': 'happy_face',
        'Text': 'happy face'
    }, {
        'When': 'AE-1015',
        'Value': 'happy_hands',
        'Text': 'happy hands'
    }, {
        'When': 'AE-1015',
        'Value': 'horse_shoe',
        'Text': 'horse shoe'
    }, {
        'When': 'AE-1015',
        'Value': 'ipod',
        'Text': 'ipod'
    }, {
        'When': 'AE-1015',
        'Value': 'kiss',
        'Text': 'kiss'
    }, {
        'When': 'AE-1015',
        'Value': 'magic_wand',
        'Text': 'magic wand'
    }, {
        'When': 'AE-1015',
        'Value': 'martini',
        'Text': 'martini'
    }, {
        'When': 'AE-1015',
        'Value': 'phone',
        'Text': 'phone'
    }, {
        'When': 'AE-1015',
        'Value': 'shooting_stars',
        'Text': 'shooting stars'
    }, {
        'When': 'AE-1015',
        'Value': 'shopping',
        'Text': 'shopping'
    }, {
        'When': 'AE-1015',
        'Value': 'star_6',
        'Text': 'star 6'
    }, {
        'When': 'AE-1015',
        'Value': 'stream_of_stars',
        'Text': 'stream of stars'
    }, {
        'When': 'AE-1015',
        'Value': 'wine_toast',
        'Text': 'wine toast'
    }, ];
    
    /* Connect #2_napkin_size to #1_napkin_color */
    jQuery("#2_napkin_size").cascade("#1_napkin_color", {
        list: size,
        template: commonTemplate,
        match: commonMatch
    });
    
    /* Connect #3_layout to #2_napkin_size */
    jQuery("#3_layout").cascade("#2_napkin_size", {
        list: layout,
        template: commonTemplate,
        match: commonMatch
    }).bind("loaded.cascade", function(){
        addNewOptions();
    });
    
    
    /* Display text feilds and icon drop down to #4_design */
    
    
    $("#4_design").change(function(){
        var opt = this.options[this.selectedIndex].value;
		 $('#7_initial').val('');
		 $('#5_design_text').val('');
		 $('#6_monogram').val('');
        if (opt == "AE-1021") {
            $('#5_design_textdiv').hide();
            $('#6_monogramdiv').hide();
            $('#7_initialdiv').hide();
            $('#8_icondiv').hide();
            $('#12_custom_logodiv').hide();
        }
        else 
            if (opt == "AE-1022") {
                $('#5_design_textdiv').show();
                $('#6_monogramdiv').hide();
                $('#7_initialdiv').hide();
                $('#8_icondiv').hide();
                $('#12_custom_logodiv').hide();
            }
            else 
                if (opt == "AE-1023") {
                    $('#5_design_textdiv').hide();
                    $('#6_monogramdiv').show();
                    $('#7_initialdiv').hide();
                    $('#8_icondiv').hide();
                    $('#12_custom_logodiv').hide();
                }
                else 
                    if (opt == "AE-1024") {
                        $('#5_design_textdiv').hide();
                        $('#6_monogramdiv').hide();
                        $('#7_initialdiv').show();
                        $('#8_icondiv').hide();
                        $('#12_custom_logodiv').hide();
                    }
                    else 
                        if (opt == "AE-1015") {
                            $('#5_design_textdiv').hide();
                            $('#6_monogramdiv').hide();
                            $('#7_initialdiv').hide();
                            $('#8_icondiv').show();
                            $('#12_custom_logodiv').show();
                        }
                        else {
                            $('#5_design_textdiv').hide();
                            $('#6_monogramdiv').hide();
                            $('#7_initialdiv').hide();
                            $('#8_icondiv').show();
                            $('#12_custom_logodiv').hide();
                        }
    })
    
    /* Connect #3_layout to #2_napkin_size */
    jQuery("#8_icon").cascade("#4_design", {
        list: icon,
        template: commonTemplate,
        match: commonMatch
    });
    
     $("#2_napkin_size, #3_layout, #4_design").change(function(){
     //addLayoutOptions();
     addNewOptions();
     });
     
    function addNewOptions(){
        //alert($("#3_layout").val());    
        $("#9_design_layout").removeOption(/./);  
    
	    var angelOptions = {
            "layout_1": "layout 1",
            "layout_2": "layout 2",
            "layout_7": "layout 7"
        };
        var straightNoneOptions = {
            "layout_1": "layout 1",
            "layout_2": "layout 2",
            "layout_3": "layout 3",
            "layout_4": "layout 4",
            "layout_5": "layout 5",
            "layout_6": "layout 6",
            "layout_7": "layout 7",
            "layout_8": "layout 8"
        
        };
		var defaultOptions = {
            "layout_1": "layout 1",
            "layout_2": "layout 2",
            "layout_3": "layout 3",
            "layout_4": "layout 4",
            "layout_5": "layout 5",
            "layout_6": "layout 6",
            "layout_7": "layout 7"
        };
		var straightOptions = {
            "layout_1": "layout 1",
            "layout_2": "layout 2",
            "layout_3": "layout 3",
            "layout_4": "layout 4",
            "layout_5": "layout 5",
            "layout_6": "layout 6",
            "layout_7": "layout 7"
        };
		 
        if ($("#3_layout").val() == "angle") {
            $("#9_design_layout").addOption(angelOptions, false);
        }
        if ($("#3_layout").val() == "straight" && $("#4_design").val() == "AE-1021") {
            $("#9_design_layout").addOption(straightNoneOptions, false);
        }
       if ($("#3_layout").val() == "default"){
	   	$("#9_design_layout").addOption(defaultOptions, false);
	   }
	   if ($("#3_layout").val() == "straight"){
	   	$("#9_design_layout").addOption(straightOptions, false);
	   }
    }
    
    /*
     function addLayoutOptions(){
     //clearLayoutOptions();
     if ($("#3_layout").val() == "angle") {
     $("#9_design_layout").addOption('layout_1', 'layout 1', false); //add it back
     $("#9_design_layout").addOption('layout_2', 'layout 2', false); //add it back
     //$("#9_design_layout").addOption('layout_3', 'layout 3', false); //add it back
     $("#9_design_layout").addOption('layout_7', 'layout 7', false); //add it back
     }
     else
     if ($("#3_layout").val() == "straight" && $("#4_design").val() == "AE-1021") {
     $("#9_design_layout").addOption('layout_1', 'layout 1', false); //add it back
     $("#9_design_layout").addOption('layout_2', 'layout 2', false); //add it back
     $("#9_design_layout").addOption('layout_3', 'layout 3', false); //add it back
     $("#9_design_layout").addOption('layout_4', 'layout 4', false); //add it back
     $("#9_design_layout").addOption('layout_5', 'layout 5', false); //add it back
     $("#9_design_layout").addOption('layout_6', 'layout 6', false); //add it back
     $("#9_design_layout").addOption('layout_7', 'layout 7', false); //add it back
     $("#9_design_layout").addOption('layout_8', 'layout 8', false); //add it back
     }
     else
     if ($("#3_layout").val() == "default") {
     $("#9_design_layout").addOption('layout_1', 'layout 1', false); //add it back
     $("#9_design_layout").addOption('layout_2', 'layout 2', false); //add it back
     $("#9_design_layout").addOption('layout_3', 'layout 3', false); //add it back
     $("#9_design_layout").addOption('layout_5', 'layout 5', false); //add it back
     $("#9_design_layout").addOption('layout_6', 'layout 6', false); //add it back
     $("#9_design_layout").addOption('layout_7', 'layout 7', false); //add it back
     }
     else
     if ($("#3_layout").val() == "straight") {
     $("#9_design_layout").addOption('layout_1', 'layout 1', false); //add it back
     $("#9_design_layout").addOption('layout_2', 'layout 2', false); //add it back
     $("#9_design_layout").addOption('layout_3', 'layout 3', false); //add it back
     $("#9_design_layout").addOption('layout_4', 'layout 4', false); //add it back
     $("#9_design_layout").addOption('layout_5', 'layout 5', false); //add it back
     $("#9_design_layout").addOption('layout_6', 'layout 6', false); //add it back
     $("#9_design_layout").addOption('layout_7', 'layout 7', false); //add it back
     }
     $("#9_design_layout option[@value='']").remove(); //remove empty options
     }
     */
    /*
     function clearLayoutOptions(){
     $("#9_design_layout option[@value='layout_1']").remove();
     $("#9_design_layout option[@value='layout_2']").remove();
     $("#9_design_layout option[@value='layout_3']").remove();
     $("#9_design_layout option[@value='layout_4']").remove();
     $("#9_design_layout option[@value='layout_5']").remove();
     $("#9_design_layout option[@value='layout_6']").remove();
     $("#9_design_layout option[@value='layout_7']").remove();
     $("#9_design_layout option[@value='layout_8']").remove();
     }
     */
    /* Start Default Selection */
    $('#1_napkin_color').trigger("change.cascade");
    $('#5_catagory').trigger("change.cascade");
    $('#3_layout').trigger("change.cascade");
    $('#3_layout').trigger("change");
    $('#4_design').trigger("change.cascade");
    $('#4_design').trigger("change");
    
});

// insert minum in var minQuan and alert message in var minAlertMessage
var minQuan = 4;
var minAlertMessage = "The minimum order is " + minQuan + " sets";
//checks quanitity field
$("#0_quantity").change(function(){
    var quan = ($(this).val())
    var numericExpression = /^[0-9]+$/;
    
    if (quan.match(numericExpression)) {
    
    }
    else {
        alert('Please enter a number in the quantity field');
        $('#0_quantity').val(minQuan);
    }
    
    if (quan < minQuan) {
        alert(minAlertMessage);
        $('#0_quantity').val(minQuan);
    }
});

