﻿//************************************************************************************* 
// File     :   tsob_advertise_paypal.js
// Version  :   1.0
// Requires :   mf_domLibrary_0.1.js, prototype.js
// Author   :   Kyle Weems (ksw)
// Origin   :   mindfly.com
// Created  :   December 27, 2007
// Modified :   December 27, 2007 (ksw)
// Purpose  :   Fires off the PayPal form when one of the PayPal buttons is clicked (changing form info depending on button)
//*************************************************************************************

// Version History (only for changes of at least 0.0.1 in version number)
// ===============
// Version 1.0   (12/27/2007) - Basic functionality.


//=============================================================================================
// AddToCart()
//=============================================================================================
// Runs the paypal add to cart form, changing the item field's value to 'name' and the value field's value to 'price'.
function AddToCart(name, price)
{
    // Set the form's 'item_name' field's value to 'name'.
    $('inputPayPalItemName').value = name;
    // Set the form's 'value' field's value to 'price'.
    $('inputPayPalValue').value = price;
    // Submit the form.
    $('payPalSubmit').submit();
} // end of function AddToCart()


//=============================================================================================
// ViewCart()
//=============================================================================================
// Shows the PayPal cart.
function ViewCart()
{
    // Submit the form 'payPalView' to view the PayPal Cart
    $('payPalView').submit();
} // end of function ViewCart()

