	var price = 0;		// Set the price to 0
	var neworder = "yes";	// Set new order default to yes
	
	function calculatePrice()
	{
		// Set the base price
		if (document.Custom_Cards.Quantity.value == 250) price = 3.75
		else if (document.Custom_Cards.Quantity.value == 100) price = 4.25
		else if (document.Custom_Cards.Quantity.value == 60) price = 4.95
		else if (document.Custom_Cards.Quantity.value == 20) price = 5.95
		else if (document.Custom_Cards.Quantity.value == 6) price = 6.95
		else if (document.Custom_Cards.Quantity.value == 1) price = 6.95
				

		// Add the cost of a Back Side Printing  
		if (document.Custom_Cards.BackSide.checked == true) 
		{
			if (document.Custom_Cards.Quantity.value == 250) price = price + 0.95
			else if (document.Custom_Cards.Quantity.value == 100) price = price + 0.95
			else if (document.Custom_Cards.Quantity.value == 60) price = price + 0.95
			else if (document.Custom_Cards.Quantity.value == 20) price = price + 0.95
			else if (document.Custom_Cards.Quantity.value == 6) price = price + 0.95
			else if (document.Custom_Cards.Quantity.value == 1) price = price + 0.95
		}

		
		// Add the cost of a HICO Magnetic Strip  
		if (document.Custom_Cards.HICO_Mag_Strip.checked == true) 
		{
			if (document.Custom_Cards.LOCO_Mag_Strip.checked == true) 
				alert("Please select either HICO or LOCO magnetic stripe.\n\nIt is not possible to have both on the same card.");

			if (document.Custom_Cards.Quantity.value == 250) price = price + 0.25
			else if (document.Custom_Cards.Quantity.value == 100) price = price + 0.25
			else if (document.Custom_Cards.Quantity.value == 60) price = price + 0.25
			else if (document.Custom_Cards.Quantity.value == 20) price = price + 0.25
			else if (document.Custom_Cards.Quantity.value == 6) price = price + 0.25
			else if (document.Custom_Cards.Quantity.value == 1) price = price + 0.25
		}

		// Add the cost of a LOCO Magnetic Strip 
		if (document.Custom_Cards.LOCO_Mag_Strip.checked == true) 
		{
			if (document.Custom_Cards.Quantity.value == 250) price = price + 0.20
			else if (document.Custom_Cards.Quantity.value == 100) price = price + 0.20
			else if (document.Custom_Cards.Quantity.value == 60) price = price + 0.20
			else if (document.Custom_Cards.Quantity.value == 20) price = price + 0.20
			else if (document.Custom_Cards.Quantity.value == 6) price = price + 0.20
			else if (document.Custom_Cards.Quantity.value == 1) price = price + 0.20
		}

		// Add the cost of a Magnetic Encoder  
		if (document.Custom_Cards.Mag_Encoding.checked == true) 
		{
			if (document.Custom_Cards.Quantity.value == 250) price = price + 1.00
			else if (document.Custom_Cards.Quantity.value == 100) price = price + 1.00
			else if (document.Custom_Cards.Quantity.value == 60) price = price + 1.00
			else if (document.Custom_Cards.Quantity.value == 20) price = price + 1.00
			else if (document.Custom_Cards.Quantity.value == 6) price = price + 1.00
			else if (document.Custom_Cards.Quantity.value == 1) price = price + 1.00
		}

		
		// Add the cost of a Holographic Overlay
		if (document.Custom_Cards.Holo_Overlay.checked == true) 
		{
			if (document.Custom_Cards.Quantity.value == 250) price = price + 1.50
			else if (document.Custom_Cards.Quantity.value == 100) price = price + 1.50
			else if (document.Custom_Cards.Quantity.value == 60) price = price + 1.50
			else if (document.Custom_Cards.Quantity.value == 20) price = price + 1.50
			else if (document.Custom_Cards.Quantity.value == 6) price = price + 1.50
			else if (document.Custom_Cards.Quantity.value == 1) price = price + 1.50
		}

		// Add the cost of Digital Signature
		if (document.Custom_Cards.Digital_Sig.checked == true) 
		{
			if (document.Custom_Cards.Quantity.value == 250) price = price + 0.50
			else if (document.Custom_Cards.Quantity.value == 100) price = price + 0.50
			else if (document.Custom_Cards.Quantity.value == 60) price = price + 0.50
			else if (document.Custom_Cards.Quantity.value == 20) price = price + 0.50
			else if (document.Custom_Cards.Quantity.value == 6) price = price + 0.50
			else if (document.Custom_Cards.Quantity.value == 1) price = price + 0.50
		}
		
		// Add the cost of Composite Cards
		if (document.Custom_Cards.Composite_Card.checked == true) 
		{
			if (document.Custom_Cards.Quantity.value == 250) price = price + 0.75
			else if (document.Custom_Cards.Quantity.value == 100) price = price + 0.75
			else if (document.Custom_Cards.Quantity.value == 60) price = price + 0.75
			else if (document.Custom_Cards.Quantity.value == 20) price = price + 0.75
			else if (document.Custom_Cards.Quantity.value == 6) price = price + 0.75
			else if (document.Custom_Cards.Quantity.value == 1) price = price + 0.75
		}

		displayQuote()					
	}


	//Determine if order is new or not
	function newOrder(x)
	{
		var x;
		
		if(x == "yes")
			neworder="yes";
		else
			neworder="no";
		
		calculatePrice()
	}
	

	function displayQuote()
	{
		//Determine if setup fee is required
		if(neworder == "yes")
			document.Custom_Cards.setup.value = "$45.00";	
		else
			document.Custom_Cards.setup.value = "Not Required";

		// Round the price to two decimal places
		price = Math.round(price*100)/100;

		// Add a zeros to the end of price, if needed		
		if (price.toString().indexOf(".") == -1) price = price + ".00";
		if ((price.toString().length - 1) - price.toString().indexOf(".") == 1) price = price + "0";
		
		// Make sure the size of the price text field is right
		if (price.toString().length < 5) document.Custom_Cards.Price.size = 1;
		if (price.toString().length == 5) document.Custom_Cards.Price.size = 2;

		// Display the price
		document.Custom_Cards.Price.value = "$" + price;	
	}
	

	//Sets the result displays to read-only
	function setReadOnlyAreas()
	{
		document.Custom_Cards.setup.readOnly = true;
		document.Custom_Cards.Price.readOnly = true;
	}



