diff -x .svn -aruN 5.2.002.src/admin_files/agora_user_lib.pl 5.2.003.src/admin_files/agora_user_lib.pl
--- 5.2.002.src/admin_files/agora_user_lib.pl	2008-03-11 09:31:21.000000000 -0500
+++ 5.2.003.src/admin_files/agora_user_lib.pl	2008-04-23 17:22:15.000000000 -0500
@@ -7,13 +7,13 @@
     $cart{"quantity"} 
     ,$cart{"db_user1"} 
     ,$cart{"name"} 
-    ,$cart{"web_options"} 
+    ,$cart{"options"} 
     ,$cart{"shipping"} 
     ,$cart{"price_after_options"} 
     );
 $sc_cart_display_str = 'Qty|Picture|Product|Options|Shipping Wt.<br>(lbs)|Cost';
 @sc_cart_display_fields = split(/\|/,$sc_cart_display_str);
-$sc_cart_display_col = 'quantity|db_user1|name|web_options|shipping|price_after_options';
+$sc_cart_display_col = 'quantity|db_user1|name|options|shipping|price_after_options';
 @sc_col_name = split(/\|/,$sc_cart_display_col);
 $sc_cart_display_fact = 'no|no|no|no|yes|yes';
 @sc_cart_display_factor = split(/\|/,$sc_cart_display_fact);
@@ -72,6 +72,7 @@
 &bull;<a href="agora.cgi?product=Programming&amp;xm=on" class="ac_left_links" title="Programming">Programming</a> <br />|;
 #:#:#: end CATEGORYLIST settings
 #:#:#: start DISCOUNT settings
+$sc_enable_discount = "no";
 @sc_discount_logic = ("");
 #:#:#: end DISCOUNT settings
 #:#:#: start FEATUREDPRODUCT settings
@@ -216,7 +217,7 @@
 $sc_buttonSetName = "TheAgora_BluGreen";
 $sc_buttonSetURL = "html/images/buttonsets/TheAgora_BluGreen";
 $sc_displayDynamicCategories = "yes";
-$sc_headerStoreTitle = "Powered by AgoraCart version 5.2.000";
+$sc_headerStoreTitle = "Powered by AgoraCart version 5.2.003";
 $sc_headerStoreTagLine = "Thanks for Visiting our Store!";
 $sc_store_header_file = "./html/html-templates/templates/TheAgora/store_header.html";
 $sc_store_footer_file = "./html/html-templates/templates/TheAgora/store_footer.html";
@@ -229,7 +230,7 @@
 $sc_secure_standard_head_info = qq|
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 |;
-$sc_doctype =  qq|<!DOCTYPE HTML PUBLIC "-//W3C//Dtd HTML 4.01 Transitional//EN">|;
+$sc_doctype =  qq|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">|;
 ##############################################################
 $sc_domain_name_for_cookie = "$ENV{'SERVER_NAME'}";
 $sc_my_script_name = "$ENV{'SCRIPT_NAME'}";
diff -x .svn -aruN 5.2.002.src/agora.cgi 5.2.003.src/agora.cgi
--- 5.2.002.src/agora.cgi	2008-01-21 22:22:39.000000000 -0600
+++ 5.2.003.src/agora.cgi	2008-04-07 19:00:10.000000000 -0500
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -T
 
-$versions{'agora.cgi'} = "5.2.000";
+$versions{'agora.cgi'} = "5.2.003";
 
 # Version history is available at... 
 # http://www.agoracart.com/
@@ -967,7 +967,7 @@
 {
 ($empty, $image_tag, $image_location) = split (/%%/, $field);
 $field = '<img src="' . "$URL_of_images_directory/$image_location" . 
-  '" alt="' . "$image_location" . '"/>';
+  '" alt="' . "$image_location" . '">';
 }
 if ($field =~ /^%%OPTION%%/i)
 {
diff -x .svn -aruN 5.2.002.src/data_files/data.file 5.2.003.src/data_files/data.file
--- 5.2.002.src/data_files/data.file	2006-10-17 21:41:04.000000000 -0500
+++ 5.2.003.src/data_files/data.file	2008-04-07 17:46:38.000000000 -0500
@@ -3,7 +3,7 @@
 00006|HT2ML Books|27.96|HTML: The Definitive Guide|<img src="%%URLofImages%%/0006.gif" alt="0006.gif">|HTML is changing so fast it's almost impossible to keep up with developments. How do you know what's real, and how do you use it? The third edition of HTML: The Definitive Guide brings it all  together for you. It covers HTML, JavaScript, Style sheets, Layers, and all of the features supported by the popular Web browsers.|4.95|%%IMG%%sm_0006.gif|test.gif|20||84567|%%OPTION%%blank.html
 00007|Books|31.96|Dynamic HTML: The Definitive Guide|<img src="%%URLofImages%%/0007.gif" alt="0007.gif">|Danny Goodman felt that he couldn't trust any of the documentation on Dynamic HTML (DHTML) that he read (too many contradictions), so he wrote this book as a reference for working with his own clients. After testing tags and techniques on multiple releases of the main browsers, Goodman came up with very practical information--some of which you may not find in any other resource.  Test some meta characters $ @ # " ? +  ' & *|4.95|%%img%%sm_0007.gif||77|DHTML|92345|%%OPTION%%var_opt.html
 00008|Books|31.99|Dreamweaver 2 Bible|<img src="%%URLofImages%%/0008.gif" alt="0008.gif">|Dreamweaver 2 brings you more control and more flexiblity than ever before. Whether you're creating heavy-action sites packed with sound effects, Shockwave movies, sophisticated animations, or data-driven, interactive sites for e-commerce, you'll find all the information you need to speed construction, smooth maintenance, and power up.|4.95|%%IMG%%sm_0008.gif|||HTML::Adobe|92345|%%OPTION%%gift_option.html
-00009|Books|39.99|XML Bible|<img src="%%URLofImages%%/0009.gif" alt="0009.gif">|XML is revolutionizing Web-site development by making difficult tasks easier and many tasks possible. This thorough tutorial-plus-reference takes you step by step through everything you need to know to put XML to work, from the fundamentals of the XML language to document construction and simple XML-based solutions for specialized markup problems.|4.95|%%IMG%%sm_0009.gif||9|HTML||%%OPTION%%blank.html
+00009|Books|39.99|XML Bible|<img src="%%URLofImages%%/0009.gif" alt="0009.gif">|XML is revolutionizing Web-site development by making difficult tasks easier and many tasks possible. This thorough tutorial-plus-reference takes you step by step through everything you need to know to put XML to work, from the fundamentals of the XML language to document construction and simple XML-based solutions for specialized markup problems.|4.95|%%IMG%%sm_0009.gif||9|HTML||%%OPTION%%var_product_discount_code.html
 00010|Books|15.99|HTML Goodies|<img src="%%URLofImages%%/0010.gif" BORDER=0>|Joe Burns' fast and friendly approach to building a Web site keeps over 300,000 people coming back to his HTML Goodies Web site every month. Now Joe has gone way beyond the Web site with HTML Goodies, the book! Let Joe show you how easy HTML can be. After you've   mastered text formatting, creating links, and inserting graphics, HTML Goodies takes you far beyond HTML basics.|4.95|%%img%%sm_0010.gif|||||||||||||HTML||%%OPTION%%gift_option.html
 00011|Books|13.29|Flash 4 for Windows and Macintosh|<img src="%%URLofImages%%/0011.gif" alt="0011.gif">|This easy, visual approach to learning Flash takes the reader through the basics of vector drawing to the creation of animated multimedia files for the Web. Using this clear guide, professional Web designers, as well as hobbyists, can find out how to add sophisticated multimedia effects to their Web pages, without having to learn complicated scripting.|4.95|%%IMG%%sm_0011.gif||34|Multimedia::Flash||%%OPTION%%blank.html
 00012|Books|31.99|Flash 4! Creative Web Animation|<img src="%%URLofImages%%/0012.gif" alt="0012.gif">|All features and tools of Flash 4 covered in great detail, including an introduction to the authoring environment, drawing tools, working with text and sound, using bitmap images, working with symbols and instances, using and managing the libraries, working with layers, animation and interactivity, testing and publishing movies, and project planning and preparation.|4.95|%%IMG%%sm_0012.gif||0|Multimedia::Flash||%%OPTION%%blank.html
@@ -15,7 +15,7 @@
 00021|Machine Tooling|60.00|Kwik-Switch 200 Acura-Flex Collet Chuck|<img src="%%URLofImages%%/Pic1a.jpg" alt="Pic1a.jpg">|Excellent condition 3/4" capacity Kwik-Switch 200 Acura-Flex Collet Chuck, Universal Engineering #80237 body and #9400005 Nut. The nose bearing is free and smooth. It uses Acura-Flex collets which are readily available in sizes from 9/64" to 25/32". This unit will also accept 3/4" capacity Acura-Grip (#90750) and 3/4" capacity Acura-Mill collets with a #90751 nut. <br /><br /><ul><li> <a href="http://www.tools-n-gizmos.com/part_pics/10013Pics.html">More pictures</a></li><li> <a href="http://www.tools-n-gizmos.com/specs/AF_Collet.html#075">Acura-Flex Collet specs</a></li><li> <a href="http://www.tools-n-gizmos.com/specs/KS_AF_Collet_Chuck.html">Acura-Flex Chuck specs</a></li><li> <a href="http://www.tools-n-gizmos.com/specs/Tapers.html#KS">Kwik-Switch Shank specs</a></li><li> <a href="http://www.tools-n-gizmos.com/store/agora.cgi?&user2=yes&user4=Spnr&description=55139&ppinc=MT">Collet Nut Spanner</a></li></ul><br />Sample item Provided by:<br /><a href="http://www.tools-n-gizmos.com/store/agora.cgi?&p_id=10013&ppinc=1a">Tools-n-Gizmos.com</a><br /><br />|1|%%IMG%%Pic1b.jpg|||||%%OPTION%%blank.html
 00022|Machine Tooling|8.00|Acura-Flex Collets, 3/4" max capacity|<img src="%%URLofImages%%/Pic2a.jpg" alt="Pic2a.jpg">|Excellent condition Universal Acura-Flex collets. These collets cover the range from 1/8" (AF-95) to 25/32" (AF-140) and 3.5mm to 20mm. They fit 3/4" capacity Acura-Flex collet chucks.(80237, 80350, 80416 and many others). There are several manufacturers of AF collets (Universal Eng., Smith Tool, Collis, Centaur and others). Most of my AF collets are made by Universal (but the one you get my not be). <br /><br /><ul><li> <a href="http://www.tools-n-gizmos.com/part_pics/AF75EXPics.html">More pictures</a></li><li> <a href="http://www.tools-n-gizmos.com/specs/AF_Collet.html#075">AF Collet specs</a></li><li> <a href="http://www.tools-n-gizmos.com/specs/KS_AF_Collet_Chuck.html">Kwik-Switch AF Chuck specs</a></li></ul><br />Sample item Provided by:<br /><a href="http://www.tools-n-gizmos.com/store/agora.cgi?user2=yes&user4=CollAF75&titttle=Acura-Flex_0.75_inch_capacity_Collets_for_sale&ppinc=MT">Tools-n-Gizmos.com</a><br /><br />|1|%%IMG%%Pic2b.jpg|||||%%OPTION%%blank.html
 00023|Machine Tooling|60.00|Kwik-Switch 200 Acura-Flex Collet Chuck|<img src="%%URLofImages%%/Pic3a.jpg" alt="Pic3a.jpg">|Excellent condition 1/2" capacity Kwik-Switch 200 "Y" Collet Chuck, Universal Engineering # 80220 body and #551084 nut. It uses size Y #55097 (3/16" to 1/2") double taper collets which are readily available. <br /><br /><ul><li> <a href="http://www.tools-n-gizmos.com/part_pics/10098Pics.html">More pictures</a></li><li> <a href="http://www.tools-n-gizmos.com/specs/DT_Collet.html">DT Collet specs</a></li><li> <a href="http://www.tools-n-gizmos.com/specs/KS_DT_Collet_Chuck.html">DT Chuck specs</a></li><li> <a href="http://www.tools-n-gizmos.com/specs/Tapers.html#KS">Kwik-Switch Shank specs</a></li></ul><br />Sample item Provided by:<br /><a href="http://www.tools-n-gizmos.com/store/agora.cgi?&user2=yes&description=80220&user4=KS200,ColChk&titttle=0.5_in._capacity_Kwik-Switch_DT_Collet_Chucks&ppinc=MT">Tools-n-Gizmos.com</a><br /><br />|1|%%IMG%%Pic3b.jpg|||||%%OPTION%%blank.html
-00026|Art|999.99|Underachievement Poster|<img src="%%URLofImages%%/motivation_01m.jpg" alt="motivation_01m.jpg">|The Tallest Blade of Grass is the First to be Cut by the Lawnmower|1|%%IMG%%motivation_01s.jpg|motivation_01l.jpg||||%%OPTION%%blank.html
+00026|Art|999.99|Underachievement Poster|<img src="%%URLofImages%%/motivation_01m.jpg" alt="motivation_01m.jpg">|The Tallest Blade of Grass is the First to be Cut by the Lawnmower|1|%%IMG%%motivation_01s.jpg|motivation_01l.jpg||||%%OPTION%%var_product_discount_code.html
 00027|Art|999.99|Ambition Poster|<img src="%%URLofImages%%/motivation_02m.jpg" alt="motivation_02m.jpg">|The Journey of a Thousand Miles Sometimes Ends Very, Very Badly|1|%%IMG%%motivation_02s.jpg|motivation_02l.jpg||||%%OPTION%%blank.html
 00028|Art|999.99|Arrogance Poster|<img src="%%URLofImages%%/motivation_04m.jpg" alt="motivation_04m.jpg">|The Best Leaders Inspire by Example. When That's Not an Option, Brute Intimidation Works Well, Too.|1|%%IMG%%motivation_04s.jpg|motivation_04l.jpg||||%%OPTION%%blank.html
 00029|Art|999.99|Conformity Poster|<img src="%%URLofImages%%/motivation_05m.jpg" alt="motivation_05m.jpg">|When People are Free to do as They Please, They Usually Imitate Each Other.|1|%%IMG%%motivation_05s.jpg|motivation_05l.jpg||||%%OPTION%%blank.html
diff -x .svn -aruN 5.2.002.src/html/forms/AuthorizeNet-orderform.html 5.2.003.src/html/forms/AuthorizeNet-orderform.html
--- 5.2.002.src/html/forms/AuthorizeNet-orderform.html	2007-12-19 22:50:55.000000000 -0600
+++ 5.2.003.src/html/forms/AuthorizeNet-orderform.html	2008-03-26 19:58:26.000000000 -0500
@@ -38,7 +38,7 @@
 Please select where your order will be shipped and 
 click 'Next'</TD>
 </tr>
-
+<tr>
 <td class="ac_checkout_left_col">Method:</td>
 <td class="ac_checkout_right_col">
 
diff -x .svn -aruN 5.2.002.src/html/options/var_product_discount_code.html 5.2.003.src/html/options/var_product_discount_code.html
--- 5.2.002.src/html/options/var_product_discount_code.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.003.src/html/options/var_product_discount_code.html	2008-04-07 19:32:02.000000000 -0500
@@ -0,0 +1,55 @@
+<HTML>
+<TITLE>Variable Option - Coupon Code Disc.</TITLE><BODY>
+<PRE>
+Example of a 'variable option' that depends on the coupon code entered
+associated with a single product id number, regardless of the
+options selected with it.
+</PRE>
+
+<h3>--cut here--</h3>
+<!--agorascript-add-to-cart-opt-099 {
+# Gold member Contribution from:
+# Sheldon Newman with Newtech Enterprises on behalf of
+# http://www.wunderwear.com
+# improvements by Mister Ed
+#
+# enable variable option code unconditionally
+# first thing is this option file name, next is the agorascript to run
+$item_user1 .= "var_product_discount_code.html,variable-option-099;";}
+-->
+<table cellspacing="0" cellpadding="1" class="opt_border">
+<tr><th class="opt_border">Enter PromoCode<br />to receive Sale Price!</th>
+</tr></table>
+
+<input  type="text" size="6" name="option|099|%%PRODUCT_ID%%"  maxlength="8" />
+
+<h3>--cut here--</h3>
+
+<!--agorascript-variable-option-099 {
+local ($qty) = $cart_row[$cart{'quantity'}];
+local ($price) = $cart_row[$cart{'price'}];
+local ($myopt) = '';undef($cart_row_options{'099'});
+if ($var_opt_action eq 'reset') {
+  $myopt = ''; #original: $myopt = 'Var099';
+ } else {
+# For the calc function, we have the cart copy loaded, find qty
+# for all products with same id, not just those of this opt #
+# or those with the same options (sort of a mix n match).
+$qty = 1; # original: $qty = 0;
+local ($xqty,$xpid,$junk);
+foreach $inx (keys(%cart_copy)) {
+  ($xqty,$xpid,$junk) = split(/\|/,$cart_copy{$inx},3);
+  if ($xpid eq $cart_row[$cart{'product_id'}]) {$qty = $qty + $xqty;}
+ }
+
+# replace DISCOUNTCODE with your code, and ajust the discount
+   if ($myopt='DISCOUNTCODE') {$myopt = '50% off each|' . &format_price((-0.50)*$price);}
+   elsif ($myopt ne 'DISCOUNTCODE2')  {$myopt = '25% off each|' . &format_price((-0.25)*$price);}
+   else  {$myopt = '0% off each|' . ((-0.00)*$price);}
+
+}
+if ($myopt ne '') {$cart_row_options{'099'} = $myopt;}
+} -->
+
+</body>
+</html> 
\ No newline at end of file
diff -x .svn -aruN 5.2.002.src/library/PayPal-order_lib.pl 5.2.003.src/library/PayPal-order_lib.pl
--- 5.2.002.src/library/PayPal-order_lib.pl	2008-02-14 01:14:06.000000000 -0600
+++ 5.2.003.src/library/PayPal-order_lib.pl	2008-04-07 16:22:44.000000000 -0500
@@ -37,7 +37,7 @@
 #                    Order Form Definition Variables                  #
 #######################################################################
 
-$versions{'PayPal-order_lib.pl'} = "5.2.000";
+$versions{'PayPal-order_lib.pl'} = "5.2.001";
 
 #best to leave this option as it is, as PayPal return is NOT guaranteed!
 $sc_paypal_email_before = "yes"; # set to "no" if email upon return
@@ -682,6 +682,13 @@
            "$text_of_confirm_email");
  }
 
+if ($sc_buySafe_is_enabled =~ /yes/) {
+    undef(%agora); 
+    undef(%agora_original_values);
+    undef(%form_data);
+    &set_agora("BUYSAFE_ORDER_COMPLETED",'yes');
+}
+
 }
 #################################################################
 
diff -x .svn -aruN 5.2.002.src/library/PayPalIPN-mgr_lib.pl 5.2.003.src/library/PayPalIPN-mgr_lib.pl
--- 5.2.002.src/library/PayPalIPN-mgr_lib.pl	2007-11-12 19:37:09.000000000 -0600
+++ 5.2.003.src/library/PayPalIPN-mgr_lib.pl	1969-12-31 18:00:00.000000000 -0600
@@ -1,480 +0,0 @@
-#
-# For the 'PayPal IPN' CC and Check Processing Gateway
-# Requires AgoraCart version 5.0.0 or above.  Just place this file in the library directory.
-#
-# Author: Andy Smith and Mister_Ed for K-Factor Technologies, Inc and AgoraCartPro.com
-# Copyright 2002-Present K-Factor Technologies, Inc.  All Rights Reserved.
-#
-# This is NOT FREE AND/OR GPL SOFTWARE!  This library is a cost item.
-# This software is a separate add-on to an ecommerce shopping cart and 
-# is the confidential and proprietary information of K-Factor Technologies, Inc.  You may
-# not disclose such Confidential Information and shall use it only in
-# conjunction with the AgoraCart (aka agora.cgi) shopping cart.
-#
-# To use it you must license it from http://www.agoracart.com/ or
-# http://www.agoracartpro.com/
-#
-# K-Factor Technologies, Inc. BytePipe, AgoraScript nor any of their employees and/or representatives
-# MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT
-# THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESSED OR IMPLIED,
-# INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-# OR NON-INFRINGEMENT.
-#
-# K-Factor Technologies, Inc., BytePipe, AgoraScript nor any of their employees and/or representatives
-# SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY
-# LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS
-# SOFTWARE OR ITS DERIVATIVES.
-#
-# You may not give this script/add-on away or distribute it an any way outside of a copy of
-# AgoraCart without written permission from K-Factor Technologies, Inc.  K-Factor Technologies, Inc.
-# reserves any and all rights to distributions, add-ons, and other works based on this
-# piece of software as well as any and all rights to profit sharing and/or to charge for
-# such works and/or derivatves.
-#
-###############################################################################
-
-$versions{'PayPalIPN-mgr_lib.pl'} = "5.5.000 Pro Version";
-&add_codehook("gateway_admin_screen","PayPalIPN_mgr_check");
-&add_codehook("gateway_admin_settings","PayPalIPN_settings");
-$mc_gateways .= "|PayPalIPN";
-##############################################################################
-sub PayPalIPN_settings {
-local($custom_logic);
-if ($sc_gateway_name eq "PayPalIPN") {
-
-$sc_PayPalIPN_top_message_temp = &my_escape($in{'sc_PayPalIPN_top_message'});
-$sc_PayPalIPN_shipping_message_temp = &my_escape($in{'sc_PayPalIPN_shipping_message'});
-$sc_PayPalIPN_special_message_temp = &my_escape($in{'sc_PayPalIPN_special_message'});
-$sc_PayPalIPN_order_name_tmp = &my_escape($in{'sc_PayPalIPN_order_name'});
-$sc_tos_display_address_temp = &my_escape($in{'sc_tos_display_address'});
-$sc_order_ok_tmp = &my_escape($in{'order_ok_final_msg_tbl'});
-$sc_paypal_return_button_text = &my_escape($in{'sc_paypal_return_button_text'});
-# added by Mister Ed May 13, 2006
-$messages{'paypalipn_echeck'} = &my_escape($in{'paypalipn_echeck'});
-$messages{'paypalipn_pending'} = &my_escape($in{'paypalipn_pendingt'});
-$messages{'paypalipn_denied'} = &my_escape($in{'paypalipn_denied'});
-
-  open (GATEWAY, "> $gateway_settings") || 
-    &my_die("Can't Open $gateway_settings");
-  print (GATEWAY  "\$sc_PayPalIPN_username = \'$in{'sc_PayPalIPN_username'}\';\n");
-  print (GATEWAY  "\$sc_use_alternate_PayPalIPN_order_processing = \'$in{'sc_use_alternate_PayPalIPN_order_processing'}\';\n");
-  print (GATEWAY  "\$sc_use_alternate_PayPalIPN_submit_page = \'$in{'sc_use_alternate_PayPalIPN_submit_page'}\';\n");
-  print (GATEWAY  "\$IPN_order_script_url = \"$in{'order_url'}\";\n");
-  print (GATEWAY  "\$sc_order_notify_url = \"$in{'sc_order_notify_url'}\";\n");
-  print (GATEWAY  "\$sc_order_return_url = \"$in{'sc_order_return_url'}\";\n");
-  print (GATEWAY  "\$sc_paypal_cancel_return = \"$in{'sc_paypal_cancel_return'}\";\n");
-  print (GATEWAY  "\$sc_paypal_header_image = \"$in{'sc_paypal_header_image'}\";\n");
-  print (GATEWAY  "\$currency_id = \"$in{'currency_id'}\";\n");
-  print (GATEWAY  "\$sc_PayPalIPN_show_table = \"$in{'show_table'}\";\n");
-  print (GATEWAY  "\$sc_PayPalIPN_top_message = qq'$sc_PayPalIPN_top_message_temp';\n");
-  print (GATEWAY  "\$sc_PayPalIPN_shipping_message = qq'$sc_PayPalIPN_shipping_message_temp';\n");
-  print (GATEWAY  "\$sc_PayPalIPN_special_message = qq'$sc_PayPalIPN_special_message_temp';\n");
-  print (GATEWAY  "\$sc_PayPalIPN_order_name = qq'$sc_PayPalIPN_order_name_tmp';\n");
-  print (GATEWAY  "\$sc_display_checkout_tos = \"$in{'sc_display_checkout_tos'}\";\n");
-  print (GATEWAY  "\$sc_tos_display_address = qq'$sc_tos_display_address_temp';\n");
-  print (GATEWAY  "\$order_ok_final_msg_tbl = qq'$sc_order_ok_tmp';\n");
-  print (GATEWAY  "\$sc_paypal_return_button_text = qq'$sc_paypal_return_button_text';\n");
-# added by Mister Ed May 13, 2006
-  print (GATEWAY  "\$messages{'paypalipn_echeck'} = qq~$messages{'paypalipn_echeck'}~;\n");
-  print (GATEWAY  "\$messages{'paypalipn_pending'} = qq~$messages{'paypalipn_pending'}~;\n");
-  print (GATEWAY  "\$messages{'paypalipn_denied'} = qq~$messages{'paypalipn_denied'}~;\n");
-
-  &codehook("manager_write_gateway_settings");
-  &codehook("PayPalIPN_mgr_write_settings");
-  print (GATEWAY  "#\n1\;# We are a Library\n");
-  close(GATEWAY);
- }
-}
-##############################################################################
-sub PayPalIPN_mgr_check {
-if ($sc_gateway_name eq "PayPalIPN") {
-  &print_PayPalIPN_mgr_form;
-  &call_exit;
- }
-}
-##############################################################################
-sub print_PayPalIPN_mgr_form {
-
-##
-## PAYPAL IPN PROCESSING
-##
-
-if ($sc_display_checkout_tos eq '') { # default it in
-  $sc_display_checkout_tos = "yes";
- }
-
-# Added by Mister Ed May 12, 2006
-if ($sc_paypal_return_button_text eq '') { # default it in
-  $sc_paypal_return_button_text = "Click Here to Complete your Order and Notify us";
- }
-
-# added by Mister Ed May 12, 2006
-if ($sc_paypal_cancel_return eq '') { # default it in
-  $sc_paypal_cancel_return = $sc_store_url . "?page=CancelPayment.html";
- }
-
-# 3 defaults added by Mister Ed May 13, 2006
-if ($messages{'paypalipn_echeck'} eq '') {
-$messages{'paypalipn_echeck'} =
-  "Thank you for your order. Paypal has notified us that your method " .
-   "of payment was echeck. Once the Payment is processed we will be " .
-   "notified and your order will be processed!\n\n";
-}
-if ($messages{'paypalipn_pending'} eq '') {
-$messages{'paypalipn_pending'} =
-  "Thank you for your order. Currently your Paypal Payment is pending " .
-  "completion, once it is processed you will receive an order confirmation  " .
-  "via email.\n\n";
-}
-if ($messages{'paypalipn_denied'} eq '') {
-$messages{'paypalipn_denied'} =
-  "Thank you for your order, However your PayPal payment has been DENIED." .
-  "Please contact Paypal for further information.\n\n";
-}
-
-print &$manager_page_header("$sc_gateway_name Gateway","","","","");
-
-print <<ENDOFTEXT;
-<CENTER>
-<TABLE WIDTH=640>
-
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-
-<TR>
-<TD WIDTH=640>
-<FONT FACE=ARIAL>
-PayPal IPN Payment Processing<br>
-Note: when using this gateway, it is suggested that you set the customer's cart contents duration to 5 days. Make sure to change it in your main settings screen.  Otherwise, any pending and/or echeck orders will not be captured.
-$msg</FONT>
-</TD>
-</TR>
-</TABLE>
-</CENTER>
-
-ENDOFTEXT
-
-if($in{'system_edit_success'} ne "")
-{
-print <<ENDOFTEXT;
-<CENTER>
-<TABLE>
-<TR>
-<TD>
-<FONT FACE=ARIAL SIZE=2 COLOR=RED>Gateway settings have been successfully updated</FONT>
-</TD>
-</TR>
-</TABLE>
-</CENTER>
-ENDOFTEXT
-}
-
-if ($sc_PayPalIPN_show_table eq '') { # default it in
-  $sc_PayPalIPN_show_table = 'no';
- }
-print <<ENDOFTEXT;
-
-<FONT FACE=ARIAL SIZE=2>
-<FORM METHOD="POST" ACTION="manager.cgi">
-<CENTER>
-<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 WIDTH=640 BORDER=0>
-
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-
-<TR>
-<TD>
-PayPal email address (your PayPal username):
-</TD>
-<TD>
-<INPUT NAME="sc_PayPalIPN_username" TYPE="TEXT" SIZE=30
-VALUE='$sc_PayPalIPN_username'><br>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2><TABLE WIDTH="100%"><TR>
-<TD>Create a browser receipt after order completion?:</TD>
-<TD>
-<SELECT NAME="show_table">
-<OPTION>$sc_PayPalIPN_show_table</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-$mc_PayPalIPN_show_table_special_option
-</SELECT>
-</TD>
-</TR></TABLE></TD>
-</TR>
-
-
-<TR>
-<TD>Define the currency in which the monetary variables (amount, shipping, shipping2, handling, tax) are denoted. </TD>
-<TD><b>:</b> 
-<SELECT NAME="currency_id">
-<OPTION>$currency_id</OPTION>
-<OPTION>USD</OPTION>
-<OPTION>AUD</OPTION>
-<OPTION>CAD</OPTION>
-<OPTION>GBP</OPTION>
-<OPTION>EUR</OPTION>
-<OPTION>JPY</OPTION>
-</SELECT><br><br>
-
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2><TABLE WIDTH="100%"><TR>
-<TD>Use Alternate payment confirmation page and order logging?<br><small>Must add/edit the PayPalIPN_custom_processing_function sub-routine in the PayPalIPN_custom_lib.pl file, placed in the library sub-directory of your store.  Cut and paste code for editing from the PayPalIPN-order_lib.pl file.  Default is no.</small></TD>
-<TD>
-<SELECT NAME="sc_use_alternate_PayPalIPN_order_processing">
-<OPTION>$sc_use_alternate_PayPalIPN_order_processing</OPTION>
-<OPTION>Yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT>
-</TD>
-</TR></TABLE></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2><TABLE WIDTH="100%"><TR>
-<TD>Use Alternate submission page?<br><small>Must add/edit the PayPalIPN_custom_submission_page sub-routine in the PayPalIPN_custom_lib.pl file, placed in the library sub-directory of your store.  Cut and paste code for editing from the PayPalIPN-order_lib.pl file.  Default is no.</small></TD>
-<TD>
-<SELECT NAME="sc_use_alternate_PayPalIPN_submit_page">
-<OPTION>$sc_use_alternate_PayPalIPN_submit_page</OPTION>
-<OPTION>Yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT>
-</TD>
-</TR></TABLE></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-<TR>
-<TD COLSPAN=2>
-URL to the PayPal Payment Gateway ( should not ever need to be changed).
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-<INPUT NAME="order_url" TYPE="TEXT" SIZE=60
-VALUE="$IPN_order_script_url"><br>
-</TD>
-</TR>
-<TR></TR>
-
-<TR>
-<TD COLSPAN=2>
-URL to your IPN Notification script. (Currently agora.cgi handles this).
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-<INPUT NAME="sc_order_notify_url" TYPE="TEXT" SIZE=70
-VALUE="$sc_order_notify_url"><br>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-Return URL after succesful payment at PayPal. (Currently agora.cgi handles this).
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-<INPUT NAME="sc_order_return_url" TYPE="TEXT" SIZE=70
-VALUE="$sc_order_return_url"><br>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-Return URL if payment CANCELLED at PayPal:
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-<INPUT NAME="sc_paypal_cancel_return" TYPE="TEXT" SIZE=70
-VALUE="$sc_paypal_cancel_return"><br>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-Header Image to be displayed at PayPal.com during checkout:<br>
-<small>Max image size: 750 pixels wide by 90 pixels high.  Must be an SSL URL (begins with https:). Leave blank if you do not have SSL or do not want to use your own image.</small>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-<INPUT NAME="sc_paypal_header_image" TYPE="TEXT" SIZE=70
-VALUE="$sc_paypal_header_image"><br>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-The name you want for the order on the PayPal site:
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-<INPUT NAME="sc_PayPalIPN_order_name" TYPE="TEXT" SIZE=70
-VALUE="$sc_PayPalIPN_order_name"><br>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-Text for the Return Button (at PayPal to return to your store). 60 characters max:
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-<INPUT NAME="sc_paypal_return_button_text" TYPE="TEXT" SIZE=70
-VALUE="$sc_paypal_return_button_text" MAXLENGTH="60"><br>
-</TD>
-</TR>
-
-<TR><TD COLSPAN=2>
-Top message for PayPalIPN form.  Allows you to place a message above the Payment Information area and just below the cart total boxes.  HTML formatting (for text color, font, spacing, etc) is accepted.  Leave blank if not needed:<br>
-<TEXTAREA NAME="sc_PayPalIPN_top_message" 
-cols="68" rows=8 
-wrap=off>$sc_PayPalIPN_top_message</TEXTAREA> <br><br>
-
-Shipping message for PayPalIPN form.  Allows you to place a message in the Shipping Information area of the PayPalIPN form.  HTML formatting (for text color, font, spacing, etc) is accepted.  Leave blank if not needed:<br>
-<TEXTAREA NAME="sc_PayPalIPN_shipping_message" 
-cols="68" rows=8 
-wrap=off>$sc_PayPalIPN_shipping_message</TEXTAREA> <br><br>
-
-Message for Special Message area for PayPalIPN form.  Allows you to place a message just above the Special Message area of the PayPalIPN form.  HTML formatting (for text color, font, spacing, etc) is accepted.  Leave blank if not needed:<br>
-<TEXTAREA NAME="sc_PayPalIPN_special_message" 
-cols="68" rows=8 
-wrap=off>$sc_PayPalIPN_special_message</TEXTAREA> <br><br>
-</TD></TR>
-
-<TR>
-<TD COLSPAN=2><br><HR><br></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2><TABLE WIDTH="100%"><TR>
-<TD>Display Terms of Service and Refund Policy checkbox and set as required?</TD>
-<TD>
-<SELECT NAME="sc_display_checkout_tos">
-<OPTION>$sc_display_checkout_tos</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT>
-</TD>
-</TR></TABLE></TD>
-</TR>
-<TR><TD COLSPAN=2><br>
-Business address and phone number (contact information) for your business.  Should be legal address for the business location for full disclosure and other privacy requirements mandated by credit card companies as well as government enitities that require such notices:<br>
-<TEXTAREA NAME="sc_tos_display_address" 
-cols="68" rows=5 
-wrap=off>$sc_tos_display_address</TEXTAREA><br>
-
-</TD>
-</TR>
-
-<TR><TD COLSPAN=2><br>
-Top message for confirmation page, the page just before going to the gateway.  This allows you to place a message above the Payment Information area and just below the cart total boxes.  HTML formatting (for text color, font, spacing, etc) is accepted.  Note: By default one exists, message 10 in the agora.setup.db file. Leave blank if not needed:<br>
-<TEXTAREA NAME="order_ok_final_msg_tbl" 
-cols="68" rows=8 
-wrap=off>$order_ok_final_msg_tbl</TEXTAREA> <br><br>
-</TD>
-</TR>
-
-<TR><TD COLSPAN=2><br>
-Message displayed on return to cart for pending eCheck payments (This is a message displayed as a replacement to the thank you message):<br>
-<TEXTAREA NAME="paypalipn_echeck" 
-cols="68" rows=6 
-wrap=off>$messages{'paypalipn_echeck'}</TEXTAREA> <br><br>
-</TD>
-</TR>
-
-<TR><TD COLSPAN=2><br>
-Message displayed on return to cart for pending payments (other than eChecks. This is a message displayed as a replacement to the thank you message):<br>
-<TEXTAREA NAME="paypalipn_pending" 
-cols="68" rows=6 
-wrap=off>$messages{'paypalipn_pending'}</TEXTAREA> <br><br>
-</TD>
-</TR>
-
-<TR><TD COLSPAN=2><br>
-Message displayed on return to cart for denied payments (This is a message displayed as a replacement to the thank you message):<br>
-<TEXTAREA NAME="paypalipn_denied" 
-cols="68" rows=6 
-wrap=off>$messages{'paypalipn_denied'}</TEXTAREA> <br><br>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-<TABLE WIDTH='100%' CELLPADDING=0 CELLSPACING=0>
-<TR>
-<TD ALIGN='LEFT' WIDTH='20%'>&nbsp;</TD>
-<TD WIDTH='60%'>
-<CENTER>
-<INPUT TYPE="HIDDEN" NAME="system_edit_success" VALUE="yes">
-<INPUT TYPE="HIDDEN" NAME="gateway" VALUE="PayPalIPN">
-<INPUT NAME="GatewaySettings" TYPE="SUBMIT" VALUE="Submit">
-&nbsp;&nbsp;
-<INPUT TYPE="RESET" VALUE="Reset">
-</CENTER>
-</TD>
-<TD ALIGN='LEFT' WIDTH='20%'>&nbsp;</TD>
-</TR></TABLE>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-<HR>
-</TD>
-</TR>
-
-</TABLE>
-
-</CENTER>
-</FORM>
-ENDOFTEXT
-print &$manager_page_footer;
-	
-}
-##############################################################################
-1; #Library
diff -x .svn -aruN 5.2.002.src/library/PayPalIPN-order_lib.pl 5.2.003.src/library/PayPalIPN-order_lib.pl
--- 5.2.002.src/library/PayPalIPN-order_lib.pl	2007-11-12 19:37:09.000000000 -0600
+++ 5.2.003.src/library/PayPalIPN-order_lib.pl	1969-12-31 18:00:00.000000000 -0600
@@ -1,1430 +0,0 @@
-#
-# For the 'PayPal IPN' CC and Check Processing Gateway
-# Requires AgoraCart version 5.0.0 or above.  Just place this file in the library directory.
-#
-# Author: Andy Smith and Mister_Ed for K-Factor Technologies, Inc and AgoraCartPro.com
-# Copyright 2002-Present K-Factor Technologies, Inc.  All Rights Reserved.
-#
-# This is NOT FREE AND/OR GPL SOFTWARE!  This library is a cost item.
-# This software is a separate add-on to an ecommerce shopping cart and 
-# is the confidential and proprietary information of K-Factor Technologies, Inc.  You may
-# not disclose such Confidential Information and shall use it only in
-# conjunction with the AgoraCart (aka agora.cgi) shopping cart.
-#
-# To use it you must license it from http://www.agoracart.com/ or
-# http://www.agoracartpro.com/
-#
-# K-Factor Technologies, Inc. BytePipe, AgoraScript nor any of their employees and/or representatives
-# MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT
-# THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESSED OR IMPLIED,
-# INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-# OR NON-INFRINGEMENT.
-#
-# K-Factor Technologies, Inc., BytePipe, AgoraScript nor any of their employees and/or representatives
-# SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY
-# LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS
-# SOFTWARE OR ITS DERIVATIVES.
-#
-# You may not give this script/add-on away or distribute it an any way outside of a copy of
-# AgoraCart without written permission from K-Factor Technologies, Inc.  K-Factor Technologies, Inc.
-# reserves any and all rights to distributions, add-ons, and other works based on this
-# piece of software as well as any and all rights to profit sharing and/or to charge for
-# such works and/or derivatves.
-#
-#######################################################################
-#                    Order Form Definition Variables                  #
-#######################################################################
-#
-# All misc $sc_paypalipn_troubleshoot areas in all subroutines added by 
-# Mister Ed for troubleshooting - December 22, 2006
-#
-
-$versions{'PayPalIPN-order_lib.pl'} = "5.1.012 Pro Version";
-
-$order_lib_cc_validate = "yes";
-$sc_use_secure_header_at_checkout = 'yes';
-$sc_PayPalIPN_form_prep = 0;
-
-&add_codehook("printSubmitPage","print_PayPalIPN_SubmitPage");
-&add_codehook("set_form_required_fields","PayPalIPN_fields");
-&add_codehook("gateway_response","check_for_PayPalIPN_response");
-&add_codehook("open_for_business","check_for_PayPalIPN_submit");
-$sc_order_response_vars{"PayPalIPN"}="txn_id";
-if ($sc_loading_primary_gateway =~ /yes/i) { #Hook into things ...
-  &add_codehook("pre_header_navigation","PayPalIPN_pre_header_processing");
- } 
-if ($PayPalIPN_picserve eq '') {
-  $PayPalIPN_picserve = $sc_picserve_url;
- }
-if ($PayPalIPN_picserve eq '') {
-  $PayPalIPN_picserve = 'picserve.cgi';
-}
-###############################################################################
-sub check_for_PayPalIPN_submit {
-  if (&form_check('submit_order_form_button')) {
-    if ($form_data{'gateway'} eq '') {
-      $form_data{'gateway'} = $sc_gateway_name;
-     }
-    if ($form_data{'gateway'} eq 'PayPalIPN') {    
-      &PayPalIPN_response_prep;
-     }
-   }
- }
-###############################################################################
-sub check_for_PayPalIPN_response {
-  if ($form_data{'custom'} && $form_data{'txn_id'}) {
-    $cart_id = $form_data{'custom'};
-    &set_sc_cart_path;
-    &load_order_lib;
-    &codehook("PayPalIPN_order");
-    &process_PayPalIPN_Order;
-    &call_exit;
-   }
- }
-###############################################################################
-sub PayPalIPN_check_and_load {
-local($myname)="PayPalIPN";
-#
-if ($myname ne $sc_gateway_name) { 
-  &require_supporting_libraries(__FILE__,__LINE__,
-     "./admin_files/$myname-user_lib.pl");
- }
-}
-###############################################################################
-sub PayPalIPN_response_prep {
-&PayPalIPN_check_and_load;
-if ($form_data{'Ecom_ShipTo_Postal_PostalCode'} eq "") {
-  if ($form_data{'Ecom_BillTo_PostalCode'} ne "") {
-  $form_data{'Ecom_ShipTo_Postal_PostalCode'} = 
-       $form_data{'Ecom_BillTo_PostalCode'};
-   }
- }
-
-if ($form_data{'Ecom_ShipTo_Postal_Name_Last'} eq "") {
-  if ($form_data{'Ecom_BillTo_Postal_Name_Last'} ne "") {
-  $form_data{'Ecom_ShipTo_Postal_Name_Last'} = 
-       $form_data{'Ecom_BillTo_Postal_Name_Last'};
-   }
- }
-
-if ($form_data{'Ecom_ShipTo_Postal_Name_First'} eq "") {
-  if ($form_data{'Ecom_BillTo_Postal_Name_First'} ne "") {
-  $form_data{'Ecom_ShipTo_Postal_Name_First'} = 
-       $form_data{'Ecom_BillTo_Postal_Name_First'};
-   }
- }
-
-if ($form_data{'Ecom_ShipTo_Postal_Street_Line1'} eq "") {
-  if ($form_data{'Ecom_BillTo_Postal_Street_Line1'} ne "") {
-    $form_data{'Ecom_ShipTo_Postal_Street_Line1'} = 
-       $form_data{'Ecom_BillTo_Postal_Street_Line1'};
-    $form_data{'Ecom_ShipTo_Postal_Street_Line2'} = 
-       $form_data{'Ecom_BillTo_Postal_Street_Line2'};
-    $form_data{'Ecom_ShipTo_Postal_Street_Line3'} = 
-       $form_data{'Ecom_BillTo_Postal_Street_Line3'};
-   }
- }
-
-if ($form_data{'Ecom_ShipTo_Postal_City'} eq "") {
-  if ($form_data{'Ecom_BillTo_Postal_City'} ne "") {
-  $form_data{'Ecom_ShipTo_Postal_City'} = 
-       $form_data{'Ecom_BillTo_Postal_City'};
-   }
- }
-
-if ($form_data{'Ecom_ShipTo_Postal_StateProv'} eq "") {
-  if ($form_data{'Ecom_BillTo_Postal_StateProv'} ne "") {
-  $form_data{'Ecom_ShipTo_Postal_StateProv'} = 
-       $form_data{'Ecom_BillTo_Postal_StateProv'};
-   }
- }
-
-# added by Mister Ed May 12, 2006
-if ($form_data{'Ecom_ShipTo_Postal_CountryCode'} eq "") {
-  if ($form_data{'Ecom_BillTo_Postal_CountryCode'} ne "") {
-  $form_data{'Ecom_ShipTo_Postal_CountryCode'} = 
-       $form_data{'Ecom_BillTo_Postal_CountryCode'};
-   }
- }
-
-# use this code hooks to check for more variables / default values
-&codehook("PayPalIPN_response_prep_bottom");
-}
-###############################################################################
-sub PayPalIPN_order_form_prep {
-  &PayPalIPN_check_and_load;
-  if ($sc_PayPalIPN_form_prep == 0) {
-    if (-f "$sc_verify_order_path"){
-      &read_verify_file;  
-     } else {
-      &codehook("load_customer_info");
-     }
-    $sc_PayPalIPN_form_prep = 1;
-   }
-  return "";
- }
-###############################################################################
-sub PayPalIPN_pre_header_processing {
-   if (($form_data{'order_form_button.x'} ne "") ||
-       ($form_data{'submit_order_form_button'} ne "") ||
-       ($form_data{'submit_order_form_button.x'} ne "") ||
-       ($form_data{'order_form_button'} ne "")) {
-     $sc_browser_header = 
-	"Content-type: text/html\nCache-Control: no-cache\n" .
-	"Pragma: no-cache\nExpires: Wed, 4 October 2000 00:00:00 GMT\n\n";
-   }
- }
-###############################################################################
-sub PayPalIPN_fields {
-local($myname)="PayPalIPN";
-
-if (!($form_data{'gateway'} eq $myname)) { return;} 
-
-%sc_order_form_array =('Ecom_BillTo_Postal_Name_First', 'First Name',
-		       'Ecom_BillTo_Postal_Name_Last', 'Last Name',
-		       'Ecom_BillTo_Postal_Street_Line1', 'Billing Address Street',
-		       'Ecom_BillTo_Postal_City', 'Billing Address City',
-		       'Ecom_BillTo_Postal_StateProv', 'Billing Address State',
-		       'Ecom_BillTo_PostalCode', 'Billing Address Zip',
-		       'Ecom_BillTo_Postal_CountryCode', 'Billing Address Country',
-		       'Ecom_ShipTo_Postal_Name_First', 'Ship To First Name',
-		       'Ecom_ShipTo_Postal_Name_Last', 'Ship To Last Name',
-		       'Ecom_ShipTo_Postal_Street_Line1', 'Shipping Address Street',
-		       'Ecom_ShipTo_Postal_City', 'Shipping Address City',
-		       'Ecom_ShipTo_Postal_StateProv', 'Shipping Address State',
-		       'Ecom_ShipTo_Postal_PostalCode', 'Shipping Address Zip',
-		       'Ecom_ShipTo_Postal_CountryCode', 'Shipping Address Country',
-		       'Ecom_BillTo_Telecom_Phone_Number', 'Phone Number',
-		       'Ecom_BillTo_Online_Email', 'Email');
-			
-
-@sc_order_form_required_fields = ("Ecom_BillTo_Postal_Name_First",
-				  "Ecom_BillTo_Postal_Name_Last",
-				  "Ecom_BillTo_Postal_Street_Line1",
-				  "Ecom_BillTo_Postal_City",
-				  "Ecom_BillTo_Postal_StateProv",
-				  "Ecom_BillTo_PostalCode",        
-				  "Ecom_BillTo_Telecom_Phone_Number",
-				  "Ecom_BillTo_Online_Email");
-
-# lines for tos added 2006 April 20 by jfindlay
- if ($sc_display_checkout_tos =~ /yes/i) {
-    push(@sc_order_form_required_fields,"Ecom_tos");
- }
-
-# use this codehook to change the above arrays for required fields and such
-&codehook("PayPalIPN_fields_bottom");
-
- }
-
-###############################################################################
-sub print_PayPalIPN_SubmitPage {
-
-local($invoice_number, $customer_number);
-local($myname)="PayPalIPN";
-local($HREF_FIELDS) = &make_hidden_fields;
-
-if (!($form_data{'gateway'} eq $myname)) { return;} 
-&PayPalIPN_check_and_load;
-
-$invoice_number = $current_verify_inv_no;
-$sc_temp_invoice_number = $invoice_number;
-$customer_number = $cart_id;
-$customer_number =~ s/_/./g;
-
-# fix discounted total so they pass. added by Mister Ed September 2, 2006
-$discounted_subtotal = &format_price($subtotal - $zfinal_discount);
-
-# Scottcrew Enterprises added '&format_price' into 2 decimal places for output to PayPal - 12/19/2006.
-# removed unnecessary "my" statements - Mister Ed -  December 22, 2006
-$zfinal_shipping = &format_price($zfinal_shipping);
-$zfinal_sales_tax = &format_price($zfinal_sales_tax);
-
-# create secondary cart file.  added by Mister Ed May 20, 2006
-my $filename1 = "$sc_cart_path" . "$cart_id";
-use File::Copy;
-copy($sc_cart_path, $filename1);
-#system("cp $sc_cart_path $filename1")
-
-print &get_PayPalIPN_confirm_middle(*form_data,$invoice_number,
-  $customer_number,$offline_ver_tbldef,$order_ok_final_msg_tbl,
-  $offline_ver_tbldef2,$authPrice,$tiCENTERme);
-
-if ($sc_PayPalIPN_username eq '') {
-    $sc_PayPalIPN_username = $sc_admin_email;
-}
-
-if ($sc_use_alternate_PayPalIPN_submit_page ne "Yes") {
-############  Start of Standard submit page - Select from this line to for copy functions ############
-#### can use in custom submit page.  Custom file must be named: PayPalIPN_custom_processing_lib.pl
-#### Custom function (aka sub routine) to replace the code below must be named: PayPalIPN_custom_submit_page
-
-print <<ENDOFTEXT;
-<DIV ALIGN="CENTER">
-<TABLE WIDTH="500" CELLPADDING="5" CELLSPACING="0" BORDER="0" class="ac_checkout_review">
-<TR>
-<TD WIDTH="50%" ALIGN="CENTER" class="ac_checkout_review">
-<FORM ACTION=\"$IPN_order_script_url\" METHOD="POST">
-<!--PayPal Account information-->
-<INPUT TYPE="hidden" NAME="cmd" VALUE="_ext-enter">
-<INPUT TYPE="hidden" NAME="redirect_cmd" VALUE="_xclick">
-<INPUT TYPE="hidden" NAME="business" VALUE=\"$sc_PayPalIPN_username\">
-<INPUT TYPE="hidden" NAME="notify_url" VALUE=\"$sc_order_notify_url\">
-<INPUT TYPE="hidden" NAME="return" VALUE=\"$sc_order_return_url\">
-<input type="hidden" name="bn" value="AgoraCart">
-ENDOFTEXT
-
-if ($sc_paypal_cancel_return ne '') {
-print <<ENDOFTEXT;
-<INPUT TYPE="hidden" NAME="cancel_return" VALUE=\"$sc_paypal_cancel_return\">
-ENDOFTEXT
-}
-
-print <<ENDOFTEXT;
-<INPUT TYPE="hidden" NAME="cbt" VALUE=\"$sc_paypal_return_button_text\">
-ENDOFTEXT
-
-if ($sc_paypal_header_image ne '') {
-print <<ENDOFTEXT;
-<INPUT TYPE="hidden" NAME="cpp_header_image" VALUE=\"$sc_paypal_header_image\">
-ENDOFTEXT
-}
-
-print <<ENDOFTEXT;
-<!--Order Financial Data-->
-<INPUT TYPE="hidden" NAME="currency_code" VALUE=\"$currency_id\">
-<INPUT TYPE="hidden" NAME="amount" VALUE=\"$discounted_subtotal\">
-<INPUT TYPE="hidden" NAME="custom" VALUE=\"$cart_id\">
-<INPUT TYPE="hidden" NAME="shipping" VALUE=\"$zfinal_shipping\">
-<INPUT TYPE="hidden" NAME="tax" VALUE=\"$zfinal_sales_tax\">
-<!--Customer/Order Data-->
-<INPUT TYPE="hidden" NAME="no_shipping" VALUE=\"1\">
-<INPUT TYPE="hidden" NAME="invoice" VALUE=\"$invoice_number\">
-<INPUT TYPE="hidden" NAME="item_name" VALUE=\"$sc_PayPalIPN_order_name: $invoice_number\">
-<!--Billing Address-->
-<INPUT TYPE=HIDDEN NAME="first_name" VALUE=\"$eform_data{'Ecom_BillTo_Postal_Name_First'}\">
-<INPUT TYPE=HIDDEN NAME="last_name" VALUE=\"$eform_data{'Ecom_BillTo_Postal_Name_Last'}\">
-<INPUT TYPE=HIDDEN NAME="address1" VALUE=\"$eform_data{'Ecom_BillTo_Postal_Street_Line1'}\">
-<INPUT TYPE=HIDDEN NAME="city" VALUE=\"$eform_data{'Ecom_BillTo_Postal_City'}\">
-<INPUT TYPE=HIDDEN NAME="state" VALUE=\"$eform_data{'Ecom_BillTo_Postal_StateProv'}\">
-<INPUT TYPE=HIDDEN NAME="zip" VALUE=\"$eform_data{'Ecom_BillTo_PostalCode'}\">
-<INPUT TYPE=HIDDEN NAME="country" VALUE=\"$eform_data{'Ecom_BillTo_Postal_CountryCode'}\">
-<INPUT TYPE=HIDDEN NAME="phone" VALUE=\"$eform_data{'Ecom_BillTo_Telecom_Phone_Number'}\">
-<INPUT TYPE=HIDDEN NAME="email" VALUE=\"$eform_data{'Ecom_BillTo_Online_Email'}\">
-<INPUT TYPE="IMAGE" NAME="Submit" VALUE="Submit Order For Processing"
-  SRC="$PayPalIPN_picserve?secpicserve=submit_order.gif">
-<!--Billing Data-->
-</FORM>
-</TD>
-<TD WIDTH="50%" ALIGN="CENTER" class="ac_checkout_review">
-<FORM METHOD=POST ACTION="$sc_stepone_order_script_url">
-<INPUT TYPE=HIDDEN NAME="order_form_button" VALUE="1">
-$HREF_FIELDS
-<INPUT TYPE=HIDDEN NAME="gateway" VALUE="PayPalIPN"> 
-<INPUT TYPE=HIDDEN NAME="ofn" VALUE="PayPalIPN"> 
-<INPUT TYPE="IMAGE" NAME="Make Changes" VALUE="Make Changes" 
-SRC="$PayPalIPN_picserve?secpicserve=make_changes.gif" BORDER=0>
-</FORM>
-</TD>
-</TR>
-</TABLE>
-</DIV>
-ENDOFTEXT
-
-############  End of Submit Page Code - Select until this line for copy functions ############
-}
-else { # uses alternate processing file in add_ons sub directory
-
- &codehook("PayPalIPN_custom_submit_page");
-
-} # end of alternate submit page
-}
-
-###############################################################
-sub get_PayPalIPN_confirm_middle{
-local(*form_data,$invoice_number,$customer_number,
-$tbldef,$top_message,$tbldef2,$authPrice,$time) = @_;
-
-local($my_ShipTo_Postal_Street,$my_BillTo_Postal_Street,$formatted_price);
-local($answer)='';
-
-$my_ShipTo_Postal_Street = $form_data{'Ecom_ShipTo_Postal_Street_Line1'};
-if ($form_data{'Ecom_ShipTo_Postal_Street_Line2'} ne "") {
- $my_ShipTo_Postal_Street .= "<BR>$form_data{'Ecom_ShipTo_Postal_Street_Line2'}";
-}
-if ($form_data{'Ecom_ShipTo_Postal_Street_Line3'} ne "") {
- $my_ShipTo_Postal_Street .= "<BR>$form_data{'Ecom_ShipTo_Postal_Street_Line3'}";
-}
-
-$my_BillTo_Postal_Street = $form_data{'Ecom_BillTo_Postal_Street_Line1'};
-if ($form_data{'Ecom_BillTo_Postal_Street_Line2'} ne "") {
- $my_BillTo_Postal_Street .= "<BR>$form_data{'Ecom_BillTo_Postal_Street_Line2'}";
-}
-if ($form_data{'Ecom_BillTo_Postal_Street_Line3'} ne "") {
- $my_BillTo_Postal_Street .= "<BR>$form_data{'Ecom_BillTo_Postal_Street_Line3'}";
-}
-
-$formatted_price = &format_price($authPrice);
-
-my $temp_variable_thingy_for_mailedfunds =  qq~<p class="ac_checkout_top_msg">$sc_mailedfunds_address</p>~;
-
-$answer.= <<ENDOFTEXT;
-
-<div align="center">
-  <p class="ac_checkout_top_msg">$top_message</p>
-
-$temp_variable_thingy_for_mailedfunds
-
-<table cellpadding="0" cellspacing="0" class="ac_checkout_review">
-<tr>
-<th colspan="2" class="ac_checkout_review">Customer Information</th>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Customer Number</td>
-<td class="ac_checkout_review_col2">$cart_id</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Order Number</td>
-<td class="ac_checkout_review_col2">$sc_temp_invoice_number</td>
-</tr>
-
-ENDOFTEXT
-
-if ($sc_display_checkout_tos =~ /yes/i){
-$answer .= <<ENDOFTEXT;
-<!-- begin add tos -->
-<tr>
-<td class="ac_checkout_review_col1">Sales Terms and Refund Policy</td>
-<td class="ac_checkout_review_col2">$form_data{'Ecom_tos'}</td>
-</tr>
-<!-- end add tos -->
-ENDOFTEXT
-}
-
-$answer .= <<ENDOFTEXT;
-
-<tr>
-<th colspan="2" class="ac_checkout_review">Billing Address</th>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Name</td>
-<td class="ac_checkout_review_col2">
-  $form_data{'Ecom_BillTo_Postal_Name_First'} $form_data{'Ecom_BillTo_Postal_Name_Last'}
-</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Street</td>
-<td class="ac_checkout_review_col2">$my_BillTo_Postal_Street&nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">City</td>
-<td class="ac_checkout_review_col2">$form_data{'Ecom_BillTo_Postal_City'}&nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">State</td>
-<td class="ac_checkout_review_col2">$form_data{'Ecom_BillTo_Postal_StateProv'}&nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Zip</td>
-<td class="ac_checkout_review_col2">$form_data{'Ecom_BillTo_PostalCode'}&nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Country</td>
-<td class="ac_checkout_review_col2">$form_data{'Ecom_BillTo_Postal_CountryCode'}&nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Phone</td>
-<td class="ac_checkout_review_col2">$form_data{'Ecom_BillTo_Telecom_Phone_Number'}&nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">E-Mail</td>
-<td class="ac_checkout_review_col2">$form_data{'Ecom_BillTo_Online_Email'}&nbsp;</td>
-</tr>
-
-<!--Shipping Address-->
-
-<tr>
-<th colspan="2" class="ac_checkout_review">Shipping Information</th>
-</tr>
-
-ENDOFTEXT
-
-if ($form_data{'Ecom_ShipTo_Method'} ne ""){
-$answer.= <<ENDOFTEXT;
-<tr>
-<td class="ac_checkout_review_col1">Ship via</td>
-<td class="ac_checkout_review_col2">$form_data{'Ecom_ShipTo_Method'}&nbsp;</td>
-</tr>
-ENDOFTEXT
-}
-
-$answer.= <<ENDOFTEXT;
-<tr>
-<td class="ac_checkout_review_col1">Name</td>
-<td class="ac_checkout_review_col2">
-  $form_data{'Ecom_ShipTo_Postal_Name_First'} $form_data{'Ecom_ShipTo_Postal_Name_Last'}&nbsp;
-</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Street</td>
-<td class="ac_checkout_review_col2">$my_ShipTo_Postal_Street&nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">City</td>
-<td class="ac_checkout_review_col2">$form_data{'Ecom_ShipTo_Postal_City'}&nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">State</td>
-<td class="ac_checkout_review_col2">$form_data{'Ecom_ShipTo_Postal_StateProv'}&nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Zip</td>
-<td class="ac_checkout_review_col2">$form_data{'Ecom_ShipTo_Postal_PostalCode'}&nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Country</td>
-<td class="ac_checkout_review_col2">$form_data{'Ecom_ShipTo_Postal_CountryCode'}&nbsp;</td>
-</tr>
-
-</table>
-</div>
-ENDOFTEXT
-
-# use this to change $answer
-&codehook("get_PayPalIPN_confirm_middle_bottom");
-
-return $answer;
-}
-###############################################################
-sub get_PayPalIPN_confirm_final{
-local(*form_data,$invoice_number,$customer_number,
-$tbldef,$top_message,$tbldef2,$authPrice,$time) = @_;
-
-local($my_ShipTo_Postal_Street,$my_BillTo_Postal_Street,$formatted_price);
-local($answer)='';
-
-$my_ShipTo_Postal_Street = $eform_Ecom_ShipTo_Postal_Street_Line1;
-if ($eform_Ecom_ShipTo_Postal_Street_Line2 ne "") {
- $my_ShipTo_Postal_Street .= "<BR>$eform_Ecom_ShipTo_Postal_Street_Line2";
-}
-if ($eform_Ecom_ShipTo_Postal_Street_Line3 ne "") {
- $my_ShipTo_Postal_Street .= "<BR>$eform_Ecom_ShipTo_Postal_Street_Line3";
-}
-
-$my_BillTo_Postal_Street = $eform_Ecom_BillTo_Postal_Street_Line1;
-if ($eform_Ecom_BillTo_Postal_Street_Line2 ne "") {
- $my_BillTo_Postal_Street .= "<BR>$eform_Ecom_BillTo_Postal_Street_Line2";
-}
-if ($eform_Ecom_BillTo_Postal_Street_Line3 ne "") {
- $my_BillTo_Postal_Street .= "<BR>$eform_Ecom_BillTo_Postal_Street_Line3";
-}
-
-$formatted_price = &format_price($authPrice);
-
-
-$answer.= <<ENDOFTEXT;
-
-<div align="center">
-  <p class="ac_checkout_top_msg">$top_message</p>
-
-<table cellpadding="0" cellspacing="0" class="ac_checkout_review">
-<tr>
-<th colspan="2" class="ac_checkout_review">Customer Information</th>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Customer Number</td>
-<td class="ac_checkout_review_col2">$cart_id</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Order Number</td>
-<td class="ac_checkout_review_col2">$sc_temp_invoice_number</td>
-</tr>
-
-ENDOFTEXT
-
-if ($sc_display_checkout_tos =~ /yes/i){
-$answer .= <<ENDOFTEXT;
-<!-- begin add tos -->
-<tr>
-<td class="ac_checkout_review_col1">Sales Terms and Refund Policy</td>
-<td class="ac_checkout_review_col2">$eform_Ecom_tos</td>
-</tr>
-<!-- end add tos -->
-ENDOFTEXT
-}
-
-$answer .= <<ENDOFTEXT;
-
-<tr>
-<th colspan="2" class="ac_checkout_review">Billing Address</th>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Name</td>
-<td class="ac_checkout_review_col2">
-  $eform_Ecom_BillTo_Postal_Name_First $eform_Ecom_BillTo_Postal_Name_Last
-</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Street</td>
-<td class="ac_checkout_review_col2">$my_BillTo_Postal_Street &nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">City</td>
-<td class="ac_checkout_review_col2">$eform_Ecom_BillTo_Postal_City &nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">State</td>
-<td class="ac_checkout_review_col2">$eform_Ecom_BillTo_Postal_StateProv &nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Zip</td>
-<td class="ac_checkout_review_col2">$eform_Ecom_BillTo_PostalCode &nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Country</td>
-<td class="ac_checkout_review_col2">$eform_Ecom_BillTo_Postal_CountryCode &nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Phone</td>
-<td class="ac_checkout_review_col2">$eform_Ecom_BillTo_Telecom_Phone_Number &nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">E-Mail</td>
-<td class="ac_checkout_review_col2">$eform_Ecom_BillTo_Online_Email &nbsp;</td>
-</tr>
-
-<!--Shipping Address-->
-
-<tr>
-<th colspan="2" class="ac_checkout_review">Shipping Information</th>
-</tr>
-
-ENDOFTEXT
-
-if ($eform_Ecom_ShipTo_Method ne ""){
-$answer.= <<ENDOFTEXT;
-<tr>
-<td class="ac_checkout_review_col1">Ship via</td>
-<td class="ac_checkout_review_col2">$eform_Ecom_ShipTo_Method &nbsp;</td>
-</tr>
-ENDOFTEXT
-}
-
-$answer.= <<ENDOFTEXT;
-<tr>
-<td class="ac_checkout_review_col1">Name</td>
-<td class="ac_checkout_review_col2">
-  $eform_Ecom_ShipTo_Postal_Name_First $eform_Ecom_ShipTo_Postal_Name_Last &nbsp;
-</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Street</td>
-<td class="ac_checkout_review_col2">$my_ShipTo_Postal_Street &nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">City</td>
-<td class="ac_checkout_review_col2">$eform_Ecom_ShipTo_Postal_City &nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">State</td>
-<td class="ac_checkout_review_col2">$eform_Ecom_ShipTo_Postal_StateProv &nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Zip</td>
-<td class="ac_checkout_review_col2">$eform_Ecom_ShipTo_Postal_PostalCode &nbsp;</td>
-</tr>
-
-<tr>
-<td class="ac_checkout_review_col1">Country</td>
-<td class="ac_checkout_review_col2">$eform_Ecom_ShipTo_Postal_CountryCode &nbsp;</td>
-</tr>
-
-</table>
-</div>
-ENDOFTEXT
-
-# use this to change $answer
-&codehook("get_PayPalIPN_confirm_final_bottom");
-
-return $answer;
-}
-
-###############################################################
-sub process_PayPalIPN_Order {
-local($subtotal, $total_quantity,
-      $total_measured_quantity,
-      $text_of_cart, $weight,
-      $required_fields_filled_in, $product, $quantity, $options,
-      $text_of_confirm_email, $text_of_admin_email, $emailCCnum, $logCCnum);
-local($stevo_shipping_thing) = "";
-local($stevo_shipping_names) = "";
-local($order_ok_final_msg,$order_ok_final_msg_tbl);
-local($ship_thing_too,$ship_instructions,$TEMP,$pass); 
-local(%orderLoggingHash);
-my ($browsertest,$req,$temp,$ipndata,$invaliddata,$IPN_verified_form_warning,$IPN_form_string) = '';
-my $filetestfound2_thingy = "no";
-my $filetestfound_thingy = "no";
-my $filename1 = "$sc_cart_path" . "$cart_id";
-my $IPN_verified_form_check = 'yes';
-
-# NEW CODEHOOK
-&codehook("process-order-routine-top");
-
-print qq!
-<html>
-$sc_special_page_meta_tags
-<head>
-<title>$messages{'ordcnf_08'}</title>
-$sc_secure_standard_head_info
-</head>
-<body>
-!;
-
-if ($sc_paypalipn_troubleshoot eq "yes") {
-    print "\$sc_special_checkout_variable2 = $sc_special_checkout_variable2 <br>";
-    print "\$ENV{'QUERY_STRING'} = $ENV{'QUERY_STRING'} <br>";
-    print "form_data{'payment_status'} = $form_data{'payment_status'} <br>";
-    print "<br><br>Printing a key / value pairs sent to PayPal for post verify:<br>";
-    while (($key,$value) = each %form_data) {
-        print "key of $key = value of $value <br>";
-    }
-}
-
-# check for secondary cart file.  added by Mister Ed Jan 18, 2007
-if (-f "$filename1"){
-    $filetestfound2_thingy = "yes";
-    &read_verify_file;
-}
-
-# check for secondary cart file.  added by Mister Ed May 20, 2006
-
-    eval q~
-     use HTTP::BrowserDetect;
-     my $browser = new HTTP::BrowserDetect($ENV{"HTTP_USER_AGENT"});
-     $browsertest = $browser->browser_string(); #.'/'.$browser->version();
-     ~;
-if ($browsertest eq '') {
-   $ipndata = "$sc_special_checkout_variable2";
-#   $ipndata = "$ENV{'QUERY_STRING'}"; 
-
-
-$ipndata .= "&cmd=_notify-validate";
-
-# post back to PayPal system to validate
-use LWP::UserAgent;
-$ua = new LWP::UserAgent;
-$req = new HTTP::Request 'POST',"$IPN_order_script_url";
-$req->content_type('application/x-www-form-urlencoded');
-$req->content($ipndata);
-$res = $ua->request($req);
-
-
-if ($sc_paypalipn_troubleshoot eq "yes") {
-  $invaliddata .= "$browsertest\n";
-  $invaliddata .= "$ENV{'HTTP_USER_AGENT'}\n";
-  $invaliddata .= "\$ipndata = " . $ipndata . "\n";
-  $invaliddata .= "\$ENV{'QUERY_STRING'} =" . $ENV{'QUERY_STRING'} . "\n";
-  $invaliddata .= "\n\n\n######## FORM DATA BELOW ########\n\n";
-  while (($key,$value) = each %form_data) {
-      $invaliddata .= "$key=$value\n";
-  }
-  &send_mail($sc_admin_email, $sc_order_email,"PayPal IPN test thingy ",$invaliddata);
-}
-
-if ($eform_cart_id ne $form_data{'custom'}) {
-    $IPN_verified_form_check = 'no';
-    $IPN_verified_form_warning = qq{FAILURE: Cart IDs did not match!\n\n};
-}
-if ($sc_verify_grand_total ne $form_data{'mc_gross'}) {
-    $IPN_verified_form_check = 'no';
-    $IPN_verified_form_warning = qq{FAILURE: Grand totals did not match!\n\n};
-}
-if ($currency_id ne $form_data{'mc_currency'}) {
-    $IPN_verified_form_check = 'no';
-    $IPN_verified_form_warning = qq{FAILURE: Currency Types did not match!\n\n};
-}
-if ($sc_PayPalIPN_username ne $form_data{'receiver_email'}) {
-    $IPN_verified_form_warning = qq{WARNING: Your Email Address in the AgoraCart IPN settings DID NOT MATCH your Business Email at PayPal - Investigate!!!\n\n};
-}
-if ($form_data{'payer_email'} ne $eform_Ecom_BillTo_Online_Email) {
-    $IPN_verified_form_warning = qq{WARNING: The Customer Email Address at AgoraCart did not match what the Customer Email at PayPal - minor issue?\n\n};
-}
-
-
-if ($IPN_verified_form_check eq 'no') {
-    $IPN_form_string = "$IPN_verified_form_warning";
-}
-
-$IPN_form_string .= "\n\n PAYMENT/ORDER DETAILS: PayPal IPN vs your AgoraCart Store\n\n";
-$IPN_form_string .= "Payment date verified/reported from PayPal: $form_data{'payment_date'} \n\n";
-$IPN_form_string .= "Item reported from PayPal: $form_data{'item_name'} \n\n";
-$IPN_form_string .= "Transaction ID reported from PayPal: $form_data{'txn_id'} \n\n";
-$IPN_form_string .= "Payor PayPal ID reported from PayPal: $form_data{'payer_id'} \n\n";
-$IPN_form_string .= "Your PayPal ID reported from PayPal: $form_data{'receiver_id'} \n\n";
-$IPN_form_string .= "Cart ID as reported from PayPal:  $form_data{'payment_date'}  Expected by AgoraCart: $eform_cart_id \n\n";
-$IPN_form_string .= "Total Amount of order as reported from PayPal:  $form_data{'mc_gross'}  Expected by AgoraCart: $sc_verify_grand_total \n\n";
-$IPN_form_string .= "Currency Type reported from PayPal: $form_data{'mc_currency'}  Expected by AgoraCart: $currency_id \n\n";
-$IPN_form_string .= "Payor's Email Address as reported from PayPal:  $form_data{'payer_email'}  Expected by AgoraCart: $eform_Ecom_BillTo_Online_Email \n\n";
-
-#if (($res->content eq 'VERIFIED') && ($IPN_verified_form_check eq 'yes')) {
-if ($res->content eq 'VERIFIED') {
-  &send_mail($sc_admin_email, $sc_order_email,"PayPal IPN Confirmed This Order",$IPN_form_string);
-} 
-elsif ($res->content eq 'INVALID') {
-  $IPN_form_string = "\n\n ACTUAL DATA AVAILABLE TO CART \n\n";
-  while (($key,$value) = each %form_data) {
-      $invaliddata .= "$key=$value\n";
-  }
-  $IPN_form_string .= "\n$browsertest\n";
-  $IPN_form_string .= "\n$ENV{'HTTP_USER_AGENT'}\n";
-  &send_mail($sc_admin_email, $sc_order_email,"PayPal Did Not Confirm This Order - (Investigate this Order)",$IPN_form_string);
-}
-
-} # end of if browsertest
-
-
-if ($form_data{'payment_status'} eq 'Pending') {
-    if ($form_data{'pending_reason'} eq 'echeck') {
-
-&SecureStoreHeader;
-print <<ENDOFTEXT;
-<CENTER>
-<TABLE WIDTH=500>
-<TR>
-<TD WIDTH=500>
-<FONT FACE=ARIAL>
-$messages{'paypalipn_echeck'}
-</FONT>
-</TD>
-</TR>
-</TABLE>
-<CENTER>
-
-ENDOFTEXT
-
-# and the footer is printed
-
-&SecureStoreFooter;
-
-print qq!
-</BODY>
-</HTML>
-!;
-
-&call_exit;
-} else  { 
-&SecureStoreHeader;
-print <<ENDOFTEXT;
-<CENTER>
-<TABLE WIDTH=500>
-<TR>
-<TD WIDTH=500>
-<FONT FACE=ARIAL>
-$messages{'paypalipn_pending'} 
-</FONT>
-</TD>
-</TR>
-</TABLE>
-<CENTER>
-
-ENDOFTEXT
-
-# and the footer is printed
-
-&SecureStoreFooter;
-
-print qq!
-</BODY>
-</HTML>
-!;
-
-&call_exit;
-	} # end of pending else
- } # end if pending
-
-
-if ($form_data{'payment_status'} ne "Completed") {
-
-&SecureStoreHeader;
-print <<ENDOFTEXT;
-<CENTER>
-<TABLE WIDTH=500>
-<TR>
-<TD WIDTH=500>
-<FONT FACE=ARIAL>
-$messages{'paypalipn_denied'}
-</FONT>
-</TD>
-</TR>
-</TABLE>
-<CENTER>
-
-ENDOFTEXT
-
-# and the footer is printed
-
-&SecureStoreFooter;
-
-print qq!
-</BODY>
-</HTML>
-!;
-
-&call_exit;
-
-}
-		
-$orderDate = &get_date;
-
-if ($sc_use_alternate_PayPalIPN_order_processing ne "Yes") {
-############  Start of Standard Processing Code - Select from this line to for copy functions ############
-#### can use in custom processing file.  Custom file must be named: PayPalIPN_custom_processing_lib.pl
-#### Place PayPalIPN_custom_processing_lib.pl in the library directory of your store
-#### Custom function (aka sub routine)  to replace the code below must be named: PayPalIPN_custom_processing_function
-
-$text_of_cart .= "Order Date:    $orderDate\n";
-$text_of_cart .= "Gateway:       PaypalIPN\n\n";
-$orderLoggingHash{'GatewayUsed'} = "PayPalIPN";
-
-$text_of_cart .= "  --PRODUCT INFORMATION--\n\n";
-
-open (CART, "$sc_cart_path") ||
-&file_open_error("$sc_cart_path", "display_cart_contents", __FILE__, __LINE__);
-
-while (<CART>)	{
-	$cartData++;
-	@cart_fields = split (/\|/, $_);
-	$quantity = $cart_fields[0];
-	$product_price = $cart_fields[3];
-	$product = $cart_fields[4];
-	$weight = $cart_fields[6];
-	$options = $cart_fields[$cart{"options"}];
-	$options =~ s/$sc_opt_sep_marker/, /g;
-	$text_of_cart .= &cart_textinfo(*cart_fields);
-	$stevo_shipping_thing .="|$quantity\*$weight";
-	$stevo_shipping_names .="|$product\($options\)";
-    # nesting codehook fixes double inventory deduction problem at checkout for IPN only - added by Mister Ed Jan 18, 2007
-    if ($filetestfound2_thingy eq "yes") {
-        &codehook("process-cart-item");
-    }
-}
-close(CART);
-
-if (!(-f "$sc_verify_order_path")){
-&SecureStoreHeader;
-print <<ENDOFTEXT;
-<CENTER>
-<TABLE WIDTH=500>
-<TR>
-<TD WIDTH=500>
-<FONT FACE=ARIAL>
-$messages{'ordcnf_01'}
-$messages{'ordcnf_02'}
-</FONT>
-</TD>
-</TR>
-</TABLE>
-<CENTER>  
-
-ENDOFTEXT
-
-# and the footer is printed
-
-&SecureStoreFooter;
-
-print qq!
-</BODY>
-</HTML>
-!;
-
-&call_exit;
-
- }
-
-# check for secondary cart file.  added by Mister Ed May 20, 2006
-if (!(-f "$filename1")){
-    &load_verify_file;
-} else {
-#    &read_verify_file;
-    $filetestfound_thingy = "yes";
-    eval("unlink  \"$filename1\";");
-}
-
-
-if ($sc_PayPalIPN_show_table =~ /yes/i) {
-  $order_ok_final_msg = $messages{'ordcnf_09'};
-  if ($order_ok_final_msg eq '') {
-    $order_ok_final_msg = $messages{'ordcnf_01'};
-    $order_ok_final_msg .= "Print this page for your records.  You will ";
-    $order_ok_final_msg .= "receive an email receipt shortly.<br>\n";
-    $order_ok_final_msg =
-	"<TABLE WIDTH=500 $cart_table_def><TR><TD>" .
-	$order_ok_final_msg .
-	"</TD></TR></TABLE>\n";
-   }
-  $special_message = $order_ok_final_msg;
-  { local(%form_data) = %eform;
-    local($sc_use_verify_values_for_display) = "yes";
-    &display_cart_table("");
-  }
- } else {
-  &SecureStoreHeader;
- }
-
-&PayPalIPN_response_prep;
-
-# initialize hash variables in case they are empty later
-# added by Mister Ed 2006
-
-$orderLoggingHash{'firstName'} = "";
-$orderLoggingHash{'lastName'} = "";
-$orderLoggingHash{'fullName'} = "";
-$orderLoggingHash{'orderFromAddress'} = "";
-$orderLoggingHash{'customerAddress2'} = "";
-$orderLoggingHash{'customerAddress3'} = "";
-$orderLoggingHash{'orderFromCity'} = "";
-$orderLoggingHash{'orderFromPostal'} = "";
-$orderLoggingHash{'customerPhone'} = "$eform_Ecom_BillTo_Telecom_Phone_Number";
-$orderLoggingHash{'companyName'} = "";
-$orderLoggingHash{'emailAddress'} = "";
-
-$orderLoggingHash{'shipToName'} = "";
-$orderLoggingHash{'shipToAddress'} = "";
-$orderLoggingHash{'shipToAddress2'} = "";
-$orderLoggingHash{'shipToAddress3'} = "";
-$orderLoggingHash{'shipToCity'} = "";
-$orderLoggingHash{'shipToState'} = "";
-$orderLoggingHash{'shipToPostal'} = "";
-$orderLoggingHash{'shipToCountry'} = "";
-$orderLoggingHash{'shiptoResidential'} = $eform_Ecom_is_Residential;
-$orderLoggingHash{'insureShipment'} = $eform_Ecom_ShipTo_Insurance; # not implemented yet, for the future
-
-$orderLoggingHash{'invoiceNumber'} = "";
-$orderLoggingHash{'customerNumber'} = "";
-$orderLoggingHash{'orderStatus'} = "$sc_order_status_default";
-$orderLoggingHash{'user1'} = "";
-$orderLoggingHash{'user2'} = "";
-$orderLoggingHash{'user3'} = "";
-$orderLoggingHash{'user4'} = "";
-$orderLoggingHash{'user5'} = "";
-$orderLoggingHash{'itemsordered'} = "";
-$orderLoggingHash{'shiptrackingID'} = "";
-$orderLoggingHash{'shipMethod'} = "";
-$orderLoggingHash{'orderFromState'} = "";
-$orderLoggingHash{'orderFromCountry'} = "";
-$orderLoggingHash{'shippingTotal'} = "";
-$orderLoggingHash{'salesTax'} = "";
-$orderLoggingHash{'tax1'} = "";
-$orderLoggingHash{'tax2'} = "";
-$orderLoggingHash{'tax3'} = "";
-$orderLoggingHash{'discounts'} = "";
-$orderLoggingHash{'netProfit'} = "";
-$orderLoggingHash{'affiliateTotal'} = "";
-$orderLoggingHash{'affiliateID'} = "";
-$orderLoggingHash{'affiliateMisc'} = "";
-$orderLoggingHash{'subTotal'} = "";
-$orderLoggingHash{'orderTotal'} = "";
-$orderLoggingHash{'adminMessages'} = "";
-$orderLoggingHash{'shippingMessages'} = "";
-$orderLoggingHash{'xcomments'} = "";
-$orderLoggingHash{'termsOfService'} = "$eform_Ecom_tos";
-$orderLoggingHash{'faxNumber'} = "";
-
-# new logging items added August 4, 2007 by Mister Ed
-$orderLoggingHash{'discountCode'} = "";
-$orderLoggingHash{'user6'} = "";
-$orderLoggingHash{'user7'} = "";
-$orderLoggingHash{'user8'} = "";
-$orderLoggingHash{'user9'} = "";
-$orderLoggingHash{'user10'} = "";
-$orderLoggingHash{'buySafe'} = "";
-$orderLoggingHash{'order_payment_type_user1'} = "";
-$orderLoggingHash{'order_payment_type_user2'} = "";
-$orderLoggingHash{'GiftCard_number'} = "";
-$orderLoggingHash{'GiftCard_amount_used'} = "";
-$orderLoggingHash{'internal_company_notes1'} = "";
-$orderLoggingHash{'internal_company_notes2'} = "";
-$orderLoggingHash{'internal_company_notes2'} = "";
-$orderLoggingHash{'customer_order_notes1'} = "";
-$orderLoggingHash{'customer_order_notes2'} = "";
-$orderLoggingHash{'customer_order_notes3'} = "";
-$orderLoggingHash{'customer_order_notes4'} = "";
-$orderLoggingHash{'customer_order_notes5'} = "";
-$orderLoggingHash{'mailinglist_subscribe'} = "";
-$orderLoggingHash{'wishlist_subscribe'} = "";
-$orderLoggingHash{'insurance_cost'} = "";
-$orderLoggingHash{'trade_in_allowance'} = "";
-$orderLoggingHash{'rma_number'} = "";
-$orderLoggingHash{'customer_contact_notes1'} = "";
-$orderLoggingHash{'customer_contact_notes2'} = "";
-$orderLoggingHash{'account_number'} = "";
-$orderLoggingHash{'sales_rep'} = "";
-$orderLoggingHash{'sales_rep_notes1'} = "";
-$orderLoggingHash{'sales_rep_notes2'} = "";
-$orderLoggingHash{'how_did_you_find_us'} = "";
-$orderLoggingHash{'suggestion_box'} = "";
-$orderLoggingHash{'preferrred_shipping_date'} = "";
-$orderLoggingHash{'ship_order_items_as_available'} = "";
-
-$sc_orderlib_use_SBW_for_ship_ins = $sc_use_SBW;
-&codehook("orderlib-ship-instructions");
-if ($sc_orderlib_use_SBW_for_ship_ins =~ /yes/i)
-{
-($ship_thing_too,$ship_instructions) = 
- &ship_put_in_boxes($stevo_shipping_thing,$stevo_shipping_names,
- $sc_verify_Origin_ZIP,$sc_verify_boxes_max_wt); 
-}
-$orderLoggingHash{'shippingMessages'} = "$ship_instructions";
-$orderLoggingHash{'shippingMessages'} =~ s/\n/<br>/g;
-
-$running_total = $form_data{'mc_gross'};
-#$running_total =~ s/[^\d\.]//g;# strip off non numeric stuff
-
-if (!((0+$sc_verify_grand_total) == (0+$running_total))){
-  $verify_error .= "  Could not verify order Total Amount\n";
-  $verify_error .= "  expected: $sc_verify_grand_total\n";
-  $verify_error .= "  observed: $running_total\n";
- }
-if ($verify_error ne ""){
-  $text_of_cart .= "** NOTE: Automatic verification not possible, this order\n" .
-  "will be manually verified.  Reason automatic verification\n" . 
-  "was not possible:\n" . $verify_error . "\n";
- }
-
-$text_of_confirm_email .= $messages{'ordcnf_07'};
-$text_of_confirm_email .= $text_of_cart;
-$text_of_confirm_email .= "\n";
-$text_of_cart .= "  --ORDER INFORMATION--\n\n";
-
-$text_of_cart .= "CUSTID:        $form_data{'custom'}\n";
-$text_of_admin_email .= "CUSTID:        $form_data{'custom'}\n";
-$orderLoggingHash{'customerNumber'} = "$form_data{'custom'}";
-
-$text_of_cart .= "INVOICE:       $form_data{'invoice'}\n";
-$text_of_confirm_email .= "INVOICE:       $form_data{'invoice'}\n";
-$sc_temp_invoice_number = $form_data{'invoice'};
-$orderLoggingHash{'invoiceNumber'} = "$form_data{'invoice'}";
-
-$temp = &display_price($sc_verify_subtotal);
-$text_of_cart .= "SUBTOTAL:      $temp\n";
-$text_of_confirm_email .= "SUBTOTAL:      $temp\n";
-$temp = &format_price($sc_verify_subtotal);
-$sc_verify_subtotal_temp3 = ($sc_verify_subtotal - $sc_verify_discount);
-$orderLoggingHash{'subTotal'} = "$temp";
-
-if ($sc_verify_shipping > 0) {
-    $temp = &display_price($sc_verify_shipping);
-    $text_of_cart .= "SHIPPING:      $temp\n";
-    $text_of_confirm_email .= "SHIPPING:      $temp\n";
-    $orderLoggingHash{'shippingTotal'} = &format_price($sc_verify_shipping);
-}
-
-if ($sc_verify_discount) {
-   &add_text_of_both('DISCOUNT',&format_price($sc_verify_discount));
-   $orderLoggingHash{'discounts'} = &format_price($sc_verify_discount);
-   &add_text_of_both('DISCOUNT CODE:',$eform_Ecom_Discount);
-   $orderLoggingHash{'discountCode'} = "$eform_Ecom_Discount";
-}
-
-if ($sc_verify_tax > 0) {
-    $temp = substr(substr("SALES TAX",0,13).":               ",0,15);
-    $text_of_cart .= "$temp$sc_verify_tax\n";
-    $text_of_confirm_email .= "$temp$sc_verify_tax\n";
-    $orderLoggingHash{'salesTax'} = &format_price($sc_verify_tax);
-}
-if ($sc_verify_etax1) {
- &add_text_of_both($sc_extra_tax1_name,$sc_verify_etax1);
- $orderLoggingHash{'tax1'} = &format_price($sc_verify_etax1);
-}
-if ($sc_verify_etax2) {
- &add_text_of_both($sc_extra_tax2_name,$sc_verify_etax2);
- $orderLoggingHash{'tax2'} = &format_price($sc_verify_etax2);
-}
-if ($sc_verify_etax3) {
- &add_text_of_both($sc_extra_tax3_name,$sc_verify_etax3);
- $orderLoggingHash{'tax3'} = &format_price($sc_verify_etax3);
-}
-
-$temp = &display_price($sc_verify_grand_total);
-
-$text_of_cart .= "TOTAL:         $temp\n";
-$text_of_confirm_email .= "TOTAL:         $temp\n\n";
-$orderLoggingHash{'orderTotal'} = &format_price($sc_verify_grand_total);
-
-$text_of_admin_email = $text_of_cart;
-
-$text_of_cart .= "METHOD:       PayPal IPN $form_data{'payment_type'}\n";
-$text_of_admin_email .= "METHOD:       Paypal IPN $form_data{'payment_type'}\n";
-
-$text_of_cart .= "Transaction ID:       $form_data{'txn_id'}\n";
-$text_of_admin_email .= "Transaction ID:       $form_data{'txn_id'}\n";
-
-$text_of_cart .= "Customer Billing Address:       $form_data{'address_status'}\n";
-$text_of_admin_email .= "Customer Billing Address:       $form_data{'address_status'}\n";
-
-$text_of_cart .= "Payment Status:       $form_data{'payment_status'}\n";
-$text_of_admin_email .= "Payment Status:       $form_data{'payment_status'}\n";
-
-$text_of_cart .= "DESCRIPTION:   $form_data{'DESCRIPTION'}\n\n";
-$text_of_admin_email .= "DESCRIPTION:   $form_data{'DESCRIPTION'}\n\n";
-
-
-$text_of_cart .= "BILLING INFORMATION --------------\n\n";
-$text_of_admin_email .= "BILLING INFORMATION --------------\n\n";
-
-$text_of_cart .= "NAME:          $eform{'Ecom_BillTo_Postal_Name_First'} $eform{'Ecom_BillTo_Postal_Name_Last'}\n";
-$text_of_admin_email .= "NAME:          $eform{'Ecom_BillTo_Postal_Name_First'} $eform{'Ecom_BillTo_Postal_Name_Last'}\n";
-$orderLoggingHash{'fullName'} = "$eform{'Ecom_BillTo_Postal_Name_First'} $eform{'Ecom_BillTo_Postal_Name_Last'}";
-$orderLoggingHash{'firstName'} = "$eform{'Ecom_BillTo_Postal_Name_First'}";
-$orderLoggingHash{'lastName'} = "$eform{'Ecom_BillTo_Postal_Name_Last'}";
-
-$text_of_cart .= "ADDRESS:       $eform{'Ecom_BillTo_Postal_Street_Line1'}\n";
-$text_of_admin_email .= "ADDRESS:      $eform{'Ecom_BillTo_Postal_Street_Line1'}\n";
-$orderLoggingHash{'orderFromAddress'} = "$eform{'Ecom_BillTo_Postal_Street_Line1'}";
-
-$text_of_cart .= "CITY:          $eform{'Ecom_BillTo_Postal_City'}\n";
-$text_of_admin_email .= "CITY:          $eform{'Ecom_BillTo_Postal_City'}\n";
-$orderLoggingHash{'orderFromCity'} = "$eform{'Ecom_BillTo_Postal_City'}";
-
-$text_of_cart .= "STATE:         $eform{'Ecom_BillTo_Postal_StateProv'}\n";
-$text_of_admin_email .= "STATE:         $eform{'Ecom_BillTo_Postal_StateProv'}\n";
-$orderLoggingHash{'orderFromState'} = "$eform{'Ecom_BillTo_Postal_StateProv'}";
-
-$text_of_cart .= "ZIP:           $eform{'Ecom_BillTo_PostalCode'}\n";
-$text_of_admin_email .= "ZIP:           $eform{'Ecom_BillTo_PostalCode'}\n";
-$orderLoggingHash{'orderFromPostal'} = "$eform{'Ecom_BillTo_PostalCode'}";
-
-$text_of_cart .= "COUNTRY:       $eform{'Ecom_BillTo_Postal_CountryCode'}\n\n";
-$text_of_admin_email .= "COUNTRY:       $eform{'Ecom_BillTo_Postal_CountryCode'}\n\n";
-$orderLoggingHash{'orderFromCountry'} = "$eform{'Ecom_BillTo_Postal_CountryCode'}";
-
-&add_text_of_both('EMAIL',$form_data{'email'});
-if ($eform_Ecom_BillTo_Online_Email =~ /\$form_data{'email'}/i) {
-    $orderLoggingHash{'emailAddress'} = "$eform_Ecom_BillTo_Online_Email";
-} else {
-    $orderLoggingHash{'emailAddress'} = "$eform_Ecom_BillTo_Online_Email,$form_data{'email'}";
-}
-$text_of_admin_email .= "EMAIL:			$form_data{'email'}\n";
-
-$text_of_cart .= "PHONE:       $eform{'Ecom_BillTo_Telecom_Phone_Number'}\n\n";
-$text_of_admin_email .= "PHONE:       $eform{'Ecom_BillTo_Telecom_Phone_Number'}\n\n";
-
-$text_of_cart .= "SHIPPING INFORMATION --------------\n\n";
-$text_of_admin_email .= "SHIPPING INFORMATION --------------\n\n";
-
-$orderLoggingHash{'shipMethod'} = $eform{'Ecom_ShipTo_Method'};
-
-if (($sc_use_SBW =~ /yes/i) || ($form_data{'x_Freight'} > .009)) {
-$text_of_cart .= "SHIP VIA:      $eform{'Ecom_ShipTo_Method'}\n";
-$text_of_admin_email .= "SHIP VIA:     $eform{'Ecom_ShipTo_Method'}\n";
-}
-
-$text_of_cart .= "NAME:          $eform{'Ecom_ShipTo_Postal_Name_First'} $eform{'Ecom_ShipTo_Postal_Name_Last'}\n";
-$text_of_admin_email .= "NAME:          $eform{'Ecom_ShipTo_Postal_Name_First'} $eform{'Ecom_ShipTo_Postal_Name_Last'}\n";
-$orderLoggingHash{'shipToName'} = "$eform{'Ecom_ShipTo_Postal_Name_First'} $eform{'Ecom_ShipTo_Postal_Name_Last'}";
-
-$text_of_cart .= "ADDRESS:       $eform{'Ecom_ShipTo_Postal_Street_Line1'}\n";
-$text_of_admin_email .= "ADDRESS:      $eform{'Ecom_ShipTo_Postal_Street_Line1'}\n";
-$orderLoggingHash{'shipToAddress'} = "$eform{'Ecom_ShipTo_Postal_Street_Line1'}";
-
-$text_of_cart .= "CITY:          $eform{'Ecom_ShipTo_Postal_City'}\n";
-$text_of_admin_email .= "CITY:          $eform{'Ecom_ShipTo_Postal_City'}\n";
-$orderLoggingHash{'shipToCity'} = "$eform{'Ecom_ShipTo_Postal_City'}";
-
-$text_of_cart .= "STATE:         $eform{'Ecom_ShipTo_Postal_StateProv'}\n";
-$text_of_admin_email .= "STATE:         $eform{'Ecom_ShipTo_Postal_StateProv'}\n";
-$orderLoggingHash{'shipToState'} = "$eform{'Ecom_ShipTo_Postal_StateProv'}";
-
-$text_of_cart .= "ZIP:           $eform{'Ecom_ShipTo_Postal_PostalCode'}\n";
-$text_of_admin_email .= "ZIP:           $eform{'Ecom_ShipTo_Postal_PostalCode'}\n";
-$orderLoggingHash{'shipToPostal'} = "$eform{'Ecom_ShipTo_Postal_PostalCode'}";
-
-$text_of_cart .= "COUNTRY:       $eform_Ecom_ShipTo_Postal_CountryCode\n\n";
-$text_of_admin_email .= "COUNTRY:       $eform_Ecom_ShipTo_Postal_CountryCode\n\n";
-$orderLoggingHash{'shipToCountry'} = "$eform_Ecom_ShipTo_Postal_CountryCode";
-
-if ($ship_instructions ne "") {
-  $text_of_cart .= "Shipping Instructions: \n$ship_instructions\n\n"; 
-  $text_of_admin_email .= "Shipping Instructions:\n$ship_instructions\n\n"; 
- } 
-
-# NEW CODEHOOK
-&codehook("process-order-pre-xcomments");
-
-$text_of_cart .= $XCOMMENTS;
-$orderLoggingHash{'xcomments'} = "$XCOMMENTS";
-$orderLoggingHash{'xcomments'} =~ s/\n/<br>/g;
-$orderLoggingHash{'adminMessages'} =~ s/\t/ /g;
-$text_of_admin_email .= $XCOMMENTS_ADMIN;
-$orderLoggingHash{'adminMessages'} .= "$XCOMMENTS_ADMIN";
-$orderLoggingHash{'adminMessages'} =~ s/\n/<br>/g;
-$orderLoggingHash{'adminMessages'} =~ s/\t/ /g;
-$text_of_confirm_email .= $XCOMMENTS;
-
-$orderLoggingHash{'adminMessages'} .= "<br>PAYMENT INFORMATION --------------------<br>" . 
-"METHOD: $form_data{'payment_type'}<br>" . 
-"Transaction ID: $form_data{'txn_id'}<br>" . 
-"Customer Billing Address: $form_data{'address_status'}<br>" . 
-"Payment Status: $form_data{'payment_status'}<br>" . 
-"DESCRIPTION: $form_data{'DESCRIPTION'}<br>" . 
-"Name on PayPal Account:  $form_data{'first_name'} $form_data{'last_name'}<br>" . 
-"---------------------------------------------------------------<br>";
- 
-$temp = &init_shop_keep_email;
-$text_of_cart = $temp . $text_of_cart;
-$text_of_admin_email = $temp . $text_of_admin_email;
-$text_of_confirm_email = &init_customer_email . $text_of_confirm_email;
-
-$temp = &addto_shop_keep_email;
-$text_of_cart .= $temp;
-$text_of_admin_email .= $temp;
-$text_of_confirm_email .= &addto_customer_email;
-
-if ($sc_use_pgp =~ /yes/i)
-{
-&require_supporting_libraries(__FILE__, __LINE__, "$sc_pgp_lib_path");
-$text_of_cart = &make_pgp_file($text_of_cart, "$sc_pgp_temp_file_path/$$.pgp");
-$text_of_cart = "\n" . $text_of_cart . "\n";
-
-$text_of_admin_email = &make_pgp_file($text_of_admin_email, "$sc_pgp_temp_file_path/$$.pgp");
-$text_of_admin_email = "\n" . $text_of_admin_email . "\n";
-}
-
-# added by Mister Ed for Pro version Feb 7, 2007
-my $temp_admin_email = "$sc_admin_email";
-if ($sc_use_customer_email_over_admin =~ /yes/i) {
-   $temp_admin_email = "$form_data{'email'}";
-}
-
-if (($sc_send_order_to_email =~ /yes/i) && ($filetestfound_thingy eq "yes")) {
-  &send_mail($temp_admin_email, $sc_order_email, "$sc_PayPalIPN_order_name $form_data{'invoice'}", $text_of_admin_email);
-}
-
-# NEW CODEHOOK
-&codehook("process-order-pre-logOrder");
-
-if ($filetestfound_thingy eq "yes") {
-    &log_order($text_of_cart,$form_data{'invoice'},$form_data{'custom'});
-}
-
-
-# Prints the form response to the confirm email
-#foreach $key (sort keys %form_data)
-#{
-#  $text_of_confirm_email .= qq~$key\t\t$form_data{"$key"}\n~;
-#}
-
-if (($cartData) && ($form_data{'payer_email'} ne "") && ($filetestfound_thingy eq "yes"))
-{
-&send_mail($sc_admin_email, "$eform_Ecom_BillTo_Online_Email,$form_data{'payer_email'}",$messages{'ordcnf_08'},
-           "$text_of_confirm_email");
-}
-  
-if ($sc_PayPalIPN_show_table =~ /yes/i) {
-  $order_ok_final_msg_tbl = $messages{'ordcnf_10'}; 
-  if ($order_ok_final_msg_tbl eq '') {
-   # Default so something is there, use $messages{'ordcnf_10'} though 
-   # to customize, set it in the Free Form Logic (either location.)
-    $order_ok_final_msg_tbl = &get_date . "<br><br>Order Confirmation:";
-   }
-  $temp = 
-    &get_PayPalIPN_confirm_final(*form_data,$invoice_number,
-    $customer_number,$offline_ver_tbldef,$order_ok_final_msg_tbl,
-    $offline_ver_tbldef2,$authPrice,$time) . "<br>\n";
- } else {
-  $temp = $messages{'ordcnf_01'};
- }
-$sc_affiliate_order_unique = $form_data{'invoice'};
-$sc_affiliate_order_total = $sc_verify_subtotal_temp3;
-
-$sc_affiliate_image_call =~ s/AMOUNT/$sc_affiliate_order_total/g;
-$sc_affiliate_image_call =~ s/UNIQUE/$sc_affiliate_order_unique/g;
-
-# NEW CODEHOOK
-&codehook("process-order-display-thankyou-page");
-
-print <<ENDOFTEXT;
-<CENTER>
-<TABLE WIDTH=500>
-<TR>
-<TD WIDTH=500>
-<FONT FACE=ARIAL>
-$temp
-</FONT>
-</TD>
-</TR>
-</TABLE>
-</CENTER>  
-ENDOFTEXT
-
-print <<ENDOFTEXT;
-<CENTER>
-<TABLE WIDTH=500>
-<TR>
-<TD WIDTH=500>
-<FONT FACE=ARIAL>
-$messages{'ordcnf_02'}
-<br>
-$sc_affiliate_image_call
-</FONT>
-</TD>
-</TR>
-</TABLE>
-</CENTER>  
-
-ENDOFTEXT
-
-
-# Empty cart if secondary cart file was erased.  added by Mister Ed May 20, 2006
-if ($filetestfound_thingy ne "yes") {
-    &empty_cart;
-    undef(%agora);
-    undef(%form_data);
-}
-
-&SecureStoreFooter;
-
-print qq!
-</BODY>
-</HTML>
-!;
-############  End of Standard Processing Code - Select until this line for copy functions ############
-}
-else { # uses alternate processing file in add_ons sub directory
-
- &codehook("PayPalIPN_custom_processing_function");
-
-} # end of alternate processing
-} 
-#################################################################
-1; # Library
diff -x .svn -aruN 5.2.002.src/library/agora_html_lib.pl 5.2.003.src/library/agora_html_lib.pl
--- 5.2.002.src/library/agora_html_lib.pl	2008-01-21 21:07:53.000000000 -0600
+++ 5.2.003.src/library/agora_html_lib.pl	2008-04-19 22:20:37.000000000 -0500
@@ -1,5 +1,5 @@
 #######################################################################
-$versions{'agora_html_lib.pl'} = "5.2.001";
+$versions{'agora_html_lib.pl'} = "5.2.003";
 #######################################################################
 if ($sc_main_script_post_url eq '') { 
   $sc_main_script_post_url = $sc_main_script_url;
@@ -1296,6 +1296,7 @@
   $myans = &prodID($arg1);
   $the_whole_page =~ s/(%%prodID-)([^%]+)(%%)/$myans/i;
 }
+$the_whole_page =~ s/%%description%%/$display_fields[2]/ig;
 $the_whole_page =~ s/%%Qty%%/$qty/ig;
 $the_whole_page =~ s/%%userFieldOne%%/$display_fields[6]/ig;
 $the_whole_page =~ s/%%userFieldTwo%%/$display_fields[7]/ig;
@@ -1343,7 +1344,6 @@
 $the_whole_page =~ s/%%href_fields%%/$href_fields/ig;
 $the_whole_page =~ s/%%image%%/$imageURL/ig;
 $the_whole_page =~ s/%%name%%/$display_fields[1]/ig;
-$the_whole_page =~ s/%%description%%/$display_fields[2]/ig;
 $the_whole_page =~ s/%%price%%/$display_fields[4]/ig;
 $the_whole_page =~ s/%%cost%%/$item_ids[2]/ig;
 $the_whole_page =~ s/%%shippingPrice%%/$display_fields[5]/ig;
diff -x .svn -aruN 5.2.002.src/library/agora_order_lib.pl 5.2.003.src/library/agora_order_lib.pl
--- 5.2.002.src/library/agora_order_lib.pl	2008-02-07 16:28:05.000000000 -0600
+++ 5.2.003.src/library/agora_order_lib.pl	2008-04-07 19:00:50.000000000 -0500
@@ -1,6 +1,6 @@
 ############################################################
 
-$versions{'agora_order_lib.pl'} = "5.2.000";
+$versions{'agora_order_lib.pl'} = "5.2.003";
 # last modified by Mister Ed from K-Factor Technologies, Inc /  AgoraCart.com
 # August 17, 2006
 #
@@ -1538,6 +1538,7 @@
   $final_sales_tax,
   $final_extra_tax1,
   $final_extra_tax2,
+  $final_extra_tax3,
   $grand_total,
        $final_buySafe) =
   ($sc_verify_shipping,$sc_verify_discount,
@@ -1928,7 +1929,7 @@
 
 &codehook("display_cart_heading_item");
 
-   if (($sc_col_name[$temp_index] ne "web_options")||($sc_col_name[$temp_index] ne "options")||($sc_col_name[$temp_index] ne "email_options")) { 
+   if (($sc_col_name[$temp_index] ne "web_options")&&($sc_col_name[$temp_index] ne "options")&&($sc_col_name[$temp_index] ne "email_options")) { 
       $cart_heading_item = "<th>$field</th>\n";
       print $cart_heading_item;
    }
diff -x .svn -aruN 5.2.002.src/library/shipping_lib.pl 5.2.003.src/library/shipping_lib.pl
--- 5.2.002.src/library/shipping_lib.pl	2008-02-14 18:35:24.000000000 -0600
+++ 5.2.003.src/library/shipping_lib.pl	2008-04-10 13:30:34.000000000 -0500
@@ -45,8 +45,9 @@
 # Modified May 17, 2007 by Mister Ed  Added dimensional weight for UPS XML and FedEx XML.
 #   user4 in cart fields filled with dimensional info for individual items, appended to stevo_shipping_thing for use in 
 #   shipping instructions and courtesy rate quotes from real-time providers.
+# Modified March 27, 2008 by Mister Ed  - fixed ghosting of empty boxes on items from alt locations or alt dimensions.
 
-$versions{'shipping_lib.pl'} = "5.2.001";
+$versions{'shipping_lib.pl'} = "5.2.003";
 if (($sc_use_SBW =~ /yes/i) || ($sc_need_sockets =~ /yes/i)) { 
  if ($sc_use_socket eq "") { 
    $sc_use_socket = "http-lib";   
@@ -178,11 +179,19 @@
         $single_item_box_list = '';
     }
 
+# commented out to fix for extra boxes being added in
+# by Mister Ed March 27, 2008
+#    if ($new_wt_data ne "") {
+#    	$new_wt_data .= '|';
+#    }
+#    $new_wt_data .= "1*${weight_of_box}*${value_of_box}*$alt_origin*$alt_stateprov*****";
+
+if ((${weight_of_box} ne '0') && (${value_of_box} ne '0')) {
     if ($new_wt_data ne "") {
     	$new_wt_data .= '|';
     }
-
     $new_wt_data .= "1*${weight_of_box}*${value_of_box}*$alt_origin*$alt_stateprov*****";
+}
 
     
  if ($max_per_box == 0) {
@@ -562,6 +571,7 @@
 			$item_cost += $splitanswer;
 		}
 	} else { # international string
+   			($splitanswer,$answer) = split(/<\/AreasServed>/i,$answer,2);
 			while ($answer =~ /<Service/ig) {
    				($splitanswer,$answer) = split(/<\/Service>/i,$answer,2);
                 # debug
diff -x .svn -aruN 5.2.002.src/protected/Merchandising_Tools-ext_lib.pl 5.2.003.src/protected/Merchandising_Tools-ext_lib.pl
--- 5.2.002.src/protected/Merchandising_Tools-ext_lib.pl	2007-12-19 23:21:19.000000000 -0600
+++ 5.2.003.src/protected/Merchandising_Tools-ext_lib.pl	2008-04-17 13:00:44.000000000 -0500
@@ -36,7 +36,7 @@
 # K-Factor Technologies, Inc. in order to distribute this add-on.
 #
 ##########################################################################
-$versions{'Merchandising_Tools-ext_lib.pl'} = "5.2.000";
+$versions{'Merchandising_Tools-ext_lib.pl'} = "5.2.003";
 
 {
  local ($modname) = 'merchant_tools_and_resources';
@@ -138,12 +138,11 @@
 <TD colspan=4>
 <font size="2" face="Arial, Helvetica, sans-serif">
 
-<a href="http://www.AgoraXchange.com" target="_blank"><img src="images/agoraexchange.jpg" width="160" height="42" border="0" align=left><b>AgoraXchange.com</b></a><br />
-
-AgoraXchange is a service that connects freelancers with webmasters that need custom programming, design or other custom services done for their websites. Much like an auction, programming and web design projects are posted and interested freelancers bid on them. Listing a project is free for merchants.<br /><br />
+<a href="http://www.AgoraPros.com" target="_blank"><img src="images/agorapros160.gif" width="160" height="40" border="0" align=left><b>AgoraPros.com</b></a><br />
+AgoraPros.com is a service that connects freelancers with webmasters that need custom programming, design or other custom services done for their websites. Much like an auction, programming and web design projects are posted and interested freelancers bid on them. Listing a project is free for merchants.<br /><br />
 An affiliate program is also available that pays you for each person you refer that signs up and posts or bids on projects that result in winning bids ... for the life of that referral.<br /><br />
 
-Sign up as a webmaster, affiliate, or a freelancer at: <a href="http://www.AgoraXchange.com" target="_blank">www.AgoraXchange.com</a>
+Sign up as a webmaster, affiliate, or a freelancer at: <a href="http://www.AgoraPros.com" target="_blank">www.AgoraPros.com</a>
 <br />
 </font>
 
diff -x .svn -aruN 5.2.002.src/protected/buySAFE-ext_lib.pl 5.2.003.src/protected/buySAFE-ext_lib.pl
--- 5.2.002.src/protected/buySAFE-ext_lib.pl	2008-01-23 17:46:37.000000000 -0600
+++ 5.2.003.src/protected/buySAFE-ext_lib.pl	2008-03-26 19:14:06.000000000 -0500
@@ -38,7 +38,7 @@
 # K-Factor Technologies, Inc. in order to distribute this add-on to AgoraCart (aka Agora.cgi).
 #
 ##########################################################################
-$versions{'buySAFE-ext_lib.pl'} = "5.2.001";
+$versions{'buySAFE-ext_lib.pl'} = "5.2.002";
 
 {
  local ($modname) = 'buySAFE';
@@ -245,7 +245,7 @@
 <table width="580" border="0">
 <TR>
 <TD>
-<FONT FACE=ARIAL size=2>Welcome to the <b>AgoraCart</b> buySAFE Bond Cancellation Manager.<br>This section will allow you to cancel the surety bond from buySAFE on order $inv_number.  <b>DO NOT cancel</b> surety bonds on orders where money has already changed hands from the buyer to you. This is tonly o be used in the event the order is cancelled prior to the customer's payment to you.
+<FONT FACE=ARIAL size=2>Welcome to the <b>AgoraCart</b> buySAFE Bond Cancellation Manager.<br>This section will allow you to cancel the surety bond from buySAFE on order $inv_number.  <b>DO NOT cancel</b> surety bonds on orders where money has already changed hands from the buyer to you. This is only to be used in the event the order is cancelled prior to the customer's payment to you.
 </font></TD>
 </TR>
 </table><br /><br />
diff -x .svn -aruN 5.2.002.src/protected/images/agoraexchange.jpg 5.2.003.src/protected/images/agoraexchange.jpg
--- 5.2.002.src/protected/images/agoraexchange.jpg	2006-08-08 17:27:07.000000000 -0500
+++ 5.2.003.src/protected/images/agoraexchange.jpg	1969-12-31 18:00:00.000000000 -0600
@@ -1,38 +0,0 @@
- JFIF   d d   Ducky     d   Adobe d       *           	
-             	    1!2a34AQq"b56	B#cdt7RC%v      !1A"Qaq2𑡱B3R#4rC$5   ?  *3I(4;3tj	BvM4^\~ iW,I[LV-UcѴ%QE\ž"
-T_rRɠڹbH_2*o
֞`Uo
<G ? ou3B1D
-nݼ)a Ne5oH
->F9rzL  Z}PhT$Q:21TQ (Ǎ"DJ.̇땐Hm't Q}/Pqo5y!%SPL`drB TIQ%~ottU00:lQsj/]7
-MC hJCrGїs1r[sֳP!pLu>m@ÁZ1䕥{=2(1L׽{ rXPڙ.b<$*9kCxyQRk,᩻E | u[e'LV:iip  ɯˠk(~m}!>
-@M@R~~^MN|2
-~b:8hR%
-]GH4Nώ""	(5FU?e~8ZV\4N׃@j Yq^_%HҡwC' 5~ixXHƌH&W%ï^	yj>?'VtpJfWQ)"1B&IDDsYD G
-n
md]5ϩ53$GB)]9q	6 QĚ$ ,E[Lᄦb(p]SR1È3<zlH{t3kk~VpMUY/"d{ØsNh4+-yt9I"ؙ{AY{$~
- }齞y5P䆱IġAUNalIc\BV%51Y(ѹBh.rEe2kk/R="LXÐЁ0ޭd%""#'!kJP5dd
-ED{+ǻݝHg,d]S$䦩5<Il/LU]w̛FUĊ&ci}.]M.HU氼ݲpA֞+dC$$RtK+UӘd!,%5	3n%8Y'iRB`.n+nW7m$U C W81 a)5݆v[B]a<֫jDaKs0 	6+*YY[9EIw>UmY3CNcꮜ۟{HNriG4 x-NmD"HL}o"9soWWIFk
-fj$ڕq5v]%k.4" #n7gt*X1TRcQ-0q®tʓ4K6=OD$VJ5XcEwZuz:əBKnYm7ߐt #45hmuq$s|<ҲVm}d]a9g͵}^e,ywl` S,cCTdLTA'b76[kk^\L)Z48[v)C
-ә;>Kzoqs
Y'^0T:,;@rVxjiM,T3Q3XU:SYMHui7;x6w5gKcs5\BS<+)lo{ZI`jxܵ(y]u^RVNql3IpXV`\so9҂R*#(@98amӗmwp]\=
.ArĴ(6 QN5$٫ً)ٛfl2XOd\':+ceFc"Wc2!Ɍx-)*@E@QMd`÷ǵy"M@&kG>5#Q8qΎXi1vjn(=f#Se*θ'O*NtS$)Pz;dc;=˩{g,Z 25J#¨eJWAN	WɜO`%NQWUN6y
-3鞦hi&jLER2
~&pRb5v};x!{Q c95x)J"v,=T/NЋo]$g/.VmHy+UF-Ǩ&6M.wn}~}S{۶iׅ<pTHFE$`2:7)ysO9(7h&VRպ:E`G&Mu\$:U2S!qFyL'5mϺ%S
-q8
-vm#qIEinJ3<*y6-b%.+
$%e]	(k%:')ީ齾+xgn]h(\ȸ*"X^C"q|gy0ጟlYV=FNv%ne
GjI-̅v.:&wrC&c%6l<w=id-x,	uI YYM|?[s=-ˇ:eFT"&:#dJ >:t<ٚ:īVZvHPp.ȃ7
-@N)S*PEU;zmT M4(W=͝Ԥw}Hiz@aB}RIܙ2E{xk^U:(645bPԑ
-/NE3'ykAq% "1gomn39rij0ƒlMny
+mYn7YB:&=U,ǵz5)s%ZʄR{3$dV\FpA#iꎊ-nmfP@^-p.PAnc{o62	ZN\E2Lβ[ڍޅOc.;m̭Tf`,,iyߣ~x%
Ί~I~2d;\lI%>ӈM%h=	Qn+(Tl{,C^60-CpU&ۺZvtSg
-CQN!%H+è"i߲Xdl77 Kcp@ݫBA5.92$ O8,*	9Y[nyڎE`j(SkK)z{QeMY]X(k>D*vM7qL6yO^4Ē
TPV[ka98\*S[mZF&e;Nhs9+m7պhho%8UKb	Ԁ";W;ۦ1Y&-kXa(	\T "σbZbH/'jYjkvY]Wq>qKlOd/Y -vܫnZګG#U[J(P*m\ d6/;Mٝpjloi(Gmy$Kn.=Ivm9~jovnl/k9D%fmIVJ~G
ԠDH8Bbz2;)qY8Z1\hR le
8884vMCFxԞgj{Ibˋ|Z"G``K=N\5 ͼM" döv|[ 0pLͭ9<Ǩvd5	Yn|"=-%=sSOf+W 1pŪ-\n+3ժw[m39I"}H._ä!'Ee`Nr$=McBrG<T!ganxn|k6oOUsWlCCjK@i{#v$MATA:S7h;<-`X,s{@cj|kXWǹ
jV*dǻɸ5l ih@+ㅞe?4ҏoMŖsk3%}!佡'B&H31(⸌(mUNK4o{Ǎ\TۋZ/;{:ۡ'u>LaȊtre{
-.vm9$s*7_>Ӈ)o4;e?Գ&GWnUh;{]j˚2iG$Y&[J[Ul3pgYʘ*{-gs-y2EsRj$sp
R9 q$s#q[TavG(mo/ELX V$.ZXT>^&/S[*v-5)fU#wQ
q|e2׮M 2!Ĵz4t܈T ϵx&9f=6k$cʽPr
qm'6H=733U	K6M\.tvV!Wg+)%-Qf/٪-hcgWMfi ܎!*6hvJ@{_ox?R03{6X2FCLqV*6,QX+2kO;=f.2
-	b5PU}gsEm
c\K(%H5ڋAwg+[\kcO%i1i6"MJ C3j#+5#3*{Zt*lyyKӭ$Pܱ"jm:ۨU47bB'xؗbF99<j?kTspYXhƍΡuKEUI,
Ho ZU(X	$ե>.+Dr5ɭqĀ<QΥ2YsuY;3[53pjCpwgOz1}
\ *潃-
-M&KVA!\$.ˬU	_M|ËDa1sm7q dVȹts* SS"A5=BSw?ab@ӁyVgtX+dtZ/nXYW[4b2zeXp^zw
-njz:>Č.qqkdFJZN{Y(1 _:b;Sry
-"V1<1jD[B4aݜ444;vǳA(Mn$L/A,v#cbZw*q5ޟ;2LOs9fHt?RLUC :LS'DCOo⨥
-mB@PvndNsպ tTB@D90H,Z{
-r[269hU}7O\T 0$$!
[Ӭ=*q4U['HYtx|}AR"n<i5ZXHK4n:gMS,c ,HDspkW"aIeЄ9\Ny
-C$G9Ubf .9V99Gcx:}')ѡޯZ<RCV6b۔wDER'S-e#.`:@v̄H@*CA8Re7
. CN =cfSe^ ꓶʼIx+ljcfK$௓dVq"S4-tzP(X]2HIj}h%Hm2w"9f
۱uiY~hjy̜e[cV4 j-prr^5p
-#P16)5** Q@88gO8hʾl
-.޵k1nnβ<:
ޔ4ՉE	yz̈1GEIxb(['4Mz\FF;Y 9*9txP~Mw(
-~K4Ʋ	lylq_c
.(+$AE&,q!D7;S(@4gUZE83k_ ib($9d7Y'is
P=C)8h2TeIL
-XYvVֈ$^zjz
VpBX>]CL l^#ds(B8FCZsA:BҬNih ` #Nj9TF&Jےy؅+ҏrL$-.ܭ!QP}>@NIĂ=ZITǠ o$2kkFA~ˤ?Rb~656HaW)!;Jٷ{K5pJNZ,5NjYMW!Κ"+.Me7$3E'Cse-v6 @
P#hh8<8 `im3\\yW̪p|Oܕ0弥^aJO2i7E
-\g9ͅSDAQkGS[JldGJ)#O/0PZ(qS&}hkP	9y0WB{vĎK1x4vpqABGv&9̕j×oI$5PF̻! G0?5+ʰ%o1r%d͛/Jen3$c;m;dU TQ,0<p&>>`{D[KI:A˒53#25HJ>	`=S`oIPǅ$dߜ܈:M"= 6N1DlHڍyT!a0hnu 
GSv~_av8Lc%a'h(*&Φ ] C_p24ے=x/M:LQe	]C]ysG2RSa
Dh5L0T8A(O 6hIBuT2*bGNuAzL2` xq];wSܨBɕ05N-S(n`8)/*ɇ98>$Ś@7b>QdTIvErܷPta{b8M3N (R <
-T`´Cn5}8-Te~yD\+Ȼ-$R2I=MNP`[o,	kP"&'1[1{Bܱ̎
AEv	ڬg^ܢPV.{&Q[3XQ"sڐD9^֗$F+#q:sdHZXwT$cm熎#RI$3N"S)@ QcCڤւ<@Ƿ?c5OO].|WqŽ-x!ׄr3Hnb}Q {r=J⹭[kAwZJ6k	ȝaܵfŐBF.y(ZNtLӆ .t	E!F!+{},LnD.	~A\+S6#xGg+Hlucj
D A6Ѳ̣V%^d.9fP)̦&h/p HTP+-6ٙ[!af3R*AlߴY(7[&"t:	!?l<}5{08aE
-!r8[upSy}nbH#m֨<idb뤕EF_ChrpLC@@9dn/ 9ZӨbZK'44Bpƍ/-#H덲=9eeffլVɳg(IV
-i) ImoyjZP☌\%<~t[,G4V,VU3q3>dr<rاT[&R:(tcD(#fE d	Ndg)X]̸TԙA~G#/0nf$e6nI<Y ޝu۲j=%LA8ִ( S@NvCQ'$*@?9NW>  g1^zK/u5fm>޿
-/z)9KFg§ڽ˹{>g;<GT~{~I{wqʨ NG9{|o1<oə~cjIK~Lb Eُ ӗLr Ͳ7 i.|;GGݹ _?\~V?q8ӽ G}_{\k?
-yMgc/<]V*K ?;#OEf:]_?72 K92rw^5S?y}5j_|
-?!7c ΋: }ˀ%~c*5yyϘqLSd<)oÓ{5 gX<`5=y?g>4lᗞ_
\ No newline at end of file
diff -x .svn -aruN 5.2.002.src/protected/images/agorapros160.gif 5.2.003.src/protected/images/agorapros160.gif
--- 5.2.002.src/protected/images/agorapros160.gif	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.003.src/protected/images/agorapros160.gif	2008-04-17 13:00:54.000000000 -0500
@@ -0,0 +1,29 @@
+GIF89a (      fff333	Y I+I3r  !Yr/LJJL#bKb0m
+T  @ttt$?{;H|KZꙙ{Ĥ&d!Zff=?DYc8Rå*kP!1kb{":t)1d\6CvVWZ			ƴK<|z1JR<Yjs&Cr2QRiDRBHvޣ#_9T))((3k*9qmnr")aWfffAZs};;:RRQ(B||||rw΁꒒ÐSc,hgw\^d 4pFPD [)cBM[ko3:kRXjzff!  ,     (  luull**lAg*tu=T=7,$:[lgutt=gL,tl[>gKKKė=t[WDT>$[*$шKT=oo7uTK[gKu琒ᩚ,DLC+uذ@ei
+(IɖM#4XDlaШXw9^J
);x;V]m$f2ܶSp];=-èF**D4*BSOG:AŬAҥ]g@a'IQ0
+a*`h)uMep!ՉGjD@iXM!lXyk@ҹHa5^T|NL̽U1\qt0|ZRI56.UPKU|/6-$7BT4ÝGK!:P|RMyrO|U2-^Ց
G5[1``DABJf[c]u0x67Paduǘ4g|vw ^tf%Xz^&bb3a%&ucdLnP~"SˇYCxBz9-ice%ח%ǜ9
&@D߆!Zf5t@˗Dڥla)u?ꕤ|kqf
uT!rk'MCI@0A-f3)gz(WҒ?mp߅:/0` PvRLЪB"jL/r1ܽINfsrz=zI'@LF	`iTS"~2S, *h;mHAsb ]0@U3
+1\֝lڰ
+4me$SƉa[C(%`,DJ8M l2	>Jw7-X>$B1 j  SFC pIgT-#0Vϖ"D.zp|bP1r8/}Q(|;ߤ!$s8&P  AQ B 20!,`aOIT\a|b	`HbP@}~˂P,X!/Ȣn,XBC2p*`A` sԀ<zGˤנ!KB^
+4/˳bz 2 X>`P1(A2P`A!
$@a
+AI@Ix?4!
Q_	@p>x@'	 	 @hT+A/'g`K% 
 
+!cXp  #< ?8Agy.@$ j
!H5ay1@0  d @2 `^@ P~AHj^Ihaɂ?ypC&4@   8^ 6y\pBTtyF	BZzuy
+ pU n@L뷆$D	)+fT 1Q
8 5y" C	'4r?Ye(j.a2p(u
6]`( n`A<}u,jR&J0F4P"J8x <%"`P6$ \$@] `V.`;:P? 0b;Xk#Ijnu$x	4& (Ad ,${	7ZDLV7!gv8X 4	e(tB%+0
+@2\|.h U: 1 ,eh   -@ xi"k4@ x3`8p4b'(ˢBe^F// I@Z<buG!!ځ<p`ouJ|i81nP ,3 5@<xB XEL ]@X,jBVu AuVy m 3
pCY'4b wi<mP!d&mꐂHn};X $ 0Р<\H;eIЅtSz	 qx7sHX`7D 1 \
+ fɫ @ 	-sE%!ĥvG;i*{0;=Ynp4V	_j=Lm@*l
gQ%CtAcCd'_8a1ЂP@e^,tIpq `J0Ve_&$ B@ɰ|fAH_
+FІ VmP ^ mIPnp9 q BUwV`0̷ , oh 0`J!P T h^h0  X' cـ5\-K0 ,i0P\ ID@hPkf`G/R`/HT
PwPzqiF64ypMN??0?J aI,
n #P@l`;0s:X^@B@+0djP:xB X 7 R,=$ d^X !# B5N#zm=S_v_ W#p-@1* @=pP Rv'5 H2, 8P@	БqG
+i^drhc
+"@.L`7[	C
ԑH0t0tp	TP V =PV%*p	B
+Fq0W$1'X |w[2r{'6$c,d#
+iqb rK0)WPNr/9,'=r	fY0'b @N, 1rpV@K}PD*7P<Bf&3:NS<(Aq*sL@=2d%F3+3=;#CBt /#PF	r0qmi+,)yl
+S9dXC?Q<UF1
+P 57Uu23acaz"驏T	"
+B1I0/ڞ1 1	TB7G7*4M+D"P?#A%@k)"B1
+?s9i{Y'590$B{/$n靡%@͙(e9
 Ҙ^yT(cU#x
	lJe4o)b1^1ٰy	c٣(1P!e)JdVڣ=NEJx#
+:6_*/&"OZzT:
+/)$1` eګ{
+= ú2
+p09
+  ) #٪(/Y>ߪ&f#j9J뺮x9%b2
+m-j"SD{"
+YIj3q :%z2 ڮ3ʫ)/NҚ,Cf8:dS &-6Y	(czs<`'?+r;*G$q&Txڪʬ+.аY8+vo$0K_
+UmZ" ;
\ No newline at end of file
diff -x .svn -aruN 5.2.002.src/protected/main_settings-ext_lib.pl 5.2.003.src/protected/main_settings-ext_lib.pl
--- 5.2.002.src/protected/main_settings-ext_lib.pl	2008-02-07 18:53:35.000000000 -0600
+++ 5.2.003.src/protected/main_settings-ext_lib.pl	2008-03-26 18:05:48.000000000 -0500
@@ -1,6 +1,6 @@
 # file ./store/protected/main_settings-ext_lib.pl
 
-$versions{'main_settings-ext_lib.pl'} = "5.2.002";
+$versions{'main_settings-ext_lib.pl'} = "5.2.003";
 #######################################################################################
 # Misc Variables
       use File::Copy;
@@ -12,7 +12,7 @@
   $stylename = "agorastyles.css";
   $templatestylename = "agoratemplate.css";
   $mc_meta_tags_css = qq~<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">~;
-  $mc_doctype = qq~<!DOCTYPE HTML PUBLIC "-//W3C//Dtd HTML 4.01 Transitional//EN">~;
+  $mc_doctype = qq~<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">~;
 #######################################################################################
 
 {
diff -x .svn -aruN 5.2.002.src/protected/manager.cgi 5.2.003.src/protected/manager.cgi
--- 5.2.002.src/protected/manager.cgi	2008-02-11 20:19:16.000000000 -0600
+++ 5.2.003.src/protected/manager.cgi	2008-04-07 19:00:33.000000000 -0500
@@ -13,7 +13,7 @@
   print `./wrap_mgr.o`;
   &call_exit;
  }
-$versions{'manager.cgi'}="5.2.002";
+$versions{'manager.cgi'}="5.2.003";
 $manager_program_running = "yes";
 chdir(".."); 
 &setup_manager;
diff -x .svn -aruN 5.2.002.src/protected/store_admin_html.pl 5.2.003.src/protected/store_admin_html.pl
--- 5.2.002.src/protected/store_admin_html.pl	2008-02-15 19:53:35.000000000 -0600
+++ 5.2.003.src/protected/store_admin_html.pl	2008-03-26 19:14:07.000000000 -0500
@@ -1,7 +1,7 @@
 ######################################################################################
 # This file contains the HTML for the store admin screens
 ######################################################################################
-$versions{'store_admin_html.pl'} = "5.2.001";
+$versions{'store_admin_html.pl'} = "5.2.002";
 &require_supporting_libraries(__FILE__,__LINE__,
   "$mgrdir/misc/mgr_miscmain.pl");
 if ($mc_max_top_menu_items eq '') { 
@@ -784,7 +784,7 @@
 
 my $buysafe_display = '';
 if ((($orderLoggingHash{'GatewayUsed'} =~ /Offline/i)||($orderLoggingHash{'GatewayUsed'} =~ /paypal standard/i)) && ($sc_buySafe_is_enabled =~ /yes/) && ($orderLoggingHash{'buySafe'} ne '')) {
-    $buysafe_display = qq~<a href="manager.cgi?buysafecanceltrigger=yes&customerNumber=$orderLoggingHash{'customerNumber'}">Cancel buySAFE Bond</a><br>~;
+    $buysafe_display = qq~<a href="manager.cgi?buysafecanceltrigger=yes&customerNumber=$orderLoggingHash{'invoiceNumber'}">Cancel buySAFE Bond</a><br>~;
 }
 
 if ($sorry_thingy ne "stop") {
