/*
 * @description Using the Fee ID, determines whether to add or insert a new fee
 * @param int Fee The amount of the fee you are adding
 * @param string ID A string that can uniquely identify this fee (for removal)
 * @param string Description The description text of the fee
 */
function AddFee(Fee, ID, Description) {

	function UpdateFee(Fee, ID, Description) {
		$('#fees p#'+ID).empty().append(
			$('<span>').addClass('fee').html('$'+new Number(Fee).toFixed(2)),
			$('<span>').addClass('description').html(Description)
		);
		
	}

	function InsertFee(Fee, ID, Description) {
		$('#fees').append(
			$('<p>').attr('id', ID).append(
				$('<span>').addClass('fee').html('$'+new Number(Fee).toFixed(2)),
				$('<span>').addClass('description').html(Description)
			)
		);
		
	}

	// Update or Instert
	if ($('#fees #'+ID).length > 0) {
		UpdateFee(Fee, ID, Description);
	} else {
		InsertFee(Fee, ID, Description);
	}

	// Get Total
	SumFees();

}

function SumFees()
{
	var Total = new Number(0);
	$('#fees .fee').each(function() {
		var Fee = parseFloat($(this).html().replace('$', ''));
		Total = Total + Fee;
	});
	//if total is greater than 0 show fees
	if (Total > 0) {
		$('#fees').show();
	} else {
		$('#fees').hide();
	}
	$('#total-price').html(Total.toFixed(2)).parent('p').parent('#price').show();
	$('input[name=price]').val(Total.toFixed(2));
}

function ClearFee(ID) {
	$('#fees p').each(function() {
		if ($(this).attr('id') == ID) {
			$(this).remove();
		}
	});
	SumFees();
}

function CalculateCustom() {

	// prepare the variables that are to be compared
	var Format = $('select[name=format]').val();
	var Finish = $('select[name=finish]').val();
	var Paper = $('select[name=paper]').val();
	var Quantity = $('select[name=quantity]').val();
	var Width = parseFloat($('input[name=width]').val());
	var Height = parseFloat($('input[name=height]').val());
	var FinishFee = parseFloat($('select[name=finish] :selected').attr('rel'));
	var PaperFee = parseFloat($('select[name=paper] :selected').attr('rel'));

	// validate heights/widths
	//AJ
	if( isNaN(Width) || isNaN(Height) ){
		$('#custom-size .error').remove();
		$('#custom-size').append($('<div>').addClass('error').html('Please enter a valid digit between 0-9"'));
		$('#custom-size .square-footage').remove();
		ClearFee('paper');
		ClearFee('finish');
		return false;
		
	}
	
	//AJ	
	
	if (Width < 12) {
		$('#custom-size .error').remove();
		$('#custom-size').append($('<div>').addClass('error').html('Minimum width is 12"'));
		$('#custom-size .square-footage').remove();
		ClearFee('paper');
		ClearFee('finish');
		return false;
	}
	if (Width > 240) {
		$('#custom-size .error').remove();
		$('#custom-size').append($('<div>').addClass('error').html('Maximum width is 240"'));
		$('#custom-size .square-footage').remove();
		ClearFee('paper');
		ClearFee('finish');
		return false;
	}
	if (Height < 12) {
		$('#custom-size .error').remove();
		$('#custom-size').append($('<div>').addClass('error').html('Minimum height is 12"'));
		$('#custom-size .square-footage').remove();
		ClearFee('paper');
		ClearFee('finish');
		return false;
	}
	//if (Format == 'Scrim Banner' || Format == 'Vinyl Banner' || Format == 'Vinyl Mesh Banner') {
	if (Format == 'Banner') {
		if (Height > 95.5) {
			$('#custom-size .error').remove();
			$('#custom-size').append($('<div>').addClass('error').html('Maximum height is 95.5"'));
			$('#custom-size .square-footage').remove();
			ClearFee('paper');
			ClearFee('finish');
			return false;
		}
	} else {
		if (Height > 59.5) {
			$('#custom-size .error').remove();
			$('#custom-size').append($('<div>').addClass('error').html('Maximum height is 59.5"'));
			$('#custom-size .square-footage').remove();
			ClearFee('paper');
			ClearFee('finish');
			return false;
		}
	}
	
	// remove the errors
	$('#custom-size .error').remove();

	// determine the square footage
	var SquareFootage = ((Width * Height) / 144).toFixed(2);
	if (PaperFee > 0) {
		AddFee((PaperFee * SquareFootage) * Quantity, 'paper', Paper + ' paper @ $' + PaperFee + ' per sq. ft.');
	}
	if (FinishFee > 0) {
		AddFee((FinishFee * SquareFootage) * Quantity, 'finish', Finish + ' finish @ $' + FinishFee + ' per sq. ft.');
	}

	// display the square footage
	if ($('#custom-size .square-footage').length > 0) {
		$('#custom-size .square-footage').html(SquareFootage + ' sq. ft.');
	}
	else {
		$('#custom-size').append($('<div>').addClass('square-footage').html(SquareFootage + ' sq. ft.'));
	}

}

$(document).ready(function() {
	/*
	 * Project Name Watermark
	 */
	$('input[name=project_name]').focus(function() {
		if ($(this).val() == 'Enter Project Name') {
			$(this).val('');
		}
	}).blur(function() {
		if ($(this).val() == '') {
			$(this).val('Enter Project Name');
		}
	});
	/*
	 * Custom Quantity Watermark
	 */
	$('#quantity').children('input').focus(function() {
		if ($(this).val() == 'Enter Quantity') {
			$(this).val('');
		}
	}).blur(function() {
		if ($(this).val() == '') {
			$(this).val('Enter Quantity');
		}
	});

	/*
	 * Job Type Dropdown Change Event
	 */
	
	var pageType = location.pathname;
	pageType = pageType.replace(/-/g," ");
	pageType = pageType.replace(/\//g,"");
	pageType = pageType.replace(/.html/g,"");

	pageType = pageType.toLowerCase();
	
	
	
	
	var jobType = location.pathname;
	jobType = jobType.replace(/-/g," ");
	jobType = jobType.replace(/\//g,"");
	jobType = jobType.replace(/.html/g,"");

	jobType = jobType.toLowerCase();
	if(jobType == 'vinyl decals')		jobType = 'vehicle wraps';
	if(jobType == '3d print') 			jobType = '3d printing';
	if(jobType == 'invitations') 		jobType = 'color laser prints';
	if(jobType == 'portfolios') 		jobType = 'color laser prints';
	if(jobType == 'restaurant menus') 	jobType = 'color laser prints';
	if(jobType == 'posters') 			jobType = 'large format prints';
	if(jobType == 'scrim') 				jobType = 'large format prints';
	if(jobType == 'giclee')				jobType = 'large format prints';
	if(jobType == 'trade show')			jobType = 'large format prints';
	
	var $options = $('option', $('#jobTypeSelectEl'));
	$options.each(function(){
		//console.debug('option: %s == %s', $(this).val().toLowerCase(), jobType);
		if($(this).val().toLowerCase() == jobType)
		{
			$(this).attr('selected','selected');
			changeJobType();
		}
	});
	
	
	
	$('select[name=job_type]').change(changeJobType);
	
	//$('select[name=job_type]').change(function() {
	function changeJobType(){
		//console.debug('in jobtyp funct');
		// hide children
		
		$('#format').hide().children('select').empty();
		
		//AJ
		$('#type').hide().children('select').empty();
		//AJ
		
		$('#paper').hide().children('select').empty();
		$('#color').hide().children('select').empty();
		$('#finish').hide().children('select').empty();
		$('#size').hide().children('select').empty();
		$('#custom-size').hide().children('p').children('input').empty();
		$('#fold').hide().children('select').empty();
		$('#quantity').hide().children('select').empty().hide().siblings('input').val('Enter Quantity').hide();
		$('#fees').hide().empty();
		$('#price').hide().children('p').children('#total-price').empty();
         
		// prepare the variables that are to be compared
		//var JobType = $(this).val(); 
		var JobType = $('#jobTypeSelectEl').val();
		//console.debug('JobTypeA: %s', JobType);
		

		// Business Cards
		if (JobType == 'Business Cards') {
			
			// add color options
			$('#color').show().children('select').empty().append(
				$('<option>').attr('value', '').html('-- Color --'),
				$('<option>').attr('value', 'color/blank').html('Front: Color, Back: Blank'),
				$('<option>').attr('value', 'color/gray').html('Front: Color, Back: Grayscale'),
				$('<option>').attr('value', 'color/color').html('Front: Color, Back: Color'),
				$('<option>').attr('value', 'gray/blank').html('Front: Grayscale, Back: Blank'),
				$('<option>').attr('value', 'gray/gray').html('Front: Grayscale, Back: Grayscale')
			);

		// Color Laser Prints
		} else if (JobType == 'Color Laser Prints') {

			// add format options
			$('#format').show().children('select').empty().append(
				$('<option>').attr('value', '').html('-- Format --'),
				//$('<option>').attr('value', 'Postcards').html('Postcards'),
				//$('<option>').attr('value', 'Invitations').html('Invitations'),
				//$('<option>').attr('value', 'Brochures').html('Brochures'),
				$('<option>').attr('value', 'Marketing Flyers').html('Marketing Flyers'),
				$('<option>').attr('value', 'Artist Portfolio').html('Artist Portfolio'),
				$('<option>').attr('value', 'Restaurant Menu').html('Restaurant Menu')
			);
			
			
		// Large Format Prints
		} else if (JobType == 'Large Format Prints') {

			// add format options
			$('#format').show().children('select').empty().append(
				$('<option>').attr('value', '').html('-- Format --'),
				$('<option>').attr('value', 'Poster').html('Poster'),
				$('<option>').attr('value', 'Presentation Board').html('Presentation Board'),
//				$('<option>').attr('value', 'Scrim Banner').html('Scrim Banner'),
//				$('<option>').attr('value', 'Vinyl Banner').html('Vinyl Banner'),
//				$('<option>').attr('value', 'Vinyl Mesh Banner').html('Vinyl Mesh Banner'),
				$('<option>').attr('value', 'Banner').html('Banners'),
				$('<option>').attr('value', 'Event Display & Signage').html('Event Display & Signage'),
				$('<option>').attr('value', 'Giclee Prints w/ Archival Inks').html('Giclee Prints w/ Archival Inks'),
				$('<option>').attr('value', 'Custom Wrapping').html('Custom Wrapping')
			);
			
		// 3D Printing
		} else if (JobType == '3D Printing') {
			
			// add format options
			$('#format').show().children('select').empty().append(
				$('<option>').attr('value', '').html('-- Format --'),
				$('<option>').attr('value', 'Rapid Prototyping').html('Rapid Prototyping'),
				$('<option>').attr('value', '3D Modeling').html('3D Modeling')
			);

		// Laser Cutting
		} else if (JobType == 'Laser Cutting') {
			
			// add format options
			$('#format').show().children('select').empty().append(
				$('<option>').attr('value', '').html('-- Format --'),
				$('<option>').attr('value', 'Models').html('Models'),
				$('<option>').attr('value', 'Text Letters').html('Text Letters'),
				$('<option>').attr('value', 'Engraving').html('Engraving')
			);
			
		// Vinyl Cutting
		} else if (JobType == 'Vinyl Cutting') {
			
			// add format options
			$('#format').show().children('select').empty().append(
				$('<option>').attr('value', '').html('-- Format --'),
				$('<option>').attr('value', 'Vinyl Lettering').html('Vinyl Lettering'),
				$('<option>').attr('value', 'Vinyl Graphics').html('Vinyl Graphics')
			);
			
		// Vehicle Wraps
		} else if (JobType == 'Vehicle Wraps') {
			
			// add format options
			$('#format').show().children('select').empty().append(
				$('<option>').attr('value', '').html('-- Format --'),
				$('<option>').attr('value', 'Standard Car').html('Standard Car'),
				$('<option>').attr('value', 'Van/Truck/SUV').html('Van/Truck/SUV'),
				$('<option>').attr('value', 'Bus/RV').html('Bus/RV'),
				$('<option>').attr('value', 'Semi Truck/Trailer').html('Semi Truck/Trailer')
			);

		}
		
		var sub = pageType.toLowerCase();
		if(sub == 'invitations') 		sub = 'marketing flyers';
		if(sub == 'portfolios') 		sub = 'artist portfolio';
		if(sub == 'restaurant menus') 	sub = 'restaurant menu';
		if(sub == 'posters') 			sub = 'poster';
		//if(sub == 'scrim') 				sub = 'scrim banner';
		if(sub == 'scrim') 				sub = 'banner';
		if(sub == 'giclee') 				sub = 'giclee prints w/ archival inks';
		var $options = $('option', $('#format select'));
		$options.each(function(){
			if($(this).val().toLowerCase() == sub)
			{
				$(this).attr('selected','selected');
			}
		});
		formatDropDown();
	} // end changeJobTypeFunction
	
	/*
	 * Format Dropdown Change Event
	 */
	//$('select[name=format]').change(function() {
	$('select[name=format]').change(formatDropDown); 
	function formatDropDown() {
		//console.debug('in format dropDown');
		// hide children
		$('#type').hide().children('select').empty();
		$('#paper').hide().children('select').empty();
		$('#color').hide().children('select').empty();
		$('#finish').hide().children('select').empty();
		$('#size').hide().children('select').empty();
		$('#custom-size').hide().children('p').children('input').empty();
		$('#fold').hide().children('select').empty();
		$('#quantity').hide().children('select').empty().hide().siblings('input').val('Enter Quantity').hide();
		$('#fees').hide().empty();
		$('#price').hide().children('p').children('#total-price').empty();
		
		// prepare the variables that are to be compared
		var JobType = $('select[name=job_type]').val();
		var Format = $('select[name=format]').val();
		
		// Large Format Prints
		if (JobType == 'Large Format Prints') {
			
			// Large Format Prints -> Posters
			// Large Format Prints -> Presentation Board
			// Large Format Prints -> Custom Wrapping
			if (Format == 'Poster' || Format == 'Presentation Board' || Format == 'Custom Wrapping') {
				
				// add paper options
				$('#paper').show().children('select').empty().append(
					$('<option>').attr({'value': ''}).html('Select a Paper Type'),
					$('<option>').attr({'value': 'Photo Matte', 'rel': '9'}).html('Photo Matte'),
					$('<option>').attr({'value': 'Hi-Quality CAD Plot', 'rel': '4'}).html('Hi-Quality CAD Plot'),
					$('<option>').attr({'value': 'CAD Plot-Bond', 'rel': '0.85'}).html('CAD Plot-Bond'),
					$('<option>').attr({'value': 'Mylar', 'rel': '14'}).html('Mylar'),
					$('<option>').attr({'value': 'Backlit', 'rel': '14'}).html('Backlit'),
					$('<option>').attr({'value': 'Transparancy', 'rel': '14'}).html('Transparency')
				);
				
			// Large Format Prints -> Scrim Banner
			// Large Format Prints -> Vinyl Banner
			// Large Format Prints -> Vinyl Mesh Banner
			//} else if (Format == 'Scrim Banner' || Format == 'Vinyl Banner' || Format == 'Vinyl Mesh Banner') {
			} else if (Format == 'Banner' ) {
				// add paper options
				$('#paper').show().children('select').empty().append(
					$('<option>').attr({'value': ''}).html('Select a Paper Type'),
//					$('<option>').attr({'value': 'Standard Outdoor/Indoor Vinyl', 'rel': '8'}).html('Standard Outdoor/Indoor Vinyl'),
//					$('<option>').attr({'value': 'Mesh Vinyl', 'rel': '11'}).html('Mesh Vinyl'),
//					$('<option>').attr({'value': 'Adhesive Vinyl', 'rel': '11'}).html('Adhesive Vinyl')
					$('<option>').attr({'value': 'Matte Vinyl', 'rel': '8'}).html('Matte Vinyl'),
					$('<option>').attr({'value': 'Glossy Vinyl', 'rel': '8'}).html('Glossy Vinyl'),
					$('<option>').attr({'value': 'Matte-Canvas', 'rel': '8'}).html('Matte-Canvas')
				);

			// Large Format Prints -> Event Display & Signage
			} else if (Format == 'Event Display & Signage') {

				// All Custom
				// Upload Artwork Available
				// Link to Laarhovendesign.com
				
			// Large Format Prints -> Giclee Prints w/ Archival Inks
			} else if (Format == 'Giclee Prints w/ Archival Inks') {

				// add paper options
				$('#paper').show().children('select').empty().append(
					$('<option>').attr({'value': ''}).html('Select a Paper Type'),
					$('<option>').attr({'value': 'Photo Matte', 'rel': '10'}).html('Photo Matte'),
					$('<option>').attr({'value': 'Fine Arts - Smooth', 'rel': '16'}).html('Fine Arts - Smooth'),
					$('<option>').attr({'value': 'Canvas-Matte', 'rel': '22'}).html('Canvas-Matte')
				);
				
			}
		
		// Color Laser Prints
		} else if (JobType == 'Color Laser Prints') {
			
			// Color Laser Prints -> Postcards
			if (Format == 'Postcards') {
				
				// add color options
				$('#color').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Color --'),
					$('<option>').attr('value', 'color/blank').html('Front: Color, Back: Blank'),
					$('<option>').attr('value', 'color/gray').html('Front: Color, Back: Grayscale'),
					$('<option>').attr('value', 'color/color').html('Front: Color, Back: Color'),
					$('<option>').attr('value', 'gray/blank').html('Front: Grayscale, Back: Blank'),
					$('<option>').attr('value', 'gray/gray').html('Front: Grayscale, Back: Grayscale')
				);
				
			// Color Laser Prints -> Invitations
			} else if (Format == 'Invitations') {

				// add paper options
				$('#paper').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Paper --'),
					$('<option>').html('Digital Semi-Gloss Card Stock 12pt (110 lbs)'),
					$('<option>').html('Digital Standard 20-32 lbs Standard'),
					$('<option>').html('Digital Semi-Gloss 20-32 lbs Standard'),
					$('<option>').html('Digital Standard 60-65 lbs Cover'),
					$('<option>').html('Digital Semi-Gloss 60-65 lbs Cover'),
					$('<option>').html('Digital Standard 80-100 lbs Cover'),
					$('<option>').html('Digital Semi-Gloss 80-100 lbs Cover')
				);

			// Color Laser Prints -> Brochures
			} else if (Format == 'Brochures') {
				
				// add paper options
				$('#paper').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Paper --'),
					$('<option>').html('Digital Standard 20-32 lbs Standard'),
					$('<option>').html('Digital Standard 60-65 lbs Cover'),
					$('<option>').html('Digital Standard 80-100 lbs Cover'),
					$('<option>').html('Digital Semi-Gloss 20-32 lbs Standard'),
					$('<option>').html('Digital Semi-Gloss 60-65 lbs Cover'),
					$('<option>').html('Digital Semi-Gloss 80-100 lbs Cover')
				);

			// Color Laser Prints -> Marketing Flyers
			} else if (Format == 'Marketing Flyers') {
				
				// add paper options
				$('#paper').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Paper --'),
					$('<option>').html('Digital Standard 20-32 lbs Standard'),
					$('<option>').html('Digital Standard 60-65 lbs Cover'),
					$('<option>').html('Digital Standard 80-100 lbs Cover'),
					$('<option>').html('Digital Semi-Gloss 20-32 lbs Standard'),
					$('<option>').html('Digital Semi-Gloss 60-65 lbs Cover'),
					$('<option>').html('Digital Semi-Gloss 80-100 lbs Cover')
				);

			// Color Laser Prints -> Artist Portfolio
			} else if (Format == 'Artist Portfolio') {

				// add paper options
				$('#paper').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Paper --'),
					$('<option>').html('Digital Standard 60-65 lbs Cover'),
					$('<option>').html('Digital Semi-Gloss 60-65 lbs Cover')
				);

			// Color Laser Prints -> Restaurant Menu
			} else if (Format == 'Restaurant Menu') {

				// add paper options
				$('#paper').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Paper --'),
					$('<option>').html('Digital Semi-Gloss Card Stock 12pt (110 lbs)'),
					$('<option>').html('Digital Standard 60-65 lbs Cover'),
					$('<option>').html('Digital Semi-Gloss 60-65 lbs Cover'),
					$('<option>').html('Digital Standard 80-100 lbs Cover'),
					$('<option>').html('Digital Semi-Gloss 80-100 lbs Cover')
				);

			}
		
		// 3D Printing
		} else if (JobType == '3D Printing') {
			
			// 3D Printing -> Rapid Prototyping
			if (Format == 'Rapid Prototyping') {
				AddFee(35, 'deposit', ' Deposit');
			// 3D Printing -> 3D Modeling
			} else if (Format == '3D Modeling') {
				AddFee(35, 'deposit', ' Deposit');
			}
			
			$('#quantity').show().children('select').empty().show().append(
				$('<option>').attr('value', '').html('-- Quantity --'),
				$('<option>').attr('value', '1').html('1'),
				$('<option>').attr('value', '2').html('2'),
				$('<option>').attr('value', '3').html('3'),
				$('<option>').attr('value', '4').html('4'),
				$('<option>').attr('value', '5').html('5'),
				$('<option>').attr('value', '6').html('6'),
				$('<option>').attr('value', '7').html('7'),
				$('<option>').attr('value', '8').html('8'),
				$('<option>').attr('value', '9').html('9'),
				$('<option>').attr('value', '10').html('10')
			);

		// Laser Cutting
		} else if (JobType == 'Laser Cutting') {
			
			// Laser Cutting -> Models
			
			if (Format == 'Models') {
				AddFee(35, 'deposit', ' Deposit');
			// Laser Cutting -> Text Letters
			} else if (Format == 'Text Letters') {
				AddFee(35, 'deposit', ' Deposit');
			// Laser Cutting -> Engraving
			} else if (Format == 'Engraving') {
				AddFee(35, 'deposit', ' Deposit');
			}
			
			$('#quantity').show().children('select').empty().show().append(
				$('<option>').attr('value', '').html('-- Quantity --'),
				$('<option>').attr('value', '1').html('1'),
				$('<option>').attr('value', '2').html('2'),
				$('<option>').attr('value', '3').html('3'),
				$('<option>').attr('value', '4').html('4'),
				$('<option>').attr('value', '5').html('5'),
				$('<option>').attr('value', '6').html('6'),
				$('<option>').attr('value', '7').html('7'),
				$('<option>').attr('value', '8').html('8'),
				$('<option>').attr('value', '9').html('9'),
				$('<option>').attr('value', '10').html('10')
			);
			
		// Vinyl Cutting
		} else if (JobType == 'Vinyl Cutting') {
			
			if (Format == 'Vinyl Lettering') {
				AddFee(18, 'deposit', ' Deposit');
			} else if (Format == 'Vinyl Graphics') {
				AddFee(18, 'deposit', ' Deposit');
			}

			$('#type').show().children('select').empty().append(
				$('<option>').attr('value', '').html('-- Type --'),
				$('<option>').attr('value', 'Window').html('Window'),
				$('<option>').attr('value', 'Wall').html('Wall'),
				$('<option>').attr('value', 'Vehicle').html('Vehicle'),
				$('<option>').attr('value', 'Trailer').html('Trailer'),
				$('<option>').attr('value', 'Boats').html('Boats'),
				$('<option>').attr('value', 'Snowmobile').html('Snowmobile'),
				$('<option>').attr('value', 'Other').html('Other')
			);
			
		// Vehicle Wraps
		} else if (JobType == 'Vehicle Wraps') {
			
			if (Format == 'Standard Car') {
				AddFee(100, 'deposit', ' Deposit');
			} else if (Format == 'Van/Truck/SUV') {
				AddFee(100, 'deposit', ' Deposit'); 
			} else if (Format == 'Bus/RV') {
				AddFee(100, 'deposit', ' Deposit');
			} else if (Format == 'Semi Truck/Trailer') {
				AddFee(100, 'deposit', ' Deposit');
			}

		}

	}//end formatDropDown

	/*
	 * Type Dropdown Change Event
	 */
	$('select[name=type]').change(function() {

		// hide children
		$('#paper').hide().children('select').empty();
		$('#color').hide().children('select').empty();
		$('#finish').hide().children('select').empty();
		$('#size').hide().children('select').empty();
		$('#custom-size').hide().children('p').children('input').empty();
		$('#fold').hide().children('select').empty();
		$('#quantity').hide().children('select').empty().hide().siblings('input').val('Enter Quantity').hide();
				
		
		// prepare the variables that are to be compared
		var JobType = $('select[name=job_type]').val();
		var Format = $('select[name=format]').val();
		var Type = $(this).val();
		
		if (JobType == 'Vinyl Cutting') {
			
			$('#color').show().children('select').empty().append(
				$('<option>').attr('value', '').html('-- Color --'),
				$('<option>').attr('value', 'White').html('White'),
				$('<option>').attr('value', 'Black').html('Black'),
				$('<option>').attr('value', 'Red').html('Red'),
				$('<option>').attr('value', 'Blue').html('Blue'),
				$('<option>').attr('value', 'Green').html('Green'),
				$('<option>').attr('value', 'Other').html('Other')
			);
			
		} else if (JobType == 'Vehicle Wraps') {
			
			$('#quantity').show().children('select').empty().show().append(
				$('<option>').attr('value', '').html(' -- Quantity --'),
				$('<option>').attr('value', '1').html('1'),
				$('<option>').attr('value', '2').html('2'),
				$('<option>').attr('value', '3').html('3'),
				$('<option>').attr('value', '4').html('4'),
				$('<option>').attr('value', '5').html('5')
			);

		}

	});
	
	/*
	 * Paper Dropdown Change Event
	 */
	$('select[name=paper]').change(function() {

		// hide children
		$('#color').hide().children('select').empty();
		$('#finish').hide().children('select').empty();
		$('#size').hide().children('select').empty();
		$('#custom-size').hide().children('p').children('input').empty();
		$('#fold').hide().children('select').empty();
		$('#quantity').hide().children('select').empty().hide().siblings('input').val('Enter Quantity').hide();
		$('#fees').hide().empty();
		$('#price').hide().children('p').children('#total-price').empty();

		// prepare the variables that are to be compared
		var JobType = $('select[name=job_type]').val();
		var Format = $('select[name=format]').val();
		var Type = $('select[name=type]').val();
		var Paper = $(this).val();

		// Color Laser Prints
		if (JobType == 'Large Format Prints') {
			
			if (Format == 'Poster' || Format == 'Presentation Board' || Format == 'Custom Wrapping') {
				$('#finish').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Finish --'),
					$('<option>').attr({ 'value':'No Finish', 'rel':'0'}).html('No Finish'),
					$('<option>').attr({ 'value':'3/16" Black Formcore', 'rel':'6' }).html('3/16" Black Formcore'),
					$('<option>').attr({ 'value':'3/16" White Formcore', 'rel':'6' }).html('3/16" White Formcore'),
					$('<option>').attr({ 'value':'3/16" Black Gatorboard', 'rel':'8' }).html('3/16" Black Gatorboard'),
					$('<option>').attr({ 'value':'3/16" White Sintraboard', 'rel':'10' }).html('3/16" White Sintraboard')
				);
			//} else if (Format == 'Scrim Banner' || Format == 'Vinyl Banner' || Format == 'Vinyl Mesh Banner') {
			} else if (Format == 'Banner') {
				$('#finish').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Finish --'),
					$('<option>').attr({ 'value':'Grommets', 'rel':'0'}).html('Grommets'),
					$('<option>').attr({ 'value':'Adhesive hems', 'rel':'0'}).html('Adhesive hems'),
					$('<option>').attr({ 'value':'Adhesive backing', 'rel':'0'}).html('Adhesive backing')
//					$('<option>').attr({ 'value':'No Finish', 'rel':'0'}).html('No Finish'),
//					$('<option>').attr({ 'value':'Grommets (Free)', 'rel':'0' }).html('Grommets (Free)')
				);
			} else if (Format == 'Giclee Prints w/ Archival Inks') {
				$('#custom-size').show();
				$('#quantity').show().children('select').empty().show().append(
					$('<option>').attr('value', '').html('-- Quantity --'),
					$('<option>').attr('value', '1').html('1'),
					$('<option>').attr('value', '2').html('2'),
					$('<option>').attr('value', '3').html('3'),
					$('<option>').attr('value', '4').html('4'),
					$('<option>').attr('value', '5').html('5'),
					$('<option>').attr('value', '6').html('6'),
					$('<option>').attr('value', '7').html('7'),
					$('<option>').attr('value', '8').html('8'),
					$('<option>').attr('value', '9').html('9'),
					$('<option>').attr('value', '10').html('10'),
					$('<option>').attr('value', 'custom').html('custom')
//					$('<option>').attr('value', '25').html('25'),
//					$('<option>').attr('value', '50').html('50'),
//					$('<option>').attr('value', '100').html('100'),
//					$('<option>').attr('value', '200').html('200'),
//					$('<option>').attr('value', '300').html('300')
				);
			}
			
		} else if (JobType == 'Color Laser Prints') {

			// Color Laser Prints -> Invitations
			if (Format == 'Invitations') {
				$('#color').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Color --'),
					$('<option>').attr('value', 'color/blank').html('Front: Color, Back: Blank'),
					$('<option>').attr('value', 'color/gray').html('Front: Color, Back: Grayscale'),
					$('<option>').attr('value', 'color/color').html('Front: Color, Back: Color'),
					$('<option>').attr('value', 'gray/blank').html('Front: Grayscale, Back: Blank'),
					$('<option>').attr('value', 'gray/gray').html('Front: Grayscale, Back: Grayscale')
				);
				
			// Color Laser Prints -> Brochures
			} else if (Format == 'Brochures') {
				$('#color').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Color --'),
					$('<option>').attr('value', 'color/blank').html('Front: Color, Back: Blank'),
					$('<option>').attr('value', 'color/gray').html('Front: Color, Back: Grayscale'),
					$('<option>').attr('value', 'color/color').html('Front: Color, Back: Color'),
					$('<option>').attr('value', 'gray/blank').html('Front: Grayscale, Back: Blank'),
					$('<option>').attr('value', 'gray/gray').html('Front: Grayscale, Back: Grayscale')
				);

			// Color Laser Prints -> Marketing Flyers
			} else if (Format == 'Marketing Flyers') {
				$('#color').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Color --'),
					$('<option>').attr('value', 'color/blank').html('Front: Color, Back: Blank'),
					$('<option>').attr('value', 'color/gray').html('Front: Color, Back: Grayscale'),
					$('<option>').attr('value', 'color/color').html('Front: Color, Back: Color'),
					$('<option>').attr('value', 'gray/blank').html('Front: Grayscale, Back: Blank'),
					$('<option>').attr('value', 'gray/gray').html('Front: Grayscale, Back: Grayscale')
				);

			// Color Laser Prints -> Artist Portfolio
			} else if (Format == 'Artist Portfolio') {
				$('#color').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Color --'),
					$('<option>').attr('value', 'color/blank').html('Front: Color, Back: Blank'),
					$('<option>').attr('value', 'color/gray').html('Front: Color, Back: Grayscale'),
					$('<option>').attr('value', 'color/color').html('Front: Color, Back: Color'),
					$('<option>').attr('value', 'gray/blank').html('Front: Grayscale, Back: Blank'),
					$('<option>').attr('value', 'gray/gray').html('Front: Grayscale, Back: Grayscale')
				);

			// Color Laser Prints -> Restaurant Menu
			} else if (Format == 'Restaurant Menu') {
				$('#color').show().children('select').empty().append(
					$('<option>').attr('value', '').html('-- Color --'),
					$('<option>').attr('value', 'color/blank').html('Front: Color, Back: Blank'),
					$('<option>').attr('value', 'color/gray').html('Front: Color, Back: Grayscale'),
					$('<option>').attr('value', 'color/color').html('Front: Color, Back: Color'),
					$('<option>').attr('value', 'gray/blank').html('Front: Grayscale, Back: Blank'),
					$('<option>').attr('value', 'gray/gray').html('Front: Grayscale, Back: Grayscale')
				);
			}
		}
	});

	/*
	 * Color Dropdown Change Event
	 */
	$('select[name=color]').change(function() {

		// hide children
		$('#finish').hide().children('select').empty();
		$('#size').hide().children('select').empty();
		$('#custom-size').hide().children('p').children('input').empty();
		$('#fold').hide().children('select').empty();
		$('#quantity').hide().children('select').empty().hide().siblings('input').val('Enter Quantity').hide();
		//AJ
		// Changed coz its affecting vinly cutting
		//$('#fees').hide().empty();
		//$('#price').hide().children('p').children('#total-price').empty();
  
		// prepare the variables that are to be compared
		var JobType = $('select[name=job_type]').val();
		var Format = $('select[name=format]').val();
		var Type = $('select[name=type]').val();
		var Paper = $('select[name=paper]').val();
		var Color = $(this).val();

		if (Color != '') {

			// Business Cards
			if (JobType == 'Business Cards') {
				$('#quantity').show().children('select').empty().show().append(
					$('<option>').attr('value', '').html('-- Quantity --'),
					$('<option>').attr('value', '50').html('50'),
					$('<option>').attr('value', '100').html('100'),
					$('<option>').attr('value', '150').html('150'),
					$('<option>').attr('value', '250').html('250'),
					$('<option>').attr('value', '500').html('500'),
					$('<option>').attr('value', '1000').html('1000'),
					$('<option>').attr('value', '1500').html('1500'),
					$('<option>').attr('value', '2000').html('2000')
				);
				ClearFee('fold');
				ClearFee('quantity');
				AddFee(20, 'cut', 'Cut Fee');
			
			// Color Laser Prints
			} else if (JobType == 'Color Laser Prints') {
				
				// Color Laser Prints -> Postcards
				if (Format == 'Postcards') {
	
					// add size options
					$('#size').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Size --'),
						$('<option>').attr('value', '4 x 6').html('4 x 6'),
						$('<option>').attr('value', '4.25 x 5.5').html('4.25 x 5.5'),
						$('<option>').attr('value', '5 x 7').html('5 x 7')
					);
	
				// Color Laser Prints -> Invitations
				} else if (Format == 'Invitations') {
	
					// Color Laser Prints -> Invitations -> Card Stock 
					if (Paper == 'Digital Semi-Gloss Card Stock 12pt (110 lbs)') {
	
						// add size options
						$('#size').show().children('select').empty().append(
							$('<option>').attr('value', '').html('-- Size --'),
							$('<option>').attr('value', '4 x 6').html('4 x 6'),
							$('<option>').attr('value', '4.25 x 5.5').html('4.25 x 5.5'),
							$('<option>').attr('value', '5 x 7').html('5 x 7')
						);
	
					// Color Laser Prints -> Invitations -> All Except Card Stock
					} else {
	
						// add size options
						$('#size').show().children('select').empty().append(
							$('<option>').attr('value', '').html('-- Size --'),
							$('<option>').attr('value', '4 x 6').html('4 x 6'),
							$('<option>').attr('value', '4.25 x 5.5').html('4.25 x 5.5'),
							$('<option>').attr('value', '5 x 7').html('5 x 7'),
							$('<option>').attr('value', '8.5 x 11').html('8.5 x 11'),
							$('<option>').attr('value', '11 x 17').html('11 x 17'),
							$('<option>').attr('value', '12 x 18').html('12 x 18')
						);
	
					}
	
				// Color Laser Prints -> Brochures
				// Color Laser Prints -> Artist Portfolio
				} else if (Format == 'Brochures' || Format == 'Artist Portfolio') {
	
					// add size options
					$('#size').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Size --'),
						$('<option>').attr('value', '8.5 x 11').html('8.5 x 11'),
						$('<option>').attr('value', '11 x 17').html('11 x 17'),
						$('<option>').attr('value', '12 x 18').html('12 x 18')
					);
	
				// Color Laser Prints -> Marketing Flyers
				} else if (Format == 'Marketing Flyers') {
	
					// add size options
					$('#size').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Size --'),
						$('<option>').attr('value', '4 x 6').html('4 x 6'),
						$('<option>').attr('value', '4.25 x 5.5').html('4.25 x 5.5'),
						$('<option>').attr('value', '5 x 7').html('5 x 7'),
						$('<option>').attr('value', '8.5 x 11').html('8.5 x 11'),
						$('<option>').attr('value', '11 x 17').html('11 x 17'),
						$('<option>').attr('value', '12 x 18').html('12 x 18')
					);
	
				// Color Laser Prints -> Restaurant Menu
				} else if (Format == 'Restaurant Menu') {
	
					// Color Laser Prints -> Restaurant Menu -> Card Stock
					if (Paper == 'Digital Semi-Gloss Card Stock 12pt (110 lbs)') {
	
						// add size options
						$('#size').show().children('select').empty().append(
							$('<option>').attr('value', '').html('-- Size --'),
							$('<option>').attr('value', '8.5 x 11').html('8.5 x 11'),
							$('<option>').attr('value', '11 x 17').html('11 x 17'),
							$('<option>').attr('value', '12 x 18').html('12 x 18'),
							$('<option>').attr('value', '13 x 19').html('13 x 19')
						);
	
					// Color Laser Prints -> Restaurant Menu -> All Except Card Stock
					} else {
	
						// add size options
						$('#size').show().children('select').empty().append(
							$('<option>').attr('value', '').html('-- Size --'),
							$('<option>').attr('value', '8.5 x 11').html('8.5 x 11'),
							$('<option>').attr('value', '11 x 17').html('11 x 17'),
							$('<option>').attr('value', '12 x 18').html('12 x 18')
						);
	
					}
	
				// Color Laser Prints -> Restaurant Menu
				} else if (Format == 'Restaurant Menu') {
					
					if (Paper == 'Digital Semi-Gloss Card Stock 12pt (110 lbs)') {
						$('#size').show().children('select').empty().append(
							$('<option>').attr('value', '').html('-- Size --'),
							$('<option>').attr('value', '8.5 x 11').html('8.5 x 11'),
							$('<option>').attr('value', '11 x 17').html('11 x 17'),
							$('<option>').attr('value', '12 x 18').html('12 x 18'),
							$('<option>').attr('value', '13 x 19').html('13 x 19')
						);
					} else {
						$('#size').show().children('select').empty().append(
							$('<option>').attr('value', '').html('-- Size --'),
							$('<option>').attr('value', '8.5 x 11').html('8.5 x 11'),
							$('<option>').attr('value', '11 x 17').html('11 x 17'),
							$('<option>').attr('value', '12 x 18').html('12 x 18')
						);
					}
					
				}
	
			// Large Format Prints
			} else if (JobType == 'Large Format Prints') {
				
			// 3D Printing
			} else if (JobType == '3D Printing') {
				
			// Laser Cutting
			} else if (JobType == 'Laser Cutting') {
				
			// Vinyl Cutting
			} else if (JobType == 'Vinyl Cutting') {

				$('#quantity').show().children('select').empty().show().append(
					$('<option>').attr('value', '').html('-- Quantity --'),
					$('<option>').attr('value', '1').html('1'),
					$('<option>').attr('value', '2').html('2'),
					$('<option>').attr('value', '3').html('3'),
					$('<option>').attr('value', '4').html('4'),
					$('<option>').attr('value', '5').html('5'),
					$('<option>').attr('value', '6').html('6'),
					$('<option>').attr('value', '7').html('7'),
					$('<option>').attr('value', '8').html('8'),
					$('<option>').attr('value', '9').html('9'),
					$('<option>').attr('value', '10').html('10'),
					$('<option>').attr('value', 'custom').html('custom')
//					$('<option>').attr('value', '15').html('15'),
//					$('<option>').attr('value', '20').html('20'),
//					$('<option>').attr('value', '25').html('25'),
//					$('<option>').attr('value', '50').html('50')
				);

			// Vehicle Wraps
			} else if (JobType == 'Vehicle Wraps') {
				
			}

		}

	});
	
	/*
	 * Finish Dropdown Change Event
	 */
	$('select[name=finish]').change(function() {

		// hide children		
		$('#size').hide().children('select').empty();
		$('#custom-size').hide().children('p').children('input').empty();
		$('#fold').hide().children('select').empty();
		$('#quantity').hide().children('select').empty().hide().siblings('input').val('Enter Quantity').hide();
		
		// prepare the variables that are to be compared
		var JobType = $('select[name=job_type]').val();
		var Format = $('select[name=format]').val();
		var Type = $('select[name=type]').val();
		var Paper = $('select[name=paper]').val();
		var Color = $('select[name=color]').val();
		var Finish = $(this).val();
		
		if (JobType == 'Large Format Prints') {
			$('#custom-size').show();
			$('#quantity').show().children('select').empty().show().append(
				$('<option>').attr('value', '').html('-- Quantity --'),
				$('<option>').attr('value', '1').html('1'),
				$('<option>').attr('value', '2').html('2'),
				$('<option>').attr('value', '3').html('3'),
				$('<option>').attr('value', '4').html('4'),
				$('<option>').attr('value', '5').html('5'),
				$('<option>').attr('value', '6').html('6'),
				$('<option>').attr('value', '7').html('7'),
				$('<option>').attr('value', '8').html('8'),
				$('<option>').attr('value', '9').html('9'),
				$('<option>').attr('value', '10').html('10'),
				$('<option>').attr('value', 'custom').html('custom')
//				$('<option>').attr('value', '25').html('25'),
//				$('<option>').attr('value', '50').html('50'),
//				$('<option>').attr('value', '100').html('100'),
//				$('<option>').attr('value', '200').html('200'),
//				$('<option>').attr('value', '300').html('300')
			);
		}
	});
	
	/*
	 * Size Dropdown Change Event
	 */
	$('select[name=size]').change(function() {
		
		// hide children
		$('#fold').hide().children('select').empty();
		$('#quantity').hide().children('select').empty().hide().siblings('input').val('Enter Quantity').hide();
		
		// prepare the variables that are to be compared
		var JobType = $('select[name=job_type]').val();
		var Format = $('select[name=format]').val();
		var Type = $('select[name=type]').val();
		var Paper = $('select[name=paper]').val();
		var Color = $('select[name=color]').val();
		var Size = $(this).val();
		

		// Color Laser Prints
		if (JobType == 'Color Laser Prints') {

			// Color Laser Prints -> Postcards
			if (Format == 'Postcards') {
				$('#quantity').show().children('select').empty().show().append(
					$('<option>').attr('value', '').html('-- Quantity --'),
					$('<option>').attr('value', '50').html('50'),
					$('<option>').attr('value', '100').html('100'),
					$('<option>').attr('value', '150').html('150'),
					$('<option>').attr('value', '250').html('250'),
					$('<option>').attr('value', '500').html('500'),
					$('<option>').attr('value', '1000').html('1000'),
					$('<option>').attr('value', '1500').html('1500'),
					$('<option>').attr('value', '2000').html('2000')
				);
				ClearFee('fold');
				ClearFee('quantity');
				AddFee(20, 'cut', 'Cut Fee');
				
			// Color Laser Prints -> Invitations
			} else if (Format == 'Invitations') {

				// Color Laser Prints -> Invitations -> Card Stock
				if (Paper == 'Digital Semi-Gloss Card Stock 12pt (110 lbs)') {
					$('#quantity').show().children('select').empty().show().append(
						$('<option>').attr('value', '').html('-- Quantity --'),
						$('<option>').attr('value', '50').html('50'),
						$('<option>').attr('value', '100').html('100'),
						$('<option>').attr('value', '150').html('150'),
						$('<option>').attr('value', '250').html('250'),
						$('<option>').attr('value', '500').html('500'),
						$('<option>').attr('value', '1000').html('1000'),
						$('<option>').attr('value', '1500').html('1500'),
						$('<option>').attr('value', '2000').html('2000')
					);
					ClearFee('fold');
					ClearFee('quantity');
					AddFee(20, 'cut', ' Cut Fee');

				// Color Laser Prints -> Invitations -> Standard
				} else {
					$('#fold').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Fold --'),
						$('<option>').attr('value', 'None').html('None'),
						$('<option>').attr('value', 'Single Fold').html('Single Fold')
					);
				}

			// Color Laser Prints -> Brochures
			} else if (Format == 'Brochures') {
				
				if (Size == '8.5 x 11') {
					$('#fold').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Fold --'),
						$('<option>').attr('value', 'None').html('None'),
						$('<option>').attr('value', 'Single Fold Horizontal 5.5" x 8.5"').html('Single Fold Horizontal 5.5" x 8.5"'),
						$('<option>').attr('value', 'Single Fold Veritcal 4.25" x 11"').html('Single Fold Veritcal 4.25" x 11"')
					);
				} else if (Size == '11 x 17') {
					$('#fold').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Fold --'),
						$('<option>').attr('value', 'None').html('None'),
						$('<option>').attr('value', 'Single Fold Horizontal 8.5" x 11"').html('Single Fold Horizontal 8.5" x 11"')
					);
				} else if (Size == '12 x 18') {
					$('#fold').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Fold --'),
						$('<option>').attr('value', 'None').html('None'),
						$('<option>').attr('value', 'Single Fold Horizontal 9" x 12"').html('Single Fold Horizontal 9" x 12"')
					);
				}
				
			// Color Laser Prints -> Marketing Flyers
			} else if (Format == 'Marketing Flyers') {
				
				// Color Laser Prints -> Marketing Flyers -> 8.5 x 11 +
				if (Size == '8.5 x 11' || Size == '11 x 17' || Size == '12 x 18') {
					$('#fold').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Fold --'),
						$('<option>').attr('value', 'None').html('None'),
						$('<option>').attr('value', 'Single Fold').html('Single Fold')
					);
				} else {
					$('#quantity').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Quantity --'),
						$('<option>').attr('value', '50').html('50'),
						$('<option>').attr('value', '100').html('100'),
						$('<option>').attr('value', '150').html('150'),
						$('<option>').attr('value', '250').html('250'),
						$('<option>').attr('value', '500').html('500'),
						$('<option>').attr('value', '1000').html('1000'),
						$('<option>').attr('value', '1500').html('1500'),
						$('<option>').attr('value', '2000').html('2000')
					);
					ClearFee('fold');
					ClearFee('quantity');
					AddFee(20, 'cut', ' Cut Fee');
				}

			// Color Laser Prints -> Artist Portfolio
			} else if (Format == 'Artist Portfolio') {

				AddFee(20, 'cut', ' Cut Fee');
				$('#quantity').show().children('select').hide().siblings('input').show();

			// Color Laser Prints -> Restaurant Menu
			} else if (Format == 'Restaurant Menu') {
				
				if (Size == '8.5 x 11') {
					$('#fold').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Fold --'),
						$('<option>').attr('value', 'None').html('None'),
						$('<option>').attr('value', 'Single Fold Horizontal 5.5" x 8.5"').html('Single Fold Horizontal 5.5" x 8.5"'),
						$('<option>').attr('value', 'Single Fold Veritcal 4.25" x 11"').html('Single Fold Veritcal 4.25" x 11"')
					);
				} else if (Size == '11 x 17') {
					$('#fold').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Fold --'),
						$('<option>').attr('value', 'None').html('None'),
						$('<option>').attr('value', 'Single Fold Horizontal 8.5" x 11"').html('Single Fold Horizontal 8.5" x 11"')
					);
				} else if (Size == '12 x 18') {
					$('#fold').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Fold --'),
						$('<option>').attr('value', 'None').html('None'),
						$('<option>').attr('value', 'Single Fold Horizontal 9" x 12"').html('Single Fold Horizontal 9" x 12"')
					);
				} else if (Size == '13 x 19') {
					$('#fold').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Fold --'),
						$('<option>').attr('value', 'None').html('None'),
						$('<option>').attr('value', 'Single Fold Horizontal').html('Single Fold Horizontal')
					);
				}
			}
		}		
	});
	
	/*
	 * Custom Size Change Event
	 */
	$('input[name=height], input[name=width]').keyup(function() {

		// prepare the variables that are to be compared
		var JobType = $('select[name=job_type]').val();
		var Format = $('select[name=format]').val();
		var Type = $('select[name=type]').val();
		var Paper = $('select[name=paper]').val();
		var Color = $('select[name=color]').val();
		var Quantity = $('select[name=quantity]').val();

		// Calculate if quantity, width and height are all specified
		if (Quantity != '' && $('input[name=width]').val() != '' && $('input[name=height]').val() != '') {
			CalculateCustom();
		} else {
			ClearFee('quantity');
		}
		
	});
	

	/*
	 * Fold Dropdown Change Event
	 */
	$('select[name=fold]').change(function() {
		
		// hide children
		$('#quantity').hide().children('select').empty().hide().siblings('input').val('Enter Quantity').hide();
		
		// prepare the variables that are to be compared
		var JobType = $('select[name=job_type]').val();
		var Format = $('select[name=format]').val();
		var Type = $('select[name=type]').val();
		var Paper = $('select[name=paper]').val();
		var Color = $('select[name=color]').val();
		var Size = $('select[name=size]').val();
		var Fold = $(this).val();

		if (Fold != '') {

			// Color Laser Prints
			if (JobType == 'Color Laser Prints') {

				// Color Laser Prints -> Invitation
				if (Format == 'Invitations') {

					// set the fold price
					if (Fold == 'None') {
						ClearFee('fold');
					} else if (Fold == 'Single Fold') {
						AddFee(15, 'fold', ' Single Fold');
					}

					// Color Laser Prints -> Invitations -> Standard
					if (Paper != 'Digital Semi-Gloss Card Stock 12pt (110 lbs)') {
						$('#quantity').show().children('select').empty().append(
							$('<option>').attr('value', '').html('-- Quantity --'),
							$('<option>').attr('value', '50').html('50'),
							$('<option>').attr('value', '100').html('100'),
							$('<option>').attr('value', '150').html('150'),
							$('<option>').attr('value', '250').html('250'),
							$('<option>').attr('value', '500').html('500'),
							$('<option>').attr('value', '1000').html('1000'),
							$('<option>').attr('value', '1500').html('1500'),
							$('<option>').attr('value', '2000').html('2000')
						);
						ClearFee('quantity');
						AddFee(20, 'cut', ' Cut Fee');
					}
					
				// Color Laser Prints -> Brochures
				} else if (Format == 'Brochures') {
					
					if (Fold == 'None') {
						ClearFee('fold');
					}
	
					// Color Laser Prints -> Brochures -> 8.5 x 11
					if (Size == '8.5 x 11') {
						if (Fold == 'Single Fold Horizontal 5.5" x 8.5"') {
							AddFee(15, 'fold', Fold);
						} else if (Fold == 'Single Fold Veritcal 4.25" x 11"') {
							AddFee(15, 'fold', Fold);
						}

					// Color Laser Prints -> Brochures -> 11 x 17
					} else if (Size == '11 x 17') {
						if (Fold == 'Single Fold Horizontal 8.5" x 11"') {
							AddFee(15, 'fold', Fold);
						}

					// Color Laser Prints -> Brochures -> 12 x 18
					} else if (Size == '12 x 18') {
						if (Fold == 'Single Fold Horizontal 9" x 12"') {
							AddFee(15, 'fold', Fold);
						}
					}

					// add quantity options
					$('#quantity').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Quantity --'),
						$('<option>').attr('value', '50').html('50'),
						$('<option>').attr('value', '100').html('100'),
						$('<option>').attr('value', '150').html('150'),
						$('<option>').attr('value', '250').html('250'),
						$('<option>').attr('value', '500').html('500'),
						$('<option>').attr('value', '1000').html('1000'),
						$('<option>').attr('value', '1500').html('1500'),
						$('<option>').attr('value', '2000').html('2000')
					);
					ClearFee('quantity');
					AddFee(20, 'cut', ' Cut Fee');

				// Color Laser Prints -> Marketing Flyers
				} else if (Format == 'Marketing Flyers') {
					
					if (Fold == 'None') {
						ClearFee('fold');
					} else if (Fold == 'Single Fold') {
						AddFee(15, 'fold', Fold);
					}
				
					// add quantity options
					$('#quantity').show().children('select').empty().append(
						$('<option>').attr('value', '').html('-- Quantity --'),
						$('<option>').attr('value', '50').html('50'),
						$('<option>').attr('value', '100').html('100'),
						$('<option>').attr('value', '150').html('150'),
						$('<option>').attr('value', '250').html('250'),
						$('<option>').attr('value', '500').html('500'),
						$('<option>').attr('value', '1000').html('1000'),
						$('<option>').attr('value', '1500').html('1500'),
						$('<option>').attr('value', '2000').html('2000')
					);
					ClearFee('quantity');
					AddFee(20, 'cut', 'Cut Fee');
	
				// Color Laser Prints -> Restaurant Menu
				} else if (Format == 'Restaurant Menu') {
					
					if (Fold == 'None') {
						ClearFee('fold');
					} else {
						AddFee(15, 'fold', Fold);
					}
					
					// show custom quantity
					$('#quantity').show().children('select').empty().hide().siblings('input').val('Enter Quantity').show();
					AddFee(20, 'cut', ' Cut Fee');

				}
			}
			
		} else {
			
			ClearFee('fold');
			ClearFee('quantity');

		}

	});
	
	/*
	 * Custom Quantity Textbox Keyup Event
	 */
	$('input[name=quantity_custom]').keyup(function() {
		
		// hide children
		$('#quantity').children('select').hide();
		
		// prepare the variables that are to be compared
		var JobType = $('select[name=job_type]').val();
		var Format = $('select[name=format]').val();
		var Type = $('select[name=type]').val();
		var Paper = $('select[name=paper]').val();
		var Color = $('select[name=color]').val();
		var Size = $('select[name=size]').val();
		var Fold = $('select[name=fold]').val();
		var Quantity = parseInt($(this).val());

		if (!isNaN(Quantity)) {
			
			// Color Laser Prints
			if (JobType == 'Color Laser Prints') {

				// Color Laser Prints -> Restaurant Menu
				if (Format == 'Restaurant Menu') {
	
					// Color Laser Prints -> Restaurant Menu -> Card Stock
					if (Paper == 'Digital Semi-Gloss Card Stock 12pt (110 lbs)') {
						
						// Color Laser Prints -> Restaurant Menu -> Card Stock -> Color
						if (Color == 'color/blank' || Color == 'color/gray' || Color == 'color/color') {
		
						// Color Laser Prints -> Restaurant Menu -> Card Stock -> Color -> One Sided
							if (Color == 'color/blank' || Color == 'gray/blank') {
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Color -> One Sided -> 8.5 x 11
								if (Size == '8.5 x 11') {
									AddFee(Quantity * .75, 'quantity', Quantity + ' One Sided Color @ $0.75/side');
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Color -> One Sided -> 11 x 17
								} else if (Size == '11 x 17') {
									AddFee(Quantity * 1, 'quantity', Quantity + ' One Sided Color @ $1.00/side');
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Color -> One Sided -> 12 x 18
								} else if (Size == '12 x 18') {
									AddFee(Quantity * 1.25, 'quantity', Quantity + ' One Sided Color @ $1.25/side');
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Color -> One Sided -> 13 x 19
								} else if (Size == '13 x 19') {
									AddFee(Quantity * 1.5, 'quantity', Quantity + ' One Sided Color @ $1.50/side');
		
								}
		
							// Color Laser Prints -> Restaurant Menu -> Card Stock -> Color -> Two Sided
							} else {
								
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Color -> Two Sided -> 8.5 x 11
								if (Size == '8.5 x 11') {
									AddFee(Quantity * 1.5, 'quantity', Quantity + ' Two Sided Color @ $0.75/side');
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Color -> Two Sided -> 11 x 17
								} else if (Size == '11 x 17') {
									AddFee(Quantity * 2, 'quantity', Quantity + ' Two Sided Color @ $1.00/side');
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Color -> Two Sided -> 12 x 18
								} else if (Size == '12 x 18') {
									AddFee(Quantity * 2.5, 'quantity', Quantity + ' Two Sided Color @ $1.25/side');
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Color -> Two Sided -> 13 x 19
								} else if (Size == '13 x 19') {
									AddFee(Quantity * 3, 'quantity', Quantity + ' Two Sided Color @ $1.50/side');
		
								}
								
							}
							
						// Color Laser Prints -> Restaurant Menu -> Card Stock -> Grayscale
						} else {
							
							// Color Laser Prints -> Restaurant Menu -> Card Stock -> Grayscale -> One Sided
							if (Color == 'color/blank' || Color == 'gray/blank') {
								
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Grayscale -> One Sided -> 8.5 x 11
								if (Size == '8.5 x 11') {
									AddFee(Quantity * .65, 'quantity', Quantity + ' One Sided Grayscale @ $0.65/side');
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Grayscale -> One Sided -> 11 x 17
								} else if (Size == '11 x 17') {
									AddFee(Quantity * .90, 'quantity', Quantity + ' One Sided Grayscale @ $0.90/side');
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Grayscale -> One Sided -> 12 x 18
								} else if (Size == '12 x 18') {
									AddFee(Quantity * 1.15, 'quantity', Quantity + ' One Sided Grayscale @ $1.15/side');
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Grayscale -> One Sided -> 13 x 19
								} else if (Size == '13 x 19') {
									AddFee(Quantity * 1.30, 'quantity', Quantity + ' One Sided Grayscale @ $1.30/side');
		
								}
								
							// Color Laser Prints -> Restaurant Menu -> Card Stock -> Grayscale -> Two Sided
							} else {
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Grayscale -> Two Sided -> 8.5 x 11
								if (Size == '8.5 x 11') {
									AddFee(Quantity * 1.30, 'quantity', Quantity + ' Two Sided Grayscale @ $0.65/side');
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Grayscale -> Two Sided -> 11 x 17
								} else if (Size == '11 x 17') {
									AddFee(Quantity * 1.80, 'quantity', Quantity + ' Two Sided Grayscale @ $0.90/side');
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Grayscale -> Two Sided -> 12 x 18
								} else if (Size == '12 x 18') {
									AddFee(Quantity * 2.30, 'quantity', Quantity + ' Two Sided Grayscale @ $1.15/side');
		
								// Color Laser Prints -> Restaurant Menu -> Card Stock -> Grayscale -> Two Sided -> 13 x 19
								} else if (Size == '13 x 19') {
									AddFee(Quantity * 2.60, 'quantity', Quantity + ' Two Sided Grayscale @ $1.30/side');
		
								}
		
							}
							
						}
		
					// Color Laser Prints -> Restaurant Menu -> Standard
					} else {
		
						// Color Laser Prints -> Restaurant Menu -> Standard -> Color
						if (Color == 'color/blank' || Color == 'color/gray' || Color == 'color/color') {
		
							// Color Laser Prints -> Restaurant Menu -> Standard -> Color -> One Sided
							if (Color == 'color/blank' || Color == 'gray/blank') {
		
								// Color Laser Prints -> Restaurant Menu -> Standard -> Color -> One Sided -> 8.5 x 11
								if (Size == '8.5 x 11') {
									AddFee(Quantity * .60, 'quantity', Quantity + ' One Sided Color @ $0.60/side');
		
								// Color Laser Prints -> Restaurant Menu -> Standard -> Color -> One Sided -> 11 x 17
								} else if (Size == '11 x 17') {
									AddFee(Quantity * .85, 'quantity', Quantity + ' One Sided Color @ $0.85/side');
		
								// Color Laser Prints -> Restaurant Menu -> Standard -> Color -> One Sided -> 12 x 18
								} else if (Size == '12 x 18') {
									AddFee(Quantity * 1.10, 'quantity', Quantity + ' One Sided Color @ $1.10/side');
		
								}
		
							// Color Laser Prints -> Restaurant Menu -> Standard -> Color -> Two Sided
							} else {
		
								// Color Laser Prints -> Restaurant Menu -> Standard -> Color -> Two Sided -> 8.5 x 11
								if (Size == '8.5 x 11') {
									AddFee(Quantity * 1.20, 'quantity', Quantity + ' Two Sided Color @ $0.60/side');
		
								// Color Laser Prints -> Restaurant Menu -> Standard -> Color -> Two Sided -> 11 x 17
								} else if (Size == '11 x 17') {
									AddFee(Quantity * 1.70, 'quantity', Quantity + ' Two Sided Color @ $0.85/side');
		
								// Color Laser Prints -> Restaurant Menu -> Standard -> Color -> Two Sided -> 12 x 18
								} else if (Size == '12 x 18') {
									AddFee(Quantity * 2.20, 'quantity', Quantity + ' Two Sided Color @ $1.10/side');
		
								}
		
							}
		
						// Color Laser Prints -> Restaurant Menu -> Standard -> Grayscale
						} else {
		
							// Color Laser Prints -> Restaurant Menu -> Standard -> Grayscale -> One Sided
							if (Color == 'color/blank' || Color == 'gray/blank') {
		
								// Color Laser Prints -> Restaurant Menu -> Standard -> Grayscale -> One Sided -> 8.5 x 11
								if (Size == '8.5 x 11') {
									AddFee(Quantity * .5, 'quantity', Quantity + ' One Sided Grayscale @ $0.50/side');
		
								// Color Laser Prints -> Restaurant Menu -> Standard -> Grayscale -> One Sided -> 11 x 17
								} else if (Size == '11 x 17') {
									AddFee(Quantity * .75, 'quantity', Quantity + ' One Sided Grayscale @ $0.75/side');
		
								// Color Laser Prints -> Restaurant Menu -> Standard -> Grayscale -> One Sided -> 12 x 18
								} else if (Size == '12 x 18') {
									AddFee(Quantity * 1.00, 'quantity', Quantity + ' One Sided Grayscale @ $1.00/side');
		
								}
								
							// Color Laser Prints -> Restaurant Menu -> Standard -> Grayscale -> Two Sided
							} else {
		
								// Color Laser Prints -> Restaurant Menu -> Standard -> Grayscale -> Two Sided -> 8.5 x 11
								if (Size == '8.5 x 11') {
									AddFee(Quantity * 1, 'quantity', Quantity + ' One Sided Grayscale @ $0.50/side');
		
								// Color Laser Prints -> Restaurant Menu -> Standard -> Grayscale -> Two Sided -> 11 x 17
								} else if (Size == '11 x 17') {
									AddFee(Quantity * 1.5, 'quantity', Quantity + ' One Sided Grayscale @ $0.75/side');
		
								// Color Laser Prints -> Restaurant Menu -> Standard -> Grayscale -> Two Sided -> 12 x 18
								} else if (Size == '12 x 18') {
									AddFee(Quantity * 2.00, 'quantity', Quantity + ' One Sided Grayscale @ $1.00/side');
		
								}
							}
						}
					}
					
				} else if (Format == 'Artist Portfolio') {

					// Color Laser Prints -> Artist Portfolio -> Color
					if (Color == 'color/blank' || Color == 'color/gray' || Color == 'color/color') {
						
						// Color Laser Prints -> Artist Portfolio -> Color -> One Sided
						if (Color == 'color/blank' || Color == 'gray/blank') {
							if (Size == '8.5 x 11') {
								AddFee(Quantity * 1, 'quantity', Quantity + ' One Sided Portfolio Pages @ $1.00/side');
							} else if (Size == '11 x 17') {
								AddFee(Quantity * 2, 'quantity', Quantity + ' One Sided Portfolio Pages @ $2.00/side');
							} else if (Size == '12 x 18') {
								AddFee(Quantity * 2.5, 'quantity', Quantity + ' One Sided Portfolio Pages @ $2.50/side');
							}
							
						// Color Laser Prints -> Artist Portfolio -> Color -> Two Sided
						} else {
							if (Size == '8.5 x 11') {
								AddFee(Quantity * 2, 'quantity', Quantity + ' Two Sided Portfolio Pages @ $1.00/side');
							} else if (Size == '11 x 17') {
								AddFee(Quantity * 4, 'quantity', Quantity + ' Two Sided Portfolio Pages @ $2.00/side');
							} else if (Size == '12 x 18') {
								AddFee(Quantity * 5, 'quantity', Quantity + ' Two Sided Portfolio Pages @ $2.50/side');
							}
						}
						
					// Color Laser Prints -> Artist Portfolio -> Grayscale
					} else {
						
						// Color Laser Prints -> Artist Portfolio -> Grayscale -> One Sided
						if (Color == 'color/blank' || Color == 'gray/blank') {
							if (Size == '8.5 x 11') {
								AddFee(Quantity * .75, 'quantity', Quantity + ' One Sided Portfolio Pages @ $0.75/side');
							} else if (Size == '11 x 17') {
								AddFee(Quantity * 1, 'quantity', Quantity + ' One Sided Portfolio Pages @ $1.00/side');
							} else if (Size == '12 x 18') {
								AddFee(Quantity * 1.25, 'quantity', Quantity + ' One Sided Portfolio Pages @ $1.25/side');
							}
							
						// Color Laser Prints -> Artist Portfolio -> Grayscale -> Two Sided
						} else {
							if (Size == '8.5 x 11') {
								AddFee(Quantity * 1.5, 'quantity', Quantity + ' Two Sided Portfolio Pages @ $0.75/side');
							} else if (Size == '11 x 17') {
								AddFee(Quantity * 2, 'quantity', Quantity + ' Two Sided Portfolio Pages @ $1.00/side');
							} else if (Size == '12 x 18') {
								AddFee(Quantity * 2.5, 'quantity', Quantity + ' Two Sided Portfolio Pages @ $1.25/side');
							}
						}
					}
				}
				
			}
			
		} else {

			ClearFee('quantity');

		}

	});

	/*
	 * Quantity Dropdown Change Event
	 */
	$('select[name=quantity]').change(function() {

		// hide children
		$('#quantity').children('input').hide();

		// prepare the variables that are to be compared
		var JobType = $('select[name=job_type]').val();
		var Format = $('select[name=format]').val();
		var Type = $('select[name=type]').val();
		var Paper = $('select[name=paper]').val();
		var Color = $('select[name=color]').val();
		var Size = $('select[name=size]').val();
		var Fold = $('select[name=fold]').val();
		var Quantity = $(this).val();

		// Business Cards
		if (JobType == 'Business Cards') {

			// Business Cards -> Color
			if (Color == 'color/blank' || Color == 'color/gray' || Color == 'color/color') {
				switch(Quantity) {
					case '50': AddFee(20, 'quantity', '50 Color Business Cards'); break;
					case '100': AddFee(30, 'quantity', '100 Color Business Cards'); break;
					case '150': AddFee(45, 'quantity', '150 Color Business Cards'); break;
					case '250': AddFee(75, 'quantity', '250 Color Business Cards'); break;
					case '500': AddFee(105, 'quantity', '500 Color Business Cards'); break;
					case '1000': AddFee(210, 'quantity', '1000 Color Business Cards'); break;
					case '1500': AddFee(250, 'quantity', '1500 Color Business Cards'); break;
					case '2000': AddFee(300, 'quantity', '2000 Color Business Cards'); break;
				}

			// Business Cards -> Grayscale
			} else {
				switch(Quantity) {
					case '50': AddFee(20, 'quantity', '50 Grayscale Business Cards'); break;
					case '100': AddFee(25, 'quantity', '100 Grayscale Business Cards'); break;
					case '150': AddFee(30, 'quantity', '150 Grayscale Business Cards'); break;
					case '250': AddFee(50, 'quantity', '250 Grayscale Business Cards'); break;
					case '500': AddFee(90, 'quantity', '500 Grayscale Business Cards'); break;
					case '1000': AddFee(200, 'quantity', '1000 Grayscale Business Cards'); break;
					case '1500': AddFee(210, 'quantity', '1500 Grayscale Business Cards'); break;
					case '2000': AddFee(250, 'quantity', '2000 Grayscale Business Cards'); break;
				}
			}

		// Color Laser Prints
		} else if (JobType == 'Color Laser Prints') {

			// Color Laser Prints -> Postcards
			if (Format == 'Postcards') {

				// Color Laser Prints -> Postcards -> Color
				if (Color == 'color/blank' || Color == 'color/gray' || Color == 'color/color') {
					switch(Quantity) {
						case '50': AddFee(55, 'quantity', '50 Color Postcards'); break;
						case '100': AddFee(75, 'quantity', '100 Color Postcards'); break;
						case '150': AddFee(99, 'quantity', '150 Color Postcards'); break;
						case '250': AddFee(125, 'quantity', '250 Color Postcards'); break;
						case '500': AddFee(200, 'quantity', '500 Color Postcards'); break;
						case '1000': AddFee(250, 'quantity', '1000 Color Postcards'); break;
						case '1500': AddFee(275, 'quantity', '1500 Color Postcards'); break;
						case '2000': AddFee(310, 'quantity', '2000 Color Postcards'); break;
					}

				// Color Laser Prints -> Postcards -> Grayscale
				} else {
					switch(Quantity) {
						case '50': AddFee(45, 'quantity', '50 Grayscale Postcards'); break;
						case '100': AddFee(65, 'quantity', '100 Grayscale Postcards'); break;
						case '150': AddFee(89, 'quantity', '150 Grayscale Postcards'); break;
						case '250': AddFee(110, 'quantity', '250 Grayscale Postcards'); break;
						case '500': AddFee(180, 'quantity', '500 Grayscale Postcards'); break;
						case '1000': AddFee(240, 'quantity', '1000 Grayscale Postcards'); break;
						case '1500': AddFee(265, 'quantity', '1500 Grayscale Postcards'); break;
						case '2000': AddFee(290, 'quantity', '2000 Grayscale Postcards'); break;
					}
				}

			// Color Laser Prints -> Invitations 
			} else if (Format == 'Invitations') {
				
				// Color Laser Prints -> Invitations -> Card Stock
				if (Paper = 'Digital Semi-Gloss Card Stock 12pt (110 lbs)') {
					
					// Color Laser Prints -> Invitations -> Card Stock -> Color
					if (Color == 'color/blank' || Color == 'color/gray' || Color == 'color/color') {
						switch(Quantity) {
							case '50': AddFee(55, 'quantity', '50 Color Card Stock Invitations'); break;
							case '100': AddFee(75, 'quantity', '100 Color Card Stock Invitations'); break;
							case '150': AddFee(99, 'quantity', '150 Color Card Stock Invitations'); break;
							case '250': AddFee(125, 'quantity', '250 Color Card Stock Invitations'); break;
							case '500': AddFee(200, 'quantity', '500 Color Card Stock Invitations'); break;
							case '1000': AddFee(250, 'quantity', '1000 Color Card Stock Invitations'); break;
							case '1500': AddFee(275, 'quantity', '1500 Color Card Stock Invitations'); break;
							case '2000': AddFee(310, 'quantity', '2000 Color Card Stock Invitations'); break;
						}
					// Color Laser Prints -> Invitations -> Card Stock -> Grayscale
					} else {
						switch(Quantity) {
							case '50': AddFee(45, 'quantity', '50 Grayscale Card Stock Invitations'); break;
							case '100': AddFee(65, 'quantity', '100 Grayscale Card Stock Invitations'); break;
							case '150': AddFee(89, 'quantity', '150 Grayscale Card Stock Invitations'); break;
							case '250': AddFee(110, 'quantity', '250 Grayscale Card Stock Invitations'); break;
							case '500': AddFee(180, 'quantity', '500 Grayscale Card Stock Invitations'); break;
							case '1000': AddFee(240, 'quantity', '1000 Grayscale Card Stock Invitations'); break;
							case '1500': AddFee(265, 'quantity', '1500 Grayscale Card Stock Invitations'); break;
							case '2000': AddFee(290, 'quantity', '2000 Grayscale Card Stock Invitations'); break;
						}
					}

				// Color Laser Prints -> Invitations -> Standard
				} else {
					
					// Color Laser Prints -> Invitations -> Standard -> Color
					if (Color == 'color/blank' || Color == 'color/gray' || Color == 'color/color') {
						switch(Quantity) {
							case '50': AddFee(50, 'quantity', '50 Color Standard Invitations'); break;
							case '100': AddFee(70, 'quantity', '100 Color Standard Invitations'); break;
							case '150': AddFee(94, 'quantity', '150 Color Standard Invitations'); break;
							case '250': AddFee(120, 'quantity', '250 Color Standard Invitations'); break;
							case '500': AddFee(195, 'quantity', '500 Color Standard Invitations'); break;
							case '1000': AddFee(245, 'quantity', '1000 Color Standard Invitations'); break;
							case '1500': AddFee(270, 'quantity', '1500 Color Standard Invitations'); break;
							case '2000': AddFee(305, 'quantity', '2000 Color Standard Invitations'); break;
						}
					// Color Laser Prints -> Invitations -> Standard -> Grayscale
					} else {
						switch(Quantity) {
							case '50': AddFee(40, 'quantity', '50 Grayscale Standard Invitations'); break;
							case '100': AddFee(60, 'quantity', '100 Grayscale Standard Invitations'); break;
							case '150': AddFee(84, 'quantity', '150 Grayscale Standard Invitations'); break;
							case '250': AddFee(105, 'quantity', '250 Grayscale Standard Invitations'); break;
							case '500': AddFee(175, 'quantity', '500 Grayscale Standard Invitations'); break;
							case '1000': AddFee(235, 'quantity', '1000 Grayscale Standard Invitations'); break;
							case '1500': AddFee(260, 'quantity', '1500 Grayscale Standard Invitations'); break;
							case '2000': AddFee(285, 'quantity', '2000 Grayscale Standard Invitations'); break;
						}
					}
				}
				
			// Color Laser Prints -> Brochures
			} else if (Format == 'Brochures') {
				
				// Color Laser Prints -> Brochures -> Color
				if (Color == 'color/blank' || Color == 'color/gray' || Color == 'color/color') {

					// Color Laser Prints -> Brochures -> Color -> 8.5 x 11
					if (Size == '8.5 x 11') {
						switch(Quantity) {
							case '50': AddFee(50, 'quantity', '50 8.5 x 11 Color Brochures'); break;
							case '100': AddFee(70, 'quantity', '100 8.5 x 11 Color Brochures'); break;
							case '150': AddFee(94, 'quantity', '150 8.5 x 11 Color Brochures'); break;
							case '250': AddFee(120, 'quantity', '250 8.5 x 11 Color Brochures'); break;
							case '500': AddFee(195, 'quantity', '500 8.5 x 11 Color Brochures'); break;
							case '1000': AddFee(245, 'quantity', '1000 8.5 x 11 Color Brochures'); break;
							case '1500': AddFee(270, 'quantity', '1500 8.5 x 11 Color Brochures'); break;
							case '2000': AddFee(305, 'quantity', '2000 8.5 x 11 Color Brochures'); break;
						}
						
					// Color Laser Prints -> Color Brochures -> Color -> 11 x 17
					} else if (Size == '11 x 17') {
						switch(Quantity) {
							case '50': AddFee(70, 'quantity', '50 11 x 17 Color Brochures'); break;
							case '100': AddFee(90, 'quantity', '100 11 x 17 Color Brochures'); break;
							case '150': AddFee(114, 'quantity', '150 11 x 17 Color Brochures'); break;
							case '250': AddFee(140, 'quantity', '250 11 x 17 Color Brochures'); break;
							case '500': AddFee(215, 'quantity', '500 11 x 17 Color Brochures'); break;
							case '1000': AddFee(265, 'quantity', '1000 11 x 17 Color Brochures'); break;
							case '1500': AddFee(290, 'quantity', '1500 11 x 17 Color Brochures'); break;
							case '2000': AddFee(325, 'quantity', '2000 11 x 17 Color Brochures'); break;
						}

					// Color Laser Prints -> Brochures -> Color -> 12 x 18
					} else if (Size == '12 x 18') {
						switch(Quantity) {
							case '50': AddFee(75, 'quantity', '50 12 x 18 Color Brochures'); break;
							case '100': AddFee(95, 'quantity', '100 12 x 18 Color Brochures'); break;
							case '150': AddFee(119, 'quantity', '150 12 x 18 Color Brochures'); break;
							case '250': AddFee(145, 'quantity', '250 12 x 18 Color Brochures'); break;
							case '500': AddFee(220, 'quantity', '500 12 x 18 Color Brochures'); break;
							case '1000': AddFee(270, 'quantity', '1000 12 x 18 Color Brochures'); break;
							case '1500': AddFee(300, 'quantity', '1500 12 x 18 Color Brochures'); break;
							case '2000': AddFee(330, 'quantity', '2000 12 x 18 Color Brochures'); break;
						}	
					}
					
				// Color Laser Prints -> Brochures -> Grayscale
				} else {

					// Color Laser Prints -> Brochures -> Grayscale -> 8.5 x 11
					if (Size == '8.5 x 11') {
						switch(Quantity) {
							case '50': AddFee(48, 'quantity', '50 8.5 x 11 Grayscale Brochures'); break;
							case '100': AddFee(68, 'quantity', '100 8.5 x 11 Grayscale Brochures'); break;
							case '150': AddFee(92, 'quantity', '150 8.5 x 11 Grayscale Brochures'); break;
							case '250': AddFee(118, 'quantity', '250 8.5 x 11 Grayscale Brochures'); break;
							case '500': AddFee(193, 'quantity', '500 8.5 x 11 Grayscale Brochures'); break;
							case '1000': AddFee(243, 'quantity', '1000 8.5 x 11 Grayscale Brochures'); break;
							case '1500': AddFee(268, 'quantity', '1500 8.5 x 11 Grayscale Brochures'); break;
							case '2000': AddFee(303, 'quantity', '2000 8.5 x 11 Grayscale Brochures'); break;
						}
						
					// Color Laser Prints -> Brochures -> Grayscale -> 11 x 17
					} else if (Size == '11 x 17') {
						switch(Quantity) {
							case '50': AddFee(65, 'quantity', '50 11 x 17 Grayscale Brochures'); break;
							case '100': AddFee(85, 'quantity', '100 11 x 17 Grayscale Brochures'); break;
							case '150': AddFee(109, 'quantity', '150 11 x 17 Grayscale Brochures'); break;
							case '250': AddFee(135, 'quantity', '250 11 x 17 Grayscale Brochures'); break;
							case '500': AddFee(210, 'quantity', '500 11 x 17 Grayscale Brochures'); break;
							case '1000': AddFee(260, 'quantity', '1000 11 x 17 Grayscale Brochures'); break;
							case '1500': AddFee(285, 'quantity', '1500 11 x 17 Grayscale Brochures'); break;
							case '2000': AddFee(320, 'quantity', '2000 11 x 17 Grayscale Brochures'); break;
						}

					// Color Laser Prints -> Brochures -> Grayscale -> 12 x 18
					} else if (Size == '12 x 18') {
						switch(Quantity) {
							case '50': AddFee(73, 'quantity', '50 12 x 18 Grayscale Brochures'); break;
							case '100': AddFee(93, 'quantity', '100 12 x 18 Grayscale Brochures'); break;
							case '150': AddFee(117, 'quantity', '150 12 x 18 Grayscale Brochures'); break;
							case '250': AddFee(143, 'quantity', '250 12 x 18 Grayscale Brochures'); break;
							case '500': AddFee(218, 'quantity', '500 12 x 18 Grayscale Brochures'); break;
							case '1000': AddFee(268, 'quantity', '1000 12 x 18 Grayscale Brochures'); break;
							case '1500': AddFee(298, 'quantity', '1500 12 x 18 Grayscale Brochures'); break;
							case '2000': AddFee(328, 'quantity', '2000 12 x 18 Grayscale Brochures'); break;
						}	
					}

				}
				
			// Color Laser Prints -> Marketing Flyers
			} else if (Format == 'Marketing Flyers') {
				
				// Color Laser Prints -> Marketing Flyers -> 20-32 lbs Standard
				if (Paper == 'Digital Standard 20-32 lbs Standard' || Paper == 'Digital Semi-Gloss 20-32 lbs Standard') {
					
					// Color Laser Prints -> Marketing Flyers -> 20-32 lbs Standard -> Color
					if (Color == 'color/blank' || Color == 'color/gray' || Color == 'color/color') {
						switch(Quantity) {
							case '50': AddFee(40, 'quantity', '50 Color Marketing Flyers'); break;
							case '100': AddFee(60, 'quantity', '100 Color Marketing Flyers'); break;
							case '150': AddFee(80, 'quantity', '150 Color Marketing Flyers'); break;
							case '250': AddFee(100, 'quantity', '250 Color Marketing Flyers'); break;
							case '500': AddFee(200, 'quantity', '500 Color Marketing Flyers'); break;
							case '1000': AddFee(250, 'quantity', '1000 Color Marketing Flyers'); break;
							case '1500': AddFee(275, 'quantity', '1500 Color Marketing Flyers'); break;
							case '2000': AddFee(300, 'quantity', '2000 Color Marketing Flyers'); break;
						}

					// Color Laser Prints -> Marketing Flyers -> 20-32 lbs Standard -> Grayscale
					} else {
						switch(Quantity) {
							case '50': AddFee(20, 'quantity', '50 Grayscale Marketing Flyers'); break;
							case '100': AddFee(40, 'quantity', '100 Grayscale Marketing Flyers'); break;
							case '150': AddFee(60, 'quantity', '150 Grayscale Marketing Flyers'); break;
							case '250': AddFee(80, 'quantity', '250 Grayscale Marketing Flyers'); break;
							case '500': AddFee(100, 'quantity', '500 Grayscale Marketing Flyers'); break;
							case '1000': AddFee(150, 'quantity', '1000 Grayscale Marketing Flyers'); break;
							case '1500': AddFee(200, 'quantity', '1500 Grayscale Marketing Flyers'); break;
							case '2000': AddFee(250, 'quantity', '2000 Grayscale Marketing Flyers'); break;
						}
					}

				// Color Laser Prints -> Marketing Flyers -> 60-65 lbs Cover
				} else if (Paper == 'Digital Standard 60-65 lbs Cover' || Paper == 'Digital Semi-Gloss 60-65 lbs Cover') {
					
					// Color Laser Prints -> Marketing Flyers -> 60-65 lbs Cover -> Color
					if (Color == 'color/blank' || Color == 'color/gray' || Color == 'color/color') {
						switch(Quantity) {
							case '50': AddFee(50, 'quantity', '50 Color Marketing Flyers'); break;
							case '100': AddFee(70, 'quantity', '100 Color Marketing Flyers'); break;
							case '150': AddFee(95, 'quantity', '150 Color Marketing Flyers'); break;
							case '250': AddFee(110, 'quantity', '250 Color Marketing Flyers'); break;
							case '500': AddFee(210, 'quantity', '500 Color Marketing Flyers'); break;
							case '1000': AddFee(260, 'quantity', '1000 Color Marketing Flyers'); break;
							case '1500': AddFee(285, 'quantity', '1500 Color Marketing Flyers'); break;
							case '2000': AddFee(310, 'quantity', '2000 Color Marketing Flyers'); break;
						}

					// Color Laser Prints -> Marketing Flyers -> 60-65 lbs Cover -> Grayscale
					} else {
						switch(Quantity) {
							case '50': AddFee(45, 'quantity', '50 Grayscale Marketing Flyers'); break;
							case '100': AddFee(65, 'quantity', '100 Grayscale Marketing Flyers'); break;
							case '150': AddFee(90, 'quantity', '150 Grayscale Marketing Flyers'); break;
							case '250': AddFee(105, 'quantity', '250 Grayscale Marketing Flyers'); break;
							case '500': AddFee(205, 'quantity', '500 Grayscale Marketing Flyers'); break;
							case '1000': AddFee(255, 'quantity', '1000 Grayscale Marketing Flyers'); break;
							case '1500': AddFee(280, 'quantity', '1500 Grayscale Marketing Flyers'); break;
							case '2000': AddFee(305, 'quantity', '2000 Grayscale Marketing Flyers'); break;
						}
					}
					
				// Color Laser Prints -> Marketing Flyers -> 80-100 lbs Cover
				} else if (Paper == 'Digital Standard 80-100 lbs Cover' || Paper == 'Digital Semi-Gloss 80-100 lbs Cover') {
					
					// Color Laser Prints -> Marketing Flyers -> 80-100 lbs Cover -> Color
					if (Color == 'color/blank' || Color == 'color/gray' || Color == 'color/color') {
						switch(Quantity) {
							case '50': AddFee(75, 'quantity', '50 Color Marketing Flyers'); break;
							case '100': AddFee(95, 'quantity', '100 Color Marketing Flyers'); break;
							case '150': AddFee(115, 'quantity', '150 Color Marketing Flyers'); break;
							case '250': AddFee(135, 'quantity', '250 Color Marketing Flyers'); break;
							case '500': AddFee(235, 'quantity', '500 Color Marketing Flyers'); break;
							case '1000': AddFee(285, 'quantity', '1000 Color Marketing Flyers'); break;
							case '1500': AddFee(310, 'quantity', '1500 Color Marketing Flyers'); break;
							case '2000': AddFee(335, 'quantity', '2000 Color Marketing Flyers'); break;
						}

					// Color Laser Prints -> Marketing Flyers -> 80-100 lbs Cover -> Grayscale
					} else {
						switch(Quantity) {
							case '50': AddFee(75, 'quantity', '50 Grayscale Marketing Flyers'); break;
							case '100': AddFee(95, 'quantity', '100 Grayscale Marketing Flyers'); break;
							case '150': AddFee(115, 'quantity', '150 Grayscale Marketing Flyers'); break;
							case '250': AddFee(135, 'quantity', '250 Grayscale Marketing Flyers'); break;
							case '500': AddFee(235, 'quantity', '500 Grayscale Marketing Flyers'); break;
							case '1000': AddFee(285, 'quantity', '1000 Grayscale Marketing Flyers'); break;
							case '1500': AddFee(310, 'quantity', '1500 Grayscale Marketing Flyers'); break;
							case '2000': AddFee(335, 'quantity', '2000 Grayscale Marketing Flyers'); break;
						}
					}
				}
				
			}
		} else if (JobType == 'Large Format Prints') {

			if (Quantity != '' && $('input[name=width]').val() != '' && $('input[name=height]').val() != '') {
				CalculateCustom();
			}
			
		
		}
	});

});