//---------------------------------------------------------------------//
// prices.js - include file for configuring the DSMI PayPal template   //
//---------------------------------------------------------------------//


// Change this to the email address for your PayPal account
var paypalAccount = new String("paypal@angel-photo.com")

// Change this to point to your home page
// Use this if you don't want a link: var HomeURL = new String("")
var HomeURL = new String("../da3home.htm")

// percentage discount, set to 0 for no discount
var discount = 0;
// var discount = 10;	// Use this for 10% discount

var numOptions = 10;	// this number must match the number of entries below
var description = new Array(numOptions);
var price = new Array(numOptions);

// Edit the description text and price for each item as required
description[0] = "Two 4x6 prints*";                 price[0] = 7; // price/description #1
description[1] = "5x7 print";                       price[1] = 7; // price/description #2
description[2] = "Two 5x7 prints*";                 price[2] = 12; // price/description #3
description[3] = "8x10 print";                      price[3] = 12; // price/description #4
description[4] = "Two 8x10 prints*";                price[4] = 20; // price/description #5
description[5] = "One 5x7 print/Two 4x6 prints*";   price[5] = 12; // price/description #6
description[6] = "One 5x7 print/Two 3.5x5 prints*"; price[6] = 12; // price/description #7
description[7] = "One 5x7 print/Eight Wallets*";    price[7] = 12; // price/description #8
description[8] = "11 x 14 print";              price[8] = 20; // price/description #9
description[9] = "Low Res Image File";              price[9] = 12; // price/description #10







// Change these values to specify the number of rows and columns per page
var numRows = 3
var numColumns = 4

//---------- Don't change anything below this line! -------------//

function orderPrintSize(filename, reference, desc, amount)
{
    if (discount < 100 && discount > 0)
    {
    	amount = Math.round((100 - discount) * amount);
    }
    else
    {
        amount = Math.round(100 * amount);
    }
    var price = new String(amount);
    price = price.substr(0, price.length - 2) + "." + price.substr(price.length - 2, 2);
    document.write('<tr>')
    document.write('<td valign="TOP">')
    document.write('<font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">' + desc + ' $' + price)
    document.write('</font></td>')
    document.write('<td>')
    document.write('<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal">')
    document.write('<input type="hidden" name="cmd" value="_cart">')
    document.write('<input type="hidden" name="business" value="' + paypalAccount + '">')
    document.write('<input type="hidden" name="item_name" value="' + desc + ' - ' + filename + '">')
    document.write('<input type="hidden" name="item_number" value="' + reference + '">')
    document.write('<input type="hidden" name="shipping" value="1.00">')
document.write('<input type="hidden" name="shipping_2" value="1.00">')   
 document.write('<input type="hidden" name="amount" value="' + price + '">')
    document.write('<input type="hidden" name="add" value="1">')
    document.write('<p><font size="5" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">')
    document.write('<input type="image" name="submit" src="add_to_cart.gif" alt="Order this print" align="BOTTOM" border="0" width="90" height="24">')
    document.write('</font></p>')
    document.write('</form>')
    document.write('</td>')
    document.write('</tr>')
}

function printSizes(filename, reference)
{
    document.write('<font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">')
    if (discount < 100 && discount > 0)
    {
    	document.write("The prices below include a discount of " + discount + "%");
    }
    document.write('</font>')
    document.write('<table border="0">')
    for (i = 0; i < description.length; i++)
    {
        orderPrintSize(filename, reference, description[i], price[i])
    }
    document.write('</table>')
}
function viewCart()
{
	document.write('<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="_xclick" target="paypal">')
    	document.write('<input type="hidden" name="cmd" value="_cart">')
    	document.write('<input type="hidden" name="business" value="' + paypalAccount + '">')
    	document.write('<input type="hidden" name="display" value="1">')
    	document.write('<p align="center">')
    	document.write('<input type="image" name="submit" src="view_cart.gif" alt="View the contents of your shopping cart" align="bottom" border="0" width="90" height="24">')
    	document.write('</p>')
	document.write('</form>')
}

