/********************************************************

Paypal Cart Helper

Original script and source from: 
    paypalhelper@aol.com
    http://members.aol.com/paypalhelper/

Modified/fixed 12/31/04 by Dave Cohen:
    dlcohen@alleycatsw.com
    http://www.alleycatsw.com
********************************************************/

// ********************************************************
// START EDITING HERE
// ********************************************************

// Debug info
DebugFlag = 0;              // run in debug mode, using...
DebugDivide = 100;          // ...this value to divide prices/amounts

// Company information, shown on order form.
MyName=       "";
MyCompany=    "DRT Press";
MyAddress1 =  "P.O. Box 427";
MyAddress2 =  "";
MyCity=       "Pittsboro"
MyState=      "NC";
MyZip=        "27312";
MyPhone=      "";
MyFax=        "";
MyEmail=      "order@drtpress.com";

MyHandling= 0;                        // cart wide handling charge
// Set shipping amount for 1 book, 2 books, 3 books, etc up to 6 books
MyShippingMedia        = [ 3.50,  4.25,  5.00,  5.75,  6.50,  7.25];           // media cost per item to ship
//MyShippingMedia        = [ 0.00,  0.00,  0.00,  0.00,  0.00,  0.00];           // media cost per item to ship
MyShippingPriority     = [ 4.95,  7.95,  10.95,  13.95, 16.95, 19.95];           // priority cost per item to ship
//MyShippingNextDay      = [ 9.00, 19.00, 36.20, 36.20, 54.05, 54.05];           // next day cost per item to ship
MyShippingInternational  = [ 21.00, 27.00, 33.00, 39.00, 45.00, 51.00];           // international cost per item to ship
MyShippingCanada         = [ 7.50, 11.00, 14.50, 18.00, 21.50, 25.00];           // canada cost per item to ship

MyTaxRate = "7.75";                       // percentage tax rate
MyTaxText = "NC 7.75%";                   // text next to tax on order form

MyPrinterImage="PPCprinter.gif";          // printer image on order form
MyCreditCardsImage="images/PPCcreditcards.gif";  // credit card image on order form

MyOrderCaption= "";                       // order form caption

MyOrderMessage="5% of all proceeds are donated to adoption charities";                        // order form message - thank you, etc

MyPPCAt = "@";
MyPPCDot = ".";
MyPPCType = "com";
MyPPCId1 = "order";
MyPPCId2 = "drtpress";

// Suggest including info indicating payment not handled at this site, since
// page is not secure (https).
MyPaypalMessage = 
  '<img src="' + MyCreditCardsImage + '" alt="PayPal Credit Cards" />';
MyPaypalButton =   
  'Process payment securely at the PayPal Web site.';

MyPrintOrderMessage = 
  'Alternatively, you can print this form and <b>mail</b> it with your remittance.<br><br>';

// COUPONS
// Format is: drtp_XXXX_NNNN_T_CC
// Where: XXXX = any 4 characters to identify coupon
//        NNNN = amount or percent, without decimal (ie, 1000 = $10 if amount, 0500 = 5% if percent)
//        T    = coupon type, either a (amount) or p (percent)
//        CC   = category coupon applies to, or set to 00 to apply to all categories
// Examples:
//        drtp_abcd_1000_p_00 : 10% off coupon, all categories, coupon is "abcd"
//        drtp_xyzz_0995_a_00 : $9.95 off coupon, all categories, coupon is "xyzz"
//        drtp_a123_2000_p_01 : 20% off coupon, category 1, coupon is "a123"
                                  
MyShowCreditCards = 1;                      // show credit cards on order form?
MyGetAgreement = 0;                         // get agreement on order form?
MyGetCoupon = 1;                            // get coupon on order form?
MyShowImages = 1;                           // show images on order form;
MyImageWidth = 80;
MyImageHeight = 60;
MyShowProductCategories = 0;                // show product categories on order form?
MyShowProductCategorySummaries = 0;         // show product category summaries on order form?

MyCurrencyCode = "USD";
MyCountryCode = "US";

MyPaypalPageStyle = "";
MyPaypalCancelPath = "";
MyPaypalReturnPath = "";

MyMinimumAmount = 0;                        // minimum amount of order, or zero.
MyMinimumQuantity = 1;                      // minimum quantity of order, or zero.

MyShowPrintedOrderForm = 1;
MyShowCartOnAdd = 1;                        // display cart when add-cart is clicked.

MyCalculatePostageLink = "<br />" +
                         "<a href='mailto:" + MyPPCId1 + MyPPCAt + MyPPCId2 + MyPPCDot + MyPPCType + "'>" +   
                         "Contact us for shipping costs on international orders<br>and orders for more than 6 books</a>" +
                         "<br />" +
                         "<a target='ppcnew' href='http://www.usps.com/tools/calculatepostage/welcome.htm'>" +
                         "Calculate postage at USPS Web site</a>";

MyMaxItemsShipping = 6;                // max # items to ship before need to get shipping quote from us

//MyCatTaxable       = [true, true, true, true]; // category taxable?
MyCatTaxable       = [true, true, true, true, true]; // category taxable?
   
// ********************************************************
// END EDITING HERE
// ********************************************************

  LoadIt();           // force load of data
  if (DebugFlag)
  { 
    MyHandling /= DebugDivide;
  }
  root.showcc = MyShowCreditCards;      // display credit card line
  root.dump = 0;                        // root diagnostic cookie dump (leave off)
  root.getagree = MyGetAgreement;       // agreement checkbox
  root.agree = 0;                       // agreement checkbox
  root.getcoup = MyGetCoupon;           // ask for coupon code on cart page
  root.showimg = 1;                     // show images in cart (SetImg)
  if (MyImageHeight > 0)
  {
    root.showimgh = MyImageHeight;
  }
  if (MyImageWidth > 0)
  {
    root.showimgw= MyImageWidth;
  }
  root.showcat = MyShowProductCategories;              // display product category in item list
  root.showcatsm = MyShowProductCategorySummaries;     // display product category in item list
  root.getship = 1;                     // ask user for shipping options
  root.gettax = 1;                      // ask user for tax options

                                        //  gm rounds up to these grams.
  SetCartHand(0, 1, MyHandling);
// required entry to store stuff off
  root.store();       // required entry!!
