﻿/*
 * Calculate the Price of a Presentation Folder — 1.0.0
 *
 * Copyright (c) 2009 Wayne Kolenchuk (wayne@kolenchuk.com)
 * $Date: 2009-02-21 
 * You can use or modify this script as long as you display this attribution
 * These can be passed to the shopping cart
 */


function PresentationFolderPrice() //calculate business card price
{
		
	var presfolder = new Array();
	//create a new array
	
	presfolder[0] = [1000,190,1189,170];
    presfolder[1] = [2000,190,1499,356];
	presfolder[2] = [5000,190,2399,331];

	
	// put the values into a multi dimensional array
	// since there is always a quantity use the selected index value of quantity to determine secondary position in the array.
	     
    var base_price = presfolder[document.getElementById('number_of_cards').selectedIndex][2];
	// get the basic price
	
	if (document.getElementById('sides').selectedIndex==1) {   
   var sides = presfolder[document.getElementById('number_of_cards').selectedIndex][3];
	}
   else {
	 sides = 0;
	}
	// get the basic price
	
	if (document.getElementById("special_die").checked) {
	
	 var special_die = presfolder[document.getElementById('number_of_cards').selectedIndex][1];
	   }  
	   else {
		   
		var special_die = 0;   
	   }
     // if special die selected get price, otherwise set to 0


	var total_price = (base_price + special_die + sides).toFixed(2);
	
	document.getElementById("Price").value = total_price;
	//put the price in a form field and display it
	

}