diff -aruN 5.0.000.src/add_ons/shipping-order-instructions-sort.pl 5.2.000.src/add_ons/shipping-order-instructions-sort.pl
--- 5.0.000.src/add_ons/shipping-order-instructions-sort.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/add_ons/shipping-order-instructions-sort.pl	2007-12-19 22:52:57.000000000 -0600
@@ -32,7 +32,7 @@
 # piece of software as well as any and all rights to profit sharing and/or to charge for
 # such works and/or derivatves.
 #######################################################################
-$versions{'shipping-order-instructions-sort.pl'} = "5.0.000";
+$versions{'shipping-order-instructions-sort.pl'} = "5.0.001";
 &add_codehook("process-cart-item","alt_origin_ship_instructions");
 &add_codehook("process-cart-item","alt_stevo_ship_thing_names");
 &add_codehook("orderlib-ship-instructions","alt_origin_process_ship_instructions");
@@ -45,7 +45,7 @@
          $product_temp = "$cart_fields[1]" . " " . "$product";
     }
 	if ($sc_alt_origin_enabled =~ /yes/i) {
-        $alt_origin = $cart_fields[11];
+        ($alt_origin,$alt_stateprov) = split(/\,/,$cart_fields[11],2);
 		if ($alt_origin ne "") {
 			if ($zip_list{$alt_origin} eq "") {
 				$zip_list{$alt_origin} = "$quantity\*$weight";
diff -aruN 5.0.000.src/admin_files/agora_ship_UPS-XML_user_lib.pl 5.2.000.src/admin_files/agora_ship_UPS-XML_user_lib.pl
--- 5.0.000.src/admin_files/agora_ship_UPS-XML_user_lib.pl	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/admin_files/agora_ship_UPS-XML_user_lib.pl	2006-02-12 02:34:46.000000000 -0600
@@ -0,0 +1,88 @@
+# agora_ship_UPS-XML_user_lib.pl
+$UPS_Server = "https://wwwcie.ups.com/ups.app/xml/Rate"; # UPS Production Server URL
+%iso_countries = ("ad"=> "Andorra","ae"=> "United Arab Emirates",
+"af"=> "Afghanistan","ag"=> "Antigua and Barbuda","ai"=> "Anguilla",
+"al"=> "Albania","am"=> "Armenia","an"=> "Netherland Antilles",
+"ao"=> "Angola","aq"=> "Antarctica","ar"=> "Argentina",
+"as"=> "American Samoa","at"=> "Austria","au"=> "Australia",
+"aw"=> "Aruba","az"=> "Azerbaidjan","ba"=> "Bosnia and Herzegovina",
+"bb"=> "Barbados","bd"=> "Banglades","be"=> "Belgium","bf"=> "Burkina Faso",
+"bg"=> "Bulgaria","bh"=> "Bahrain","bi"=> "Burundi","bj"=> "Benin",
+"bm"=> "Bermuda","bn"=> "Brunei Darussalam","bo"=> "Bolivia",
+"br"=> "Brazil","bs"=> "Bahamas","bt"=> "Bhutan","bv"=> "Bouvet Island",
+"bw"=> "Botswana","by"=> "Belarus","bz"=> "Belize","ca"=> "Canada",
+"cc"=> "Cocos (Keeling) Islands","cd"=> "Congo, Democratic Republic of the",
+"cf"=> "Central African Republic","cg"=> "Congo, Republic of the",
+"ch"=> "Switzerland","ci"=> "Cote d'Ivoire",
+"ck"=> "Cook Islands","cl"=> "Chile","cm"=> "Cameroon","cn"=> "China",
+"co"=> "Colombia","cr"=> "Costa Rica","cu"=> "Cuba","cv"=> "Cape Verde",
+"cx"=> "Christmas Island","cy"=> "Cyprus","de"=> "Germany",
+"dj"=> "Djibouti","dk"=> "Denmark","dm"=> "Dominica","do"=> "Dominican Republic",
+"dz"=> "Algeria","ec"=> "Ecuador","ee"=> "Estonia","eg"=> "Egypt",
+"eh"=> "Western Sahara","er"=> "Eritrea",
+"es"=> "Spain","et"=> "Ethiopia","fi"=> "Finland","fj"=> "Fiji",
+"fk"=> "Falkland Islands","fm"=> "Micronesia, Federated States of",
+"fo"=> "Faroe Islands","fr"=> "France","ga"=> "Gabon","gb"=> "Great Britain",
+"gd"=> "Grenada","ge"=> "Georgia","gg"=> "Guernsey","gh"=> "Ghana",
+"gi"=> "Gibraltar","gl"=> "Greenland","gm"=> "Gambia","gn"=> "Guinea",
+"gp"=> "Guadeloupe","gq"=> "Equatorial Guinea","gr"=> "Greece",
+"gt"=> "Guatemala","gu"=> "Guam","gw"=> "Guinea Bissau","gy"=> "Guyana",
+"hk"=> "Hong Kong","hm"=> "Heard Island and McDonald Islands",
+"hn"=> "Honduras","hr"=> "Croatia","ht"=> "Haiti","hu"=> "Hungary",
+"id"=> "Indonesia","ie"=> "Ireland","il"=> "Israel","im"=> "Man, Isle of",
+"in"=> "India","io"=> "British Indian Ocean Territory","iq"=> "Iraq",
+"ir"=> "Iran","is"=> "Iceland","it"=> "Italy","jm"=> "Jamaica",
+"jo"=> "Jordan","jp"=> "Japan","ke"=> "Kenya","kg"=> "Kyrgyzstan",
+"kh"=> "Cambodia","ki"=> "Kiribati","km"=> "Comoros",
+"kn"=> "Saint Kitts and Nevis Anguilla","kp"=> "North Korea",
+"kr"=> "South Korea","kw"=> "Kuwait","ky"=> "Cayman Islands",
+"kz"=> "Kazachstan","la"=> "Laos","lb"=> "Lebanon","lc"=> "Saint Lucia",
+"li"=> "Liechtenstein","lk"=> "Sri Lanka","lr"=> "Liberia",
+"ls"=> "Lesotho","lt"=> "Lithuania",
+"lu"=> "Luxembourg","lv"=> "Latvia","ly"=> "Libya","ma"=> "Morocco",
+"mc"=> "Monaco","md"=> "Moldova, Republic of","mg"=> "Madagascar",
+"mh"=> "Marshall Islands","mk"=> "Macedonia, The former Yougoslav Republic of",
+"ml"=> "Mali","mm"=> "Myanmar","mn"=> "Mongolia","mo"=> "Macau",
+"mp"=> "Northern Mariana Islands","mq"=> "Martinique","mr"=> "Mauritania",
+"ms"=> "Montserrat","mt"=> "Malta","mu"=> "Mauritius","mv"=> "Maldives",
+"mw"=> "Malawi","mx"=> "Mexico","my"=> "Malaysia","mz"=> "Mozambique",
+"na"=> "Namibia","nc"=> "New Caledonia","ne"=> "Niger",
+"nf"=> "Norfolk Island","ng"=> "Nigeria","ni"=> "Nicaragua",
+"nl"=> "Netherlands","no"=> "Norway","np"=> "Nepal","nr"=> "Nauru",
+"nu"=> "Niue","nz"=> "New Zealand","om"=> "Oman",
+"os"=> "Palestinian Territory, Occupied","pa"=> "Panama",
+"pe"=> "Peru","pf"=> "Polynesia","pg"=> "Papua New Guinea",
+"ph"=> "Philippines","pk"=> "Pakistan","pl"=> "Poland",
+"pm"=> "Saint Pierre and Miquelon","pn"=> "Pitcairn",
+"pr"=> "Puerto Rico","pt"=> "Portugal","pw"=> "Palau",
+"py"=> "Paraguay","qa"=> "Qatar","re"=> "Reunion",
+"ro"=> "Romania","ru"=> "Russian Federation","rw"=> "Rwanda",
+"sa"=> "Saudi Arabia","sb"=> "Solomon Islands","sc"=> "Seychelles",
+"sd"=> "Sudan","se"=> "Sweden","sg"=> "Singapore","sh"=> "Saint Helena",
+"si"=> "Slovenia","sj"=> "Svalbard and Jan Mayen Islands",
+"sk"=> "Slovak Republic","sl"=> "Sierra Leone","sm"=> "San Marino",
+"sn"=> "Senegal","so"=> "Somalia","sr"=> "Suriname",
+"st"=> "Sao Tome and Principe","su"=> "Soviet Union",
+"sx"=> "Saint Croix","sv"=> "El Salvador","sy"=> "Syria",
+"sz"=> "Swaziland","tc"=> "Turks and Caicos Islands",
+"td"=> "Chad","tf"=> "French Southern Territories",
+"tg"=> "Togo","th"=> "Thailand","tj"=> "Tajikistan",
+"tk"=> "Tokelau","tm"=> "Turkmenistan",
+"tn"=> "Tunisia","to"=> "Tonga","tp"=> "East Timor",
+"tr"=> "Turkey","tt"=> "Trinidad and Tobago",
+"tv"=> "Tuvalu","tw"=> "Taiwan","tz"=> "Tanzania",
+"ua"=> "Ukraine","ug"=> "Uganda","uk"=> "United Kingdom",
+"us"=> "United States","uy"=> "Uruguay","uz"=> "Uzbekistan",
+"va"=> "Holly See (Vatican City State)",
+"vc"=> "Saint Vincent and the Grenadines","ve"=> "Venezuela",
+"vg"=> "Virgin Islands (British)","vi"=> "Virgin Islands (US)",
+"vn"=> "Vietnam","vu"=> "Vanuatu",
+"wf"=> "Wallis and Futuna Islands","ws"=> "Samoa","ye"=> "Yemen",
+"yt"=> "Mayotte","yu"=> "Yugoslavia","za"=> "South Africa",
+"zm"=> "Zambia","zr"=> "Zaire","zw"=> "Zimbabwe",
+"eu"=> "Saint EUSTATIUS",
+"uv"=> "Saint JOHN",
+"nt"=> "Saint BARTHELEMY",
+"sw"=> "Saint CHRISTOPHER",
+"vl"=> "Saint THOMAS");
+1;
\ No newline at end of file
diff -aruN 5.0.000.src/admin_files/agora_user_lib.pl 5.2.000.src/admin_files/agora_user_lib.pl
--- 5.0.000.src/admin_files/agora_user_lib.pl	2006-10-31 09:51:14.000000000 -0600
+++ 5.2.000.src/admin_files/agora_user_lib.pl	2008-01-28 13:46:30.000000000 -0600
@@ -41,15 +41,36 @@
 &init_cart_settings;
 }
 #:#:#: end CART settings
-#:#:#: start CSSDESIGN settings
-$sc_standard_head_info = qq~<link rel="stylesheet" type="text/css" href="agorastyles.css" media="screen">
-<link rel="stylesheet" type="text/css" href="html/html-templates/templates/TheAgora/TheAgora_BluGreen/agoratemplate.css" media="screen">
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-~;
-$sc_secure_standard_head_info = qq!
-!;
-$sc_doctype =  qq~<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">~;
-#:#:#: end CSSDESIGN settings
+#:#:#: start CATEGORYLIST settings
+$sc_categories_with_subcats = qq|
+&bull;<a href="agora.cgi?cart_id=%%cart_id%%&amp;product=Art&amp;xm=on" class="ac_left_links" title="Art">Art</a> <br />
+&bull;<a href="agora.cgi?cart_id=%%cart_id%%&amp;product=Books&amp;xm=on" class="ac_left_links" title="Books">Books</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?cart_id=%%cart_id%%&amp;product=Books&amp;user4=Adobe&amp;xm=on" class="ac_left_links" title="Adobe">Adobe</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?cart_id=%%cart_id%%&amp;product=Books&amp;user4=DHTML&amp;xm=on" class="ac_left_links" title="DHTML">DHTML</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?cart_id=%%cart_id%%&amp;product=Books&amp;user4=Flash&amp;xm=on" class="ac_left_links" title="Flash">Flash</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?cart_id=%%cart_id%%&amp;product=Books&amp;user4=HTML&amp;xm=on" class="ac_left_links" title="HTML">HTML</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?cart_id=%%cart_id%%&amp;product=Books&amp;user4=Linux&amp;xm=on" class="ac_left_links" title="Linux">Linux</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?cart_id=%%cart_id%%&amp;product=Books&amp;user4=Multimedia&amp;xm=on" class="ac_left_links" title="Multimedia">Multimedia</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?cart_id=%%cart_id%%&amp;product=Books&amp;user4=UNIX&amp;xm=on" class="ac_left_links" title="UNIX">UNIX</a> <br />
+&bull;<a href="agora.cgi?cart_id=%%cart_id%%&amp;product=HT2ML Books&amp;xm=on" class="ac_left_links" title="HT2ML Books">HT2ML Books</a> <br />
+&bull;<a href="agora.cgi?cart_id=%%cart_id%%&amp;product=Hands Free&amp;xm=on" class="ac_left_links" title="Hands Free">Hands Free</a> <br />
+&bull;<a href="agora.cgi?cart_id=%%cart_id%%&amp;product=Machine Tooling&amp;xm=on" class="ac_left_links" title="Machine Tooling">Machine Tooling</a> <br />
+&bull;<a href="agora.cgi?cart_id=%%cart_id%%&amp;product=Programming&amp;xm=on" class="ac_left_links" title="Programming">Programming</a> <br />|;
+$sc_categories_bots_with_subcats = qq|
+&bull;<a href="agora.cgi?product=Art&amp;xm=on" class="ac_left_links" title="Art">Art</a> <br />
+&bull;<a href="agora.cgi?product=Books&amp;xm=on" class="ac_left_links" title="Books">Books</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?product=Books&amp;user4=Adobe&amp;xm=on" class="ac_left_links" title="Adobe">Adobe</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?product=Books&amp;user4=DHTML&amp;xm=on" class="ac_left_links" title="DHTML">DHTML</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?product=Books&amp;user4=Flash&amp;xm=on" class="ac_left_links" title="Flash">Flash</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?product=Books&amp;user4=HTML&amp;xm=on" class="ac_left_links" title="HTML">HTML</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?product=Books&amp;user4=Linux&amp;xm=on" class="ac_left_links" title="Linux">Linux</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?product=Books&amp;user4=Multimedia&amp;xm=on" class="ac_left_links" title="Multimedia">Multimedia</a> <br />
+&nbsp;&nbsp; <a href="agora.cgi?product=Books&amp;user4=UNIX&amp;xm=on" class="ac_left_links" title="UNIX">UNIX</a> <br />
+&bull;<a href="agora.cgi?product=HT2ML Books&amp;xm=on" class="ac_left_links" title="HT2ML Books">HT2ML Books</a> <br />
+&bull;<a href="agora.cgi?product=Hands Free&amp;xm=on" class="ac_left_links" title="Hands Free">Hands Free</a> <br />
+&bull;<a href="agora.cgi?product=Machine Tooling&amp;xm=on" class="ac_left_links" title="Machine Tooling">Machine Tooling</a> <br />
+&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_discount_logic = ("");
 #:#:#: end DISCOUNT settings
@@ -73,6 +94,14 @@
 $sc_free_form_logic = "\# This gets executed after the agora.setup.db file is loaded
 \# by agora.cgi ... You can set \'html thingies\', load libraries, etc.
 \#
+\&add_codehook(\"process-order-pre-ship-instructions\",\"order_confirmation_changer_function\");
+
+sub order_confirmation_changer_function {
+
+\$messages{\'ordcnf_08\'} = \"AgoraCart Shopping Receipt - thank you\";
+
+ }
+
 ";
 #
 $sc_free_form_logic_too = "";
@@ -119,20 +148,25 @@
 $sc_db_max_rows_returned = "6";
 $sc_money_symbol = qq`\$`;
 $sc_money_symbol_placement = "front";
+$sc_money_symbol_spaces = "";
 $layout_store_productpage_thanks_mess = qq~Thank you, your selection has been added to your order.~;
+$sc_search_error_message = qq~I\'m sorry, no matches were found. Please try your search again.~;
 $sc_item_ordered_message = '<tr><td class="ac_add_message">Thank you, your selection has been added to your order.</td></tr>';
 $sc_show_shipping_label_box = "yes";
 $sc_totals_table_ship_label = "Shipping:";
 $sc_totals_table_disc_label = "Discount:";
 $sc_totals_table_stax_label = "Sales Tax (statehere) :";
+$sc_show_subtotal_label_box = "yes";
+$sc_totals_table_subtot_label = "Sub Total";
 $sc_totals_table_gtot_label = "Grand Total:";
 $sc_totals_table_itot_label = "Item Cost Subtotal";
 $sc_totals_table_thdr_label = "Order Totals";
 $sc_display_cartlinksite = "yes";
-$sc_display_cartlinksite_url = "www.domainnamehere.com";
-$sc_display_cartlinksite_name = "Home: domainnamehere.com";
+$sc_display_cartlinksite_url = "www.domain-here.com";
+$sc_display_cartlinksite_name = "domain-here.com";
 $sc_display_cartlinkhome = "yes";
-$sc_display_cartlinkhome_name = "Main Store Page";
+$sc_display_cartlinkhome_name = "Restart Shopping";
+$sc_footer_copyright_text = "2001-2008 by K-Factor Technologies Inc.";
 #:#:#: end LAYOUT settings
 #:#:#: start MAIN settings
 $sc_set_0077_umask = 'no';
@@ -156,10 +190,11 @@
 $sc_order_email = "[% email %]";
 $sc_first_order_email = "[% email %]";
 $sc_second_order_email = "sales\@yourdomain.com";
+$sc_use_customer_email_over_admin = "no";
 $sc_use_dynamic_email_subjects = "no";
 $sc_store_url = "[% url_to_install %]agora.cgi";
-$sc_ssl_location_url2 = "https://secure.domainnamehere.net/store5/agora.cgi";
-$sc_stepone_order_script_url = "https://secure.domainnamehere.net/store5/agora.cgi";
+$sc_ssl_location_url2 = "https://secure.domain-here.net/store52/agora.cgi";
+$sc_stepone_order_script_url = "https://secure.domain-here.net/store52/agora.cgi";
 $sc_admin_email = "[% email %]";
 $sc_domain_name_for_cookie = "[% installed_on_domain %]";
 $sc_path_for_cookie = "/[% installpath %]";
@@ -176,6 +211,25 @@
 $sc_running_an_SSI_store = 'no';
 $sc_use_meta_cookies = 'no';
 $sc_debug_mode = "no";
+$sc_headerTemplateName = "TheAgora/TheAgora_BluGreen";
+$sc_headerTemplateRoot = "TheAgora";
+$sc_buttonSetName = "TheAgora_BluGreen";
+$sc_buttonSetURL = "html/images/buttonsets/TheAgora_BluGreen";
+$sc_displayDynamicCategories = "yes";
+$sc_headerStoreTitle = "Powered by AgoraCart version 5.2.000";
+$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";
+$sc_secure_store_header_file = "./html/html-templates/templates/TheAgora/secure_store_header.html";
+$sc_secure_store_footer_file = "./html/html-templates/templates/TheAgora/secure_store_footer.html";
+$sc_standard_head_info = qq|<link rel="stylesheet" type="text/css" href="agorastyles.css" media="screen">
+<link rel="stylesheet" type="text/css" href="html/html-templates/templates/TheAgora/TheAgora_BluGreen/agoratemplate.css" media="screen">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+|;
+$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_domain_name_for_cookie = "$ENV{'SERVER_NAME'}";
 $sc_my_script_name = "$ENV{'SCRIPT_NAME'}";
@@ -225,7 +279,7 @@
 #:#:#: start PGP settings
 $sc_use_pgp = "[% use_pgp %]";
 $sc_pgp_change_newline = "";
-$sc_pgp_or_gpg = "PGP";
+$sc_pgp_or_gpg = "GPG";
 $sc_pgp_or_gpg_path = "[% pgp_path %]";
 $sc_pgp_order_email = "[% email %]";
 #:#:#: end PGP settings
@@ -284,18 +338,5 @@
 $sc_extra_tax2_logic = qq``;
 $sc_extra_tax3_logic = qq``;
 #:#:#: end TAX settings
-#:#:#: start TEMPLATE settings
-$sc_headerTemplateName = "TheAgora/TheAgora_BluGreen";
-$sc_headerTemplateRoot = "TheAgora";
-$sc_buttonSetName = "TheAgora_BluGreen";
-$sc_buttonSetURL = "html/images/buttonsets/TheAgora_BluGreen";
-$sc_displayDynamicCategories = "yes";
-$sc_headerStoreTitle = "Powered by AgoraCart version 5.0.000";
-$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";
-$sc_secure_store_header_file = "./html/html-templates/templates/TheAgora/secure_store_header.html";
-$sc_secure_store_footer_file = "./html/html-templates/templates/TheAgora/secure_store_footer.html";
-#:#:#: end TEMPLATE settings
 #
 1;
diff -aruN 5.0.000.src/admin_files/mgrinvoiceTemplate.html 5.2.000.src/admin_files/mgrinvoiceTemplate.html
--- 5.0.000.src/admin_files/mgrinvoiceTemplate.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/admin_files/mgrinvoiceTemplate.html	2008-01-14 21:39:16.000000000 -0600
@@ -127,6 +127,7 @@
 <table width=80% border=0 cellpadding=0>
 <tr><td align=right><font face=arial size=1>Order Subtotal:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%subTotal%%</font></td></tr>
 <tr><td align=right><font face=arial size=1>Discounts Given:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%discounts%%</font></td></tr>
+<tr><td align=right><font face=arial size=1>buySAFE Bond Fee:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%buysafecost%%</font></td></tr>
 <tr><td align=right><font face=arial size=1>Sales Tax:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%salesTax%%</font></td></tr>
 <tr><td align=right><font face=arial size=1>Tax 1:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%tax1%%</font></td></tr>
 <tr><td align=right><font face=arial size=1>Tax 2:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%tax2%%</font></td></tr>
diff -aruN 5.0.000.src/admin_files/Offline-user_lib.pl 5.2.000.src/admin_files/Offline-user_lib.pl
--- 5.0.000.src/admin_files/Offline-user_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/admin_files/Offline-user_lib.pl	2008-01-14 21:40:27.000000000 -0600
@@ -1,4 +1,4 @@
-$sc_order_script_url = "https://secure.somesitename.net/~username/storepro5rc1/agora.cgi";
+$sc_order_script_url = "https://secure.somesitename.net/~username/store52/agora.cgi";
 $sc_Offline_CC_validation = "no";
 $sc_allow_pay_by_check = "no";
 $sc_allow_pay_by_mailedcheck = "yes";
@@ -7,14 +7,14 @@
 $sc_take_discover = "yes";
 $sc_take_amex = "no";
 $sc_Offline_show_table = "yes";
-$sc_tos_display_address = qq'K-Factor Tech<br>
+$sc_tos_display_address = qq'K-Factor Techologies<br>
 1234 N. YukaTan<br>
-Blahblah, NV, 1234<br>
+Blahblah, NV, 12345<br>
 USA';
 $sc_mailedfunds_address = qq'Mail your payment to:<br>
-K-Factor Tech<br>
+K-Factor Technologies<br>
 1234 N. YukaTan<br>
-Blahblah, NV, 1234<br>
+Blahblah, NV, 12345<br>
 USA';
 $sc_offline_top_message = qq'';
 $sc_offline_shipping_message = qq'';
diff -aruN 5.0.000.src/admin_files/PayPalIPN-user_lib.pl 5.2.000.src/admin_files/PayPalIPN-user_lib.pl
--- 5.0.000.src/admin_files/PayPalIPN-user_lib.pl	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/admin_files/PayPalIPN-user_lib.pl	2007-11-12 19:37:47.000000000 -0600
@@ -0,0 +1,22 @@
+$IPN_order_script_url = "https://www.paypal.com/cgi-bin/webscr";
+$sc_order_notify_url = "http://www.domain.com/cgi-bin/store/agora.cgi";
+$sc_order_return_url = "http://www.domain.com/cgi-bin/store/agora.cgi";
+$sc_paypal_cancel_return = "";
+$sc_paypal_header_image = "";
+$currency_id = "USD";
+$sc_PayPalIPN_show_table = "yes";
+$sc_PayPalIPN_top_message = qq'Enter top message here or leave blank';
+$sc_PayPalIPN_shipping_message = qq'Enter shipping message here or leave blank';
+$sc_PayPalIPN_special_message = qq'Enter special message here or leave blank';
+$sc_PayPalIPN_order_name = qq'PayPalIPN AgoraCart Purchase, INV# $sc_verify_inv_no';
+$sc_display_checkout_tos = "no";
+$sc_tos_display_address = qq'AgoraCart<br>
+123 Main<br>
+Salt Lick City, UT 88888<br>
+123-456-7890';
+$order_ok_final_msg_tbl = qq'';
+$sc_paypal_return_button_text = qq'';
+$messages{'paypalipn_echeck'} = qq~~;
+$messages{'paypalipn_pending'} = qq~~;
+$messages{'paypalipn_denied'} = qq~~;
+1;
diff -aruN 5.0.000.src/admin_files/PayPal-user_lib.pl 5.2.000.src/admin_files/PayPal-user_lib.pl
--- 5.0.000.src/admin_files/PayPal-user_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/admin_files/PayPal-user_lib.pl	2007-05-17 01:36:33.000000000 -0500
@@ -1,5 +1,5 @@
 $sc_gateway_username = 'user@domain.com';
-$sc_button_image_URL = "http://images.paypal.com/images/x-click-but6.gif";
+$sc_button_image_URL = "https://images.paypal.com/images/x-click-but6.gif";
 $sc_paypal_change = "agora.cgi?secpicserve=make_changes.gif";
 $sc_order_script_url = "https://www.paypal.com/xclick/business";
 $sc_paypal_order_name = 'PayPal AgoraCart Purchase, INV# ';
@@ -15,7 +15,7 @@
 $sc_display_checkout_tos = qq'no';
 $sc_tos_display_address = qq'AgoraCart<br>
 123 Main<br>
-Salt Lake City, UT 88888<br>
+Salt Lick City, UT 88888<br>
 123-456-7890';
 $order_ok_final_msg_tbl = qq'';
 #
diff -aruN 5.0.000.src/agora.cgi 5.2.000.src/agora.cgi
--- 5.0.000.src/agora.cgi	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/agora.cgi	2008-01-21 22:22:39.000000000 -0600
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -T
 
-$versions{'agora.cgi'} = "5.0.000";
+$versions{'agora.cgi'} = "5.2.000";
 
 # Version history is available at... 
 # http://www.agoracart.com/
@@ -10,9 +10,10 @@
 # made independently by Carey Internet Services before splitting 
 # off and becoming this package known as Agora.cgi, now known as
 # AgoraCart since August 2002.
-# The package distributed here is Copyright 2001 to Present by K-Factor
-# Technologies, Inc. at AgoraCart.com with additional Copyrights 1999-2001
-# by Steven P. Kneizys and is distributed free of charge
+# The package distributed here is Copyright 2001 to Present by
+# K-Factor Technologies, Inc. at AgoraCart.com / K-Factor.net
+# with additional Copyrights 1999-2001 by Steven P. Kneizys and 
+# Copyrights 2000-2007 by C. Edward Mayo and is distributed free of charge
 # consistent with the GNU General Public License Version 2
 # dated June 1991.
 #
@@ -47,12 +48,17 @@
 
 $time = time;
 $main_program_running = "yes";
+$sc_global_bot_tracker = '';
 &require_supporting_libraries (__FILE__, __LINE__,
     "./admin_files/agora_user_lib.pl",
     "./library/MD5.pl",
     "./library/cgi-lib.pl",
     "./library/agora_html_lib.pl");  # added by Mister Ed for mySQL testing.  fixes other thingies too.
+
+$sc_special_checkout_variable2 = ""; #reserved
+
 &read_and_parse_form_data;
+&xss_killer; # added by Mister Ed - December 12, 2006
 &require_supporting_libraries (__FILE__, __LINE__,
     "./library/agora.setup.db");
 &codehook("after_loading_setup_db");
@@ -66,7 +72,6 @@
 
 # added by Mister Ed July 11, 2006
 $sc_special_checkout_variable1 = ''; # reserved, do not use if using random key generation
-$sc_special_checkout_variable2 = '';
 $sc_special_checkout_variable3 = '';
 $sc_special_misc_variable1 = '';
 $sc_special_misc_variable2 = '';
@@ -415,7 +420,11 @@
  &codehook("alias_and_override_top");
 &special_security_f3_01172004;
 
-if (($sc_gateway_name ne "iTransact") && ($sc_gateway_name ne "AgoraPay") && ($sc_gateway_name ne "NiftyPay")) {
+ if ((
+ ((($form_data{'NiftyPay'} eq '')&&($sc_gateway_name eq "NiftyPay"))||(($form_data{'AgoraPay'} eq '')&&($sc_gateway_name eq "AgoraPay"))
+ ||(($form_data{'iTransact'} eq '')&&($sc_gateway_name eq "iTransact")))
+ ||(($sc_gateway_name ne "iTransact")&&($sc_gateway_name ne "AgoraPay")&&($sc_gateway_name ne "NiftyPay"))
+ )) {
  &special_security_f1_01242002;}
  
  if (defined($form_data{'versions'})) {
@@ -739,66 +748,6 @@
  return $field;
 }
 #######################################################################
-    # delete_old_carts is a subroutine which is used to prune
-    # the carts directory, cleaning out all the old carts
-    # after some time interval defined in the setup file.  It
-    # takes no argumnetes and is called with the following
-    # syntax:
-    #
-    # &delete_old_carts;
-
-sub check_cart_expiry {
-  &check_cart_type_file_expiry("$sc_cart_path");
-  &check_cart_type_file_expiry("$sc_verify_order_path");
-  &check_cart_type_file_expiry("$sc_server_cookie_path");
- }
-
-sub check_cart_type_file_expiry {
-local($cart_type_file_path) = @_;
-if (-M "$cart_type_file_path" > $sc_number_days_keep_old_carts)
-{
-if ($cart_type_file_path =~ /cart/i) {
-  &codehook("delete-cart");
- } else {
-  &codehook("delete-non-cart");
- }
-unlink("$cart_type_file_path");
-}
-}
-
-sub delete_old_carts
-{
-
-    # The subroutine begins by grabbing a listing of all of
-    # the client created shoppping carts in the User_carts
-    # directory.
-    #
-    # It then opens the directory and reads the contents using
-    # grep to grab every file with the extension _cart. Then
-    # it closes the directory.  
-    #
-    # If the script has any trouble opening the directory,
-    # it will output an error message using the
-    # file_open_error subroutine discussed later.  To the
-    # subroutine, it will pass the name of the file which had
-    # trouble, as well as the current routine in the script
-    # having trouble , the filename and the current line
-    # number.
-
-opendir (USER_CARTS, "$sc_user_carts_directory_path") || &file_open_error("$sc_user_carts_directory_path", "Delete Old Carts", __FILE__, __LINE__);
-@carts = grep(/\.[0-9]/,readdir(USER_CARTS)); # must have . followed by digits
-closedir (USER_CARTS);
-foreach $cart (@carts)
-{
-$sc_cart_path = "$sc_user_carts_directory_path/$cart";
-$sc_cart_path =~ /([\w\-\=\+\/\.]+)/;
-$sc_cart_path = "$1";
-$sc_cart_path = "" if ($sc_cart_path eq ".");
-$sc_cart_path =~ s/^\/+//; # Get rid of any residual / prefix
-&check_cart_type_file_expiry("$sc_cart_path");
-}
-}
-#######################################################################
     # assign_a_unique_shopping_cart_id is a subroutine used to
     # assign a unique cart id to every new clinet.  It takes
     # no argumnets and is called with the following syntax:
@@ -963,6 +912,9 @@
 }
 ($body_html,$prod_message,$status,$total_row_count) = 
   &create_html_page_from_db_body;
+# new code hook added by Mister Ed October 19, 2006
+# allows changes to page titles or other info just before page display
+&codehook("create_html_page_from_db_hook");
 &product_page_header($sc_product_display_title,$prod_message);
 print $body_html;
 &product_page_footer($prod_message);
@@ -1035,11 +987,10 @@
 close (OPTION_FILE);
 }
 $field = &agorascript($field,"pre","$option_location",__FILE__,__LINE__);
-$cart_id_for_html = &cart_id_for_html;
 $field =~ s/%%PRODUCT_ID%%/$database_fields[$sc_db_index_of_product_id]/g;
 $field =~ s/%%PRODUCTID%%/$database_fields[$sc_db_index_of_product_id]/g;
 $field =~ s/%%URLofImages%%/$URL_of_images_directory/g;
-$field =~ s/%%cart_id%%/$cart_id_for_html/g;
+$field =~ s/%%cart_id%%/$cart_id/g;
 $field = &agorascript($field,"post","$option_location",__FILE__,__LINE__);
 ($very_first_part,$field,$junk) = 
   split(/<h3>--cut here--<\/h3>/i,$field,3);
@@ -1081,13 +1032,17 @@
 
 sub file_open_error {
 local ($bad_file,$script_section,$this_file,$line_number) = @_;
+local ($bad_file,$script_section,$this_file,$line_number) = @_;
+
+if ($sc_global_bot_tracker ne "1") { # run only if not a bot
 &update_error_log("FILE OPEN ERROR-$bad_file", $this_file, $line_number);
 open(ERROR, $error_page);
 while (<ERROR>)
 {  
 print $_;
 }
- close (ERROR);
+close (ERROR);
+}  # close of run only if not a bot
 }
 #######################################################################
     # display_page is used to filter HTML pages through the
@@ -1173,11 +1128,16 @@
  }
 $the_file = &agorascript($the_file,"pre","$page",__FILE__,__LINE__);
 $the_file =~ s/%%item_ordered_msg%%/$item_ordered_message/ig;
-$the_file =~ s/%%CartID%%/%%cart_id%%/g;
-$the_file =~ s/%%cartID%%/%%cart_id%%/ig;
+if ($sc_global_bot_tracker eq "1") {
+$the_file =~ s/cart_id=%%cart_id%%/cart_id=/g;
+$the_file =~ s/cart_id=//g;
+$the_file =~ s/%%cart_id%%//g;
+}
+else {
 $the_file =~ s/cart_id=%%cart_id%%/cart_id=/ig;
 $the_file =~ s/cart_id=/cart_id=$cart_id_for_html/ig;
 $the_file =~ s/%%cart_id%%/$cart_id_for_html/ig;
+}
 $the_file =~ s/%%page%%/$form_data{'page'}/ig;
 $the_file =~ s/%%cartlink%%/$form_data{'cartlink'}/ig;
 $the_file =~ s/%%date%%/$date/ig;
@@ -1207,10 +1167,12 @@
   if ($@ ne ""){ $myans = "%% Eval Error on: $arg %%";}
   $the_file =~ s/(%%eval)([^%]+)(%%)/$myans/i;
 }
+if ($sc_global_bot_tracker ne "1") {
 while ($the_file =~ /%%ZZZ%%/) {
-  $cart_id_for_html = &cart_id_for_html;
+  $cart_id_for_html = $cart_id;
   $the_file =~ s/%%ZZZ%%/$cart_id_for_html/;
 }
+}
 $the_file = &agorascript($the_file,"post","$page",__FILE__,__LINE__);
 $the_file = &agorascript($the_file,"","$page",__FILE__,__LINE__);
 while ($the_file =~ /%%StoreHeader%%/i) {
@@ -1564,8 +1526,7 @@
  $sc_capture_path = "$base${cart_id}_CAPTURE";
  $sc_server_cookie_path = "$base${cart_id}_COOKIES";
  $sc_verify_order_path  = "$base${cart_id}_VERIFY";
- $cart_id_for_html  = "$cart_id*" . &make_random_chars; 
- &check_cart_expiry;
+ $cart_id_for_html  = "$cart_id"; 
  &load_server_side_cookies;
  $sc_test_repeat = 0;
  $raw_text = &get_agora('TRANSACTIONS');
@@ -1597,20 +1558,12 @@
      use HTTP::BrowserDetect;
      my $browser = new HTTP::BrowserDetect($ENV{"HTTP_USER_AGENT"});
      ~;
-  if ($agora{'HTTP_USER_AGENT'} ne $ENV{'HTTP_USER_AGENT'})  { 
+  if (($agora{'HTTP_USER_AGENT'} ne $ENV{'HTTP_USER_AGENT'}) || ($agora{'BUYSAFE_ORDER_COMPLETED'} eq 'yes'))  { 
 &assign_a_unique_shopping_cart_id;
   }
  return;
 }
 #######################################################################
-sub cart_id_for_html{ # nice and simple ... append random chars as tag
- if ($sc_running_an_SSI_store =~ /yes/i) {
-   return "$cart_id";
-  } else {
-   return "$cart_id*" . &make_random_chars;
-  }
-}
-#######################################################################
 sub zcode_error {
   local ($ZCODE,$at,$file,$line)=@_;
   local ($xx)="-" x 60;
@@ -1669,11 +1622,11 @@
      use HTTP::BrowserDetect;
      my $browser = new HTTP::BrowserDetect($ENV{"HTTP_USER_AGENT"});
      if ($browser->robot()) {
+         $cart_id = ""; #$cart_id = "9999999.99999";
+         $form_data{'cart_id'} = ""; #$form_data{'cart_id'} = "9999999.99999";
+         $cookie{'cart_id'} = ""; #$cookie{'cart_id'} = "9999999.99999";
          &set_agora("BOT",1);
-         $cart_id = "9999999.99999";
-         $form_data{'cart_id'} = "9999999.99999";
-         $cookie{'cart_id'} = "9999999.99999";
-         &set_agora("BOT",1);
+         $sc_global_bot_tracker = '1';
          &set_agora("BROWSER",$browser->browser_string().'/'.$browser->version());
      }
      ~;
@@ -1682,9 +1635,10 @@
 #reduces inheritances in sharing URLs with Cart IDs
 #resolves 95% or so of the problems.  IF same exact browser and configs, then can be seen/shared possibly
 
+if ($sc_global_bot_tracker ne "1") { # run only if not a bot
+
 if ($cookie{'cart_id'} eq "" && $form_data{'cart_id'} eq "") {
 # new visitor
-  &delete_old_carts;
   &assign_a_unique_shopping_cart_id;
   $cart_id_history .= "set new cart value "; #for debugging of course
   &codehook("got_a_new_cart");
@@ -1700,14 +1654,25 @@
     &check_server_cookies_first;
    } else { # fail safe
     $cart_id = $form_data{'cart_id'};
-    $cart_id_history .= "set from form data ";
+    $cart_id_history .= "set from form data "; #for debugging of course
     &set_sc_cart_path;
    }
  }
+ } # end of if not a bot
+
+if ($sc_buySafe_is_enabled =~ /yes/) {
+    my $temp_buysafe_check = &get_agora('BUYSAFE_ORDER_COMPLETED');
+    if ($temp_buysafe_check eq 'yes') {
+        &assign_a_unique_shopping_cart_id;
+    }
+}
+
 &pre_header_navigation;
 print $sc_cookie_information;
 print $sc_browser_header;
 $sc_header_printed = 1;
+
+#print "cart_id: $cart_id $cart_id_for_html $cart_id_history<br>\n";# debugging
 $are_any_query_fields_filled_in = "no";
 }
 #######################################################################
@@ -1723,6 +1688,7 @@
 # Cart Links Sub Routine
 #
 # cartlinks added by Mister Ed of AgoraCart.com 09/2002
+# edited by Mister Ed of AgoraCart.com 09/2007
 #
 # cart link routine reads all thew .htm and .html files in the store's html sub directory.
 # Agora Script is then placed on files such as static pages, headers, footers, etc that
@@ -1740,21 +1706,28 @@
 
 sub cartlinks
 {
+if ($cartlinks eq '') {
   $cartlinks = "<ul>\n";
   
   # do we want to display a link to the Site's page?
   if ($sc_display_cartlinksite =~ /yes/i) {
     $cartlinks .= "<li><a class=\"ac_cart_info_links\" href=\"";
     if ($sc_display_cartlinksite_url =~ /http/i) {
-      $cartlinks .= "$sc_display_cartlinksite_url";
+       $cartlinks .= qq|$sc_display_cartlinksite_url|;
     } else {
-      $cartlinks .= "http://$sc_display_cartlinksite_url";
+       $cartlinks .= qq|http://$sc_display_cartlinksite_url|;
     }
-    $cartlinks .= "\" title=\"$sc_display_cartlinksite_name\">$sc_display_cartlinksite_name</a></li>\n";
+       $cartlinks .= qq|" title="$sc_display_cartlinksite_name">$sc_display_cartlinksite_name</a></li>\n|;
   }
-    # do we want to display a link to the main store page?
+  
+  # do we want to display a link to the main store page?
   if ($sc_display_cartlinkhome =~ /yes/i) {
-    $cartlinks .= "<li><a class=\"ac_cart_info_links\" href=\"$sc_store_url?cart_id=$cart_id\" title=\"$sc_display_cartlinkhome_name\">$sc_display_cartlinkhome_name</a></li>\n";
+    if ($sc_global_bot_tracker ne '1') {
+       $cartlinks .= qq|<li><a class="ac_cart_info_links" href="$sc_store_url?cart_id=%%cart_id%%" title="$sc_display_cartlinkhome_name">$sc_display_cartlinkhome_name</a></li>\n|;
+    }
+    else {
+       $cartlinks .= qq|<li><a class="ac_cart_info_links" href="$sc_store_url" title="$sc_display_cartlinkhome_name">$sc_display_cartlinkhome_name</a></li>\n|;
+    }
   }
   opendir(PAGES,"./html")||die("Cannot open Directory!");
   @clinknames = readdir(PAGES);
@@ -1765,15 +1738,72 @@
     $clinkname =~ s/-/ /ig;
     if ($page2_extension eq "htm" or $page2_extension eq "html") {
       if ($clinkname && $clinkname ne "" && $clinkname ne "index" && $clinkname ne "error" && $clinkname ne "frontpage") {
-        $cartlinks .= "<li><a class=\"ac_cart_info_links\" href=\"$sc_store_url?cartlink=$clinknames&amp;cart_id=$cart_id\" title=\"$clinkname\">$clinkname</a></li>\n";
+         if ($sc_global_bot_tracker ne '1') {
+           $cartlinks .= qq|<li><a class="ac_cart_info_links" href="$sc_store_url?cartlink=$clinknames&amp;cart_id=%%cart_id%%" 
+title="$clinkname">$clinkname</a></li>\n|;
+         }
+         else {
+           $cartlinks .= qq|<li><a class="ac_cart_info_links" href="$sc_store_url?cartlink=$clinknames" title="$clinkname">$clinkname</a></li>\n|;
+         }
+        
       }
     }
   }
-  &codehook("cartlinks_bottom");
   $cartlinks .= "</ul>";
   close (PAGES);
+}
+
+  &codehook("cartlinks_bottom");
 
 }
+########################################################################
+# For XSS cleanup purposes.  XSS doesn't get in anyways, but cleans up any
+# residual code thingies.  PERL taint and special security routines already block
+# XSS stuff.  Added by Mister Ed at K-Factor Technologies, Inc. on Dec 12, 2006
+########################################################################
+sub xss_FormData_cleaner {
+my $temp = '';
+  codehook("xss_FormData_cleaner_top");
+  for $xx (keys %form_data) { 
+    $temp = $form_data{$xx};
+    if ($form_data{$xx} ne '') {
+    if (($temp =~ /((<)(script|object|java|vbscript|img|embed|iframe|frameset))/i) || ($temp =~ /script>|src=|\.js|\.cgi|\.pl|document\.|vbscript|\.cookie|\.jsp|\.asp|\.php|javascript|eval\(|\`/i)) {
+        if (($xx eq "cart_id") || ($xx eq "page")) {
+            $form_data{$xx} = '';
+        } else {
+            delete($form_data{$xx});
+        }
+    } else {
+    $temp =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($temp))/ge;
+    
+    # debuging purposes
+    # print "Content-type: text/html\n\n <br> $temp - $xx - $form_data{$xx}<br>";
+    # <script>alert('Test')</script>
+    # code below finds tags: <code> or </code> in either hex or alpha - not used currently
+    #if ((($temp =~ /((\%3C)|<)((\%2F)|\/)*[a-z0-9\%]+((\%3E)|>)/ix) {
+
+    if (($temp =~ /((<)(script|object|java|vbscript|img|embed|iframe|frameset))/i) || ($temp =~ /script|src=|\.js|\.cgi|\.pl|vbscript|document\.|\.cookie|\.jsp|\.asp|\.php|\.css|javascript|java|eval\(|\`/i)) {
+        if (($xx eq "cart_id") || ($xx eq "page")) {
+            $form_data{$xx} = '';
+        } else {
+            delete($form_data{$xx});
+        }
+    }
+   }
+   }
+ }
+}
+############
+sub xss_killer {
+my $temp = '';
+  codehook("xss_killer_top");
+ for $xx (keys %form_data) { 
+    $temp =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($form_data{$xx}))/ge;
+    if ((($temp =~ /((<)(script|object|java|vbscript|img|embed|iframe|frameset))/i) || ($temp =~ /script|src=|\.js|\.cgi|\.pl|document\.|\.cookie|\.jsp|\.asp|\.php|\.css|javascript|java|vbscript/i))  && ($xx ne "cart_id")) {
+      delete($form_data{$xx});
+    }
+ }
+}
 #######################################################################
 sub call_exit {
 &require_supporting_libraries(__FILE__,__LINE__,"./library/agora_html_lib.pl");
diff -aruN 5.0.000.src/agorastyles.css 5.2.000.src/agorastyles.css
--- 5.0.000.src/agorastyles.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/agorastyles.css	2007-06-14 21:25:39.000000000 -0500
@@ -275,27 +275,28 @@
 }
 /* ~~~~~~ View Cart Table ~~~~~~*/
 table.ac_cart_table{
-  background-color: #AAAAAA;  /* this color ends up being the border color for the table */
+  background-color: #2A6D60;  /* this color ends up being the border color for the table */
   width: 90%;
   margin:0px;
   margin-left: auto;
   margin-right: auto;
   margin-top: 20px;
   margin-bottom: 20px;
-  color: #000000;
+  color: #FFFFFF;
   font-family: Arial, Helvetica, sans-serif;
   font-size : 10pt;
   text-align: center;
 }
 table.ac_cart_table th{
   font-size : 11pt;
-  background-color: #FFE0E0;
+  background-color: #1B433A;
   margin:0px;
   width: auto;
   vertical-align : top;
 }
 table.ac_cart_table td{
-  background-color: #E8FFF8;
+  background-color: #FFFFFF;
+  color: #000000;
   border: 0px;
   width: auto;
 }
@@ -318,6 +319,13 @@
   width:auto;
   text-align: right;
 }
+.buysafe {
+    text-align:center;
+	font-family: Geneva, Arial, Helvetica, sans-serif;
+    font-size: 9pt;
+	font-weight: normal;
+	color: #FF0000;
+}
 /* ~~~~~~ Check Out Pages ~~~~~~ */
 .ac_checkout{
   margin: 10px auto;
diff -aruN 5.0.000.src/data_files/data.old_demo 5.2.000.src/data_files/data.old_demo
--- 5.0.000.src/data_files/data.old_demo	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/data_files/data.old_demo	2006-02-02 18:23:55.000000000 -0600
@@ -0,0 +1,20 @@
+00001|PERL|23.96|Learning Perl|<img src="%%URLofImages%%/0001.gif" alt="0001.gif">|In this smooth, carefully paced course, a leading Perl trainer teaches you to program in the language that threatens to make C, sed, awk, and the Unix shell obsolete for many tasks. This book is the "official" guide for both formal (classroom) and informal learning. It is fully accessible to the novice programmer. <a href="http://www.amazon.com/exec/obidos/ASIN/1565922840/dial411com">Learn More</a>|4.95|%%IMG%%sm_0001.gif||0|sub 2::sub 3||%%OPTION%%blank.html
+00002|PERL|35.96|Programming Perl (2nd Edition)|<img src="%%URLofImages%%/0002.gif" alt="0002.gif">|Programming Perl, 2nd Edition, is the authoritative guide to Perl version 5, the scripting utility that has established itself as the programming tool of choice for the World Wide Web, UNIX system administration, and a vast range of other applications. Version 5 of Perl includes object oriented programming facilities. The book is coauthored by Larry Wall, the creator of Perl. <a href="http://www.amazon.com/exec/obidos/ASIN/1565921496/dial411com">Learn More</a>|4.95|%%IMG%%sm_0002.gif|||sub 2||%%OPTION%%blank.html
+00003|PERL|31.96|Perl Cookbook|<img src="%%URLofImages%%/0003.gif" alt="0003.gif">|The Perl Cookbook is a comprehensive collection of problems, solutions, and practical examples for anyone programming in Perl. Topics range from beginner questions to techniques that even the most experienced Perl programmers can learn from. More than just a collection of tips and tricks, the Perl Cookbook is the long-awaited companion volume to Programming Perl, filled with previously unpublished Perl arcana. <a href="http://www.amazon.com/exec/obidos/ASIN/1565922433/dial411com">Learn More</a>|4.95|%%IMG%%sm_0003.gif|yes||sub 2::sub 3::sub4::sub5||%%OPTION%%blank.html
+00004|PERL|15.19|Perl and CGI for the World Wide Web|<img src="%%URLofImages%%/0004.gif" alt="0004.gif">|Included on most UNIX platforms and available free of charge for Windows and Macintosh, Perl lets you place forms on your Web site   that collect and process user input such as product orders and comments, enable visitors to conduct keyword searches for information on your site, and integrate a database into your site, among many other capabilities. Perl and CGI for the... <a href="http://www.amazon.com/exec/obidos/ASIN/020135358X/dial411com">Learn More</a>|4.95|%%IMG%%sm_0004.gif|||||%%OPTION%%blank.html
+00005|PERL|27.96|Mastering Regular Expressions|<img src="%%URLofImages%%/0005.gif" alt="0005.gif">|Regular expressions is a powerful tool for manipulating text and data. In this book, the author leads you through the steps of crafting a regular expression that gets the job done. He examines a variety of tools and uses them in an extensive array of examples, dedicating an entire chapter to Perl. <a href="http://www.amazon.com/exec/obidos/ASIN/1565922573/dial411com">Learn More</a>|4.95|%%IMG%%sm_0005.gif||0|||%%OPTION%%blank.html
+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. <a  href="http://www.amazon.com/exec/obidos/ASIN/1565924924/dial411com">Learn More</a>|4.95|%%IMG%%sm_0006.gif|test.gif|20|subcat 1::subcat99|84567|%%OPTION%%blank.html
+00007|HTML|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. <a href="http://www.amazon.com/exec/obidos/ASIN/1565924940/dial411com">Learn More</a> $23.00 @ # " ? + $ '&*|4.95|%%img%%sm_0007.gif||77|html subcat|92345|%%OPTION%%var_opt.html
+00008|HTML|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...<a href="http://www.amazon.com/exec/obidos/ASIN/0764533223/dial411com">Learn More</a>|4.95|%%IMG%%sm_0008.gif||||92345|%%OPTION%%gift_option.html
+00009|HTML|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. <a href="http://www.amazon.com/exec/obidos/ASIN/0764532367/dial411com">Learn More</a>|4.95|%%IMG%%sm_0009.gif||0|||%%OPTION%%blank.html
+00010|HTML|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. <a href="http://www.amazon.com/exec/obidos/ASIN/0789718235/dial411com">Learn More</a>|4.95|%%img%%sm_0010.gif|||||||||||||||%%OPTION%%gift_option.html
+00011|MULTIMEDIA|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... <a href="http://www.amazon.com/exec/obidos/ASIN/020135473X/dial411com">Learn More</a>|4.95|%%IMG%%sm_0011.gif||34|||%%OPTION%%blank.html
+00012|MULTIMEDIA|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. <a href="http://www.amazon.com/exec/obidos/ASIN/0201354705/dial411com">Learn More</a>|4.95|%%IMG%%sm_0012.gif||0|||%%OPTION%%blank.html
+00013|MULTIMEDIA|39.99|Director 7 Demystified|<img src="%%URLofImages%%/0013.gif" alt="0013.gif">|Macromedia Director is the #1 platform for creating interactive multimedia. Its power and versatility are unmatched, allowing users to merge text, graphics, animation, video, and sounds to create exciting, interactive desktop movies for use in   presentations, CD-ROMs, and the Web. <a href="http://www.amazon.com/exec/obidos/ASIN/0201354454/dial411com">Learn More</a>|4.95|%%IMG%%sm_0013.gif||87|||%%OPTION%%blank.html
+00014|MULTIMEDIA|20.99|Essential Flash 4|<IMG SRC="%%URLofImages%%/0014.gif" BORDER=0>|With Flash 4's slick, fast-loading vector graphics and animation, you can transcend the limits of HTML, building sites as hot as your imagination! Now, learn Flash 4 in a flash from a professional Web designer-through real-world projects you can view live on a linked website. <a href="http://www.amazon.com/exec/obidos/ASIN/0130143278/dial411com">Learn More</a>|4.95|%%IMG%%sm_0014.gif||-5|||||||||||||%%OPTION%%gift_option.html
+00015|MULTIMEDIA|27.99|Animation on the Web|<IMG SRC="%%URLofImages%%/0015.gif" BORDER=0>|As the Web evolves from a static publishing medium to one based more on active media and interactivity, animation is becoming a critical component of Web site design. The demand for animation on Web sites is skyrocketing. That's where Animation on the Web comes in: a thorough guide to everything having to do with Web animation. <a href="http://www.amazon.com/exec/obidos/ASIN/0201696878/dial411com">Learn More</a>|4.95|%%IMG%%sm_0015.gif"|||||||||||||||%%OPTION%%gift_option.html
+00016|testing this site|19.96|Unix in a Nutshell|<img src="%%URLofImages%%/0016.gif" alt="0016.gif">|You may have seen UNIX quick reference guides, but you've never seen anything like UNIX in a Nutshell. Not a scaled-down quick reference of common commands, UNIX in a Nutshell is a complete reference containing all commands and options, along with generous descriptions and examples that put the commands in context. <a href="http://www.amazon.com/exec/obidos/ASIN/1565920015/dial411com">Learn More</a>|4.95|%%IMG%%sm_0016.gif||53|||%%OPTION%%blank.html
+00017|testing other site|47.96|Unix Power Tools|<img src="%%URLofImages%%/0017.gif" alt="0017.gif">|Loaded with even more practical advice about almost every aspect of UNIX, this new second edition of "UNIX Power Tools" addresses the technology that UNIX users face today. You'll find increased coverage of POSIX utilities, including GNU versions, greater "bash" and "tcsh" shell coverage, more emphasis on Perl, and a CD-ROM that contains some of the best freeware available. <a href="http://www.amazon.com/exec/obidos/ASIN/1565922603/dial411com">Learn More</a>|4.95|%%IMG%%sm_0017.gif|||||%%OPTION%%var_opt_wild2.html
+00018|UNIX|15.99|Unix for Dummies|<img src="%%URLofImages%%/0018.gif" alt="0018.gif">|UNIX continues to be one of the strongest server systems available for enterprises that need a highly scalable system. With this revision, readers can find out about the latest UNIX operating systems, including UNIXWare 7 and Solaris 2.7. <a href="http://www.amazon.com/exec/obidos/ASIN/0764504193/dial411com">Learn More</a>|4.95|%%IMG%%sm_0018.gif||0|||%%OPTION%%blank.html
+00019|UNIX|15.99|Linux Complete|<img src="%%URLofImages%%/0019.gif" alt="0019.gif">|Everything you ever wanted to know about making Linux jump through hoops but felt too intimidated to ask. Coverage includes installation, device configuration, local area networking, dial-up networking with PPP, IP masquerading, DHCP setup, and IP chains. <a href="http://www.amazon.com/exec/obidos/ASIN/0782125670/dial411com">Learn More</a>|4.95|%%IMG%%sm_0019.gif||40|||%%OPTION%%blank.html
+00020|UNIX|27.99|Red Hat Linux 6 Unleashed|<img src="%%URLofImages%%/0020.gif" alt="0020.gif">|Red Hat Linux 6 Unleashed shows you how to install, configure, and manage version 6.0, the latest version of Red Hat operating system. Version 6.0 boasts the latest Linux kernel, a new and improved installation program, updated libraries and a host of other improvements. <a href="http://www.amazon.com/exec/obidos/ASIN/0672316897/dial411com">Learn More</a>|4.95|%%IMG%%sm_0020.gif||0|||%%OPTION%%blank.html
diff -aruN 5.0.000.src/html/forms/2checkout-orderform.html 5.2.000.src/html/forms/2checkout-orderform.html
--- 5.0.000.src/html/forms/2checkout-orderform.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/forms/2checkout-orderform.html	2007-12-19 22:50:54.000000000 -0600
@@ -9,6 +9,8 @@
 
 <h2>CART CONTENTS HERE</h2>
 
+</form><form method="post" action="agora.cgi">
+
 <div align="center">
 <table class="ac_checkout">
 <!--agorascript-pre
@@ -36,9 +38,11 @@
 <tr>
 <td class="ac_checkout_left_col">Method:</td>
 <td class="ac_checkout_right_col">
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW THIS-->
 
-<select name="Ecom_ShipTo_Method">
+
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
+<select name=Ecom_ShipTo_Method>
 <option value="$vform_Ecom_ShipTo_Method"><!--agorascript-pre
  if ("$vform_Ecom_ShipTo_Method" eq "") {
    return " Select Shipping Method ";
@@ -47,24 +51,51 @@
   }
 --></option>
 <option value="Electronic Delivery">Electronic Delivery</option>
-<option value="Local Delivery">	Local Delivery</option>
+<option value="Local Delivery">Local Delivery</option>
 <option value="Pickup">Pickup</option>
-<option value="USPS Parcel Post (Parcel)">USPS Parcel Post (5-14 days)</option>
-<option value="USPS Priority Mail (Priority)">USPS Priority Mail (3-7 days)</option>
-<option value="USPS Express Mail (Express)">USPS Express Mail (1-3 days)</option>
-<option value="USPS (Economy (Surface) Parcel Post)">Economy (Surface) Parcel Post (4-6 weeks - international)</option>
-<option value="USPS (Airmail Parcel Post)">Airmail Parcel Post (4-10 days - international)</option>
-<option value="USPS (Global Express Mail)">Global Express Mail (3-5 days - international)</option>
-<option value="USPS (Global Express Guaranteed Document Service)">Global Express Guaranteed - Non-Document (2-3 days - international)</option>
+<option value="USPS Parcel Post (Parcel)">
+USPS Parcel Post (5-14 days)</option>
+<option value="USPS Priority Mail (Priority)">
+USPS Priority Mail (3-7 days)</option>
+<option value="USPS Express Mail (Express)">
+USPS Express Mail (1-3 days)</option>
+<option value="USPS (Priority Mail International)">
+Priority Mail International (6-10 days)</option>
+<option value="USPS (Express Mail International)">
+Express Mail International (3-5 days)</option>
+<option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed (1-3 days)</option>
+<option value="UPS Ground (GND)">UPS Ground (7-10 days)</option>
+<option value="UPS Standard (STD)">UPS Standard to Canada Only (7-10 days)</option>
 <option value="UPS 3 Day Select (3DS)">UPS 3 Day Select (3-4 days)</option>
 <option value="UPS 2nd Day Air (2DA)">UPS 2nd Day Air</option>
+<option value="UPS 2nd Day Air Early AM (2DM)">UPS 2nd Day Air Early AM</option>
+<option value="UPS Next Day Saver (1DP)">UPS Next Day Air Saver</option>
 <option value="UPS Next Day Air (1DA)">UPS Next Day Air</option>
-<OPTION VALUE="UPS Ground Residential(GNDRES)">UPS Ground Residential</OPTION>
-<OPTION VALUE="UPS Ground Commercial (GNDCOM)">UPS Ground Commercial</OPTION>
+<option value="UPS Next Day Air Early AM (1DM)">UPS Next Day Air Early AM</option>
+<option value="UPS Worldwide Express (XPR)">UPS Worldwide Express (international)</option>
+<option value="UPS Worldwide Expedited (XPD)">UPS Worldwide Expedited (international)</option>
+<option value="UPS Worldwide Express Plus(XDM)">UPS Worldwide Express Plus (international)</option>
+<option value='FedEx Priority Overnight'>FedEx Priority Overnight</option>
+<option value='FedEx Standard Overnight'>FedEx Standard Overnight</option>
+<option value='FedEx First Overnight'>FedEx First Overnight</option>
+<option value='FedEx 2 Day'>FedEx 2 Day</option>
+<option value='FedEx Express Saver'>FedEx Express Saver</option>
+<option value='FedEx International Priority'>FedEx International Priority</option>
+<option value='FedEx International Economy'>FedEx International Economy</option>
+<option value='FedEx International First'>FedEx International First</option>
+<option value='FedEx 1 Day Freight'>FedEx 1 Day Freight</option>
+<option value='FedEx 2 Day Freight'>FedEx 2 Day Freight</option>
+<option value='FedEx 3 Day Freight'>FedEx 3 Day Freight</option>
+<option value='FedEx Ground'>FedEx Ground</option>
+<option value='FedEx Ground Home Delivery'>FedEx Ground Home Delivery</option>
+<option value='FedEx International Priority Freight'>FedEx International Priority Freight</option>
+<option value='FedEx International Economy Freight'>FedEx International Economy Freight</option>
+<option value='FedEx Europe First International Priority'>FedEx Europe First International Priority</option>
 </select>
 
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS-->
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
 </td>
 </TR>
 <tr>
@@ -328,13 +359,52 @@
 <tr>
 <td colspan=2 class="ac_checkout_right_col">
 $sc_tos_display_address<br><br>
-You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="agora.cgi?page=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
+You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="$sc_store_url?cartlink=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
 Then put a tick in the box below. By selecting &quot;I Agree&quot; you are acknowledging that you have read and agree to our policies contained within that page.
 <br><br>
 <input type="checkbox" name="Ecom_tos" value="I Agree">&nbsp;&nbsp;&nbsp; I Agree and have read the Terms of Service listed above (required to continue)<br><br></td>
 </tr>
 ~;} -->
+<td colspan=2 class="ac_checkout_top_col">
+Misc Info</td>
+
+<!--agorascript-pre
+if ("$sc_enable_discount" =~ /yes/i) {
+  if ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+  } else { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="text" NAME="Ecom_Discount" value="$eform_Ecom_Discount" size="22" maxlength="30">
+  </td>
+</tr>
+~;
+  }
+} elsif ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+}
+-->
 
+<td colspan=2><br/></td>
+</tr>
 <tr>
 <td class="ac_checkout_left_col">Special Notes:</td>
 <td class="ac_checkout_right_col">
diff -aruN 5.0.000.src/html/forms/AgoraPay-orderform.html 5.2.000.src/html/forms/AgoraPay-orderform.html
--- 5.0.000.src/html/forms/AgoraPay-orderform.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/forms/AgoraPay-orderform.html	2007-12-19 22:50:54.000000000 -0600
@@ -10,6 +10,8 @@
 
 <H2>CART CONTENTS HERE</H2>
 
+</form><form method="post" action="agora.cgi">
+
 <CENTER>
 
 <TABLE class="ac_checkout">
@@ -41,36 +43,62 @@
 <TD class="ac_checkout_left_col">Shipping Method:</TD>
 <TD class="ac_checkout_right_col">
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW THIS-->
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
 
-<SELECT NAME="Ecom_ShipTo_Method">
-<!--agorascript-pre 
- if ("$vform_Ecom_ShipTo_Method" ne "") {
-   return '<OPTION value="$vform_Ecom_ShipTo_Method">' . 
-	'$vform_Ecom_ShipTo_Method &nbsp;</OPTION>' . 
-	'<OPTION VALUE="UPS Ground (GNDRES)">UPS Ground';
+<select name=Ecom_ShipTo_Method>
+<option value="$vform_Ecom_ShipTo_Method"><!--agorascript-pre
+ if ("$vform_Ecom_ShipTo_Method" eq "") {
+   return " Select Shipping Method ";
   } else {
-   return '<OPTION VALUE="UPS Ground (GNDRES)" CHECKED>UPS Ground';
+   return "$vform_Ecom_ShipTo_Method";
   }
---></OPTION>
+--></option>
 <option value="Electronic Delivery">Electronic Delivery</option>
-<option value="Local Delivery">	Local Delivery</option>
+<option value="Local Delivery">Local Delivery</option>
 <option value="Pickup">Pickup</option>
-<option value="USPS Parcel Post (Parcel)">USPS Parcel Post (5-14 days)</option>
-<option value="USPS Priority Mail (Priority)">USPS Priority Mail (3-7 days)</option>
-<option value="USPS Express Mail (Express)">USPS Express Mail (1-3 days)</option>
-<option value="USPS (Economy (Surface) Parcel Post)">Economy (Surface) Parcel Post (4-6 weeks - international)</option>
-<option value="USPS (Airmail Parcel Post)">Airmail Parcel Post (4-10 days - international)</option>
-<option value="USPS (Global Express Mail)">Global Express Mail (3-5 days - international)</option>
-<option value="USPS (Global Express Guaranteed Document Service)">Global Express Guaranteed - Non-Document (2-3 days - international)</option>
+<option value="USPS Parcel Post (Parcel)">
+USPS Parcel Post (5-14 days)</option>
+<option value="USPS Priority Mail (Priority)">
+USPS Priority Mail (3-7 days)</option>
+<option value="USPS Express Mail (Express)">
+USPS Express Mail (1-3 days)</option>
+<option value="USPS (Priority Mail International)">
+Priority Mail International (6-10 days)</option>
+<option value="USPS (Express Mail International)">
+Express Mail International (3-5 days)</option>
+<option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed (1-3 days)</option>
+<option value="UPS Ground (GND)">UPS Ground (7-10 days)</option>
+<option value="UPS Standard (STD)">UPS Standard to Canada Only (7-10 days)</option>
 <option value="UPS 3 Day Select (3DS)">UPS 3 Day Select (3-4 days)</option>
 <option value="UPS 2nd Day Air (2DA)">UPS 2nd Day Air</option>
+<option value="UPS 2nd Day Air Early AM (2DM)">UPS 2nd Day Air Early AM</option>
+<option value="UPS Next Day Saver (1DP)">UPS Next Day Air Saver</option>
 <option value="UPS Next Day Air (1DA)">UPS Next Day Air</option>
-<OPTION VALUE="UPS Ground Residential(GNDRES)">UPS Ground Residential</OPTION>
-<OPTION VALUE="UPS Ground Commercial (GNDCOM)">UPS Ground Commercial</OPTION>
+<option value="UPS Next Day Air Early AM (1DM)">UPS Next Day Air Early AM</option>
+<option value="UPS Worldwide Express (XPR)">UPS Worldwide Express (international)</option>
+<option value="UPS Worldwide Expedited (XPD)">UPS Worldwide Expedited (international)</option>
+<option value="UPS Worldwide Express Plus(XDM)">UPS Worldwide Express Plus (international)</option>
+<option value='FedEx Priority Overnight'>FedEx Priority Overnight</option>
+<option value='FedEx Standard Overnight'>FedEx Standard Overnight</option>
+<option value='FedEx First Overnight'>FedEx First Overnight</option>
+<option value='FedEx 2 Day'>FedEx 2 Day</option>
+<option value='FedEx Express Saver'>FedEx Express Saver</option>
+<option value='FedEx International Priority'>FedEx International Priority</option>
+<option value='FedEx International Economy'>FedEx International Economy</option>
+<option value='FedEx International First'>FedEx International First</option>
+<option value='FedEx 1 Day Freight'>FedEx 1 Day Freight</option>
+<option value='FedEx 2 Day Freight'>FedEx 2 Day Freight</option>
+<option value='FedEx 3 Day Freight'>FedEx 3 Day Freight</option>
+<option value='FedEx Ground'>FedEx Ground</option>
+<option value='FedEx Ground Home Delivery'>FedEx Ground Home Delivery</option>
+<option value='FedEx International Priority Freight'>FedEx International Priority Freight</option>
+<option value='FedEx International Economy Freight'>FedEx International Economy Freight</option>
+<option value='FedEx Europe First International Priority'>FedEx Europe First International Priority</option>
 </select>
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS-->
+
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
 
 </td>
 </TR>
@@ -340,13 +368,53 @@
 <tr>
 <td colspan=2>
 $sc_tos_display_address<br><br>
-You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="agora.cgi?page=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
+You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="$sc_store_url?cartlink=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
 Then put a tick in the box below. By selecting &quot;I Agree&quot; you are acknowledging that you have read and agree to our policies contained within that page.
 <br><br>
 <input type="checkbox" name="Ecom_tos" value="I Agree">&nbsp;&nbsp;&nbsp; I Agree and have read the Terms of Service listed above (required to continue)<br><br></td>
 </tr>
 ~;} -->
 
+<td colspan=2 class="ac_checkout_top_col">
+Misc Info</td>
+
+<!--agorascript-pre
+if ("$sc_enable_discount" =~ /yes/i) {
+  if ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+  } else { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="text" NAME="Ecom_Discount" value="$eform_Ecom_Discount" size="22" maxlength="30">
+  </td>
+</tr>
+~;
+  }
+} elsif ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+}
+-->
+
+<td colspan=2><br/></td>
+</tr>
 <tr>
 <td class="ac_checkout_left_col">Special Notes:</td>
 <td class="ac_checkout_right_col">
diff -aruN 5.0.000.src/html/forms/AuthorizeNet-orderform.html 5.2.000.src/html/forms/AuthorizeNet-orderform.html
--- 5.0.000.src/html/forms/AuthorizeNet-orderform.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/forms/AuthorizeNet-orderform.html	2007-12-19 22:50:55.000000000 -0600
@@ -10,6 +10,8 @@
 
 <H2>CART CONTENTS HERE</H2>
 
+</form><form method="post" action="agora.cgi">
+
 <CENTER>
 
 <TABLE class="ac_checkout">
@@ -39,9 +41,11 @@
 
 <td class="ac_checkout_left_col">Method:</td>
 <td class="ac_checkout_right_col">
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW THIS-->
 
-<select name="Ecom_ShipTo_Method">
+
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
+<select name=Ecom_ShipTo_Method>
 <option value="$vform_Ecom_ShipTo_Method"><!--agorascript-pre
  if ("$vform_Ecom_ShipTo_Method" eq "") {
    return " Select Shipping Method ";
@@ -50,23 +54,52 @@
   }
 --></option>
 <option value="Electronic Delivery">Electronic Delivery</option>
-<option value="Local Delivery">	Local Delivery</option>
+<option value="Local Delivery">Local Delivery</option>
 <option value="Pickup">Pickup</option>
-<option value="USPS Parcel Post (Parcel)">USPS Parcel Post (5-14 days)</option>
-<option value="USPS Priority Mail (Priority)">USPS Priority Mail (3-7 days)</option>
-<option value="USPS Express Mail (Express)">USPS Express Mail (1-3 days)</option>
-<option value="USPS (Economy (Surface) Parcel Post)">Economy (Surface) Parcel Post (4-6 weeks - international)</option>
-<option value="USPS (Airmail Parcel Post)">Airmail Parcel Post (4-10 days - international)</option>
-<option value="USPS (Global Express Mail)">Global Express Mail (3-5 days - international)</option>
-<option value="USPS (Global Express Guaranteed Document Service)">Global Express Guaranteed - Non-Document (2-3 days - international)</option>
+<option value="USPS Parcel Post (Parcel)">
+USPS Parcel Post (5-14 days)</option>
+<option value="USPS Priority Mail (Priority)">
+USPS Priority Mail (3-7 days)</option>
+<option value="USPS Express Mail (Express)">
+USPS Express Mail (1-3 days)</option>
+<option value="USPS (Priority Mail International)">
+Priority Mail International (6-10 days)</option>
+<option value="USPS (Express Mail International)">
+Express Mail International (3-5 days)</option>
+<option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed (1-3 days)</option>
+<option value="UPS Ground (GND)">UPS Ground (7-10 days)</option>
+<option value="UPS Standard (STD)">UPS Standard to Canada Only (7-10 days)</option>
 <option value="UPS 3 Day Select (3DS)">UPS 3 Day Select (3-4 days)</option>
 <option value="UPS 2nd Day Air (2DA)">UPS 2nd Day Air</option>
+<option value="UPS 2nd Day Air Early AM (2DM)">UPS 2nd Day Air Early AM</option>
+<option value="UPS Next Day Saver (1DP)">UPS Next Day Air Saver</option>
 <option value="UPS Next Day Air (1DA)">UPS Next Day Air</option>
-<OPTION VALUE="UPS Ground Residential(GNDRES)">UPS Ground Residential</OPTION>
-<OPTION VALUE="UPS Ground Commercial (GNDCOM)">UPS Ground Commercial</OPTION>
+<option value="UPS Next Day Air Early AM (1DM)">UPS Next Day Air Early AM</option>
+<option value="UPS Worldwide Express (XPR)">UPS Worldwide Express (international)</option>
+<option value="UPS Worldwide Expedited (XPD)">UPS Worldwide Expedited (international)</option>
+<option value="UPS Worldwide Express Plus(XDM)">UPS Worldwide Express Plus (international)</option>
+<option value='FedEx Priority Overnight'>FedEx Priority Overnight</option>
+<option value='FedEx Standard Overnight'>FedEx Standard Overnight</option>
+<option value='FedEx First Overnight'>FedEx First Overnight</option>
+<option value='FedEx 2 Day'>FedEx 2 Day</option>
+<option value='FedEx Express Saver'>FedEx Express Saver</option>
+<option value='FedEx International Priority'>FedEx International Priority</option>
+<option value='FedEx International Economy'>FedEx International Economy</option>
+<option value='FedEx International First'>FedEx International First</option>
+<option value='FedEx 1 Day Freight'>FedEx 1 Day Freight</option>
+<option value='FedEx 2 Day Freight'>FedEx 2 Day Freight</option>
+<option value='FedEx 3 Day Freight'>FedEx 3 Day Freight</option>
+<option value='FedEx Ground'>FedEx Ground</option>
+<option value='FedEx Ground Home Delivery'>FedEx Ground Home Delivery</option>
+<option value='FedEx International Priority Freight'>FedEx International Priority Freight</option>
+<option value='FedEx International Economy Freight'>FedEx International Economy Freight</option>
+<option value='FedEx Europe First International Priority'>FedEx Europe First International Priority</option>
 </select>
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS-->
+
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
 </td>
 </TR>
 
@@ -331,12 +364,52 @@
 <tr>
 <td colspan=2>
 $sc_tos_display_address<br><br>
-You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="agora.cgi?page=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
+You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="$sc_store_url?cartlink=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
 Then put a tick in the box below. By selecting &quot;I Agree&quot; you are acknowledging that you have read and agree to our policies contained within that page.
 <br><br>
 <input type="checkbox" name="Ecom_tos" value="I Agree">&nbsp;&nbsp;&nbsp; I Agree and have read the Terms of Service listed above (required to continue)<br><br></td>
 </tr>
 ~;} -->
+<td colspan=2 class="ac_checkout_top_col">
+Misc Info</td>
+
+<!--agorascript-pre
+if ("$sc_enable_discount" =~ /yes/i) {
+  if ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+  } else { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="text" NAME="Ecom_Discount" value="$eform_Ecom_Discount" size="22" maxlength="30">
+  </td>
+</tr>
+~;
+  }
+} elsif ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+}
+-->
+
+<td colspan=2><br/></td>
+</tr>
 <tr>
 <td class="ac_checkout_left_col">Special Notes:</td>
 <td class="ac_checkout_right_col">
diff -aruN 5.0.000.src/html/forms/combo-orderform.html 5.2.000.src/html/forms/combo-orderform.html
--- 5.0.000.src/html/forms/combo-orderform.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/forms/combo-orderform.html	2007-12-19 22:50:55.000000000 -0600
@@ -6,7 +6,9 @@
 
 <FORM action="agora.cgi" method="POST">
 <H2>CART CONTENTS HERE</H2>
-</FORM>
+
+
+</form><form method="post" action="agora.cgi">
 
 <CENTER>
 <TABLE WIDTH="550" BORDER="0" CELLPADDING="0">
@@ -20,7 +22,7 @@
 <TR>
 <TD width="50%" align="center">
 <FORM action="agora.cgi" method="POST">
-<INPUT TYPE=HIDDEN NAME = "ofn" VALUE = "NiftyPay">
+<INPUT TYPE=HIDDEN NAME = "ofn" VALUE = "Offline">
 <INPUT TYPE=HIDDEN NAME = "submit" VALUE = "Next">
 <INPUT TYPE=HIDDEN NAME="order_form_button" VALUE="1">
 <INPUT TYPE="IMAGE" NAME="Pay By Credit Card" VALUE="1"
diff -aruN 5.0.000.src/html/forms/combosample-orderform.html 5.2.000.src/html/forms/combosample-orderform.html
--- 5.0.000.src/html/forms/combosample-orderform.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/forms/combosample-orderform.html	2003-07-22 12:07:52.000000000 -0500
@@ -0,0 +1,136 @@
+<HTML>
+<HEAD>
+<TITLE>Step One</TITLE>
+</HEAD>
+
+<BODY BGCOLOR="#ffffff">
+
+<FORM action="agora.cgi" method="POST">
+
+<H2>CART CONTENTS HERE</H2>
+
+<CENTER>
+
+<TABLE WIDTH="550" BORDER="0">
+
+<TR>
+<TD COLSPAN="2">
+<P>&nbsp;</P>
+</TD>
+</TR>
+
+<TR BGCOLOR="#C0FFFF">
+<TD>
+
+<TABLE WIDTH="550" BORDER="1">
+<TR BGCOLOR="#C0FFFF">
+<TD ALIGN="CENTER" colspan=3><FONT FACE="ARIAL" SIZE="2"
+COLOR="#000000">Please select where your order will be shipped and 
+click 'Next'</FONT></TD>
+</tr>
+<tr>
+   <td colspan=3>Method:&nbsp;&nbsp;&nbsp;
+<SELECT NAME="Ecom_ShipTo_Method">
+<OPTION VALUE="UPS Ground (GNDRES)" CHECKED>
+UPS Ground</OPTION>
+<OPTION VALUE="UPS 2nd Day (2DA)">
+UPS 2nd Day</OPTION>
+<OPTION VALUE="UPS Next Day (1DA)">
+UPS Next Day</OPTION>
+<OPTION VALUE="FEDEX Priority Overnight (Express,Priority Overnight)">
+FedEx Priority Overnight</OPTION>
+<OPTION VALUE="FEDEX Express (Express,Express Saver)">
+FedEx Express Saver</OPTION>
+<OPTION VALUE="FEDEX Ground (Ground,Ground)">
+FedEx Ground</OPTION>
+<OPTION VALUE="FEDEX Home Delivery (Home,Home)">
+FedEx Home Delivery</OPTION>
+<OPTION VALUE="USPS Parcel Post (Parcel)">
+USPS Parcel Post</OPTION>
+<OPTION VALUE="USPS Priority Mail (Priority)">
+USPS Priority Mail</OPTION>
+<OPTION VALUE="USPS Express Mail (Express)">
+USPS Express Mail</OPTION>
+</SELECT></TD>
+ </tr>
+      
+<TR BGCOLOR="#C0FFFF">
+<TD ALIGN="CENTER" colspan=1>Zip/Postal Code
+<INPUT TYPE=TEXT NAME="Ecom_ShipTo_Postal_PostalCode" size=5></td>
+<TD ALIGN="CENTER" colspan=1>
+<SELECT NAME="Ecom_ShipTo_Postal_StateProv">
+<OPTION VALUE="">Select State</OPTION>
+<OPTION>AK</OPTION>
+<OPTION>AL</OPTION> 
+<OPTION>AR</OPTION>
+<OPTION>AZ</OPTION> 
+<OPTION>CA</OPTION> 
+<OPTION>CO</OPTION> 
+<OPTION>CT</OPTION> 
+<OPTION>DC</OPTION>
+<OPTION>DE</OPTION> 
+<OPTION>FL</OPTION> 
+<OPTION>GA</OPTION> 
+<OPTION>GU</OPTION> 
+<OPTION>HI</OPTION> 
+<OPTION>IA</OPTION>
+<OPTION>ID</OPTION> 
+<OPTION>IL</OPTION> 
+<OPTION>IN</OPTION> 
+<OPTION>KS</OPTION> 
+<OPTION>KY</OPTION> 
+<OPTION>LA</OPTION> 
+<OPTION>MA</OPTION> 
+<OPTION>MD</OPTION>
+<OPTION>ME</OPTION> 
+<OPTION>MI</OPTION> 
+<OPTION>MN</OPTION> 
+<OPTION>MO</OPTION>
+<OPTION>MS</OPTION> 
+<OPTION>MT</OPTION> 
+<OPTION>NC</OPTION> 
+<OPTION>ND</OPTION> 
+<OPTION>NE</OPTION> 
+<OPTION>NH</OPTION> 
+<OPTION>NJ</OPTION> 
+<OPTION>NM</OPTION> 
+<OPTION>NV</OPTION> 
+<OPTION>NY</OPTION> 
+<OPTION>OH</OPTION> 
+<OPTION>OK</OPTION> 
+<OPTION>OR</OPTION> 
+<OPTION>PA</OPTION> 
+<OPTION>PR</OPTION> 
+<OPTION>RI</OPTION> 
+<OPTION>SC</OPTION> 
+<OPTION>SD</OPTION> 
+<OPTION>TN</OPTION> 
+<OPTION>TX</OPTION> 
+<OPTION>UT</OPTION> 
+<OPTION>VA</OPTION>
+<OPTION>VI</OPTION> 
+<OPTION>VT</OPTION> 
+<OPTION>WA</OPTION> 
+<OPTION>WI</OPTION>
+<OPTION>WV</OPTION> 
+<OPTION>WY</OPTION> 
+</SELECT>
+</TD>
+<TD ALIGN="CENTER" colspan=1><INPUT
+TYPE=SUBMIT NAME="gateway" VALUE="AuthorizeNet"><br><INPUT
+TYPE=SUBMIT NAME="gateway" VALUE="iTransact"><BR>
+<INPUT TYPE=SUBMIT NAME="gateway" VALUE="Linkpoint"><INPUT 
+TYPE=HIDDEN NAME ="submit_order_form_button" VALUE = "Next"></TD>
+</TR>
+</TABLE>
+</TD>
+</TR>
+</TABLE>
+</CENTER>
+</FONT>
+</CENTER>
+</FORM>
+
+</BODY>
+</HTML>
+
diff -aruN 5.0.000.src/html/forms/iTransact-orderform.html 5.2.000.src/html/forms/iTransact-orderform.html
--- 5.0.000.src/html/forms/iTransact-orderform.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/forms/iTransact-orderform.html	2007-12-19 22:50:56.000000000 -0600
@@ -10,6 +10,8 @@
 
 <H2>CART CONTENTS HERE</H2>
 
+</form><form method="post" action="agora.cgi">
+
 <CENTER>
 
 <TABLE class="ac_checkout">
@@ -41,36 +43,64 @@
 <TD class="ac_checkout_left_col">Shipping Method:</TD>
 <TD class="ac_checkout_right_col">
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW THIS-->
 
-<SELECT NAME="Ecom_ShipTo_Method">
-<!--agorascript-pre 
- if ("$vform_Ecom_ShipTo_Method" ne "") {
-   return '<OPTION value="$vform_Ecom_ShipTo_Method">' . 
-	'$vform_Ecom_ShipTo_Method &nbsp;</OPTION>' . 
-	'<OPTION VALUE="UPS Ground (GNDRES)">UPS Ground';
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
+<select name=Ecom_ShipTo_Method>
+<option value="$vform_Ecom_ShipTo_Method"><!--agorascript-pre
+ if ("$vform_Ecom_ShipTo_Method" eq "") {
+   return " Select Shipping Method ";
   } else {
-   return '<OPTION VALUE="UPS Ground (GNDRES)" CHECKED>UPS Ground';
+   return "$vform_Ecom_ShipTo_Method";
   }
---></OPTION>
+--></option>
 <option value="Electronic Delivery">Electronic Delivery</option>
-<option value="Local Delivery">	Local Delivery</option>
+<option value="Local Delivery">Local Delivery</option>
 <option value="Pickup">Pickup</option>
-<option value="USPS Parcel Post (Parcel)">USPS Parcel Post (5-14 days)</option>
-<option value="USPS Priority Mail (Priority)">USPS Priority Mail (3-7 days)</option>
-<option value="USPS Express Mail (Express)">USPS Express Mail (1-3 days)</option>
-<option value="USPS (Economy (Surface) Parcel Post)">Economy (Surface) Parcel Post (4-6 weeks - international)</option>
-<option value="USPS (Airmail Parcel Post)">Airmail Parcel Post (4-10 days - international)</option>
-<option value="USPS (Global Express Mail)">Global Express Mail (3-5 days - international)</option>
-<option value="USPS (Global Express Guaranteed Document Service)">Global Express Guaranteed - Non-Document (2-3 days - international)</option>
+<option value="USPS Parcel Post (Parcel)">
+USPS Parcel Post (5-14 days)</option>
+<option value="USPS Priority Mail (Priority)">
+USPS Priority Mail (3-7 days)</option>
+<option value="USPS Express Mail (Express)">
+USPS Express Mail (1-3 days)</option>
+<option value="USPS (Priority Mail International)">
+Priority Mail International (6-10 days)</option>
+<option value="USPS (Express Mail International)">
+Express Mail International (3-5 days)</option>
+<option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed (1-3 days)</option>
+<option value="UPS Ground (GND)">UPS Ground (7-10 days)</option>
+<option value="UPS Standard (STD)">UPS Standard to Canada Only (7-10 days)</option>
 <option value="UPS 3 Day Select (3DS)">UPS 3 Day Select (3-4 days)</option>
 <option value="UPS 2nd Day Air (2DA)">UPS 2nd Day Air</option>
+<option value="UPS 2nd Day Air Early AM (2DM)">UPS 2nd Day Air Early AM</option>
+<option value="UPS Next Day Saver (1DP)">UPS Next Day Air Saver</option>
 <option value="UPS Next Day Air (1DA)">UPS Next Day Air</option>
-<OPTION VALUE="UPS Ground Residential(GNDRES)">UPS Ground Residential</OPTION>
-<OPTION VALUE="UPS Ground Commercial (GNDCOM)">UPS Ground Commercial</OPTION>
+<option value="UPS Next Day Air Early AM (1DM)">UPS Next Day Air Early AM</option>
+<option value="UPS Worldwide Express (XPR)">UPS Worldwide Express (international)</option>
+<option value="UPS Worldwide Expedited (XPD)">UPS Worldwide Expedited (international)</option>
+<option value="UPS Worldwide Express Plus(XDM)">UPS Worldwide Express Plus (international)</option>
+<option value='FedEx Priority Overnight'>FedEx Priority Overnight</option>
+<option value='FedEx Standard Overnight'>FedEx Standard Overnight</option>
+<option value='FedEx First Overnight'>FedEx First Overnight</option>
+<option value='FedEx 2 Day'>FedEx 2 Day</option>
+<option value='FedEx Express Saver'>FedEx Express Saver</option>
+<option value='FedEx International Priority'>FedEx International Priority</option>
+<option value='FedEx International Economy'>FedEx International Economy</option>
+<option value='FedEx International First'>FedEx International First</option>
+<option value='FedEx 1 Day Freight'>FedEx 1 Day Freight</option>
+<option value='FedEx 2 Day Freight'>FedEx 2 Day Freight</option>
+<option value='FedEx 3 Day Freight'>FedEx 3 Day Freight</option>
+<option value='FedEx Ground'>FedEx Ground</option>
+<option value='FedEx Ground Home Delivery'>FedEx Ground Home Delivery</option>
+<option value='FedEx International Priority Freight'>FedEx International Priority Freight</option>
+<option value='FedEx International Economy Freight'>FedEx International Economy Freight</option>
+<option value='FedEx Europe First International Priority'>FedEx Europe First International Priority</option>
 </select>
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS-->
+
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
 
 </td>
 </TR>
@@ -340,13 +370,53 @@
 <tr>
 <td colspan=2>
 $sc_tos_display_address<br><br>
-You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="agora.cgi?page=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
+You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="$sc_store_url?cartlink=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
 Then put a tick in the box below. By selecting &quot;I Agree&quot; you are acknowledging that you have read and agree to our policies contained within that page.
 <br><br>
 <input type="checkbox" name="Ecom_tos" value="I Agree">&nbsp;&nbsp;&nbsp; I Agree and have read the Terms of Service listed above (required to continue)<br><br></td>
 </tr>
 ~;} -->
 
+<td colspan=2 class="ac_checkout_top_col">
+Misc Info</td>
+
+<!--agorascript-pre
+if ("$sc_enable_discount" =~ /yes/i) {
+  if ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+  } else { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="text" NAME="Ecom_Discount" value="$eform_Ecom_Discount" size="22" maxlength="30">
+  </td>
+</tr>
+~;
+  }
+} elsif ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+}
+-->
+
+<td colspan=2><br/></td>
+</tr>
 <tr>
 <td class="ac_checkout_left_col">Special Notes:</td>
 <td class="ac_checkout_right_col">
diff -aruN 5.0.000.src/html/forms/LinkpointConnect-orderform.html 5.2.000.src/html/forms/LinkpointConnect-orderform.html
--- 5.0.000.src/html/forms/LinkpointConnect-orderform.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/forms/LinkpointConnect-orderform.html	2007-12-19 22:50:56.000000000 -0600
@@ -10,6 +10,8 @@
 
 <H2>CART CONTENTS HERE</H2>
 
+</form><form method="post" action="agora.cgi">
+
 <CENTER>
 
 <TABLE class="ac_checkout">
@@ -41,9 +43,10 @@
 <TD class="ac_checkout_left_col">Shipping Method:</TD>
 <TD class="ac_checkout_right_col">
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW THIS-->
 
-<select name="Ecom_ShipTo_Method">
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
+<select name=Ecom_ShipTo_Method>
 <option value="$vform_Ecom_ShipTo_Method"><!--agorascript-pre
  if ("$vform_Ecom_ShipTo_Method" eq "") {
    return " Select Shipping Method ";
@@ -52,23 +55,51 @@
   }
 --></option>
 <option value="Electronic Delivery">Electronic Delivery</option>
-<option value="Local Delivery">	Local Delivery</option>
+<option value="Local Delivery">Local Delivery</option>
 <option value="Pickup">Pickup</option>
-<option value="USPS Parcel Post (Parcel)">USPS Parcel Post (5-14 days)</option>
-<option value="USPS Priority Mail (Priority)">USPS Priority Mail (3-7 days)</option>
-<option value="USPS Express Mail (Express)">USPS Express Mail (1-3 days)</option>
-<option value="USPS (Economy (Surface) Parcel Post)">Economy (Surface) Parcel Post (4-6 weeks - international)</option>
-<option value="USPS (Airmail Parcel Post)">Airmail Parcel Post (4-10 days - international)</option>
-<option value="USPS (Global Express Mail)">Global Express Mail (3-5 days - international)</option>
-<option value="USPS (Global Express Guaranteed Document Service)">Global Express Guaranteed - Non-Document (2-3 days - international)</option>
+<option value="USPS Parcel Post (Parcel)">
+USPS Parcel Post (5-14 days)</option>
+<option value="USPS Priority Mail (Priority)">
+USPS Priority Mail (3-7 days)</option>
+<option value="USPS Express Mail (Express)">
+USPS Express Mail (1-3 days)</option>
+<option value="USPS (Priority Mail International)">
+Priority Mail International (6-10 days)</option>
+<option value="USPS (Express Mail International)">
+Express Mail International (3-5 days)</option>
+<option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed (1-3 days)</option>
+<option value="UPS Ground (GND)">UPS Ground (7-10 days)</option>
+<option value="UPS Standard (STD)">UPS Standard to Canada Only (7-10 days)</option>
 <option value="UPS 3 Day Select (3DS)">UPS 3 Day Select (3-4 days)</option>
 <option value="UPS 2nd Day Air (2DA)">UPS 2nd Day Air</option>
+<option value="UPS 2nd Day Air Early AM (2DM)">UPS 2nd Day Air Early AM</option>
+<option value="UPS Next Day Saver (1DP)">UPS Next Day Air Saver</option>
 <option value="UPS Next Day Air (1DA)">UPS Next Day Air</option>
-<OPTION VALUE="UPS Ground Residential(GNDRES)">UPS Ground Residential</OPTION>
-<OPTION VALUE="UPS Ground Commercial (GNDCOM)">UPS Ground Commercial</OPTION>
+<option value="UPS Next Day Air Early AM (1DM)">UPS Next Day Air Early AM</option>
+<option value="UPS Worldwide Express (XPR)">UPS Worldwide Express (international)</option>
+<option value="UPS Worldwide Expedited (XPD)">UPS Worldwide Expedited (international)</option>
+<option value="UPS Worldwide Express Plus(XDM)">UPS Worldwide Express Plus (international)</option>
+<option value='FedEx Priority Overnight'>FedEx Priority Overnight</option>
+<option value='FedEx Standard Overnight'>FedEx Standard Overnight</option>
+<option value='FedEx First Overnight'>FedEx First Overnight</option>
+<option value='FedEx 2 Day'>FedEx 2 Day</option>
+<option value='FedEx Express Saver'>FedEx Express Saver</option>
+<option value='FedEx International Priority'>FedEx International Priority</option>
+<option value='FedEx International Economy'>FedEx International Economy</option>
+<option value='FedEx International First'>FedEx International First</option>
+<option value='FedEx 1 Day Freight'>FedEx 1 Day Freight</option>
+<option value='FedEx 2 Day Freight'>FedEx 2 Day Freight</option>
+<option value='FedEx 3 Day Freight'>FedEx 3 Day Freight</option>
+<option value='FedEx Ground'>FedEx Ground</option>
+<option value='FedEx Ground Home Delivery'>FedEx Ground Home Delivery</option>
+<option value='FedEx International Priority Freight'>FedEx International Priority Freight</option>
+<option value='FedEx International Economy Freight'>FedEx International Economy Freight</option>
+<option value='FedEx Europe First International Priority'>FedEx Europe First International Priority</option>
 </select>
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS-->
+
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
 
 </td>
 </TR>
@@ -76,7 +107,7 @@
 <TD class="ac_checkout_left_col">Email Address:</TD>
 <TD class="ac_checkout_right_col">
 <INPUT TYPE=TEXT NAME="Ecom_BillTo_Online_Email" 
-VALUE="$eform_Ecom_BillTo_Online_Email" size=35></td>
+VALUE="$eform_Ecom_BillTo_Online_Email" size=55></td>
 </TR>
 <TD class="ac_checkout_left_col">Name:</TD>
 <TD class="ac_checkout_right_col">
@@ -352,13 +383,52 @@
 <tr>
 <td colspan=2>
 $sc_tos_display_address<br><br>
-You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="agora.cgi?page=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
+You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="$sc_store_url?cartlink=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
 Then put a tick in the box below. By selecting &quot;I Agree&quot; you are acknowledging that you have read and agree to our policies contained within that page.
 <br><br>
 <input type="checkbox" name="Ecom_tos" value="I Agree">&nbsp;&nbsp;&nbsp; I Agree and have read the Terms of Service listed above (required to continue)<br><br></td>
 </tr>
 ~;} -->
+<td colspan=2 class="ac_checkout_top_col">
+Misc Info</td>
+
+<!--agorascript-pre
+if ("$sc_enable_discount" =~ /yes/i) {
+  if ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+  } else { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="text" NAME="Ecom_Discount" value="$eform_Ecom_Discount" size="22" maxlength="30">
+  </td>
+</tr>
+~;
+  }
+} elsif ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+}
+-->
 
+<td colspan=2><br/></td>
+</tr>
 <tr>
 <td class="ac_checkout_left_col">Special Notes:</td>
 <td class="ac_checkout_right_col">
diff -aruN 5.0.000.src/html/forms/NiftyPay-orderform.html 5.2.000.src/html/forms/NiftyPay-orderform.html
--- 5.0.000.src/html/forms/NiftyPay-orderform.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/forms/NiftyPay-orderform.html	2007-12-19 22:50:56.000000000 -0600
@@ -10,6 +10,8 @@
 
 <H2>CART CONTENTS HERE</H2>
 
+</form><form method="post" action="agora.cgi">
+
 <CENTER>
 
 <TABLE class="ac_checkout">
@@ -41,36 +43,64 @@
 <TD class="ac_checkout_left_col">Shipping Method:</TD>
 <TD class="ac_checkout_right_col">
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW THIS-->
 
-<SELECT NAME="Ecom_ShipTo_Method">
-<!--agorascript-pre 
- if ("$vform_Ecom_ShipTo_Method" ne "") {
-   return '<OPTION value="$vform_Ecom_ShipTo_Method">' . 
-	'$vform_Ecom_ShipTo_Method &nbsp;</OPTION>' . 
-	'<OPTION VALUE="UPS Ground (GNDRES)">UPS Ground';
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
+<select name=Ecom_ShipTo_Method>
+<option value="$vform_Ecom_ShipTo_Method"><!--agorascript-pre
+ if ("$vform_Ecom_ShipTo_Method" eq "") {
+   return " Select Shipping Method ";
   } else {
-   return '<OPTION VALUE="UPS Ground (GNDRES)" CHECKED>UPS Ground';
+   return "$vform_Ecom_ShipTo_Method";
   }
---></OPTION>
+--></option>
 <option value="Electronic Delivery">Electronic Delivery</option>
-<option value="Local Delivery">	Local Delivery</option>
+<option value="Local Delivery">Local Delivery</option>
 <option value="Pickup">Pickup</option>
-<option value="USPS Parcel Post (Parcel)">USPS Parcel Post (5-14 days)</option>
-<option value="USPS Priority Mail (Priority)">USPS Priority Mail (3-7 days)</option>
-<option value="USPS Express Mail (Express)">USPS Express Mail (1-3 days)</option>
-<option value="USPS (Economy (Surface) Parcel Post)">Economy (Surface) Parcel Post (4-6 weeks - international)</option>
-<option value="USPS (Airmail Parcel Post)">Airmail Parcel Post (4-10 days - international)</option>
-<option value="USPS (Global Express Mail)">Global Express Mail (3-5 days - international)</option>
-<option value="USPS (Global Express Guaranteed Document Service)">Global Express Guaranteed - Non-Document (2-3 days - international)</option>
+<option value="USPS Parcel Post (Parcel)">
+USPS Parcel Post (5-14 days)</option>
+<option value="USPS Priority Mail (Priority)">
+USPS Priority Mail (3-7 days)</option>
+<option value="USPS Express Mail (Express)">
+USPS Express Mail (1-3 days)</option>
+<option value="USPS (Priority Mail International)">
+Priority Mail International (6-10 days)</option>
+<option value="USPS (Express Mail International)">
+Express Mail International (3-5 days)</option>
+<option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed (1-3 days)</option>
+<option value="UPS Ground (GND)">UPS Ground (7-10 days)</option>
+<option value="UPS Standard (STD)">UPS Standard to Canada Only (7-10 days)</option>
 <option value="UPS 3 Day Select (3DS)">UPS 3 Day Select (3-4 days)</option>
 <option value="UPS 2nd Day Air (2DA)">UPS 2nd Day Air</option>
+<option value="UPS 2nd Day Air Early AM (2DM)">UPS 2nd Day Air Early AM</option>
+<option value="UPS Next Day Saver (1DP)">UPS Next Day Air Saver</option>
 <option value="UPS Next Day Air (1DA)">UPS Next Day Air</option>
-<OPTION VALUE="UPS Ground Residential(GNDRES)">UPS Ground Residential</OPTION>
-<OPTION VALUE="UPS Ground Commercial (GNDCOM)">UPS Ground Commercial</OPTION>
+<option value="UPS Next Day Air Early AM (1DM)">UPS Next Day Air Early AM</option>
+<option value="UPS Worldwide Express (XPR)">UPS Worldwide Express (international)</option>
+<option value="UPS Worldwide Expedited (XPD)">UPS Worldwide Expedited (international)</option>
+<option value="UPS Worldwide Express Plus(XDM)">UPS Worldwide Express Plus (international)</option>
+<option value='FedEx Priority Overnight'>FedEx Priority Overnight</option>
+<option value='FedEx Standard Overnight'>FedEx Standard Overnight</option>
+<option value='FedEx First Overnight'>FedEx First Overnight</option>
+<option value='FedEx 2 Day'>FedEx 2 Day</option>
+<option value='FedEx Express Saver'>FedEx Express Saver</option>
+<option value='FedEx International Priority'>FedEx International Priority</option>
+<option value='FedEx International Economy'>FedEx International Economy</option>
+<option value='FedEx International First'>FedEx International First</option>
+<option value='FedEx 1 Day Freight'>FedEx 1 Day Freight</option>
+<option value='FedEx 2 Day Freight'>FedEx 2 Day Freight</option>
+<option value='FedEx 3 Day Freight'>FedEx 3 Day Freight</option>
+<option value='FedEx Ground'>FedEx Ground</option>
+<option value='FedEx Ground Home Delivery'>FedEx Ground Home Delivery</option>
+<option value='FedEx International Priority Freight'>FedEx International Priority Freight</option>
+<option value='FedEx International Economy Freight'>FedEx International Economy Freight</option>
+<option value='FedEx Europe First International Priority'>FedEx Europe First International Priority</option>
 </select>
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS-->
+
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
 
 </td>
 </TR>
@@ -340,13 +370,53 @@
 <tr>
 <td colspan=2>
 $sc_tos_display_address<br><br>
-You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="agora.cgi?page=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
+You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="$sc_store_url?cartlink=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
 Then put a tick in the box below. By selecting &quot;I Agree&quot; you are acknowledging that you have read and agree to our policies contained within that page.
 <br><br>
 <input type="checkbox" name="Ecom_tos" value="I Agree">&nbsp;&nbsp;&nbsp; I Agree and have read the Terms of Service listed above (required to continue)<br><br></td>
 </tr>
 ~;} -->
 
+<td colspan=2 class="ac_checkout_top_col">
+Misc Info</td>
+
+<!--agorascript-pre
+if ("$sc_enable_discount" =~ /yes/i) {
+  if ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+  } else { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="text" NAME="Ecom_Discount" value="$eform_Ecom_Discount" size="22" maxlength="30">
+  </td>
+</tr>
+~;
+  }
+} elsif ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+}
+-->
+
+<td colspan=2><br/></td>
+</tr>
 <tr>
 <td class="ac_checkout_left_col">Special Notes:</td>
 <td class="ac_checkout_right_col">
diff -aruN 5.0.000.src/html/forms/Offline-orderform.html 5.2.000.src/html/forms/Offline-orderform.html
--- 5.0.000.src/html/forms/Offline-orderform.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/forms/Offline-orderform.html	2007-12-19 22:50:57.000000000 -0600
@@ -9,7 +9,7 @@
 
 <h2>CART CONTENTS HERE</h2>
 
-<form method="post" action="agora.cgi">
+</form><form method="post" action="agora.cgi">
 
 <div align="center">
 <table class="ac_checkout">
@@ -308,6 +308,50 @@
   </td>
 </tr>
 
+<!--agorascript-pre
+if ("$sc_enable_discount" =~ /yes/i) {
+  if ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td colspan="2"><hr/></td>
+</tr>
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+  } else { return
+q~
+<tr>
+  <td colspan="2"><hr/></td>
+</tr>
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="text" NAME="Ecom_Discount" value="$eform_Ecom_Discount" size="22" maxlength="30">
+  </td>
+</tr>
+~;
+  }
+} elsif ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td colspan="2"><hr/></td>
+</tr>
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+}
+-->
+
 <tr>
   <td colspan="2"><hr/></td>
 </tr>
@@ -460,7 +504,7 @@
 return q~
 <tr>
 <td class="ac_checkout_left_col">Number:</td>
-<td class="ac_checkout_rught_col">
+<td class="ac_checkout_right_col">
   <input type="text" name="Ecom_Payment_Card_Number"
     value="$ags_Ecom_Payment_Card_Number" maxlength="20">
 </td>
@@ -555,9 +599,9 @@
 <td class="ac_checkout_right_col">
 
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW THIS-->
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
 
-<select name="Ecom_ShipTo_Method">
+<select name=Ecom_ShipTo_Method>
 <option value="$vform_Ecom_ShipTo_Method"><!--agorascript-pre
  if ("$vform_Ecom_ShipTo_Method" eq "") {
    return " Select Shipping Method ";
@@ -566,24 +610,51 @@
   }
 --></option>
 <option value="Electronic Delivery">Electronic Delivery</option>
-<option value="Local Delivery">	Local Delivery</option>
+<option value="Local Delivery">Local Delivery</option>
 <option value="Pickup">Pickup</option>
-<option value="USPS Parcel Post (Parcel)">USPS Parcel Post (5-14 days)</option>
-<option value="USPS Priority Mail (Priority)">USPS Priority Mail (3-7 days)</option>
-<option value="USPS Express Mail (Express)">USPS Express Mail (1-3 days)</option>
-<option value="USPS (Economy (Surface) Parcel Post)">Economy (Surface) Parcel Post (4-6 weeks - international)</option>
-<option value="USPS (Airmail Parcel Post)">Airmail Parcel Post (4-10 days - international)</option>
-<option value="USPS (Global Express Mail)">Global Express Mail (3-5 days - international)</option>
-<option value="USPS (Global Express Guaranteed Document Service)">Global Express Guaranteed - Non-Document (2-3 days - international)</option>
+<option value="USPS Parcel Post (Parcel)">
+USPS Parcel Post (5-14 days)</option>
+<option value="USPS Priority Mail (Priority)">
+USPS Priority Mail (3-7 days)</option>
+<option value="USPS Express Mail (Express)">
+USPS Express Mail (1-3 days)</option>
+<option value="USPS (Priority Mail International)">
+Priority Mail International (6-10 days)</option>
+<option value="USPS (Express Mail International)">
+Express Mail International (3-5 days)</option>
+<option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed (1-3 days)</option>
+<option value="UPS Ground (GND)">UPS Ground (7-10 days)</option>
+<option value="UPS Standard (STD)">UPS Standard to Canada Only (7-10 days)</option>
 <option value="UPS 3 Day Select (3DS)">UPS 3 Day Select (3-4 days)</option>
 <option value="UPS 2nd Day Air (2DA)">UPS 2nd Day Air</option>
+<option value="UPS 2nd Day Air Early AM (2DM)">UPS 2nd Day Air Early AM</option>
+<option value="UPS Next Day Saver (1DP)">UPS Next Day Air Saver</option>
 <option value="UPS Next Day Air (1DA)">UPS Next Day Air</option>
-<OPTION VALUE="UPS Ground Residential(GNDRES)">UPS Ground Residential</OPTION>
-<OPTION VALUE="UPS Ground Commercial (GNDCOM)">UPS Ground Commercial</OPTION>
+<option value="UPS Next Day Air Early AM (1DM)">UPS Next Day Air Early AM</option>
+<option value="UPS Worldwide Express (XPR)">UPS Worldwide Express (international)</option>
+<option value="UPS Worldwide Expedited (XPD)">UPS Worldwide Expedited (international)</option>
+<option value="UPS Worldwide Express Plus(XDM)">UPS Worldwide Express Plus (international)</option>
+<option value='FedEx Priority Overnight'>FedEx Priority Overnight</option>
+<option value='FedEx Standard Overnight'>FedEx Standard Overnight</option>
+<option value='FedEx First Overnight'>FedEx First Overnight</option>
+<option value='FedEx 2 Day'>FedEx 2 Day</option>
+<option value='FedEx Express Saver'>FedEx Express Saver</option>
+<option value='FedEx International Priority'>FedEx International Priority</option>
+<option value='FedEx International Economy'>FedEx International Economy</option>
+<option value='FedEx International First'>FedEx International First</option>
+<option value='FedEx 1 Day Freight'>FedEx 1 Day Freight</option>
+<option value='FedEx 2 Day Freight'>FedEx 2 Day Freight</option>
+<option value='FedEx 3 Day Freight'>FedEx 3 Day Freight</option>
+<option value='FedEx Ground'>FedEx Ground</option>
+<option value='FedEx Ground Home Delivery'>FedEx Ground Home Delivery</option>
+<option value='FedEx International Priority Freight'>FedEx International Priority Freight</option>
+<option value='FedEx International Economy Freight'>FedEx International Economy Freight</option>
+<option value='FedEx Europe First International Priority'>FedEx Europe First International Priority</option>
 </select>
 
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS-->
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
 
 </td>
 </tr>
@@ -890,7 +961,7 @@
 <td class="ac_checkout_left_col">E-Mail:</td>
 <td class="ac_checkout_right_col">
   <input type="text" name="Ecom_BillTo_Online_Email"
-    value="$eform_Ecom_BillTo_Online_Email" maxlength="30">
+    value="$eform_Ecom_BillTo_Online_Email" maxlength="70">
 </td>
 </tr>
 
@@ -923,7 +994,7 @@
 <tr>
 <td colspan=2 class="ac_checkout_right_col">
 $sc_tos_display_address<br><br>
-You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="agora.cgi?page=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
+You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="$sc_store_url?cartlink=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
 Then put a tick in the box below. By selecting &quot;I Agree&quot; you are acknowledging that you have read and agree to our policies contained within that page.
 <br><br>
 <input type="checkbox" name="Ecom_tos" value="I Agree">&nbsp;&nbsp;&nbsp; I Agree and have read the Terms of Service listed above (required to continue)</td>
diff -aruN 5.0.000.src/html/forms/PayPal-orderform.html 5.2.000.src/html/forms/PayPal-orderform.html
--- 5.0.000.src/html/forms/PayPal-orderform.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/forms/PayPal-orderform.html	2007-12-19 22:50:57.000000000 -0600
@@ -12,6 +12,8 @@
 
 <H2>CART CONTENTS HERE</H2>
 
+</form><form method="post" action="agora.cgi">
+
 <CENTER>
 
 <TABLE class="ac_checkout">
@@ -39,9 +41,11 @@
 <tr>
 <td class="ac_checkout_left_col">Method:</td>
 <td class="ac_checkout_right_col">
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW THIS-->
 
-<select name="Ecom_ShipTo_Method">
+
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
+<select name=Ecom_ShipTo_Method>
 <option value="$vform_Ecom_ShipTo_Method"><!--agorascript-pre
  if ("$vform_Ecom_ShipTo_Method" eq "") {
    return " Select Shipping Method ";
@@ -50,24 +54,53 @@
   }
 --></option>
 <option value="Electronic Delivery">Electronic Delivery</option>
-<option value="Local Delivery">	Local Delivery</option>
+<option value="Local Delivery">Local Delivery</option>
 <option value="Pickup">Pickup</option>
-<option value="USPS Parcel Post (Parcel)">USPS Parcel Post (5-14 days)</option>
-<option value="USPS Priority Mail (Priority)">USPS Priority Mail (3-7 days)</option>
-<option value="USPS Express Mail (Express)">USPS Express Mail (1-3 days)</option>
-<option value="USPS (Economy (Surface) Parcel Post)">Economy (Surface) Parcel Post (4-6 weeks - international)</option>
-<option value="USPS (Airmail Parcel Post)">Airmail Parcel Post (4-10 days - international)</option>
-<option value="USPS (Global Express Mail)">Global Express Mail (3-5 days - international)</option>
-<option value="USPS (Global Express Guaranteed Document Service)">Global Express Guaranteed - Non-Document (2-3 days - international)</option>
+<option value="USPS Parcel Post (Parcel)">
+USPS Parcel Post (5-14 days)</option>
+<option value="USPS Priority Mail (Priority)">
+USPS Priority Mail (3-7 days)</option>
+<option value="USPS Express Mail (Express)">
+USPS Express Mail (1-3 days)</option>
+<option value="USPS (Priority Mail International)">
+Priority Mail International (6-10 days)</option>
+<option value="USPS (Express Mail International)">
+Express Mail International (3-5 days)</option>
+<option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed (1-3 days)</option>
+<option value="UPS Ground (GND)">UPS Ground (7-10 days)</option>
+<option value="UPS Standard (STD)">UPS Standard to Canada Only (7-10 days)</option>
 <option value="UPS 3 Day Select (3DS)">UPS 3 Day Select (3-4 days)</option>
 <option value="UPS 2nd Day Air (2DA)">UPS 2nd Day Air</option>
+<option value="UPS 2nd Day Air Early AM (2DM)">UPS 2nd Day Air Early AM</option>
+<option value="UPS Next Day Saver (1DP)">UPS Next Day Air Saver</option>
 <option value="UPS Next Day Air (1DA)">UPS Next Day Air</option>
-<OPTION VALUE="UPS Ground Residential(GNDRES)">UPS Ground Residential</OPTION>
-<OPTION VALUE="UPS Ground Commercial (GNDCOM)">UPS Ground Commercial</OPTION>
+<option value="UPS Next Day Air Early AM (1DM)">UPS Next Day Air Early AM</option>
+<option value="UPS Worldwide Express (XPR)">UPS Worldwide Express (international)</option>
+<option value="UPS Worldwide Expedited (XPD)">UPS Worldwide Expedited (international)</option>
+<option value="UPS Worldwide Express Plus(XDM)">UPS Worldwide Express Plus (international)</option>
+<option value='FedEx Priority Overnight'>FedEx Priority Overnight</option>
+<option value='FedEx Standard Overnight'>FedEx Standard Overnight</option>
+<option value='FedEx First Overnight'>FedEx First Overnight</option>
+<option value='FedEx 2 Day'>FedEx 2 Day</option>
+<option value='FedEx Express Saver'>FedEx Express Saver</option>
+<option value='FedEx International Priority'>FedEx International Priority</option>
+<option value='FedEx International Economy'>FedEx International Economy</option>
+<option value='FedEx International First'>FedEx International First</option>
+<option value='FedEx 1 Day Freight'>FedEx 1 Day Freight</option>
+<option value='FedEx 2 Day Freight'>FedEx 2 Day Freight</option>
+<option value='FedEx 3 Day Freight'>FedEx 3 Day Freight</option>
+<option value='FedEx Ground'>FedEx Ground</option>
+<option value='FedEx Ground Home Delivery'>FedEx Ground Home Delivery</option>
+<option value='FedEx International Priority Freight'>FedEx International Priority Freight</option>
+<option value='FedEx International Economy Freight'>FedEx International Economy Freight</option>
+<option value='FedEx Europe First International Priority'>FedEx Europe First International Priority</option>
 </select>
 
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS-->
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
+
 </td>
 </TR>
 
@@ -364,7 +397,7 @@
 <tr>
 <td colspan=2>
 $sc_tos_display_address<br><br>
-You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="agora.cgi?page=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
+You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="$sc_store_url?cartlink=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
 Then put a tick in the box below. By selecting &quot;I Agree&quot; you are acknowledging that you have read and agree to our policies contained within that page.
 <br><br>
 <input type="checkbox" name="Ecom_tos" value="I Agree">&nbsp;&nbsp;&nbsp; I Agree and have read the Terms of Service listed above (required to continue)<br><br></td>
@@ -377,10 +410,48 @@
 <td class="ac_checkout_left_col">E-Mail:</td>
 <td class="ac_checkout_right_col">
   <input type="text" name="Ecom_BillTo_Online_Email"
-    value="$vform_Ecom_BillTo_Online_Email" maxlength="30">
+    value="$vform_Ecom_BillTo_Online_Email" maxlength="70">
+1234567_9876543210@comcast.net
 </td>
 </tr>
 
+<!--agorascript-pre
+if ("$sc_enable_discount" =~ /yes/i) {
+  if ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+  } else { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="text" NAME="Ecom_Discount" value="$vform_Ecom_Discount" size="22" maxlength="30">
+  </td>
+</tr>
+~;
+  }
+} elsif ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+}
+-->
+
+<td colspan=2><br/></td>
+</tr>
 <tr>
 <td class="ac_checkout_left_col">Special Notes:</td>
 <td class="ac_checkout_right_col">
diff -aruN 5.0.000.src/html/forms/PlugnPay-orderform.html 5.2.000.src/html/forms/PlugnPay-orderform.html
--- 5.0.000.src/html/forms/PlugnPay-orderform.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/forms/PlugnPay-orderform.html	2007-12-19 22:50:57.000000000 -0600
@@ -10,6 +10,8 @@
 
 <H2>CART CONTENTS HERE</H2>
 
+</form><form method="post" action="agora.cgi">
+
 <CENTER>
 
 <TABLE class="ac_checkout">
@@ -38,9 +40,10 @@
 <td class="ac_checkout_left_col">Method:</td>
 <td class="ac_checkout_right_col">
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW THIS-->
 
-<select name="Ecom_ShipTo_Method">
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
+<select name=Ecom_ShipTo_Method>
 <option value="$vform_Ecom_ShipTo_Method"><!--agorascript-pre
  if ("$vform_Ecom_ShipTo_Method" eq "") {
    return " Select Shipping Method ";
@@ -49,23 +52,52 @@
   }
 --></option>
 <option value="Electronic Delivery">Electronic Delivery</option>
-<option value="Local Delivery">	Local Delivery</option>
+<option value="Local Delivery">Local Delivery</option>
 <option value="Pickup">Pickup</option>
-<option value="USPS Parcel Post (Parcel)">USPS Parcel Post (5-14 days)</option>
-<option value="USPS Priority Mail (Priority)">USPS Priority Mail (3-7 days)</option>
-<option value="USPS Express Mail (Express)">USPS Express Mail (1-3 days)</option>
-<option value="USPS (Economy (Surface) Parcel Post)">Economy (Surface) Parcel Post (4-6 weeks - international)</option>
-<option value="USPS (Airmail Parcel Post)">Airmail Parcel Post (4-10 days - international)</option>
-<option value="USPS (Global Express Mail)">Global Express Mail (3-5 days - international)</option>
-<option value="USPS (Global Express Guaranteed Document Service)">Global Express Guaranteed - Non-Document (2-3 days - international)</option>
+<option value="USPS Parcel Post (Parcel)">
+USPS Parcel Post (5-14 days)</option>
+<option value="USPS Priority Mail (Priority)">
+USPS Priority Mail (3-7 days)</option>
+<option value="USPS Express Mail (Express)">
+USPS Express Mail (1-3 days)</option>
+<option value="USPS (Priority Mail International)">
+Priority Mail International (6-10 days)</option>
+<option value="USPS (Express Mail International)">
+Express Mail International (3-5 days)</option>
+<option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed (1-3 days)</option>
+<option value="UPS Ground (GND)">UPS Ground (7-10 days)</option>
+<option value="UPS Standard (STD)">UPS Standard to Canada Only (7-10 days)</option>
 <option value="UPS 3 Day Select (3DS)">UPS 3 Day Select (3-4 days)</option>
 <option value="UPS 2nd Day Air (2DA)">UPS 2nd Day Air</option>
+<option value="UPS 2nd Day Air Early AM (2DM)">UPS 2nd Day Air Early AM</option>
+<option value="UPS Next Day Saver (1DP)">UPS Next Day Air Saver</option>
 <option value="UPS Next Day Air (1DA)">UPS Next Day Air</option>
-<OPTION VALUE="UPS Ground Residential(GNDRES)">UPS Ground Residential</OPTION>
-<OPTION VALUE="UPS Ground Commercial (GNDCOM)">UPS Ground Commercial</OPTION>
+<option value="UPS Next Day Air Early AM (1DM)">UPS Next Day Air Early AM</option>
+<option value="UPS Worldwide Express (XPR)">UPS Worldwide Express (international)</option>
+<option value="UPS Worldwide Expedited (XPD)">UPS Worldwide Expedited (international)</option>
+<option value="UPS Worldwide Express Plus(XDM)">UPS Worldwide Express Plus (international)</option>
+<option value='FedEx Priority Overnight'>FedEx Priority Overnight</option>
+<option value='FedEx Standard Overnight'>FedEx Standard Overnight</option>
+<option value='FedEx First Overnight'>FedEx First Overnight</option>
+<option value='FedEx 2 Day'>FedEx 2 Day</option>
+<option value='FedEx Express Saver'>FedEx Express Saver</option>
+<option value='FedEx International Priority'>FedEx International Priority</option>
+<option value='FedEx International Economy'>FedEx International Economy</option>
+<option value='FedEx International First'>FedEx International First</option>
+<option value='FedEx 1 Day Freight'>FedEx 1 Day Freight</option>
+<option value='FedEx 2 Day Freight'>FedEx 2 Day Freight</option>
+<option value='FedEx 3 Day Freight'>FedEx 3 Day Freight</option>
+<option value='FedEx Ground'>FedEx Ground</option>
+<option value='FedEx Ground Home Delivery'>FedEx Ground Home Delivery</option>
+<option value='FedEx International Priority Freight'>FedEx International Priority Freight</option>
+<option value='FedEx International Economy Freight'>FedEx International Economy Freight</option>
+<option value='FedEx Europe First International Priority'>FedEx Europe First International Priority</option>
 </select>
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS-->
+
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
 
 </td>
 </TR>
@@ -330,13 +362,52 @@
 <tr>
 <td colspan=2>
 $sc_tos_display_address<br><br>
-You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="agora.cgi?page=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
+You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="$sc_store_url?cartlink=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
 Then put a tick in the box below. By selecting &quot;I Agree&quot; you are acknowledging that you have read and agree to our policies contained within that page.
 <br><br>
 <input type="checkbox" name="Ecom_tos" value="I Agree">&nbsp;&nbsp;&nbsp; I Agree and have read the Terms of Service listed above (required to continue)<br><br></td>
 </tr>
 ~;} -->
+<td colspan=2 class="ac_checkout_top_col">
+Misc Info</td>
 
+<!--agorascript-pre
+if ("$sc_enable_discount" =~ /yes/i) {
+  if ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+  } else { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="text" NAME="Ecom_Discount" value="$eform_Ecom_Discount" size="22" maxlength="30">
+  </td>
+</tr>
+~;
+  }
+} elsif ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+}
+-->
+
+<td colspan=2><br/></td>
+</tr>
 <tr>
 <td class="ac_checkout_left_col">Special Notes:</td>
 <td class="ac_checkout_right_col">
diff -aruN 5.0.000.src/html/forms/USAepay-orderform.html 5.2.000.src/html/forms/USAepay-orderform.html
--- 5.0.000.src/html/forms/USAepay-orderform.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/forms/USAepay-orderform.html	2007-12-19 22:50:58.000000000 -0600
@@ -9,7 +9,7 @@
 
 <h2>CART CONTENTS HERE</h2>
 
-
+</form><form method="post" action="agora.cgi">
 
 <div align="center">
 <table class="ac_checkout">
@@ -308,6 +308,50 @@
   </td>
 </tr>
 
+<!--agorascript-pre
+if ("$sc_enable_discount" =~ /yes/i) {
+  if ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td colspan="2"><hr/></td>
+</tr>
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+  } else { return
+q~
+<tr>
+  <td colspan="2"><hr/></td>
+</tr>
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="text" NAME="Ecom_Discount" value="$eform_Ecom_Discount" size="22" maxlength="30">
+  </td>
+</tr>
+~;
+  }
+} elsif ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td colspan="2"><hr/></td>
+</tr>
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+}
+-->
+
 <tr>
   <td colspan="2"><hr/></td>
 </tr>
@@ -389,7 +433,6 @@
 -->
 
 </option>
-<option value="06"> 2006</option>
 <option value="07"> 2007</option>
 <option value="08"> 2008</option>
 <option value="09"> 2009</option>
@@ -433,9 +476,9 @@
 <td class="ac_checkout_right_col">
 
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW THIS-->
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
 
-<select name="Ecom_ShipTo_Method">
+<select name=Ecom_ShipTo_Method>
 <option value="$vform_Ecom_ShipTo_Method"><!--agorascript-pre
  if ("$vform_Ecom_ShipTo_Method" eq "") {
    return " Select Shipping Method ";
@@ -444,24 +487,52 @@
   }
 --></option>
 <option value="Electronic Delivery">Electronic Delivery</option>
-<option value="Local Delivery">	Local Delivery</option>
+<option value="Local Delivery">Local Delivery</option>
 <option value="Pickup">Pickup</option>
-<option value="USPS Parcel Post (Parcel)">USPS Parcel Post (5-14 days)</option>
-<option value="USPS Priority Mail (Priority)">USPS Priority Mail (3-7 days)</option>
-<option value="USPS Express Mail (Express)">USPS Express Mail (1-3 days)</option>
-<option value="USPS (Economy (Surface) Parcel Post)">Economy (Surface) Parcel Post (4-6 weeks - international)</option>
-<option value="USPS (Airmail Parcel Post)">Airmail Parcel Post (4-10 days - international)</option>
-<option value="USPS (Global Express Mail)">Global Express Mail (3-5 days - international)</option>
-<option value="USPS (Global Express Guaranteed Document Service)">Global Express Guaranteed - Non-Document (2-3 days - international)</option>
+<option value="USPS Parcel Post (Parcel)">
+USPS Parcel Post (5-14 days)</option>
+<option value="USPS Priority Mail (Priority)">
+USPS Priority Mail (3-7 days)</option>
+<option value="USPS Express Mail (Express)">
+USPS Express Mail (1-3 days)</option>
+<option value="USPS (Priority Mail International)">
+Priority Mail International (6-10 days)</option>
+<option value="USPS (Express Mail International)">
+Express Mail International (3-5 days)</option>
+<option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed (1-3 days)</option>
+<option value="UPS Ground (GND)">UPS Ground (7-10 days)</option>
+<option value="UPS Standard (STD)">UPS Standard to Canada Only (7-10 days)</option>
 <option value="UPS 3 Day Select (3DS)">UPS 3 Day Select (3-4 days)</option>
 <option value="UPS 2nd Day Air (2DA)">UPS 2nd Day Air</option>
+<option value="UPS 2nd Day Air Early AM (2DM)">UPS 2nd Day Air Early AM</option>
+<option value="UPS Next Day Saver (1DP)">UPS Next Day Air Saver</option>
 <option value="UPS Next Day Air (1DA)">UPS Next Day Air</option>
-<OPTION VALUE="UPS Ground Residential(GNDRES)">UPS Ground Residential</OPTION>
-<OPTION VALUE="UPS Ground Commercial (GNDCOM)">UPS Ground Commercial</OPTION>
+<option value="UPS Next Day Air Early AM (1DM)">UPS Next Day Air Early AM</option>
+<option value="UPS Worldwide Express (XPR)">UPS Worldwide Express (international)</option>
+<option value="UPS Worldwide Expedited (XPD)">UPS Worldwide Expedited (international)</option>
+<option value="UPS Worldwide Express Plus(XDM)">UPS Worldwide Express Plus (international)</option>
+<option value='FedEx Priority Overnight'>FedEx Priority Overnight</option>
+<option value='FedEx Standard Overnight'>FedEx Standard Overnight</option>
+<option value='FedEx First Overnight'>FedEx First Overnight</option>
+<option value='FedEx 2 Day'>FedEx 2 Day</option>
+<option value='FedEx Express Saver'>FedEx Express Saver</option>
+<option value='FedEx International Priority'>FedEx International Priority</option>
+<option value='FedEx International Economy'>FedEx International Economy</option>
+<option value='FedEx International First'>FedEx International First</option>
+<option value='FedEx 1 Day Freight'>FedEx 1 Day Freight</option>
+<option value='FedEx 2 Day Freight'>FedEx 2 Day Freight</option>
+<option value='FedEx 3 Day Freight'>FedEx 3 Day Freight</option>
+<option value='FedEx Ground'>FedEx Ground</option>
+<option value='FedEx Ground Home Delivery'>FedEx Ground Home Delivery</option>
+<option value='FedEx International Priority Freight'>FedEx International Priority Freight</option>
+<option value='FedEx International Economy Freight'>FedEx International Economy Freight</option>
+<option value='FedEx Europe First International Priority'>FedEx Europe First International Priority</option>
 </select>
 
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS-->
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
+
 
 </td>
 </tr>
@@ -768,7 +839,7 @@
 <td class="ac_checkout_left_col">E-Mail:</td>
 <td class="ac_checkout_right_col">
   <input type="text" name="Ecom_BillTo_Online_Email"
-    value="$eform_Ecom_BillTo_Online_Email" maxlength="30">
+    value="$eform_Ecom_BillTo_Online_Email" maxlength="55">
 </td>
 </tr>
 
@@ -801,7 +872,7 @@
 <tr>
 <td colspan=2 class="ac_checkout_right_col">
 $sc_tos_display_address<br><br>
-You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="agora.cgi?page=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
+You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="$sc_store_url?cartlink=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
 Then put a tick in the box below. By selecting &quot;I Agree&quot; you are acknowledging that you have read and agree to our policies contained within that page.
 <br><br>
 <input type="checkbox" name="Ecom_tos" value="I Agree">&nbsp;&nbsp;&nbsp; I Agree and have read the Terms of Service listed above (required to continue)</td>
diff -aruN 5.0.000.src/html/forms/YourPayConnect-orderform.html 5.2.000.src/html/forms/YourPayConnect-orderform.html
--- 5.0.000.src/html/forms/YourPayConnect-orderform.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/forms/YourPayConnect-orderform.html	2007-12-19 22:50:58.000000000 -0600
@@ -10,6 +10,8 @@
 
 <H2>CART CONTENTS HERE</H2>
 
+</form><form method="post" action="agora.cgi">
+
 <CENTER>
 
 <TABLE class="ac_checkout">
@@ -41,9 +43,9 @@
 <TD class="ac_checkout_left_col">Shipping Method:</TD>
 <TD class="ac_checkout_right_col">
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW THIS-->
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER BELOW - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
 
-<select name="Ecom_ShipTo_Method">
+<select name=Ecom_ShipTo_Method>
 <option value="$vform_Ecom_ShipTo_Method"><!--agorascript-pre
  if ("$vform_Ecom_ShipTo_Method" eq "") {
    return " Select Shipping Method ";
@@ -52,23 +54,51 @@
   }
 --></option>
 <option value="Electronic Delivery">Electronic Delivery</option>
-<option value="Local Delivery">	Local Delivery</option>
+<option value="Local Delivery">Local Delivery</option>
 <option value="Pickup">Pickup</option>
-<option value="USPS Parcel Post (Parcel)">USPS Parcel Post (5-14 days)</option>
-<option value="USPS Priority Mail (Priority)">USPS Priority Mail (3-7 days)</option>
-<option value="USPS Express Mail (Express)">USPS Express Mail (1-3 days)</option>
-<option value="USPS (Economy (Surface) Parcel Post)">Economy (Surface) Parcel Post (4-6 weeks - international)</option>
-<option value="USPS (Airmail Parcel Post)">Airmail Parcel Post (4-10 days - international)</option>
-<option value="USPS (Global Express Mail)">Global Express Mail (3-5 days - international)</option>
-<option value="USPS (Global Express Guaranteed Document Service)">Global Express Guaranteed - Non-Document (2-3 days - international)</option>
+<option value="USPS Parcel Post (Parcel)">
+USPS Parcel Post (5-14 days)</option>
+<option value="USPS Priority Mail (Priority)">
+USPS Priority Mail (3-7 days)</option>
+<option value="USPS Express Mail (Express)">
+USPS Express Mail (1-3 days)</option>
+<option value="USPS (Priority Mail International)">
+Priority Mail International (6-10 days)</option>
+<option value="USPS (Express Mail International)">
+Express Mail International (3-5 days)</option>
+<option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed (1-3 days)</option>
+<option value="UPS Ground (GND)">UPS Ground (7-10 days)</option>
+<option value="UPS Standard (STD)">UPS Standard to Canada Only (7-10 days)</option>
 <option value="UPS 3 Day Select (3DS)">UPS 3 Day Select (3-4 days)</option>
 <option value="UPS 2nd Day Air (2DA)">UPS 2nd Day Air</option>
+<option value="UPS 2nd Day Air Early AM (2DM)">UPS 2nd Day Air Early AM</option>
+<option value="UPS Next Day Saver (1DP)">UPS Next Day Air Saver</option>
 <option value="UPS Next Day Air (1DA)">UPS Next Day Air</option>
-<OPTION VALUE="UPS Ground Residential(GNDRES)">UPS Ground Residential</OPTION>
-<OPTION VALUE="UPS Ground Commercial (GNDCOM)">UPS Ground Commercial</OPTION>
+<option value="UPS Next Day Air Early AM (1DM)">UPS Next Day Air Early AM</option>
+<option value="UPS Worldwide Express (XPR)">UPS Worldwide Express (international)</option>
+<option value="UPS Worldwide Expedited (XPD)">UPS Worldwide Expedited (international)</option>
+<option value="UPS Worldwide Express Plus(XDM)">UPS Worldwide Express Plus (international)</option>
+<option value='FedEx Priority Overnight'>FedEx Priority Overnight</option>
+<option value='FedEx Standard Overnight'>FedEx Standard Overnight</option>
+<option value='FedEx First Overnight'>FedEx First Overnight</option>
+<option value='FedEx 2 Day'>FedEx 2 Day</option>
+<option value='FedEx Express Saver'>FedEx Express Saver</option>
+<option value='FedEx International Priority'>FedEx International Priority</option>
+<option value='FedEx International Economy'>FedEx International Economy</option>
+<option value='FedEx International First'>FedEx International First</option>
+<option value='FedEx 1 Day Freight'>FedEx 1 Day Freight</option>
+<option value='FedEx 2 Day Freight'>FedEx 2 Day Freight</option>
+<option value='FedEx 3 Day Freight'>FedEx 3 Day Freight</option>
+<option value='FedEx Ground'>FedEx Ground</option>
+<option value='FedEx Ground Home Delivery'>FedEx Ground Home Delivery</option>
+<option value='FedEx International Priority Freight'>FedEx International Priority Freight</option>
+<option value='FedEx International Economy Freight'>FedEx International Economy Freight</option>
+<option value='FedEx Europe First International Priority'>FedEx Europe First International Priority</option>
 </select>
 
-<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS-->
+
+<!--PASTE SHIPPING METHODS FROM SHIPPING MANAGER ABOVE THIS - REPLACE ENTIRE SHIPPING SELECT ELEMENT-->
 
 </td>
 </TR>
@@ -76,7 +106,7 @@
 <TD class="ac_checkout_left_col">Email Address:</TD>
 <TD class="ac_checkout_right_col">
 <INPUT TYPE=TEXT NAME="Ecom_BillTo_Online_Email" 
-VALUE="$eform_Ecom_BillTo_Online_Email" size=35></td>
+VALUE="$eform_Ecom_BillTo_Online_Email" size=55></td>
 </TR>
 <TD class="ac_checkout_left_col">Name:</TD>
 <TD class="ac_checkout_right_col">
@@ -352,13 +382,52 @@
 <tr>
 <td colspan=2>
 $sc_tos_display_address<br><br>
-You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="agora.cgi?page=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
+You must read the following link before you can continue:  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="$sc_store_url?cartlink=terms_of_service.html" TARGET="_blank"><b>Sales/Terms of Service and Refund Policy</b></A>.<br>
 Then put a tick in the box below. By selecting &quot;I Agree&quot; you are acknowledging that you have read and agree to our policies contained within that page.
 <br><br>
 <input type="checkbox" name="Ecom_tos" value="I Agree">&nbsp;&nbsp;&nbsp; I Agree and have read the Terms of Service listed above (required to continue)<br><br></td>
 </tr>
 ~;} -->
+<td colspan=2 class="ac_checkout_top_col">
+Misc Info</td>
 
+<!--agorascript-pre
+if ("$sc_enable_discount" =~ /yes/i) {
+  if ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+  } else { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="text" NAME="Ecom_Discount" value="$eform_Ecom_Discount" size="22" maxlength="30">
+  </td>
+</tr>
+~;
+  }
+} elsif ("$sc_storewide_discount" ne "0") { return
+q~
+<tr>
+  <td class="ac_checkout_left_col">Discount Code:</td>
+  <td class="ac_checkout_right_col">
+    <input type="hidden" NAME="Ecom_Discount" value="storewide">
+    <i>Storewide Sale going on. No other discounts can be applied.</i>
+  </td>
+</tr>
+~;
+}
+-->
+
+<td colspan=2><br/></td>
+</tr>
 <tr>
 <td class="ac_checkout_left_col">Special Notes:</td>
 <td class="ac_checkout_right_col">
diff -aruN 5.0.000.src/html/html-templates/cart_footer.inc 5.2.000.src/html/html-templates/cart_footer.inc
--- 5.0.000.src/html/html-templates/cart_footer.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/cart_footer.inc	2007-12-19 22:48:04.000000000 -0600
@@ -1,4 +1,6 @@
-<div align="center">
+<div align="center"><table class="ac_checkout">
+	<tr>
+		<td><div align="center">
 <!--agorascript-pre
 if ($sc_qty_box_on_cart_display =~ /yes/i) {
   return '<input type="image" name="submit_change_quantity_button" 
@@ -13,7 +15,7 @@
 <input type="image" name="continue_shopping_button" 
 	value="Continue Shopping" src="%%ButtonSetURL%%/continue_shopping.gif">
 
-<br/>
+<br>
 
 <!--DO NOT DELETE THIS NEXT LINE-->
 %%offlineSecureURL%%
@@ -21,6 +23,10 @@
 
 <input type="image" name="order_form_button" 
 	value="Complete Secure Order" src="%%ButtonSetURL%%/complete_order.gif">
-</form>
 </div>
+		</td>
+	</tr>
+</table>
+</div>
+</form>
 
diff -aruN 5.0.000.src/html/html-templates/change_quantity_footer.inc 5.2.000.src/html/html-templates/change_quantity_footer.inc
--- 5.0.000.src/html/html-templates/change_quantity_footer.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/change_quantity_footer.inc	2007-12-19 22:48:04.000000000 -0600
@@ -1,7 +1,13 @@
-<div align="center">           
+<div align="center"><table class="ac_checkout">
+	<tr>
+		<td><div align="center">       
 <input type="image" name="submit_change_quantity_button" 
 	value="Submit Change" src="%%ButtonSetURL%%/edit_items.gif">
 <input type="image" name="continue_shopping_button" 
 	value="Continue Shopping" src="%%ButtonSetURL%%/continue_shopping.gif">
 </div>
+		</td>
+	</tr>
+</table>
+</div>
 </form>
diff -aruN 5.0.000.src/html/html-templates/delete_items_footer.inc 5.2.000.src/html/html-templates/delete_items_footer.inc
--- 5.0.000.src/html/html-templates/delete_items_footer.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/delete_items_footer.inc	2007-12-19 22:48:05.000000000 -0600
@@ -1,7 +1,13 @@
-<div align="center">
+<div align="center"><table class="ac_checkout">
+	<tr>
+		<td><div align="center">
 	<input type="image" name="submit_deletion_button" 
 		value="Submit Deletion" src="%%ButtonSetURL%%/remove_items.gif">
 	<input type="image" name="continue_shopping_button" 
 		value="Continue Shopping" src="%%ButtonSetURL%%/continue_shopping.gif">
 </div>
+		</td>
+	</tr>
+</table>
+</div>
 </form>
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/empty_cart_footer.inc 5.2.000.src/html/html-templates/empty_cart_footer.inc
--- 5.0.000.src/html/html-templates/empty_cart_footer.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/empty_cart_footer.inc	2007-12-19 22:48:05.000000000 -0600
@@ -1,13 +1,12 @@
-<div align="center">
-<table>
+<table class="ac_checkout">
 	<tr>
-		<td>
+		<td><div align="center">
 			<input type="hidden" name="return_to_frontpage_button" value="
 			  <!--agorascript "$sc_return_to_frontpage_after_empty_cart"; -->">
 			<input type="image" name="continue_shopping_button" value="Continue Shopping" 
 				src="%%ButtonSetURL%%/continue_shopping.gif">
+</div>
 		</td>
 	</tr>
 </table>
-</div>
 </form>
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/productPage-1a.inc 5.2.000.src/html/html-templates/productPage-1a.inc
--- 5.0.000.src/html/html-templates/productPage-1a.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/productPage-1a.inc	2007-12-19 22:48:05.000000000 -0600
@@ -13,5 +13,5 @@
 %%description%%<br><br/>
 <span class="ac_product_price">%%price%%</span><br>
 </td></form></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td class="ac_product_desc">
-<a href="%%scripturl%%?dc=1&%%href_fields%%">Check Out</a></td></tr>
+<a href="%%scripturl%%?dc=1&%%href_fields%%" rel="nofollow">Check Out</a></td></tr>
 <tr><td colspan=3><hr/></td></tr>
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/productPage-1b1.inc 5.2.000.src/html/html-templates/productPage-1b1.inc
--- 5.0.000.src/html/html-templates/productPage-1b1.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/productPage-1b1.inc	2007-12-19 22:48:06.000000000 -0600
@@ -11,5 +11,5 @@
 <td class="ac_add-quantity"><input type="image" name="add_to_cart_button" value="Add To Cart" src="%%ButtonSetURL%%/add_to_cart.gif">
 </td></tr></table>
 <!--END SELECT QUANTITY BUTTON-->
-<a href="agora.cgi?dc=1&%%href_fields%%"><b>Check Out</b></a></td></form></tr>
+<a href="agora.cgi?dc=1&%%href_fields%%" rel="nofollow"><b>Check Out</b></a></td></form></tr>
 <tr><td><hr/></td></tr>
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/productPage-1b.inc 5.2.000.src/html/html-templates/productPage-1b.inc
--- 5.0.000.src/html/html-templates/productPage-1b.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/productPage-1b.inc	2007-12-19 22:48:06.000000000 -0600
@@ -9,6 +9,6 @@
 <td class="ac_add-quantity"><input type="image" name="add_to_cart_button" value="Add To Cart" src="%%ButtonSetURL%%/add_to_cart.gif">
 </td></tr></table>
 <!--END SELECT QUANTITY BUTTON-->
-<a href="agora.cgi?dc=1&%%href_fields%%"><b>Check Out</b></a>
+<a href="agora.cgi?dc=1&%%href_fields%%" rel="nofollow"><b>Check Out</b></a>
 </td></form></tr>
 <tr><td><hr/></td></tr>
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/productPage-1c.inc 5.2.000.src/html/html-templates/productPage-1c.inc
--- 5.0.000.src/html/html-templates/productPage-1c.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/productPage-1c.inc	2007-12-19 22:48:06.000000000 -0600
@@ -9,5 +9,5 @@
 <td class="ac_add-quantity"><input type="image" name="add_to_cart_button" value="Add To Cart" src="%%ButtonSetURL%%/add_to_cart.gif">
 </td></tr></table>
 <!--END SELECT QUANTITY BUTTON-->
-<a href="%%scripturl%%?dc=1&%%href_fields%%">Check Out</a></td></tr>
+<a href="%%scripturl%%?dc=1&%%href_fields%%" rel="nofollow">Check Out</a></td></form></tr>
 <tr><td colspan=3><hr/></td></tr>
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/productPage-1d.inc 5.2.000.src/html/html-templates/productPage-1d.inc
--- 5.0.000.src/html/html-templates/productPage-1d.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/productPage-1d.inc	2007-12-19 22:48:06.000000000 -0600
@@ -31,7 +31,7 @@
 </TR>
 </TABLE>
 <!--END SELECT QUANTITY BUTTON-->
-<A HREF="agora.cgi?dc=1&%%href_fields%%">
+<A HREF="agora.cgi?dc=1&%%href_fields%%" rel="nofollow">
 <FONT FACE=ARIAL size="2"><B>Check Out</B></FONT>
 </A>
 </TD>
diff -aruN 5.0.000.src/html/html-templates/productPage-2a1.inc 5.2.000.src/html/html-templates/productPage-2a1.inc
--- 5.0.000.src/html/html-templates/productPage-2a1.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/productPage-2a1.inc	2007-12-19 22:48:07.000000000 -0600
@@ -38,7 +38,7 @@
 					</td>
 					<td class="ac_add-quantity">
 						<input type="image" name="add_to_cart_button" value="Add To Cart"
-							src="%%URLofImages%%/add_to_cart.gif">
+							src="%%ButtonSetURL%%/add_to_cart.gif">
 					</td>
 				</tr>
 			</table>
@@ -74,10 +74,10 @@
 					<span class="ac_product_price">%%price%%</span>
 				</td>
 				<td width='33%' align=center>
-					<a href="%%scripturl%%?dc=1&amp;%%href_fields%%">View Cart</a>
+					<a href="%%scripturl%%?dc=1&amp;%%href_fields%%" rel="nofollow">View Cart</a>
 				</td>
 				<td width = '33%' align=center>
-					<a href='%%StepOneURL%%?order_form_button.x=1&amp;%%href_fields%%'>Check Out</a>
+					<a href='%%StepOneURL%%?order_form_button.x=1&amp;%%href_fields%%' rel="nofollow">Check Out</a>
 				</td>
 			</tr>
 		</table>
diff -aruN 5.0.000.src/html/html-templates/productPage-2a.inc 5.2.000.src/html/html-templates/productPage-2a.inc
--- 5.0.000.src/html/html-templates/productPage-2a.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/productPage-2a.inc	2007-12-19 22:48:07.000000000 -0600
@@ -38,7 +38,7 @@
 					</td>
 					<td class="ac_add-quantity">
 						<input type="image" name="add_to_cart_button" value="Add To Cart"
-							src="%%URLofImages%%/add_to_cart.gif">
+							src="%%ButtonSetURL%%/add_to_cart.gif">
 					</td>
 				</tr>
 			</table>
@@ -74,7 +74,7 @@
 					<span class="ac_product_price">%%price%%</span>
 				</td>
 				<td width = '50%' align=center>
-					<a href='%%StepOneURL%%?order_form_button.x=1&amp;%%href_fields%%'>Check Out</a>
+					<a href='%%StepOneURL%%?order_form_button.x=1&amp;%%href_fields%%'  rel="nofollow">Check Out</a>
 				</td>
 			</tr>
 		</table>
diff -aruN 5.0.000.src/html/html-templates/productPage-4a.inc 5.2.000.src/html/html-templates/productPage-4a.inc
--- 5.0.000.src/html/html-templates/productPage-4a.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/productPage-4a.inc	2007-12-19 22:48:07.000000000 -0600
@@ -23,7 +23,7 @@
  } else { #first one
   $myans .= '<tr><td width="'.$ags_row_wd.'%" valign="top">';
  }
-$myans.=qq~<form method="post" action="%%scriptURL%%">
+$myans.=qq~<form method="post" action="%%scriptURL%%" rel="nofollow">
 %%make_hidden_fields%%
 <table width="100%">
 ~;
diff -aruN 5.0.000.src/html/html-templates/productPage.inc 5.2.000.src/html/html-templates/productPage.inc
--- 5.0.000.src/html/html-templates/productPage.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/productPage.inc	2007-12-19 22:48:08.000000000 -0600
@@ -25,28 +25,17 @@
 return $myans;
 } # end of controller code
 -->
-<tr> 
-	<td class="ac_product_opt-add">
+<tr><td class="ac_product_opt-add">
 		<form method="post" action="%%scriptURL%%">
 			%%make_hidden_fields%%
 			%%optionFile%%
 			<!--BEGIN SELECT QUANTITY BUTTON-->
-			<table class="ac_add-quantity">
-				<tr>
-					<td class="ac_add-quantity">
-						%%QtyBox%%
-					</td>
-					<td class="ac_add-quantity">
-						<input type="image" name="add_to_cart_button" value="Add To Cart"
-							src="%%ButtonSetURL%%/add_to_cart.gif">
-					</td>
-				</tr>
-			</table>
+			<table class="ac_add-quantity"><tr><td class="ac_add-quantity">%%QtyBox%%
+					</td><td class="ac_add-quantity">
+						<input type="image" name="add_to_cart_button" value="Add To Cart" src="%%ButtonSetURL%%/add_to_cart.gif">
+					</td></tr></table>
 			<!--END SELECT QUANTITY BUTTON-->
-		</form>
-	</td>
-	<td class="ac_product_image">%%image%%</td>
-</tr>
+		</form></td><td class="ac_product_image">%%image%%</td></tr>
 <!--agorascript-pre
 { # more controller code
 local ($myans)="";
@@ -60,29 +49,16 @@
 return $myans;
 } # end controller code
 -->
-<tr>
-	<td colspan=2>
-		<h3 class="ac_product_name">%%name%%</h3>
-		<p class="ac_product_desc">%%description%%</p>	
-	</td>
-</tr>
-<tr> 
-	<td colspan=2>
+<tr><td colspan=2>
+		<h3 class="ac_product_name">%%name%%</h3><p class="ac_product_desc">%%description%%</p>	
+	</td></tr>
+<tr><td colspan=2>
 		<table width='100%' border=0 cellpadding=0 cellspacing=0 class="ac_product_desc">
-			<tr>
-				<td width='33%' align=center>
-					<span class="ac_product_price">%%price%%</span>
-				</td>
-				<td width='33%' align=center>
-					<a href="%%scripturl%%?dc=1&amp;%%href_fields%%">View Cart</a>
-				</td>
-				<td width = '33%' align=center>
-					<a href='%%StepOneURL%%?order_form_button.x=1&amp;%%href_fields%%'>Check Out</a>
-				</td>
-			</tr>
-		</table>
-	</td>
-</tr>
+			<tr><td width='33%' align=center><span class="ac_product_price">%%price%%</span>
+				</td><td width='33%' align=center><a href="%%scripturl%%?dc=1&amp;%%href_fields%%" rel="nofollow">View Cart</a>
+				</td><td width = '33%' align=center><a href='%%StepOneURL%%?order_form_button.x=1&amp;%%href_fields%%' rel="nofollow">Check Out</a>
+				</td></tr></table>
+	</td></tr>
 <!--agorascript-pre
 { # more controller code
 local ($myans)="";
diff -aruN 5.0.000.src/html/html-templates/productPage-search2.inc 5.2.000.src/html/html-templates/productPage-search2.inc
--- 5.0.000.src/html/html-templates/productPage-search2.inc	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/productPage-search2.inc	2007-12-19 22:48:07.000000000 -0600
@@ -15,8 +15,8 @@
 				<tr><td width='33%' align=center>
 						<span class="ac_product_price">%%price%%</span>
 					</td><td width='33%' align=center>
-						<a href="%%scripturl%%?dc=1&amp;%%href_fields%%">View Cart</a>
+						<a href="%%scripturl%%?dc=1&amp;%%href_fields%%" rel="nofollow">View Cart</a>
 					</td><td width = '33%' align=center>
-						<a href='%%StepOneURL%%?order_form_button.x=1&amp;%%href_fields%%'>Check Out</a>
+						<a href='%%StepOneURL%%?order_form_button.x=1&amp;%%href_fields%%' rel="nofollow">Check Out</a>
 					</td></tr></table></td>
 </tr><tr><td colspan="3"><hr/></td></tr>
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/Custom/secure_store_footer.html 5.2.000.src/html/html-templates/templates/Custom/secure_store_footer.html
--- 5.0.000.src/html/html-templates/templates/Custom/secure_store_footer.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/Custom/secure_store_footer.html	2005-12-12 19:24:39.000000000 -0600
@@ -0,0 +1,21 @@
+<!-- Begin Footer -->
+	</td>
+</tr>
+<tr>
+	<td>&nbsp;</td><td class="ac_bottom_links">
+
+<!--agorascript-pre 
+&capture_STDOUT; 
+&cartlinks;
+$cartlinks =~ s/<ul>\n<li>/<ul>\n<li class="first">/ig;
+print $cartlinks;
+&uncapture_STDOUT;  -->
+
+	</td>
+</tr>
+<tr>
+<td colspan="2" class="ac_copyright">
+	Copyright 1999 to Present by K-Factor Technologies Inc. at <a href="http://www.agoracart.com">AgoraCart.com</a>
+</td>
+</tr>
+</table>
diff -aruN 5.0.000.src/html/html-templates/templates/Custom/secure_store_header.html 5.2.000.src/html/html-templates/templates/Custom/secure_store_header.html
--- 5.0.000.src/html/html-templates/templates/Custom/secure_store_header.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/Custom/secure_store_header.html	2005-12-12 19:24:39.000000000 -0600
@@ -0,0 +1,100 @@
+<!--BEGIN HEADER TABLE-->
+<table class="ac_header">
+<tr>
+  <td>
+    <h1 id="ac_h1">Powered by AgoraCart - AgoraCart.com</h1>
+    <h2 id="ac_h2">Thanks for Visiting our Store!</h2>
+  </td>
+  <td class="ac_header_search">
+    <form method="post" action="<!--agorascript-post { &capture_STDOUT;
+print "$sc_store_url";
+&uncapture_STDOUT;
+} -->">
+      <input type="hidden" name="cart_id" value="%%cart_id%%">
+      <input type="text" name="keywords" size="20" maxlength="40">
+      <input type="hidden" name="ppinc=search" value="search">
+      <input type="submit" name="search_request_button" value="Search"> 
+    </form>
+  </td>
+</tr>
+</table>
+<table class="ac_mainbody" cellpadding=0 cellspacing=0>
+<tr>
+  <td class="ac_left_nav">
+  <h3>Shopping Categories:</h3>
+<!--agorascript-pre { # code to list categories and/or sub categories
+# updated for AgoraCart 5.x by Mister Ed Jan 11, 2005
+# updated to fit CSS mods by Eric Welin Feb 02, 2005
+local($sku,$category,$subcategory);
+my ($catnumber,$catnumber2)= '';
+local(%db_ele,%subcatarray)= ();
+if (!($sc_db_lib_was_loaded =~ /yes/i)){ 
+  &require_supporting_libraries (__FILE__, __LINE__, "$sc_db_lib_path"); 
+}
+&capture_STDOUT;
+print "  <ul>";
+if ($sc_use_database_subcats =~ /yes/i) {
+  &get_prod_db_element($db{"product"},*db_ele);
+  foreach $sku (sort (keys %db_ele)) {
+    $catnumber = "";
+    $category = $db_ele{$sku};
+    %subcatarray = %{$db_ele{$category}};
+    $category2 = $category;
+    $category2=~s/ /%20/g;
+    if ($sc_count_database_cats =~ /yes/i) {
+      $catnumber = "(" . $db_ele2{$category} . ")";
+    }
+    print qq~\n    <li><a href="agora.cgi?cart_id=%%cart_id%%&amp;product=$category2" class="ac_left_links" title="$category">$category</a> $catnumber</li>~;
+    foreach $subcategoryarray (sort(keys %subcatarray)) {
+      $category3 = $subcategoryarray;
+#      $category3=~s/ /%20/g;
+      if ($sc_count_database_cats =~ /yes/i) {
+        $catnumber2 = "(" . $db_ele{$category}->{$subcategoryarray} . ")";
+      }
+      print qq~\n    <li><a href="agora.cgi?cart_id=%%cart_id%%&amp;product=$category2&amp;user4=$category3" class="ac_left_sub_links" title="$category3">$category3</a> $catnumber2</li>~;
+    }
+  }
+} else { 
+  &get_prod_db_element($db{"product"},*db_ele);
+  foreach $sku (keys %db_ele) {
+    $category = $db_ele{$sku};
+    $category_list{$category}++;
+  }
+  foreach $category (sort(keys %category_list)) {
+    $category2 = $category;
+    $category2=~s/_/ /g;
+    print qq~\n    <li><a href="agora.cgi?cart_id=%%cart_id%%&amp;product=$category" class="ac_left_links" title="$category2">$category2</a></li>~;
+  }
+}
+print "\n  </ul>";
+&uncapture_STDOUT; }
+-->
+    <hr/>
+    <form method="post" action="<!--agorascript-post { &capture_STDOUT;
+print "$sc_store_url";
+&uncapture_STDOUT;
+} -->">
+      <h3>
+        Look For Gifts<br/>
+        under this Price:<br/>
+        <input type="hidden" name="cart_id" value="%%cart_id%%">
+        $ <input type="text" name="query_price_high_range" size="6" maxlength="10"><br/>
+        <input type="hidden" name="ppinc" value="search">
+        <input type="submit" name="search_request_button" value=" Search ">
+      </h3>
+    </form>
+    <hr/>
+    <h3>Company Info:</h3>
+<!--agorascript-pre 
+&capture_STDOUT; 
+&cartlinks;
+# Match the style for left links
+$cartlinks =~ s/<a href/<a class=\"ac_left_links\" href/ig;
+print $cartlinks;
+&uncapture_STDOUT;  -->
+    
+
+    
+  </td>
+  <td class="ac_content">
+<!--END HEADER TABLE-->
diff -aruN 5.0.000.src/html/html-templates/templates/Custom/store_footer.html 5.2.000.src/html/html-templates/templates/Custom/store_footer.html
--- 5.0.000.src/html/html-templates/templates/Custom/store_footer.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/Custom/store_footer.html	2005-12-12 19:24:40.000000000 -0600
@@ -0,0 +1,16 @@
+<!-- Begin Footer -->
+	</td>
+</tr>
+<tr>
+	<td>&nbsp;</td><td class="ac_bottom_links">
+
+&nbsp;
+
+	</td>
+</tr>
+<tr>
+<td colspan="2" class="ac_copyright">
+	Copyright 1999 to Present by K-Factor Technologies Inc. at <a href="http://www.agoracart.com">AgoraCart.com</a>
+</td>
+</tr>
+</table>
diff -aruN 5.0.000.src/html/html-templates/templates/Custom/store_header.html 5.2.000.src/html/html-templates/templates/Custom/store_header.html
--- 5.0.000.src/html/html-templates/templates/Custom/store_header.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/Custom/store_header.html	2005-12-12 19:24:41.000000000 -0600
@@ -0,0 +1,134 @@
+<!--BEGIN HEADER TABLE-->
+<table class="ac_header">
+<tr>
+  <td>
+<!--agorascript-pre 
+&capture_STDOUT; 
+print qq~<font class="template_fonth1"><b>$sc_headerStoreTitle</b></font>~;
+print qq~<font class="template_fonth2"><br>$sc_headerStoreTagLine</font>~;
+&uncapture_STDOUT;  -->
+  </td>
+  <td class="ac_header_search">
+    <form method="post" action="agora.cgi">
+      <input type="hidden" name="cart_id" value="%%cart_id%%">
+      <input type="text" name="keywords" size="20" maxlength="40">
+      <input type="hidden" name="ppinc" value="search">
+      <input type="submit" name="search_request_button" value="Search"> 
+    </form>
+  </td>
+</tr>
+</table>
+<table class="ac_mainbody" cellpadding=0 cellspacing=0>
+<tr>
+  <td class="ac_left_nav">
+  <h3>Shopping Categories:</h3>
+<!--agorascript-pre { # code to list categories and/or sub categories
+# updated for AgoraCart 5.x by Mister Ed Jan 11, 2005
+# updated to fit CSS mods by Eric Welin Feb 02, 2005
+local($sku,$category,$subcategory);
+my ($catnumber,$catnumber2)= '';
+local(%db_ele,%subcatarray)= ();
+if (!($sc_db_lib_was_loaded =~ /yes/i)){ 
+  &require_supporting_libraries (__FILE__, __LINE__, "$sc_db_lib_path"); 
+}
+&capture_STDOUT;
+print "  <ul>";
+if ($sc_use_database_subcats =~ /yes/i) {
+  &get_prod_db_element($db{"product"},*db_ele);
+  foreach $sku (sort (keys %db_ele)) {
+    $catnumber = "";
+    $category = $db_ele{$sku};
+    %subcatarray = %{$db_ele{$category}};
+    $category2 = $category;
+    $category2=~s/ /%20/g;
+    if ($sc_count_database_cats =~ /yes/i) {
+      $catnumber = "(" . $db_ele2{$category} . ")";
+    }
+    print qq~\n    <li><a href="agora.cgi?cart_id=%%cart_id%%&amp;product=$category2" class="ac_left_links" title="$category">$category</a> $catnumber</li>~;
+    foreach $subcategoryarray (sort(keys %subcatarray)) {
+      $category3 = $subcategoryarray;
+#      $category3=~s/ /%20/g;
+      if ($sc_count_database_cats =~ /yes/i) {
+        $catnumber2 = "(" . $db_ele{$category}->{$subcategoryarray} . ")";
+      }
+      print qq~\n    <li><a href="agora.cgi?cart_id=%%cart_id%%&amp;product=$category2&amp;user4=$category3" class="ac_left_sub_links" title="$category3">$category3</a> $catnumber2</li>~;
+    }
+  }
+} else { 
+  &get_prod_db_element($db{"product"},*db_ele);
+  foreach $sku (keys %db_ele) {
+    $category = $db_ele{$sku};
+    $category_list{$category}++;
+  }
+  foreach $category (sort(keys %category_list)) {
+    $category2 = $category;
+    $category2=~s/_/ /g;
+    print qq~\n    <li><a href="agora.cgi?cart_id=%%cart_id%%&amp;product=$category" class="ac_left_links" title="$category2">$category2</a></li>~;
+  }
+}
+print "\n  </ul>";
+&uncapture_STDOUT; }
+-->
+    <hr/>
+    <form method="post" action="agora.cgi">
+      <h3>
+        Look For Gifts<br/>
+        under this Price:<br/>
+        <input type="hidden" name="cart_id" value="%%cart_id%%">
+        $ <input type="text" name="query_price_high_range" size="6" maxlength="10"><br/>
+        <input type="hidden" name="ppinc" value="search">
+        <input type="submit" name="search_request_button" value=" Search ">
+      </h3>
+    </form>
+    <hr/>
+    <h3>Company Info:</h3>
+<!--agorascript-pre 
+&capture_STDOUT; 
+&cartlinks;
+print $cartlinks;
+&uncapture_STDOUT;  -->
+    
+    <div id="ac_html_validator">
+      <a href="http://validator.w3.org/check?uri=referer" target="_new">
+        <img src="%%URLofImages%%/valid-html401.png"
+          alt="Valid HTML 4.01!" height="31" width="88"></a>
+    </div>
+    
+  </td>
+  <td class="ac_content">
+<!--agorascript-pre {
+local (@my_cart_fields,$my_cart_row_number,$result);
+local ($count,$price,$product_id,$quantity,$total_cost,$total_qty)=0;
+if ((!(-f "$sc_cart_path"))||($sc_processing_order =~ /yes/i)) {return ""}
+open (CART, "$sc_cart_path") || &file_open_error("$sc_cart_path",
+ "display_cart_contents_in_header", __FILE__, __LINE__);
+ while (<CART>)
+  {
+   $count++;
+   chop;    
+   @my_cart_fields = split (/\|/, $_);
+   $my_cart_row_number = pop(@my_cart_fields);
+   push (@my_cart_fields, $my_cart_row_number);
+   $quantity = $my_cart_fields[0];
+   $product_id = $my_cart_fields[1];
+   $price = $my_cart_fields[$sc_cart_index_of_price_after_options]; 
+   $total_cost = $total_cost + $quantity * $price;
+   $total_qty = $total_qty + $quantity;
+  } # End of while (<CART>)
+close (CART);
+if ($count > 0) {
+  $result = '<div align="center"><table class="ac_cart_summary"><tr>' .
+      '<td><a href="agora.cgi?dc=1&amp;%%href_fields%%' . 
+      '">View Cart</a></td>' .
+      "<td> Items in shopping cart: $total_qty\n" . 
+      "<br/> Item cost subtotal:&nbsp; " . &display_price($total_cost) . 
+      "</td>\n" .
+      '<td><a href="%%StepOneURL%%?order_form_button.x=1&amp;%%href_fields%%' . 
+      '">Check Out</a></td>' .
+      "</tr></table></div>";
+ } else {
+  $result = "";
+ }
+ return $result;
+}-->
+<!--END HEADER TABLE-->
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/secure_store_footer.html 5.2.000.src/html/html-templates/templates/TheAgora/secure_store_footer.html
--- 5.0.000.src/html/html-templates/templates/TheAgora/secure_store_footer.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/secure_store_footer.html	2007-12-20 15:56:03.000000000 -0600
@@ -15,7 +15,13 @@
             <td class="template_cartcontents"><div align="center"><span class="style6"> </span>   <!--agorascript-pre {
 local (@my_cart_fields,$my_cart_row_number,$result);
 local ($count,$price,$product_id,$quantity,$total_cost,$total_qty)=0;
-if ((!(-f "$sc_cart_path"))||($sc_processing_order =~ /yes/i)) {return "<br>Items in your cart: 0<br><br>"}
+if ((!(-f "$sc_cart_path"))||($sc_processing_order =~ /yes/i)) {
+    my $buysafe_temp_display = '';
+     if ($sc_buySafe_is_enabled =~ /yes/) {
+         $buysafe_temp_display = qq|<br><br>$sc_buysafe_merchant_seal_complete_button_string|;
+    }
+    return "<br>Items in your cart: 0 $buysafe_temp_display<br><br>"
+}
 open (CART, "$sc_cart_path") || &file_open_error("$sc_cart_path",
  "display_cart_contents_in_header", __FILE__, __LINE__);
  while (<CART>)
@@ -32,15 +38,19 @@
    $total_qty = $total_qty + $quantity;
   } # End of while (<CART>)
 close (CART);
+my $buysafe_temp_display = '';
+if ($sc_buySafe_is_enabled =~ /yes/) {
+    $buysafe_temp_display = qq|<br><br>$sc_buysafe_merchant_seal_complete_button_string <br>|;
+}
 if ($count > 0) {
   $result = '<table><tr><td class="template_cartcontents">' .
       "Items in your cart: <font color=red>$total_qty</font>\n" . 
-      "<br/>Subtotal:&nbsp;<font color=red>" . &display_price($total_cost) . 
+      "<br>Subtotal:&nbsp;<font color=red>" . &display_price($total_cost) . 
       '</font><br><br></td></tr><tr><td class="template_checkoutcartcontents">' .
       "<a href=\"$sc_store_url?dc=1&amp;%%href_fields%%" . 
-      '">View Cart Details</a><br>' .
+      '" rel="nofollow">View Cart Details</a><br>' .
       '<a href="%%StepOneURL%%?order_form_button.x=1&amp;%%href_fields%%' . 
-      '">Check Out</a></td>' .
+      qq|" rel="nofollow">Check Out</a>$buysafe_temp_display</td>'|.
       "</tr></table>";
  } else {
   $result = "";
@@ -49,10 +59,6 @@
 }--></div></td>
 
 
-
-
-
-
           </tr>
         </table>
 		<p></p>
@@ -116,12 +122,31 @@
 }
 # end of display Top Sellers
 -->
-<br/>
+<br>
       </td>
 	</tr>
 	<tr class="template_copyright">
 	  <td height="24" colspan="3" class="template_copyright"><center>
-	Copyright 1999 to Present by K-Factor Technologies Inc. at <a href="http://www.agoracart.com" class="copyright_link">AgoraCart.com</a> and <a href="http://www.K-Factor.net" class="copyright_link">K-Factor.net</a></center>
+Copyright &copy; 
+<!--agorascript-pre {
+&capture_STDOUT;
+
+# start display New Products
+if ($sc_footer_copyright_text eq ''){ 
+print qq~
+1999 to Present by K-Factor Technologies Inc. at <a href="http://www.agoracart.com" class="copyright_link">AgoraCart.com</a> and <a href="http://www.K-Factor.net" class="copyright_link">K-Factor.net</a>
+~;
+} else {
+print qq~
+$sc_footer_copyright_text
+~;
+}
+&uncapture_STDOUT;
+}
+# end of display Top Sellers
+-->
+<br>
+	Powered by <a href="http://www.AgoraCartPro.com" class="copyright_link">AgoraCart Pro</a>. Maintained by <a href="http://www.K-Factor.net" class="copyright_link">Mister Ed</a> at <a href="http://www.AgoraCart.com" class="copyright_link">AgoraCart.com</a></center>
  	</td>
   </tr>
 </table>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/secure_store_header.html 5.2.000.src/html/html-templates/templates/TheAgora/secure_store_header.html
--- 5.0.000.src/html/html-templates/templates/TheAgora/secure_store_header.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/secure_store_header.html	2007-12-19 22:49:52.000000000 -0600
@@ -34,7 +34,6 @@
 <!--START Dynamic Links - cartlinks-->
 <!-- .html and .htm pages in the html directory of your store, compiled in real time.  Add/Remove/Rename pages in your store's html directory to alter these links-->
 <!--agorascript-pre 
-
 &capture_STDOUT; 
 &cartlinks;
 $cartlinks =~ s/<ul>\n//ig;
@@ -44,10 +43,7 @@
 $cartlinks =~ s/<\/ul>//ig;
 print $cartlinks;
 &uncapture_STDOUT;  -->
-
-<!--START Dynamic Links - cartlinks-->
-
-
+<!--END Dynamic Links - cartlinks-->
 
 
 		</span>	  </td>
@@ -56,9 +52,11 @@
 	  <td width="175" valign="top" bgcolor="#FFFFFF">
 
 
-
 <!--START Search Box-->
-    <form method="post" action="$sc_store_url">
+<!--agorascript-pre 
+&capture_STDOUT;
+    print qq|<form method="post" action="$sc_store_url">|;
+&uncapture_STDOUT;  -->
         <div align="center"><span class="style14"><br>
     Search: </span>
       <input type="hidden" name="cart_id" value="%%cart_id%%">
@@ -71,19 +69,11 @@
 <!--END Search Box-->
 
 
-
 <!--START Category Listings-->
-
-<!--agorascript-pre { # code to list categories and/or sub categories
-# updated for AgoraCart 5.x by Mister Ed Jan 11, 2005
-# updated to fit CSS mods by Eric Welin Feb 02, 2005
+<!--agorascript-pre {
+# code to list categories and/or sub categories
+# updated for pre-built lists in managers by Mister Ed September 29, 2007
 if ($sc_displayDynamicCategories =~ /yes/i) {
-local($sku,$category,$subcategory);
-my ($catnumber,$catnumber2)= '';
-local(%db_ele,%subcatarray)= ();
-if (!($sc_db_lib_was_loaded =~ /yes/i)){ 
-  &require_supporting_libraries (__FILE__, __LINE__, "$sc_db_lib_path"); 
-}
 &capture_STDOUT;
 	    print qq~<table width="160" border="0" align="center" cellpadding="3" cellspacing="1" class="template_mainbackground">
         <tr>
@@ -93,37 +83,9 @@
           <td bgcolor="#FFFFFF"><div align="left"><span class="style6"> </span><br>
 ~;
 if ($sc_use_database_subcats =~ /yes/i) {
-  &get_prod_db_element($db{"product"},*db_ele);
-  foreach $sku (sort (keys %db_ele)) {
-    $catnumber = "";
-    $category = $db_ele{$sku};
-    %subcatarray = %{$db_ele{$category}};
-    $category2 = $category;
-    $category2=~s/ /%20/g;
-    if ($sc_count_database_cats =~ /yes/i) {
-      $catnumber = "(" . $db_ele2{$category} . ")";
-    }
-    print qq~\n&bull;<a href="$sc_store_url?cart_id=%%cart_id%%&amp;product=$category2" class="ac_left_links" title="$category">$category</a> $catnumber<br>~;
-    foreach $subcategoryarray (sort(keys %subcatarray)) {
-      $category3 = $subcategoryarray;
-#      $category3=~s/ /%20/g;
-      if ($sc_count_database_cats =~ /yes/i) {
-        $catnumber2 = "(" . $db_ele{$category}->{$subcategoryarray} . ")";
-      }
-      print qq~\n&nbsp;&nbsp;<a href="$sc_store_url?cart_id=%%cart_id%%&amp;product=$category2&amp;$sc_subcat_index_field=$category3" class="ac_left_sub_links" title="$category3">$category3</a> $catnumber2<br>~;
-    }
-  }
+    print qq|\n$sc_categories_with_subcats\n|;
 } else { 
-  &get_prod_db_element($db{"product"},*db_ele);
-  foreach $sku (keys %db_ele) {
-    $category = $db_ele{$sku};
-    $category_list{$category}++;
-  }
-  foreach $category (sort(keys %category_list)) {
-    $category2 = $category;
-    $category2=~s/_/ /g;
-    print qq~\n&bull; <a href="$sc_store_url?cart_id=%%cart_id%%&amp;product=$category" class="ac_left_links" title="$category2">$category2</a><br>~;
-  }
+    print qq|\n$sc_categories_no_subcats\n|;
 }
 print "\n";
 	    print qq~
@@ -135,21 +97,20 @@
 &uncapture_STDOUT; }
 }
 -->
-
 <!--END Category Listings-->
 
 
-
-
-
 <!--START Price Search-->
         <table width="160" border="0" align="center" cellpadding="3" cellspacing="1" class="template_mainbackground">
           <tr>
             <td  class="template_mainbackground"><span class="style6"><span class="style7">Search by Price</span></span></td>
           </tr>
           <tr>
-            <td bgcolor="#FFFFFF"><div align="center"><br><form method="post" action="$sc_store_url">
-<span class="style6">Search Between:<br/><br/> <input type="hidden" name="cart_id" value="%%cart_id%%">
+            <td bgcolor="#FFFFFF"><div align="center"><br><!--agorascript-pre 
+&capture_STDOUT;
+    print qq|<form method="post" action="$sc_store_url">|;
+&uncapture_STDOUT;  -->
+<span class="style6">Search Between:<br><br> <input type="hidden" name="cart_id" value="%%cart_id%%">
 %%sc_money_symbol%% <input type="text" name="query_price_low_range" size="5" maxlength="10">
 <small> & </small>
 <input type="text" name="query_price_high_range" size="5" maxlength="10"><br><br>
@@ -167,10 +128,6 @@
           <tr>
  
   <td class="ac_content">
-
 <!--END HEADER TABLE-->
 
 
-
-
-
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/store_footer.html 5.2.000.src/html/html-templates/templates/TheAgora/store_footer.html
--- 5.0.000.src/html/html-templates/templates/TheAgora/store_footer.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/store_footer.html	2007-12-20 15:56:03.000000000 -0600
@@ -1,6 +1,5 @@
 
 
-
 <!-- Begin Footer -->
 </td>
           </tr>
@@ -15,7 +14,13 @@
             <td class="template_cartcontents"><div align="center"><span class="style6"> </span>   <!--agorascript-pre {
 local (@my_cart_fields,$my_cart_row_number,$result);
 local ($count,$price,$product_id,$quantity,$total_cost,$total_qty)=0;
-if ((!(-f "$sc_cart_path"))||($sc_processing_order =~ /yes/i)) {return "<br>Items in your cart: 0<br><br>"}
+if ((!(-f "$sc_cart_path"))||($sc_processing_order =~ /yes/i)) {
+    my $buysafe_temp_display = '';
+     if ($sc_buySafe_is_enabled =~ /yes/) {
+         $buysafe_temp_display = qq|<br><br>$sc_buysafe_merchant_seal_complete_button_string|;
+    }
+    return "<br>Items in your cart: 0 $buysafe_temp_display<br><br>"
+}
 open (CART, "$sc_cart_path") || &file_open_error("$sc_cart_path",
  "display_cart_contents_in_header", __FILE__, __LINE__);
  while (<CART>)
@@ -32,31 +37,31 @@
    $total_qty = $total_qty + $quantity;
   } # End of while (<CART>)
 close (CART);
+my $buysafe_temp_display = '';
+if ($sc_buySafe_is_enabled =~ /yes/) {
+    $buysafe_temp_display = qq|<br><br>$sc_buysafe_merchant_seal_complete_button_string <br>|;
+}
 if ($count > 0) {
   $result = '<table><tr><td class="template_cartcontents">' .
       "Items in your cart: <font color=red>$total_qty</font>\n" . 
-      "<br/>Subtotal:&nbsp;<font color=red>" . &display_price($total_cost) . 
+      "<br>Subtotal:&nbsp;<font color=red>" . &display_price($total_cost) . 
       '</font><br><br></td></tr><tr><td class="template_checkoutcartcontents">' .
       "<a href=\"$sc_store_url?dc=1&amp;%%href_fields%%" . 
-      '">View Cart Details</a><br>' .
+      '" rel="nofollow">View Cart Details</a><br>' .
       '<a href="%%StepOneURL%%?order_form_button.x=1&amp;%%href_fields%%' . 
-      '">Check Out</a></td>' .
+      qq|" rel="nofollow">Check Out</a>$buysafe_temp_display</td>| .
       "</tr></table>";
  } else {
   $result = '<table><tr><td class="template_cartcontents">' .
       "Items in your cart: <font color=red>0</font>\n" . 
-      "<br/>Subtotal:&nbsp;<font color=red>" . &display_price("0.00") . 
-      '</font><br></td>' .
+      "<br>Subtotal:&nbsp;<font color=red>" . &display_price("0.00") . 
+      qq|</font>$buysafe_temp_display</td>| .
       "</tr></table>";
  }
  return $result;
 }--></div></td>
 
 
-
-
-
-
           </tr>
         </table>
 		<p></p>
@@ -120,12 +125,29 @@
 }
 # end of display Top Sellers
 -->
-<br/>
+<br>
       </td>
 	</tr>
 	<tr class="template_copyright">
 	  <td height="24" colspan="3" class="template_copyright"><center>
-	Copyright 1999 to Present by K-Factor Technologies Inc. at <a href="http://www.agoracart.com" class="copyright_link">AgoraCart.com</a> and <a href="http://www.K-Factor.net" class="copyright_link">K-Factor.net</a></center>
+Copyright &copy; 
+<!--agorascript-pre {
+&capture_STDOUT;
+
+if ($sc_footer_copyright_text eq ''){ 
+print qq~
+1999 to Present by K-Factor Technologies Inc. at <a href="http://www.agoracart.com" class="copyright_link">AgoraCart.com</a> and <a href="http://www.K-Factor.net" class="copyright_link">K-Factor.net</a>
+~;
+} else {
+print qq~
+$sc_footer_copyright_text
+~;
+}
+&uncapture_STDOUT;
+}
+-->
+<br />
+	Powered by <a href="http://www.AgoraCartPro.com" class="copyright_link">AgoraCart Pro</a>. Maintained by <a href="http://www.K-Factor.net" class="copyright_link">Mister Ed</a> at <a href="http://www.AgoraCart.com" class="copyright_link">AgoraCart.com</a></center>
  	</td>
   </tr>
 </table>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/store_header.html 5.2.000.src/html/html-templates/templates/TheAgora/store_header.html
--- 5.0.000.src/html/html-templates/templates/TheAgora/store_header.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/store_header.html	2007-12-19 22:49:52.000000000 -0600
@@ -32,7 +32,6 @@
 <!--START Dynamic Links - cartlinks-->
 <!-- .html and .htm pages in the html directory of your store, compiled in real time.  Add/Remove/Rename pages in your store's html directory to alter these links-->
 <!--agorascript-pre 
-
 &capture_STDOUT; 
 &cartlinks;
 $cartlinks =~ s/<ul>\n//ig;
@@ -42,10 +41,7 @@
 $cartlinks =~ s/<\/ul>//ig;
 print $cartlinks;
 &uncapture_STDOUT;  -->
-
-<!--START Dynamic Links - cartlinks-->
-
-
+<!--END Dynamic Links - cartlinks-->
 
 
 		</span>	  </td>
@@ -54,7 +50,6 @@
 	  <td width="175" valign="top" bgcolor="#FFFFFF">
 
 
-
 <!--START Search Box-->
     <form method="post" action="agora.cgi">
         <div align="center"><span class="style14"><br>
@@ -69,19 +64,11 @@
 <!--END Search Box-->
 
 
-
 <!--START Category Listings-->
-
-<!--agorascript-pre { # code to list categories and/or sub categories
-# updated for AgoraCart 5.x by Mister Ed Jan 11, 2005
-# updated to fit CSS mods by Eric Welin Feb 02, 2005
+<!--agorascript-pre {
+# code to list categories and/or sub categories
+# updated for pre-built lists in managers by Mister Ed September 29, 2007
 if ($sc_displayDynamicCategories =~ /yes/i) {
-local($sku,$category,$subcategory);
-my ($catnumber,$catnumber2)= '';
-local(%db_ele,%subcatarray)= ();
-if (!($sc_db_lib_was_loaded =~ /yes/i)){ 
-  &require_supporting_libraries (__FILE__, __LINE__, "$sc_db_lib_path"); 
-}
 &capture_STDOUT;
 	    print qq~<table width="160" border="0" align="center" cellpadding="3" cellspacing="1" class="template_mainbackground">
         <tr>
@@ -91,37 +78,19 @@
           <td bgcolor="#FFFFFF"><div align="left"><span class="style6"> </span><br>
 ~;
 if ($sc_use_database_subcats =~ /yes/i) {
-  &get_prod_db_element($db{"product"},*db_ele);
-  foreach $sku (sort (keys %db_ele)) {
-    $catnumber = "";
-    $category = $db_ele{$sku};
-    %subcatarray = %{$db_ele{$category}};
-    $category2 = $category;
-    $category2=~s/ /%20/g;
-    if ($sc_count_database_cats =~ /yes/i) {
-      $catnumber = "(" . $db_ele2{$category} . ")";
+    if ($sc_global_bot_tracker ne '1') {
+           print qq|\n$sc_categories_with_subcats\n|;
     }
-    print qq~\n&bull;<a href="agora.cgi?cart_id=%%cart_id%%&amp;product=$category2" class="ac_left_links" title="$category">$category</a> $catnumber<br>~;
-    foreach $subcategoryarray (sort(keys %subcatarray)) {
-      $category3 = $subcategoryarray;
-#      $category3=~s/ /%20/g;
-      if ($sc_count_database_cats =~ /yes/i) {
-        $catnumber2 = "(" . $db_ele{$category}->{$subcategoryarray} . ")";
-      }
-      print qq~\n&nbsp;&nbsp;<a href="agora.cgi?cart_id=%%cart_id%%&amp;product=$category2&amp;$sc_subcat_index_field=$category3" class="ac_left_sub_links" title="$category3">$category3</a> $catnumber2<br>~;
+    else {
+           print qq|\n$sc_categories_bots_with_subcats\n|;
     }
-  }
 } else { 
-  &get_prod_db_element($db{"product"},*db_ele);
-  foreach $sku (keys %db_ele) {
-    $category = $db_ele{$sku};
-    $category_list{$category}++;
-  }
-  foreach $category (sort(keys %category_list)) {
-    $category2 = $category;
-    $category2=~s/_/ /g;
-    print qq~\n&bull; <a href="agora.cgi?cart_id=%%cart_id%%&amp;product=$category" class="ac_left_links" title="$category2">$category2</a><br>~;
-  }
+    if ($sc_global_bot_tracker ne '1') {
+           print qq|\n$sc_categories_no_subcats\n|;
+    }
+    else {
+    print qq|\n$sc_categories_bots_no_subcats\n|;
+    }
 }
 print "\n";
 	    print qq~
@@ -133,13 +102,9 @@
 &uncapture_STDOUT; }
 }
 -->
-
 <!--END Category Listings-->
 
 
-
-
-
 <!--START Price Search-->
         <table width="160" border="0" align="center" cellpadding="3" cellspacing="1" class="template_mainbackground">
           <tr>
@@ -147,7 +112,7 @@
           </tr>
           <tr>
             <td bgcolor="#FFFFFF"><div align="center"><br><form method="post" action="agora.cgi">
-<span class="style6">Search Between:<br/><br/> <input type="hidden" name="cart_id" value="%%cart_id%%">
+<span class="style6">Search Between:<br><br> <input type="hidden" name="cart_id" value="%%cart_id%%">
 %%sc_money_symbol%% <input type="text" name="query_price_low_range" size="5" maxlength="10">
 <small> & </small>
 <input type="text" name="query_price_high_range" size="5" maxlength="10"><br><br>
@@ -170,10 +135,6 @@
           <tr>
  
   <td class="ac_content">
-
 <!--END HEADER TABLE-->
 
 
-
-
-
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_BlueRoyal/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_BlueRoyal/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_BlueRoyal/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_BlueRoyal/agoratemplate.css	2007-06-14 21:14:40.000000000 -0500
@@ -1,4 +1,3 @@
-<style type="text/css">
 .style6 {
 	font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
@@ -124,5 +123,3 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_BlueRoyal/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_BlueRoyal/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_BlueRoyal/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_BlueRoyal/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a I   M%W/N%L%M&R*P(F!f>Z1O'S+U-Q)\4N&_7c:M&L$M$N&L$M%                        !     ,     I  +5EE`i\J\qjɤw<Fa$ ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_BluGreen/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_BluGreen/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_BluGreen/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_BluGreen/agoratemplate.css	2007-06-14 21:14:42.000000000 -0500
@@ -1,4 +1,3 @@
-<style type="text/css">
 .style6 {
 	font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
@@ -124,5 +123,4 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
+
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_BluGreen/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_BluGreen/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_BluGreen/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_BluGreen/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a I   )m`,ma+l_+m`*ma-na*m_)l`*k_-nb+ma,ob,na-ob)l_*m`*l_                                             !     ,     I  & PiNj:S> @mma|?b(6BQ  ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Caramel/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Caramel/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Caramel/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Caramel/agoratemplate.css	2007-06-14 21:14:43.000000000 -0500
@@ -1,128 +1,124 @@
-<style type="text/css">
-<!--
-.style6 {font-family: Geneva, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	color: #947F3C;
-}
-a:link {
-	text-decoration: none;
-	color: #947F3C;
-}
-a:visited {
-	text-decoration: none;
-	color: #957F3C;
-}
-a:hover {
-	text-decoration: none;
-	color: #846300;
-}
-a:active {
-	text-decoration: none;
-	color: #000000;
-}
-.style11 {color: #96803E; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; }
-.style7 {font-family: Geneva, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	color: #FFFFFF;
-}
-.style12 {color: #947F3C}
-.style8 {font-family: Geneva, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	color: #FFFFFF;
-}
-.style14 {font-size: 12px}
-.ac_ppinc_content{
-  background-color: #FFFFFF;
-  vertical-align : top;
-  height : 100%;
-  padding: 0px; 
-  padding-bottom: 25px;
-}
-.template_mainbackground{
-  background-color : #947F3C;
-  border-color : #947F3C;
-}
-.style14 {font-size: 12px}
-.template_image_no_border{
-  border : none;
-}
-.template_table_image_background{
-  background-image : url(backgroundbanner.gif);
-}
-.template_copyright{
-  background-color : #947F3C;
-  text-align: center;
-  font-size: 10pt;
-  color: #FFFFFF;
-}
-a.copyright_link {
-  font-size: 10pt;
-  font-weight: normal;
-  text-decoration : none;
-  color: #FFFF00;
-}
-.template_cartcontents{
-  background-color : #FFFFFF;
-  text-align: center;
-  font-size: 9pt;
-  color: #000000;
-}
-.template_checkoutcartcontents{
-  background-color : #FFFFFF;
-  text-align: center;
-  font-size: 11pt;
-  color: #000000;
-}
-.template_fonth1{
-  padding: 0px;
-  padding-right: 0px; 
-  padding-left: 0px;
-  font-family: Geneva, Arial, Helvetica, sans-serif;
-  font-size: 17pt;
-  font-weight: bold;
-  color: #FFFFFF;
-}
-.template_fonth2{
-  padding: 0px;
-  padding-right: 0px; 
-  padding-left: 0px;
-  font-family: Geneva, Arial, Helvetica, sans-serif;
-  font-size: 14pt;
-  font-weight: normal;
-  font-style : italic;
-  color: #FFFFFF;
-}
-a.ac_cart_info_links {
-  padding: 0px;
-  padding-right: 5px; 
-  padding-left: 5px;
-  font-size: 11pt;
-  font-weight: bold;
-  text-decoration : none;
-}
-.ac_left_nav{
-  width: 155px;
-  vertical-align : top;
-  padding: 0px;
-  padding-top: 15px;
-}
-a.ac_left_links {
-  text-align: left;
-  padding: 0px;
-  padding-right: 3px; 
-  padding-left: 10px;
-  font-size: 10pt;
-  font-weight: normal;
-  text-decoration : none;
-}
-a.ac_left_sub_links {
-  text-align: left;
-  padding: 0px;
-  padding-right: 3px; 
-  padding-left: 18px;
-  font-size: 9pt;
-  font-weight: normal;
-  text-decoration : none;
-}
--->
-</style>
+.style6 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #947F3C;
+}
+a:link {
+	text-decoration: none;
+	color: #947F3C;
+}
+a:visited {
+	text-decoration: none;
+	color: #957F3C;
+}
+a:hover {
+	text-decoration: none;
+	color: #846300;
+}
+a:active {
+	text-decoration: none;
+	color: #000000;
+}
+.style11 {color: #96803E; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; }
+.style7 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #FFFFFF;
+}
+.style12 {color: #947F3C}
+.style8 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #FFFFFF;
+}
+.style14 {font-size: 12px}
+.ac_ppinc_content{
+  background-color: #FFFFFF;
+  vertical-align : top;
+  height : 100%;
+  padding: 0px; 
+  padding-bottom: 25px;
+}
+.template_mainbackground{
+  background-color : #947F3C;
+  border-color : #947F3C;
+}
+.style14 {font-size: 12px}
+.template_image_no_border{
+  border : none;
+}
+.template_table_image_background{
+  background-image : url(backgroundbanner.gif);
+}
+.template_copyright{
+  background-color : #947F3C;
+  text-align: center;
+  font-size: 10pt;
+  color: #FFFFFF;
+}
+a.copyright_link {
+  font-size: 10pt;
+  font-weight: normal;
+  text-decoration : none;
+  color: #FFFF00;
+}
+.template_cartcontents{
+  background-color : #FFFFFF;
+  text-align: center;
+  font-size: 9pt;
+  color: #000000;
+}
+.template_checkoutcartcontents{
+  background-color : #FFFFFF;
+  text-align: center;
+  font-size: 11pt;
+  color: #000000;
+}
+.template_fonth1{
+  padding: 0px;
+  padding-right: 0px; 
+  padding-left: 0px;
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 17pt;
+  font-weight: bold;
+  color: #FFFFFF;
+}
+.template_fonth2{
+  padding: 0px;
+  padding-right: 0px; 
+  padding-left: 0px;
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 14pt;
+  font-weight: normal;
+  font-style : italic;
+  color: #FFFFFF;
+}
+a.ac_cart_info_links {
+  padding: 0px;
+  padding-right: 5px; 
+  padding-left: 5px;
+  font-size: 11pt;
+  font-weight: bold;
+  text-decoration : none;
+}
+.ac_left_nav{
+  width: 155px;
+  vertical-align : top;
+  padding: 0px;
+  padding-top: 15px;
+}
+a.ac_left_links {
+  text-align: left;
+  padding: 0px;
+  padding-right: 3px; 
+  padding-left: 10px;
+  font-size: 10pt;
+  font-weight: normal;
+  text-decoration : none;
+}
+a.ac_left_sub_links {
+  text-align: left;
+  padding: 0px;
+  padding-right: 3px; 
+  padding-left: 18px;
+  font-size: 9pt;
+  font-weight: normal;
+  text-decoration : none;
+}
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Caramel/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Caramel/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Caramel/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Caramel/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1,2 +0,0 @@
-GIF89a I   B~<AF0M@JHSP?VD?>~;>><==<=                        !     ,     I  +dSzW{Q{.\UQ~S2uPx,1@
- ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Fuscha/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Fuscha/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Fuscha/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Fuscha/agoratemplate.css	2007-06-14 21:14:45.000000000 -0500
@@ -1,128 +1,124 @@
-<style type="text/css">
-<!--
-.style6 {font-family: Geneva, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	color: #BA4EA9;
-}
-a:link {
-	text-decoration: none;
-	color: #BA4EA9;
-}
-a:visited {
-	text-decoration: none;
-	color: #A121A1;
-}
-a:hover {
-	text-decoration: none;
-	color: #A121A1;
-}
-a:active {
-	text-decoration: none;
-	color: #000000;
-}
-.style11 {color: #BA4EA9; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; }
-.style7 {font-family: Geneva, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	color: #FFFFFF;
-}
-.style12 {color: #BA4EA90}
-.style8 {font-family: Geneva, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	color: #FFFFFF;
-}
-.style14 {font-size: 12px}
-.ac_ppinc_content{
-  background-color: #FFFFFF;
-  vertical-align : top;
-  height : 100%;
-  padding: 0px; 
-  padding-bottom: 25px;
-}
-.template_mainbackground{
-  background-color : #BA4EA9;
-  border-color : #BA4EA9;
-}
-.style14 {font-size: 12px}
-.template_image_no_border{
-  border : none;
-}
-.template_table_image_background{
-  background-image : url(backgroundbanner.gif);
-}
-.template_copyright{
-  background-color : #BA4EA9;
-  text-align: center;
-  font-size: 10pt;
-  color: #FFFFFF;
-}
-a.copyright_link {
-  font-size: 10pt;
-  font-weight: normal;
-  text-decoration : none;
-  color: #FFFF00;
-}
-.template_cartcontents{
-  background-color : #FFFFFF;
-  text-align: center;
-  font-size: 9pt;
-  color: #000000;
-}
-.template_checkoutcartcontents{
-  background-color : #FFFFFF;
-  text-align: center;
-  font-size: 11pt;
-  color: #000000;
-}
-.template_fonth1{
-  padding: 0px;
-  padding-right: 0px; 
-  padding-left: 0px;
-  font-family: Geneva, Arial, Helvetica, sans-serif;
-  font-size: 17pt;
-  font-weight: bold;
-  color: #FFFFFF;
-}
-.template_fonth2{
-  padding: 0px;
-  padding-right: 0px; 
-  padding-left: 0px;
-  font-family: Geneva, Arial, Helvetica, sans-serif;
-  font-size: 14pt;
-  font-weight: normal;
-  font-style : italic;
-  color: #FFFFFF;
-}
-a.ac_cart_info_links {
-  padding: 0px;
-  padding-right: 5px; 
-  padding-left: 5px;
-  font-size: 11pt;
-  font-weight: bold;
-  text-decoration : none;
-}
-.ac_left_nav{
-  width: 155px;
-  vertical-align : top;
-  padding: 0px;
-  padding-top: 15px;
-}
-a.ac_left_links {
-  text-align: left;
-  padding: 0px;
-  padding-right: 3px; 
-  padding-left: 10px;
-  font-size: 10pt;
-  font-weight: normal;
-  text-decoration : none;
-}
-a.ac_left_sub_links {
-  text-align: left;
-  padding: 0px;
-  padding-right: 3px; 
-  padding-left: 18px;
-  font-size: 9pt;
-  font-weight: normal;
-  text-decoration : none;
-}
--->
-</style>
+.style6 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #BA4EA9;
+}
+a:link {
+	text-decoration: none;
+	color: #BA4EA9;
+}
+a:visited {
+	text-decoration: none;
+	color: #A121A1;
+}
+a:hover {
+	text-decoration: none;
+	color: #A121A1;
+}
+a:active {
+	text-decoration: none;
+	color: #000000;
+}
+.style11 {color: #BA4EA9; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; }
+.style7 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #FFFFFF;
+}
+.style12 {color: #BA4EA90}
+.style8 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #FFFFFF;
+}
+.style14 {font-size: 12px}
+.ac_ppinc_content{
+  background-color: #FFFFFF;
+  vertical-align : top;
+  height : 100%;
+  padding: 0px; 
+  padding-bottom: 25px;
+}
+.template_mainbackground{
+  background-color : #BA4EA9;
+  border-color : #BA4EA9;
+}
+.style14 {font-size: 12px}
+.template_image_no_border{
+  border : none;
+}
+.template_table_image_background{
+  background-image : url(backgroundbanner.gif);
+}
+.template_copyright{
+  background-color : #BA4EA9;
+  text-align: center;
+  font-size: 10pt;
+  color: #FFFFFF;
+}
+a.copyright_link {
+  font-size: 10pt;
+  font-weight: normal;
+  text-decoration : none;
+  color: #FFFF00;
+}
+.template_cartcontents{
+  background-color : #FFFFFF;
+  text-align: center;
+  font-size: 9pt;
+  color: #000000;
+}
+.template_checkoutcartcontents{
+  background-color : #FFFFFF;
+  text-align: center;
+  font-size: 11pt;
+  color: #000000;
+}
+.template_fonth1{
+  padding: 0px;
+  padding-right: 0px; 
+  padding-left: 0px;
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 17pt;
+  font-weight: bold;
+  color: #FFFFFF;
+}
+.template_fonth2{
+  padding: 0px;
+  padding-right: 0px; 
+  padding-left: 0px;
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 14pt;
+  font-weight: normal;
+  font-style : italic;
+  color: #FFFFFF;
+}
+a.ac_cart_info_links {
+  padding: 0px;
+  padding-right: 5px; 
+  padding-left: 5px;
+  font-size: 11pt;
+  font-weight: bold;
+  text-decoration : none;
+}
+.ac_left_nav{
+  width: 155px;
+  vertical-align : top;
+  padding: 0px;
+  padding-top: 15px;
+}
+a.ac_left_links {
+  text-align: left;
+  padding: 0px;
+  padding-right: 3px; 
+  padding-left: 10px;
+  font-size: 10pt;
+  font-weight: normal;
+  text-decoration : none;
+}
+a.ac_left_sub_links {
+  text-align: left;
+  padding: 0px;
+  padding-right: 3px; 
+  padding-left: 18px;
+  font-size: 9pt;
+  font-weight: normal;
+  text-decoration : none;
+}
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Fuscha/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Fuscha/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Fuscha/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Fuscha/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1,2 +0,0 @@
-GIF89a I   UYaQ_\d9TgWSQOMNNLNM                                    !     ,     I  %`$ΤP,$ʹ\?P
-!q ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Grayish/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Grayish/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Grayish/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Grayish/agoratemplate.css	2007-06-14 21:14:46.000000000 -0500
@@ -1,5 +1,3 @@
-<style type="text/css">
-<!--
 .style6 {font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
 	color: #716D60;
@@ -124,5 +122,3 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Grayish/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Grayish/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Grayish/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Grayish/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a I   uqe{wj}yl{orsocwsfvtpcxuhyupdvrespcrmaqm`rnasnbsob                                       !     ,     I  ;#cdBQ,o

ϑ@6dP@  0@@ A  ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Green1/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Green1/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Green1/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Green1/agoratemplate.css	2007-06-14 21:14:48.000000000 -0500
@@ -1,4 +1,3 @@
-<style type="text/css">
 .style6 {
 	font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
@@ -124,5 +123,3 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Green1/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Green1/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Green1/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Green1/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a I   (_*a(^*`)_)`(_)`)_                     !     ,     I  C!cȤZ)'"9aHq1سsq>_ڠ& `b>ZגM  Jg8 ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Green2/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Green2/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Green2/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Green2/agoratemplate.css	2007-06-14 21:14:49.000000000 -0500
@@ -1,4 +1,3 @@
-<style type="text/css">
 .style6 {
 	font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
@@ -124,5 +123,3 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Green2/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Green2/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Green2/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Green2/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a I   +o,o*n+m)m+o(k(l+n,o*m)m)l         !     ,     I  vbW'JxƍPI P"D ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoney/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoney/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoney/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoney/agoratemplate.css	2007-06-14 21:14:51.000000000 -0500
@@ -1,4 +1,3 @@
-<style type="text/css">
 .style6 {
 	font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
@@ -124,5 +123,3 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoney/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoney/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoney/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoney/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a H   MnLmMoLlKmNoJkIjLmKlMnLmJkKl      !     ,     H  !ɪ&[^(.J,ǅ肼 ,An ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoss/669900.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoss/669900.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoss/669900.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoss/669900.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1,236 +0,0 @@
-GIF89aI   n/,-2j/1.()oi-j-1+pn,2~%*)l~&nl*kk'k*)po{"j&iilgm{#}$o(}%'h'hu|#x i2vh}$|$3&ss3q,y r|#z!)z"gwuqqtz!xfvtwgty!e
f
rupy xw~&f
er{#dvdd40sm20c(c
-4i3~%jb	b
-/2+.upioy!rvlj-a	'j,1k{$k{"ksx /kkb
-knhgj+/f3i*,+m.m0/.101                                                                                                                                                                                                                                             !     ,    I   8 Xj!WZ FNu .8yb凩VZl
-W@+4|8qV)P0uJ|p+VXE\UX\h&URj )dO)h@A)^(TS L j
"VLE !_^zL<<0A5(T%Htbɀ]48e*T5%b%	bX^cm@'[}%nxV Jx(H'LFD]ET*
JplA4L  8@ PBQ\90`%29X d
-ĠaX!DL LAa@+u
-IlTE,*dlEY@C
-
- l
-`,
4|&i0HPB	$
- @7pCx	$@q)	z(%驨VVyF@CenW]Fс	8laV @TaoT*+[k[A%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ora_GreenMoss/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoss/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoss/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoss/agoratemplate.css	2007-06-14 21:14:52.000000000 -0500
@@ -1,4 +1,3 @@
-<style type="text/css">
 .style6 {
 	font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
@@ -124,5 +123,3 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoss/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoss/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoss/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_GreenMoss/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1,4 +0,0 @@
-GIF89a I   rrpmnqpnonqooqpp!     ,     I  Ic8\9b,<2
33$K?XP$
'A`4
-kV!kȸ+dؙwޚ'$LȠg$}U48OIQ_rTjJr
-z<90`Q<Q 
-   ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Mustard/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Mustard/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Mustard/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Mustard/agoratemplate.css	2007-06-14 21:14:54.000000000 -0500
@@ -1,4 +1,3 @@
-<style type="text/css">
 .style6 {
 	font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
@@ -124,5 +123,3 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Mustard/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Mustard/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Mustard/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Mustard/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a H   ð/°/,-,°.-¯/*-¯.+,-+,!     ,     H  >9D8b}_"Mt4:2%ǱDCHB  8 M@06LD  ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Orange2/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Orange2/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Orange2/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Orange2/agoratemplate.css	2007-06-14 21:14:55.000000000 -0500
@@ -1,4 +1,3 @@
-<style type="text/css">
 .style6 {
 	font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
@@ -124,5 +123,3 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Orange2/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Orange2/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Orange2/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Orange2/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a H   JJIHIHHI!     ,     H  &X5jPx($HPJa)A, .  ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_ProBlue/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_ProBlue/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_ProBlue/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_ProBlue/agoratemplate.css	2007-06-14 21:14:57.000000000 -0500
@@ -1,129 +1,154 @@
-<style type="text/css">
-<!--
-.style6 {font-family: Geneva, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	color: #336699;
-}
-a:link {
-	text-decoration: none;
-	color: #4D6D84;
-	text-decoration: none;
-}
-a:visited {
-	text-decoration: none;
-	color: 113961;
-}
-a:hover {
-	text-decoration: none;
-	color: 113961;
-}
-a:active {
-	text-decoration: none;
-	color: #000000;
-}
-.style11 {color: #4D6D84; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; }
-.style7 {font-family: Geneva, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	color: #FFFFFF;
-}
-.style12 {color: #4D6D84}
-.style8 {font-family: Geneva, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	color: #716D60;
-}
-.style14 {font-size: 12px}
-.ac_ppinc_content{
-  background-color: #FFFFFF;
-  vertical-align : top;
-  height : 100%;
-  padding: 0px; 
-  padding-bottom: 25px;
-}
-.template_mainbackground{
-  background-color : #4D6D84;
-  border-color : #4D6D84;
-}
-.style14 {font-size: 12px}
-.template_image_no_border{
-  border : none;
-}
-.template_table_image_background{
-  background-image : url(backgroundbanner.gif);
-}
-.template_copyright{
-  background-color : #4D6D84;
-  text-align: center;
-  font-size: 10pt;
-  color: #FFFFFF;
-}
-a.copyright_link {
-  font-size: 10pt;
-  font-weight: normal;
-  text-decoration : none;
-  color: #FFFF00;
-}
-.template_cartcontents{
-  background-color : #FFFFFF;
-  text-align: center;
-  font-size: 9pt;
-  color: #000000;
-}
-.template_checkoutcartcontents{
-  background-color : #FFFFFF;
-  text-align: center;
-  font-size: 11pt;
-  color: #000000;
-}
-.template_fonth1{
-  padding: 0px;
-  padding-right: 0px; 
-  padding-left: 0px;
-  font-family: Geneva, Arial, Helvetica, sans-serif;
-  font-size: 17pt;
-  font-weight: bold;
-  color: #FFFFFF;
-}
-.template_fonth2{
-  padding: 0px;
-  padding-right: 0px; 
-  padding-left: 0px;
-  font-family: Geneva, Arial, Helvetica, sans-serif;
-  font-size: 14pt;
-  font-weight: normal;
-  font-style : italic;
-  color: #FFFFFF;
-}
-a.ac_cart_info_links {
-  padding: 0px;
-  padding-right: 5px; 
-  padding-left: 5px;
-  font-size: 11pt;
-  font-weight: bold;
-  text-decoration : none;
-}
-.ac_left_nav{
-  width: 155px;
-  vertical-align : top;
-  padding: 0px;
-  padding-top: 15px;
-}
-a.ac_left_links {
-  text-align: left;
-  padding: 0px;
-  padding-right: 3px; 
-  padding-left: 10px;
-  font-size: 10pt;
-  font-weight: normal;
-  text-decoration : none;
-}
-a.ac_left_sub_links {
-  text-align: left;
-  padding: 0px;
-  padding-right: 3px; 
-  padding-left: 18px;
-  font-size: 9pt;
-  font-weight: normal;
-  text-decoration : none;
-}
--->
-</style>
+.style6 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #336699;
+}
+
+a:link {
+	text-decoration: none;
+	color: #4D6D84;
+	text-decoration: none;
+}
+
+a:visited {
+	text-decoration: none;
+	color: 113961;
+}
+
+
+a:hover {
+	text-decoration: none;
+	color: 113961;
+}
+
+a:active {
+	text-decoration: none;
+	color: #000000;
+}
+
+.style11 {color: #4D6D84; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; }
+
+.style7 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #FFFFFF;
+}
+
+.style12 {color: #4D6D84;}
+
+.style8 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #716D60;
+}
+
+
+.style14 {font-size: 12px;}
+
+
+.ac_ppinc_content{
+  background-color: #FFFFFF;
+  vertical-align : top;
+  height : 100%;
+  padding: 0px; 
+  padding-bottom: 25px;
+}
+
+.template_mainbackground{
+  background-color : #4D6D84;
+  border-color : #4D6D84;
+}
+
+
+.style14 {font-size: 12px;}
+
+.template_image_no_border{
+  border : none;
+}
+
+
+.template_table_image_background{
+  background-image : url(backgroundbanner.gif);
+}
+
+.template_copyright{
+  background-color : #4D6D84;
+  text-align: center;
+  font-size: 10pt;
+  color: #FFFFFF;
+}
+
+a.copyright_link {
+  font-size: 10pt;
+  font-weight: normal;
+  text-decoration : none;
+  color: #FFFF00;
+}
+
+.template_cartcontents{
+  background-color : #FFFFFF;
+  text-align: center;
+  font-size: 9pt;
+  color: #000000;
+}
+
+.template_checkoutcartcontents{
+  background-color : #FFFFFF;
+  text-align: center;
+  font-size: 11pt;
+  color: #000000;
+}
+
+.template_fonth1{
+  padding: 0px;
+  padding-right: 0px; 
+  padding-left: 0px;
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 17pt;
+  font-weight: bold;
+  color: #FFFFFF;
+}
+
+.template_fonth2{
+  padding: 0px;
+  padding-right: 0px; 
+  padding-left: 0px;
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 14pt;
+  font-weight: normal;
+  font-style : italic;
+  color: #FFFFFF;
+}
+
+a.ac_cart_info_links {
+  padding: 0px;
+  padding-right: 5px; 
+  padding-left: 5px;
+  font-size: 11pt;
+  font-weight: bold;
+  text-decoration : none;
+}
+
+.ac_left_nav{
+  width: 155px;
+  vertical-align : top;
+  padding: 0px;
+  padding-top: 15px;
+}
+
+a.ac_left_links {
+  text-align: left;
+  padding: 0px;
+  padding-right: 3px; 
+  padding-left: 10px;
+  font-size: 10pt;
+  font-weight: normal;
+  text-decoration : none;
+}
+
+a.ac_left_sub_links {
+  text-align: left;
+  padding: 0px;
+  padding-right: 3px; 
+  padding-left: 18px;
+  font-size: 9pt;
+  font-weight: normal;
+  text-decoration : none;
+}
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_ProBlue/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_ProBlue/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_ProBlue/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_ProBlue/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a I   WvPpRrSs[{^}QqaPoYxMmdUtgNnNmOoOnMmMl3fNm                              !     ,     I  '$dT	WDxpC "`pX4(! ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Purple1/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Purple1/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Purple1/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Purple1/agoratemplate.css	2007-06-14 21:14:58.000000000 -0500
@@ -1,128 +1,124 @@
-<style type="text/css">
-<!--
-.style6 {font-family: Geneva, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	color: #6a1b8d;
-}
-a:link {
-	text-decoration: none;
-	color: #8729B1;
-}
-a:visited {
-	text-decoration: none;
-	color: #6A1B8D;
-}
-a:hover {
-	text-decoration: none;
-	color: #6A1B8D;
-}
-a:active {
-	text-decoration: none;
-	color: #000000;
-}
-.style11 {color: #8729B1; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; }
-.style7 {font-family: Geneva, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	color: #FFFFFF;
-}
-.style12 {color: #8729B1}
-.style8 {font-family: Geneva, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	color: #FFFFFF;
-}
-.style14 {font-size: 12px}
-.ac_ppinc_content{
-  background-color: #FFFFFF;
-  vertical-align : top;
-  height : 100%;
-  padding: 0px; 
-  padding-bottom: 25px;
-}
-.template_mainbackground{
-  background-color : #8729B1;
-  border-color : #8729B1;
-}
-.style14 {font-size: 12px}
-.template_image_no_border{
-  border : none;
-}
-.template_table_image_background{
-  background-image : url(backgroundbanner.gif);
-}
-.template_copyright{
-  background-color : #8729B1;
-  text-align: center;
-  font-size: 10pt;
-  color: #FFFFFF;
-}
-a.copyright_link {
-  font-size: 10pt;
-  font-weight: normal;
-  text-decoration : none;
-  color: #FFFF00;
-}
-.template_cartcontents{
-  background-color : #FFFFFF;
-  text-align: center;
-  font-size: 9pt;
-  color: #000000;
-}
-.template_checkoutcartcontents{
-  background-color : #FFFFFF;
-  text-align: center;
-  font-size: 11pt;
-  color: #000000;
-}
-.template_fonth1{
-  padding: 0px;
-  padding-right: 0px; 
-  padding-left: 0px;
-  font-family: Geneva, Arial, Helvetica, sans-serif;
-  font-size: 17pt;
-  font-weight: bold;
-  color: #FFFFFF;
-}
-.template_fonth2{
-  padding: 0px;
-  padding-right: 0px; 
-  padding-left: 0px;
-  font-family: Geneva, Arial, Helvetica, sans-serif;
-  font-size: 14pt;
-  font-weight: normal;
-  font-style : italic;
-  color: #FFFFFF;
-}
-a.ac_cart_info_links {
-  padding: 0px;
-  padding-right: 5px; 
-  padding-left: 5px;
-  font-size: 11pt;
-  font-weight: bold;
-  text-decoration : none;
-}
-.ac_left_nav{
-  width: 155px;
-  vertical-align : top;
-  padding: 0px;
-  padding-top: 15px;
-}
-a.ac_left_links {
-  text-align: left;
-  padding: 0px;
-  padding-right: 3px; 
-  padding-left: 10px;
-  font-size: 10pt;
-  font-weight: normal;
-  text-decoration : none;
-}
-a.ac_left_sub_links {
-  text-align: left;
-  padding: 0px;
-  padding-right: 3px; 
-  padding-left: 18px;
-  font-size: 9pt;
-  font-weight: normal;
-  text-decoration : none;
-}
--->
-</style>
+.style6 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #6a1b8d;
+}
+a:link {
+	text-decoration: none;
+	color: #8729B1;
+}
+a:visited {
+	text-decoration: none;
+	color: #6A1B8D;
+}
+a:hover {
+	text-decoration: none;
+	color: #6A1B8D;
+}
+a:active {
+	text-decoration: none;
+	color: #000000;
+}
+.style11 {color: #8729B1; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; }
+.style7 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #FFFFFF;
+}
+.style12 {color: #8729B1}
+.style8 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #FFFFFF;
+}
+.style14 {font-size: 12px}
+.ac_ppinc_content{
+  background-color: #FFFFFF;
+  vertical-align : top;
+  height : 100%;
+  padding: 0px; 
+  padding-bottom: 25px;
+}
+.template_mainbackground{
+  background-color : #8729B1;
+  border-color : #8729B1;
+}
+.style14 {font-size: 12px}
+.template_image_no_border{
+  border : none;
+}
+.template_table_image_background{
+  background-image : url(backgroundbanner.gif);
+}
+.template_copyright{
+  background-color : #8729B1;
+  text-align: center;
+  font-size: 10pt;
+  color: #FFFFFF;
+}
+a.copyright_link {
+  font-size: 10pt;
+  font-weight: normal;
+  text-decoration : none;
+  color: #FFFF00;
+}
+.template_cartcontents{
+  background-color : #FFFFFF;
+  text-align: center;
+  font-size: 9pt;
+  color: #000000;
+}
+.template_checkoutcartcontents{
+  background-color : #FFFFFF;
+  text-align: center;
+  font-size: 11pt;
+  color: #000000;
+}
+.template_fonth1{
+  padding: 0px;
+  padding-right: 0px; 
+  padding-left: 0px;
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 17pt;
+  font-weight: bold;
+  color: #FFFFFF;
+}
+.template_fonth2{
+  padding: 0px;
+  padding-right: 0px; 
+  padding-left: 0px;
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 14pt;
+  font-weight: normal;
+  font-style : italic;
+  color: #FFFFFF;
+}
+a.ac_cart_info_links {
+  padding: 0px;
+  padding-right: 5px; 
+  padding-left: 5px;
+  font-size: 11pt;
+  font-weight: bold;
+  text-decoration : none;
+}
+.ac_left_nav{
+  width: 155px;
+  vertical-align : top;
+  padding: 0px;
+  padding-top: 15px;
+}
+a.ac_left_links {
+  text-align: left;
+  padding: 0px;
+  padding-right: 3px; 
+  padding-left: 10px;
+  font-size: 10pt;
+  font-weight: normal;
+  text-decoration : none;
+}
+a.ac_left_sub_links {
+  text-align: left;
+  padding: 0px;
+  padding-right: 3px; 
+  padding-left: 18px;
+  font-size: 9pt;
+  font-weight: normal;
+  text-decoration : none;
+}
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Purple1/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Purple1/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Purple1/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Purple1/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a I   /+264,?ǌ.<ġBʏ09*+**+()))                                 !     ,     I  +`$R)4Q,8*<M0FB,B@! CB ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Red2/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Red2/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Red2/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Red2/agoratemplate.css	2007-06-14 21:15:00.000000000 -0500
@@ -1,4 +1,3 @@
-<style type="text/css">
 .style6 {
 	font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
@@ -124,5 +123,3 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Red2/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Red2/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_Red2/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_Red2/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a H   '&%&&$$$&%                  !     ,     H  -B48cddihz"l&,-A :@ @L0$1+ ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_RedDark/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_RedDark/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_RedDark/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_RedDark/agoratemplate.css	2007-06-14 21:15:01.000000000 -0500
@@ -1,4 +1,3 @@
-<style type="text/css">
 .style6 {
 	font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
@@ -25,12 +24,12 @@
 	font-weight: bold;
 	color: #FFFFFF;
 }
-.style12 {color: #712518}
+.style12 {color: #712518;}
 .style8 {font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
 	color: #FFFFFF;
 }
-.style14 {font-size: 12px}
+.style14 {font-size: 12px;}
 .ac_ppinc_content{
   background-color: #FFFFFF;
   vertical-align : top;
@@ -124,5 +123,3 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_RedDark/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_RedDark/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_RedDark/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_RedDark/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a I   q%p%r&s'p$s'r&q&p%p$q%               !     ,     I  "0*B΄Rw!_YT &pP D ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_TurquoiseLight/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_TurquoiseLight/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_TurquoiseLight/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_TurquoiseLight/agoratemplate.css	2007-06-14 21:15:03.000000000 -0500
@@ -1,4 +1,3 @@
-<style type="text/css">
 .style6 {
 	font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
@@ -25,12 +24,12 @@
 	font-weight: bold;
 	color: #FFFFFF;
 }
-.style12 {color: #70B4A7}
+.style12 {color: #70B4A7;}
 .style8 {font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
 	color: #FFFFFF;
 }
-.style14 {font-size: 12px}
+.style14 {font-size: 12px;}
 .ac_ppinc_content{
   background-color: #FFFFFF;
   vertical-align : top;
@@ -42,7 +41,7 @@
   background-color : #70B4A7;
   border-color : #70B4A7;
 }
-.style14 {font-size: 12px}
+.style14 {font-size: 12px;}
 .template_image_no_border{
   border : none;
 }
@@ -124,5 +123,3 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_TurquoiseLight/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_TurquoiseLight/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_TurquoiseLight/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_TurquoiseLight/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-GIF89a I   rorroqpqqpp               !     ,     I  DP̤ڜm'*9!ʁ1R2"|7tmPH$Gkh:I4| `   ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_VioletLight/agoratemplate.css 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_VioletLight/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_VioletLight/agoratemplate.css	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_VioletLight/agoratemplate.css	2007-06-14 21:15:04.000000000 -0500
@@ -1,4 +1,3 @@
-<style type="text/css">
 .style6 {
 	font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
@@ -25,7 +24,7 @@
 	font-weight: bold;
 	color: #FFFFFF;
 }
-.style12 {color: #9590CB}
+.style12 {color: #9590CB;}
 .style8 {font-family: Geneva, Arial, Helvetica, sans-serif;
 	font-weight: bold;
 	color: #FFFFFF;
@@ -42,7 +41,7 @@
   background-color : #9590CB;
   border-color : #9590CB;
 }
-.style14 {font-size: 12px}
+.style14 {font-size: 12px;}
 .template_image_no_border{
   border : none;
 }
@@ -124,5 +123,3 @@
   font-weight: normal;
   text-decoration : none;
 }
--->
-</style>
diff -aruN 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_VioletLight/backgroundbanner.gif 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_VioletLight/backgroundbanner.gif
--- 5.0.000.src/html/html-templates/templates/TheAgora/TheAgora_VioletLight/backgroundbanner.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/TheAgora/TheAgora_VioletLight/backgroundbanner.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1,2 +0,0 @@
-GIF89a I   ̖͕̔̕˓ʔʕ˕˔                  !     ,     I  E0%cȤZ)mIgd8!Cr ǋ7q6$a
-$eXDh   D  ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/Version4k/index.html 5.2.000.src/html/html-templates/templates/Version4k/index.html
--- 5.0.000.src/html/html-templates/templates/Version4k/index.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/Version4k/index.html	2006-09-02 19:40:36.000000000 -0500
@@ -0,0 +1 @@
+Restricted Area
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/Version4k/secure_store_footer.html 5.2.000.src/html/html-templates/templates/Version4k/secure_store_footer.html
--- 5.0.000.src/html/html-templates/templates/Version4k/secure_store_footer.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/Version4k/secure_store_footer.html	2007-12-20 15:55:50.000000000 -0600
@@ -0,0 +1,33 @@
+<!-- Begin Footer -->
+	</td>
+</tr>
+<tr>
+	<td>&nbsp;</td><td class="ac_bottom_links">
+
+	Powered by <a href="http://www.AgoraCartPro.com">AgoraCart Pro</a>. Maintained by <a href="http://www.K-Factor.net">Mister Ed</a> at <a href="http://www.AgoraCart.com">AgoraCart.com</a>
+
+	</td>
+</tr>
+<tr class="ac_copyright">
+<td colspan="2" class="ac_copyright">
+<center>
+Copyright &copy; 
+<!--agorascript-pre {
+&capture_STDOUT;
+
+if ($sc_footer_copyright_text eq ''){ 
+print qq~
+1999 to Present by K-Factor Technologies Inc. at <a href="http://www.agoracart.com">AgoraCart.com</a> and <a href="http://www.K-Factor.net" >K-Factor.net</a>
+~;
+} else {
+print qq~
+$sc_footer_copyright_text
+~;
+}
+&uncapture_STDOUT;
+}
+-->
+</center>
+</td>
+</tr>
+</table>
diff -aruN 5.0.000.src/html/html-templates/templates/Version4k/secure_store_header.html 5.2.000.src/html/html-templates/templates/Version4k/secure_store_header.html
--- 5.0.000.src/html/html-templates/templates/Version4k/secure_store_header.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/Version4k/secure_store_header.html	2007-12-20 15:55:50.000000000 -0600
@@ -0,0 +1,89 @@
+<!--BEGIN HEADER TABLE-->
+<table class="ac_header">
+<tr>
+  <td>
+<!--agorascript-pre 
+&capture_STDOUT; 
+print qq~<font class="template_fonth1"><b>$sc_headerStoreTitle</b></font>~;
+print qq~<font class="template_fonth2"><br>$sc_headerStoreTagLine</font>~;
+&uncapture_STDOUT;  -->
+
+  </td>
+  <td class="ac_header_search">
+    <form method="post" action="<!--agorascript-post { &capture_STDOUT;
+print "$sc_store_url";
+&uncapture_STDOUT;
+} -->">
+      <input type="hidden" name="cart_id" value="%%cart_id%%">
+      <input type="text" name="keywords" size="20" maxlength="40">
+      <input type="hidden" name="ppinc=search" value="search">
+      <input type="submit" name="search_request_button" value="Search"> 
+    </form>
+  </td>
+</tr>
+</table>
+<table class="ac_mainbody" cellpadding=0 cellspacing=0>
+<tr>
+  <td class="ac_left_nav">
+<!--START Category Listings-->
+<!--agorascript-pre {
+     if ($sc_buySafe_is_enabled =~ /yes/) {
+          &capture_STDOUT;
+          print qq|<br>$sc_buysafe_merchant_seal_complete_button_string<br><br>|;
+          &uncapture_STDOUT;
+    }
+# code to list categories and/or sub categories
+# updated for pre-built lists in managers by Mister Ed September 29, 2007
+if ($sc_displayDynamicCategories =~ /yes/i) {
+&capture_STDOUT;
+        print "<h3>Categories</span></h3>";
+if ($sc_use_database_subcats =~ /yes/i) {
+    if ($sc_global_bot_tracker ne '1') {
+           print qq|\n$sc_categories_with_subcats\n|;
+    }
+    else {
+           print qq|\n$sc_categories_bots_with_subcats\n|;
+    }
+} else { 
+    if ($sc_global_bot_tracker ne '1') {
+           print qq|\n$sc_categories_no_subcats\n|;
+    }
+    else {
+    print qq|\n$sc_categories_bots_no_subcats\n|;
+    }
+}
+print "\n <br>";
+
+&uncapture_STDOUT; }
+}
+-->
+<!--END Category Listings-->
+    <hr/>
+    <form method="post" action="<!--agorascript-post { &capture_STDOUT;
+print "$sc_store_url";
+&uncapture_STDOUT;
+} -->">
+      <h3>
+        Look For Gifts<br/>
+        under this Price:<br/>
+        <input type="hidden" name="cart_id" value="%%cart_id%%">
+        $ <input type="text" name="query_price_high_range" size="6" maxlength="10"><br/>
+        <input type="hidden" name="ppinc" value="search">
+        <input type="submit" name="search_request_button" value=" Search ">
+      </h3>
+    </form>
+    <hr/>
+    <h3>Company Info:</h3>
+<!--agorascript-pre 
+&capture_STDOUT; 
+&cartlinks;
+# Match the style for left links
+$cartlinks =~ s/<a href/<a class=\"ac_left_links\" href/ig;
+print $cartlinks;
+&uncapture_STDOUT;  -->
+    
+
+    
+  </td>
+  <td class="ac_content">
+<!--END HEADER TABLE-->
diff -aruN 5.0.000.src/html/html-templates/templates/Version4k/store_footer.html 5.2.000.src/html/html-templates/templates/Version4k/store_footer.html
--- 5.0.000.src/html/html-templates/templates/Version4k/store_footer.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/Version4k/store_footer.html	2007-12-20 15:55:51.000000000 -0600
@@ -0,0 +1,33 @@
+<!-- Begin Footer -->
+	</td>
+</tr>
+<tr>
+	<td>&nbsp;</td><td class="ac_bottom_links">
+
+	Powered by <a href="http://www.AgoraCartPro.com">AgoraCart Pro</a>. Maintained by <a href="http://www.K-Factor.net" class="copyright_link">Mister Ed</a> at <a href="http://www.AgoraCart.com">AgoraCart.com</a>
+
+	</td>
+</tr>
+<tr class="ac_copyright">
+<td colspan="2" class="ac_copyright">
+<center>
+Copyright &copy; 
+<!--agorascript-pre {
+&capture_STDOUT;
+
+if ($sc_footer_copyright_text eq ''){ 
+print qq~
+1999 to Present by K-Factor Technologies Inc. at <a href="http://www.agoracart.com">AgoraCart.com</a> and <a href="http://www.K-Factor.net" >K-Factor.net</a>
+~;
+} else {
+print qq~
+$sc_footer_copyright_text
+~;
+}
+&uncapture_STDOUT;
+}
+-->
+</center>
+</td>
+</tr>
+</table>
diff -aruN 5.0.000.src/html/html-templates/templates/Version4k/store_header.html 5.2.000.src/html/html-templates/templates/Version4k/store_header.html
--- 5.0.000.src/html/html-templates/templates/Version4k/store_header.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/Version4k/store_header.html	2007-12-20 15:55:51.000000000 -0600
@@ -0,0 +1,151 @@
+<!--BEGIN HEADER TABLE-->
+<table class="ac_header">
+<tr>
+  <td>
+<!--agorascript-pre 
+&capture_STDOUT; 
+print qq~<font class="template_fonth1"><b>$sc_headerStoreTitle</b></font>~;
+print qq~<font class="template_fonth2"><br>$sc_headerStoreTagLine</font>~;
+&uncapture_STDOUT;  -->
+  </td>
+  <td class="ac_header_search">
+    <form method="post" action="agora.cgi">
+      <input type="hidden" name="cart_id" value="%%cart_id%%">
+      <input type="text" name="keywords" size="20" maxlength="40">
+      <input type="hidden" name="ppinc" value="search">
+      <input type="submit" name="search_request_button" value="Search"> 
+    </form>
+  </td>
+</tr>
+</table>
+<table class="ac_mainbody" cellpadding=0 cellspacing=0>
+<tr>
+  <td class="ac_left_nav">
+
+<!--START Category Listings-->
+<!--agorascript-pre {
+     if ($sc_buySafe_is_enabled =~ /yes/) {
+          &capture_STDOUT;
+          print qq|<br>$sc_buysafe_merchant_seal_complete_button_string<br><br>|;
+          &uncapture_STDOUT;
+    }
+# code to list categories and/or sub categories
+# updated for pre-built lists in managers by Mister Ed September 29, 2007
+if ($sc_displayDynamicCategories =~ /yes/i) {
+&capture_STDOUT;
+        print "<h3>Categories</span></h3>";
+if ($sc_use_database_subcats =~ /yes/i) {
+    if ($sc_global_bot_tracker ne '1') {
+           print qq|\n$sc_categories_with_subcats\n|;
+    }
+    else {
+           print qq|\n$sc_categories_bots_with_subcats\n|;
+    }
+} else { 
+    if ($sc_global_bot_tracker ne '1') {
+           print qq|\n$sc_categories_no_subcats\n|;
+    }
+    else {
+    print qq|\n$sc_categories_bots_no_subcats\n|;
+    }
+}
+print "\n <br>";
+
+&uncapture_STDOUT; }
+}
+-->
+<!--END Category Listings-->
+
+<!--agorascript-pre {
+&capture_STDOUT;
+
+# start display New Products
+if ($sc_displayNewProducts =~ /yes/i){ 
+print qq~
+          <hr><h3>New Products<h3>
+  
+<br>$sc_tenNewProducts<br><br>
+        <br>
+~;
+}
+# end display New Products
+
+# start display Featured Product
+if ($sc_displayFeaturedProducts =~ /yes/i){ 
+print qq~
+          <hr>
+            <h3>Featured Product</h3>
+            <div align="left"><span class="style6"> </span>   
+<br>$sc_featuredProduct<br><br>
+~;
+}
+# end display Featured Product
+
+#display Top Sellers
+if ($sc_displayTopSellers =~ /yes/i){ 
+print qq~
+          <hr>
+            <h3>Best Sellers</h3>
+            <div align="left"><span class="style6"> </span>   
+<br>$sc_tenBestSellers<br><br>
+~;
+}
+&uncapture_STDOUT;
+}
+# end of display Top Sellers
+-->
+    <hr/>
+    <h3>Company Info:</h3>
+<!--agorascript-pre 
+&capture_STDOUT; 
+&cartlinks;
+# Match the style for left links
+$cartlinks =~ s/<a href/<a class=\"ac_left_links\" href/ig;
+print $cartlinks;
+&uncapture_STDOUT;  -->
+<br>
+    
+    <div id="ac_html_validator">
+      <a href="http://validator.w3.org/check?uri=referer" target="_new">
+        <img src="%%URLofImages%%/valid-html401.png"
+          alt="Valid HTML 4.01!" height="31" width="88"></a>
+    </div>
+    
+  </td>
+  <td class="ac_content">
+<!--agorascript-pre {
+local (@my_cart_fields,$my_cart_row_number,$result);
+local ($count,$price,$product_id,$quantity,$total_cost,$total_qty)=0;
+if ((!(-f "$sc_cart_path"))||($sc_processing_order =~ /yes/i)) {return ""}
+open (CART, "$sc_cart_path") || &file_open_error("$sc_cart_path",
+ "display_cart_contents_in_header", __FILE__, __LINE__);
+ while (<CART>)
+  {
+   $count++;
+   chop;    
+   @my_cart_fields = split (/\|/, $_);
+   $my_cart_row_number = pop(@my_cart_fields);
+   push (@my_cart_fields, $my_cart_row_number);
+   $quantity = $my_cart_fields[0];
+   $product_id = $my_cart_fields[1];
+   $price = $my_cart_fields[$sc_cart_index_of_price_after_options]; 
+   $total_cost = $total_cost + $quantity * $price;
+   $total_qty = $total_qty + $quantity;
+  } # End of while (<CART>)
+close (CART);
+if ($count > 0) {
+  $result = '<div align="center"><table class="ac_cart_summary"><tr>' .
+      '<td><a href="agora.cgi?dc=1&amp;%%href_fields%%' . 
+      '">View Cart</a></td>' .
+      "<td> Items in shopping cart: $total_qty\n" . 
+      "<br/> Item cost subtotal:&nbsp; " . &display_price($total_cost) . 
+      "</td>\n" .
+      '<td><a href="%%StepOneURL%%?order_form_button.x=1&amp;%%href_fields%%' . 
+      '">Check Out</a></td>' .
+      "</tr></table></div>";
+ } else {
+  $result = "";
+ }
+ return $result;
+}-->
+<!--END HEADER TABLE-->
diff -aruN 5.0.000.src/html/html-templates/templates/Version4k/Version4k/agoratemplate.css 5.2.000.src/html/html-templates/templates/Version4k/Version4k/agoratemplate.css
--- 5.0.000.src/html/html-templates/templates/Version4k/Version4k/agoratemplate.css	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/Version4k/Version4k/agoratemplate.css	2005-12-12 15:51:04.000000000 -0600
@@ -0,0 +1,148 @@
+a:link {
+  color: #0000FF;
+}
+a:visited {
+  color: #0000FF;
+}
+a:hover {
+  color: #00AAFF;
+}
+a:active{
+  color: #0000FF;
+}
+.style7 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #FFFFFF;
+}
+.style8 {font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #FFFFFF;
+}
+.template_fonth1{
+  padding: 0px;
+  padding-right: 0px; 
+  padding-left: 0px;
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 17pt;
+  font-weight: bold;
+  color: #FFFFFF;
+}
+.template_fonth2{
+  padding: 0px;
+  padding-right: 0px; 
+  padding-left: 0px;
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 14pt;
+  font-weight: normal;
+  font-style : italic;
+  color: #FFFFFF;
+}
+.template_mainbackground{
+  background-color : #680098;
+  border-color : #680098;
+}
+.template_image_no_border{
+  border : none;
+}
+.ac_header, .ac_mainbody{
+  width :100%;
+  font-size : 10pt;
+}
+.ac_header{
+  background-color : #680098;
+  padding: 0px;
+  text-align: center;
+  font-family : Verdana, Arial;
+  color: #FFFFFF;
+}
+h1#ac_h1 {
+  font-size : 15pt;
+  font-weight : bold;
+  margin: 0px;
+  color: #FFFFFF;
+}
+h2#ac_h2 {
+  font-style : italic;
+  margin: 0px;
+  font-size: 12pt;
+  color: #FFFFFF;
+}
+.ac_left_nav h3 {
+  color : #FF0000;
+  font-weight : bold;
+  text-align: center;
+  margin: 0px;
+  padding: 5px 0px 0px 5px;
+  font-size: 10pt;
+}
+.ac_left_nav hr{
+  padding:0px;
+  margin: 25px 0px 25px 0px;
+  width : 95%;
+}
+.ac_header_search{
+  text-align: right;
+  vertical-align : middle;
+}
+.ac_mainbody, .ac_cart_summary{
+  background-image : url(agora.cgi?secpicserve=steelgrey.jpg);
+  background-color : #cccccc;
+}
+.ac_mainbody{
+  padding: 0px;
+  margin: 0px;
+}
+.ac_left_nav{
+  width: 155px;
+  vertical-align : top;
+  padding: 0px;
+  padding-top: 15px;
+}
+a.ac_cart_info_links {
+  padding: px;
+  padding-right: 5px; 
+  padding-left: 10px;
+  font-size: 10pt;
+  font-weight: bold;
+  text-decoration : none;
+}
+a.ac_left_links {
+  text-align: left;
+  padding: 0px;
+  padding-right: 3px; 
+  padding-left: 10px;
+  font-size: 10pt;
+  font-weight: normal;
+  text-decoration : underline;
+}
+a.ac_left_sub_links {
+  text-align: left;
+  padding: 0px;
+  padding-right: 3px; 
+  padding-left: 18px;
+  font-size: 9pt;
+  font-weight: normal;
+  text-decoration : none;
+}
+.ac_cart_summary{
+  font-size: 12pt;
+  width:100%;
+  color: #000000;
+  text-align: center;
+  padding: 0px;
+  padding-top:10px;
+  padding-bottom:10px;
+}
+.ac_copyright{
+  text-align: center;
+  font-size: 10pt;
+  background-color: #FFFFFF;
+  padding: 0px;
+  padding-top:10px;
+  padding-bottom:10px;
+} 
+div#ac_html_validator{
+  text-align: center;
+  padding-top : 100px;
+  vertical-align : bottom;
+}
\ No newline at end of file
diff -aruN 5.0.000.src/html/html-templates/templates/Version4k/Version4k/index.html 5.2.000.src/html/html-templates/templates/Version4k/Version4k/index.html
--- 5.0.000.src/html/html-templates/templates/Version4k/Version4k/index.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/html-templates/templates/Version4k/Version4k/index.html	2006-09-02 19:47:54.000000000 -0500
@@ -0,0 +1 @@
+Restricted Area
\ No newline at end of file
diff -aruN 5.0.000.src/html/images/agora468.gif 5.2.000.src/html/images/agora468.gif
--- 5.0.000.src/html/images/agora468.gif	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/images/agora468.gif	1969-12-31 18:00:00.000000000 -0600
@@ -1,29 +0,0 @@
-GIF87a<  1       $$,,44<<DDLLUUnXVTT7aedd}eys?omll|||ބ4E1UyY\`t^դV,    <  @pH,F΀l: `JZجvzxL.z|N7|1Rmi>.z."p	#Sr>7t.>~.	?9 s>~Ś 
-H tq
-hH΂y>gǏ C	뽑H)G͛8I` 
-rd4Р9<(XT-}4`1ׯ`fAņ	?tcƏ<a#
3ܾ1!F3TLC۸52 Y/5$b3k,v*  ^Pņ
-6,@ HLP	3pTXFI#`pVtNz$?c( C	xPTz	=(ULGZ3F	V\,`T\0A4P0[AGMĝ(#GsY$
!6ttGW  =#~yJ5xTPɑ	@Ax
M1P	`*`	,LpPY@lP:`@%7`$PYxG;,>}vDu@ߌoԘԍQhP
/Q95D0DqM2\
-\2l ? $HM@ L䑔IQtgĚxR9@4
t`BF(SFЫ@<<w)W: :Cڴ3=[oCa 0!N*@ه(KN3% r	pd 
opPλfj|6H
SGB|V5@ 	  >cB  	MaϨ6$A D׀	`Cs$P5zCC~S64BA
w545 k3x	(!0P̰gSs;B@d\pp#M`Dod 44b G;&*
-G	V]o{U3Z&o2ʛh? 45AT82^ǃo<P
-&̎ 6ؐx %DxbVvo%pp@ 6B!>[|X X@An){CWr"
 |o
-}o*@z ~RD@(f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qt,ʁ1VM3RCENY;!Lo
ycL?iDυ:h3@_ÃCCI'GH)4 ԏQÒj;b-m"C8(0c_L%֞)V2\W>}4ɁZՈ#AJm7e[K/3%;cQ9Aa
+kn	%@K3Ve@ r|Ҿ'ںE΁-	2&|=4cqFQDCjآD
-BLd/
-Zddx1exGatHxJ!èI̮C!D0dDsICRLg4SK(kg7\2Q;
-7p 
;\Q?aE7S0`.ӧdP :RMmԭx,S@
B^M\a$4]b@8}*UD2 TP`ejS4`QWo99۩iy`6v#]x-R-7ޕWyV	dE8s~%fc=S
-M>U^]  dmuޙ}蠅袍>餕^g ~ꨥꪭ묵ޚ뮽>Վ:       ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/images/buttonsets/OldWest001/index.html 5.2.000.src/html/images/buttonsets/OldWest001/index.html
--- 5.0.000.src/html/images/buttonsets/OldWest001/index.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/images/buttonsets/OldWest001/index.html	2006-09-02 19:50:41.000000000 -0500
@@ -0,0 +1 @@
+Restricted Area
\ No newline at end of file
diff -aruN 5.0.000.src/html/images/buttonsets/TheAgora_Mustard/continue_shopping.gif 5.2.000.src/html/images/buttonsets/TheAgora_Mustard/continue_shopping.gif
--- 5.0.000.src/html/images/buttonsets/TheAgora_Mustard/continue_shopping.gif	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/images/buttonsets/TheAgora_Mustard/continue_shopping.gif	2007-05-29 19:17:31.000000000 -0500
@@ -0,0 +1,3 @@
+GIF89ao    {ȸF̽Tnĳ9ۢ҉&aז,&                                       !     ,    o   `$$Chɾpdx|'ȤgeX֬x8 `G`x $
 8g#[>rm^0|@ik		66sVOv8}8U@w`j6   s	gc:
+66
+h g
  6	q7OUyzg_`~z|8U
(((`(BCu% ,qtZ(b<GPx	c8	#AA M?Uf YGe0}5/Q/^MщFIlL[6Irni9SZjOk_H0`:e(K9(rTyb/P:̌-:z,cNo>id?Tf-;Y^XsoВD	23)Z|CnOCGX$N%+@qa $1ń[k%5 TB@$97ɕ':h	Fd8xOЂ͡  jHbP,ȕi"Lf8 ?W#hsd'F1lEaܖdpVP@cc@4@
3B4+  ;
\ No newline at end of file
diff -aruN 5.0.000.src/html/index.html 5.2.000.src/html/index.html
--- 5.0.000.src/html/index.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/index.html	2007-12-19 22:46:20.000000000 -0600
@@ -70,16 +70,16 @@
 	</tr><tr>
 
 	<td valign=top width="25%"><center><font face=arial size="2">
-	<a href="agora.cgi?cart_id=&amp;p_id=$special1[0]&amp;xm=on">$special1[3]</a></font></center></td>
+	<a href="agora.cgi?p_id=$special1[0]&amp;xm=on">$special1[3]</a></font></center></td>
 
 	<td valign=top width="25%"><center><font face=arial size="2">
-	<a href="agora.cgi?cart_id=&amp;p_id=$special2[0]&amp;xm=on">$special2[3]</a></font></center></td>
+	<a href="agora.cgi?p_id=$special2[0]&amp;xm=on">$special2[3]</a></font></center></td>
 
 	<td valign=top width="25%"><center><font face=arial size="2">
-	<a href="agora.cgi?cart_id=&amp;p_id=$special3[0]&amp;xm=on">$special3[3]</a></font></center></td>
+	<a href="agora.cgi?p_id=$special3[0]&amp;xm=on">$special3[3]</a></font></center></td>
 
 	<td valign=top width="25%"><center><font face=arial size="2">
-	<a href="agora.cgi?cart_id=&amp;p_id=$special4[0]&amp;xm=on">$special4[3]</a></font></center></td>
+	<a href="agora.cgi?p_id=$special4[0]&amp;xm=on">$special4[3]</a></font></center></td>
 
 	</tr><tr>
 
@@ -129,7 +129,7 @@
 		or this part won't make sense). Notice the code for the category links above and to the left. For example,
 		<strong>agora.cgi?product=java&amp;cart_id=</strong> displays all of the products from the database that are in the
 		<strong>java</strong> category. The 'cart id=' tells the script to add in the numeric cart id when the page is
-		parsed through the script. In other words, the cart id IS NOT hardcoded into the source code of the page, but is
+		parsed through the script. In other words, the cart_id IS NOT hardcoded into the source code of the page, but is
 		added dynamically to the page when it is displayed. This makes the script more accessible to users that do not
 		accept cookies.
 	</p>
@@ -138,7 +138,7 @@
 	<h3>Linking to Your Store</h3>
 
 	<p>
-		Linking to your store is fairly easy and you can link from jsut about anywhere.  Here are the most common way
+		Linking to your store is fairly easy and you can link from just about anywhere.  Here are the most common way
 		to link to your store:
 	</p>
 	<p>
@@ -174,7 +174,7 @@
 
 	<p>
 		Store Manager can be accessed <a href="protected/manager.cgi" target="_TOP">here</a>. Please note, on similar
-		scripts you need to use this syntax <strong>manager.cgi?welcome_screen=yes</strong>
+		scripts you need to use this syntax <strong>manager.cgi</strong>
 	</p>
 	<p>
 		If you use only <strong>manager.cgi</strong>, this script automatically loads the welcome screen!
@@ -189,13 +189,10 @@
 	<h3>Editing the Look of Your Store</h3>
 
 	<p>
-		To edit the look of the store, you may download the basic header footer manager at
-		<a href="http://www.agoracart.com/download/basicheader.zip">http://www.agoracart.com/download.htm</a>
-		which will edit the store look using this same look.  If you wish to edit the look yourself, you must manually
-		edit the store_header.inc, store_footer.inc, secure_store_header.inc, and secure_store_footer.inc files found in
-		the html/html-templates sub directory of your store, as well as edit the index.html file found in the html sub
-		directory of your store.  An options editor to add simple options to your database products is also available at
-		<a href="http://www.agoracart.com/download/simple.zip">http://www.agoracart.com/download.htm</a>
+		To edit the look of the store, you may edit pre-installed headers and footer files as well as the CSS files via the online CSS and Template editors in hte store management areas.  If you wish to customize the look to an existing design, you must manually
+		create a store_header.html, store_footer.html, secure_store_header.html, and secure_store_footer.html files place in the in
+		the html/html-templates/templates/template-name-here sub directory of your store, as well as edit the index.html file found in the html sub
+		directory of your store.  An options editor to add simple options to your database products is also available for installation from inside the upgrade manager.  See the online user forums and manuals/wiki for more information on customizing your store.
 	</p>
 
 
@@ -208,8 +205,8 @@
 		<a href="http://www.careyinternet.com/">Carey Internet Services</a>. The software has split off from the
 		commerce.cgi source tree (2.0beta1) and begun adding significant enhancements suggested by users as well as many
 		found as &quot;cool hacks&quot; available for the 'Web Store' program. The <strong>AgoraCart, AgoraCartPro,
-		AgoracgiPro, Agora.cgi, Agora,</strong> and <strong>Agoracgi</strong> names and software package are copyright
-		1999-2004 K-Factor Technologies, Inc. at <a href="http://www.agoracart.com/">AgoraCart.com</a>.
+		Agora.cgi, Agora,</strong> and <strong>Agoracgi</strong> names and software package are copyright
+		1999-Present K-Factor Technologies, Inc. - <a href="http://www.agoracart.com/">AgoraCart.com</a>.
 	</p>
 
 	<p>
@@ -221,10 +218,10 @@
 
 	<p>
 		Agora.cgi is open source freeware and is distributed <strong>without support</strong>. AgoraCart.com does maintain
-		a <a href="http://www.agoracart.com">Pro Member Area and Mailing List</a>, it is only a $59.95 for Lifetime or
-		$29.95 per year. We rely heavily on the AgoraCart/Agora.cgi community to support itself. If you find this product
-		useful to you, we hope that you will subscribe to the the list and perhaps even help someone else on the Mailing
-		List. Thanks!
+		a <a href="http://www.agoracart.com">Pro Version Member Area and Mailing List</a>, it is only a $49.95 for Lifetime or
+		$29.95 per year. We rely heavily on the AgoraCart community to support itself. If you find this product
+		useful to you, we hope that you donate your time, talents or a little money as well as subscribe to the the list ... and perhaps 
+        even help someone else on the Mailing	List. Thanks!
 	<p></div>
 
 %%StoreFooter%%
diff -aruN 5.0.000.src/html/options/ewerqwr.html 5.2.000.src/html/options/ewerqwr.html
--- 5.0.000.src/html/options/ewerqwr.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/options/ewerqwr.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,2 +0,0 @@
-<table border="0"><tr><td><p align="right"><font size="2" face="Arial">
-</font></td></tr></table>
diff -aruN 5.0.000.src/html/options/ext_warranty.html 5.2.000.src/html/options/ext_warranty.html
--- 5.0.000.src/html/options/ext_warranty.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/html/options/ext_warranty.html	2007-12-19 22:47:18.000000000 -0600
@@ -0,0 +1,44 @@
+<HTML>
+<TITLE>Extended Warranty Option</TITLE>
+<BODY>
+ <pre>
+this part never gets displayed, it is above the cut here tag.
+This allows the software to be more easily edited by
+html editors or commented well. :)
+
+This example of an option file sets the price of the extended warranty 
+as a percentage of the original price using the %%eval()%% mechanism. 
+ </pre>
+
+ <h3>--cut here--</h3>
+<!--agorascript-post &parse_options_to_verify(q^ AGSC-->
+ <TABLE CELLPADDING="0" CELLSPACING="0">
+  <TR ALIGN="CENTER"><TD><FONT FACE=ARIAL SIZE="2">
+   <B>Choose your Warranty %%cost%%</B>
+   <br>
+   </FONT></TD></TR>
+  <TR ALIGN="CENTER"><TD>
+  <SELECT NAME = "option|003|%%PRODUCT_ID%%">
+    <OPTION VALUE = "90 Day Warr.|0">90 Day Warranty
+    <OPTION 
+VALUE = "1 Yr Ext. Warr.|%%eval(&format_price(0.1*%%cost%%))%%"
+>1 Year (+%%eval(&display_price_nospaces($myans))%%)
+    <OPTION 
+VALUE = "3 Yr Ext. Warr.|%%eval(&format_price(0.25*%%cost%%))%%"
+>3 Years (+%%eval(&display_price_nospaces($myans))%%)
+  </SELECT></TD></TR>
+  </TABLE>
+<!--AGSC ^); -->
+<!--agorascript-post {
+ my $inx,$out;
+ $out="<table border=1 width=150><tr><td>opt
+key</td><td>value</td></tr>\n";
+ foreach $inx (keys %item_opt_verify) {
+  $out .= "<tr><td>$inx</td><td>$item_opt_verify{$inx}</td></tr>\n";
+ }
+ return $out . "</table>\n";}  -->
+  <h3>--cut here--</h3>
+  more junk here that is discarded.
+</BODY>
+</HTML>
+
diff -aruN 5.0.000.src/html/options/var_opt.html 5.2.000.src/html/options/var_opt.html
--- 5.0.000.src/html/options/var_opt.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/options/var_opt.html	2007-12-19 22:47:20.000000000 -0600
@@ -61,7 +61,7 @@
 local ($xqty,$xpid,$junk);
 foreach $inx (keys(%cart_copy)) {
   ($xqty,$xpid,$junk) = split(/\|/,$cart_copy{$inx},3);
-  if ($xpid == $cart_row[$cart{'product_id'}]) {$qty = $qty + $xqty;}
+  if ($xpid eq $cart_row[$cart{'product_id'}]) {$qty = $qty + $xqty;}
  }
    if ($qty > 99) {$myopt = '20% Qty Disc.|' . ((-0.20)*$price);}
 elsif ($qty > 49) {$myopt = '15% Qty Disc.|' . ((-0.15)*$price);}
diff -aruN 5.0.000.src/html/options/var_opt_wild2.html 5.2.000.src/html/options/var_opt_wild2.html
--- 5.0.000.src/html/options/var_opt_wild2.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/options/var_opt_wild2.html	2007-12-19 22:47:20.000000000 -0600
@@ -68,7 +68,7 @@
 foreach $inx (keys(%cart_copy)) { 
 #  ($xqty,$xpid,$junk) = split(/\|/,$cart_copy{$inx},3); #original style
   ($xqty,$xpid,$xproduct,$xprice,$xname,$ximage,$xshipping,$xshipping_calc_flag,$xoptions_ids,$junk) = split(/\|/,$cart_copy{$inx},10); 
-  if (($xpid == $cart_row[$cart{'product_id'}]) && ($xoptions_ids =~ /001/)) {$qty = $qty + $xqty;} 
+  if (($xpid eq $cart_row[$cart{'product_id'}]) && ($xoptions_ids =~ /001/)) {$qty = $qty + $xqty;} 
  } 
    if ($qty > 99) {$myopt = '20% Qty Disc.|' . &format_price((-0.20)*$price);} 
 elsif ($qty > 49) {$myopt = '15% Qty Disc.|' . &format_price((-0.15)*$price);} 
@@ -95,7 +95,7 @@
 foreach $inx (keys(%cart_copy)) { 
 #  ($xqty,$xpid,$junk) = split(/\|/,$cart_copy{$inx},3); #original style
   ($xqty,$xpid,$xproduct,$xprice,$xname,$ximage,$xshipping,$xshipping_calc_flag,$xoptions_ids,$junk) = split(/\|/,$cart_copy{$inx},10); 
-  if (($xpid == $cart_row[$cart{'product_id'}]) && ($xoptions_ids =~ /002/)) {$qty = $qty + $xqty;} 
+  if (($xpid eq $cart_row[$cart{'product_id'}]) && ($xoptions_ids =~ /002/)) {$qty = $qty + $xqty;} 
  } 
    if ($qty > 99) {$myopt = '20% Qty Disc.|' . &format_price((-0.20)*$price);} 
 elsif ($qty > 49) {$myopt = '15% Qty Disc.|' . &format_price((-0.15)*$price);} 
@@ -122,7 +122,7 @@
 foreach $inx (keys(%cart_copy)) { 
 #  ($xqty,$xpid,$junk) = split(/\|/,$cart_copy{$inx},3); #original style
   ($xqty,$xpid,$xproduct,$xprice,$xname,$ximage,$xshipping,$xshipping_calc_flag,$xoptions_ids,$junk) = split(/\|/,$cart_copy{$inx},10); 
-  if (($xpid == $cart_row[$cart{'product_id'}]) && ($xoptions_ids =~ /003/)) {$qty = $qty + $xqty;} 
+  if (($xpid eq $cart_row[$cart{'product_id'}]) && ($xoptions_ids =~ /003/)) {$qty = $qty + $xqty;} 
  } 
    if ($qty > 99) {$myopt = '20% Qty Disc.|' . &format_price((-0.20)*$price);} 
 elsif ($qty > 49) {$myopt = '15% Qty Disc.|' . &format_price((-0.15)*$price);} 
diff -aruN 5.0.000.src/html/options/var_opt_wild.html 5.2.000.src/html/options/var_opt_wild.html
--- 5.0.000.src/html/options/var_opt_wild.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/options/var_opt_wild.html	2007-12-19 22:47:20.000000000 -0600
@@ -59,7 +59,7 @@
 local ($xqty,$xpid,$junk);
 foreach $inx (keys(%cart_copy)) {
   ($xqty,$xpid,$junk) = split(/\|/,$cart_copy{$inx},3);
-  if ($xpid == $cart_row[$cart{'product_id'}]) {$qty = $qty + $xqty;}
+  if ($xpid eq $cart_row[$cart{'product_id'}]) {$qty = $qty + $xqty;}
  }
    if ($qty > 99) {$myopt = '20% Qty Disc.|' . &format_price((-0.20)*$price);}
 elsif ($qty > 49) {$myopt = '15% Qty Disc.|' . &format_price((-0.15)*$price);}
diff -aruN 5.0.000.src/html/pages/mgrinvoiceTemplate.html 5.2.000.src/html/pages/mgrinvoiceTemplate.html
--- 5.0.000.src/html/pages/mgrinvoiceTemplate.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/pages/mgrinvoiceTemplate.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,157 +0,0 @@
-<HTML>
-<head>
-<TITLE> %%month%% %%year%% Invoice: %%invoiceNumber%% - %%customerNumber%%</TITLE>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<meta name="copyright" content="%%year%%">
-<meta name="author" content="AgoraCart">
-<meta name="publisher" content="K-Factor Technologies,Inc.">
-</head>
-<BODY bgcolor="#FFFFFF" text="#000000" alink="#FF0000" vlink="#FF00FF" link="#0000FF">
-<!--
-Available Tokens:
-%%year%%
-%%day%%
-%%month%%
-%%invoiceNumber%%
-%%customerNumber%%
-%%orderStatus%%
-%%shiptrackingID%%
-%%firstName%%
-%%lastName%%
-%%fullName%%
-%%companyName%%
-%%customerPhone%%
-%%faxNumber%%
-%%emailAddress%%
-%%orderFromAddress%%
-%%customerAddress2%%
-%%customerAddress3%%
-%%orderFromCity%%
-%%orderFromState%%
-%%orderFromPostal%%
-%%orderFromCountry%%
-%%shipToName%%
-%%shipToAddress%%
-%%shipToAddress2%%
-%%shipToAddress3%%
-%%shipToCity%%
-%%shipToState%%
-%%shipToPostal%%
-%%shipToCountry%%
-%%shipMethod%%
-%%shippingTotal%%
-%%shipToInsured%%
-%%shipToResidential%%
-%%salesTax%%
-%%tax1%%
-%%tax2%%
-%%tax3%%
-%%discounts%%
-%%subTotal%%
-%%orderTotal%%
-%%user1%%
-%%user2%%
-%%user3%%
-%%user4%%
-%%user5%%
-%%adminMessages%%
-%%GatewayUsed%%
-%%cartContents%%
-%%money_symbol%%
-%%shippingMessages%%
-%%xcomments%%
-%%termsOfService%%
--->
-<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td>
-<center><font face=arial size=+3 color=red><b>Invoice&nbsp;&nbsp;&nbsp;</b> </font></center>
-<font face=arial size=+2 color=red>AgoraCart.com</font><br>
-<font face=arial size=1>your company address<br>City, State, Postalcode<br>Phone: 800-123-4567<br>Email_address@SomeDomainNameHere.com</font><br>
-<br>
-<table width=98% border=1 cellpadding=10 cellspacing=0>
-<tr bgcolor=#99CC99>
-<td valign=top width=50%>
-<font face=arial size=1>
-<b>Bill To:</b>
-</font>
-</td>
-<td valign=top width=50%>
-<font face=arial size=1>
-<b>Ship To:</b>
-</font>
-</td></tr>
-<tr>
-<td valign=top width=50%>
-<font face=arial size=1><b>
-%%fullName%%<br>
-%%orderFromAddress%%<br>
-<!--%%companyName%%<br>-->
-%%orderFromCity%%, %%orderFromState%%<br>
-%%orderFromPostal%%<br>
-%%orderFromCountry%%<br><br>
-%%customerPhone%%<br>
-%%emailAddress%%<br>
-</b>
-</font>
-</td>
-<td valign=top>
-<font face=arial size=1><b>
-%%shipToName%%<br>
-%%shipToAddress%%<br>
-%%shipToCity%%, %%shipToState%%<br>
-%%shipToPostal%%<br>
-%%shipToCountry%%<br><br>
-</b>
-</font>
-</td></tr>
-<tr bgcolor=#99CC99>
-<td colspan=2 valign=top width=100%>
-<font face=arial size=2>
-<b>Order: %%invoiceNumber%% - %%customerNumber%%</b>
-</font>
-</td></tr>
-<tr>
-<td valign=top width=50%>
-<font face=arial size=1>
-<b>Date of Order:</b> %%month%% %%day%%, %%year%%<br>
-<b>Status of Order:</b> %%orderStatus%%<br><br>
-<b>Invoice Number:</b> %%invoiceNumber%%<br>
-<b>Customer ID:</b> %%customerNumber%%<br>
-<b>Processed Via:</b> %%GatewayUsed%%<br><br>
-<b>Ship via:</b> %%shipMethod%%<br>
-<b>Residential?</b> %%shipToResidential%%<br>
-<b>Insure?</b> %%shipToInsured%%<br>
-<b>Tracking ID (if any):</b> %%shiptrackingID%%<br>
-</font>
-</td>
-<td valign=top width=50%>
-<table width=80% border=0 cellpadding=0>
-<tr><td align=right><font face=arial size=1>Order Subtotal:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%subTotal%%</font></td></tr>
-<tr><td align=right><font face=arial size=1>Discounts Given:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%discounts%%</font></td></tr>
-<tr><td align=right><font face=arial size=1>Sales Tax:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%salesTax%%</font></td></tr>
-<tr><td align=right><font face=arial size=1>Tax 1:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%tax1%%</font></td></tr>
-<tr><td align=right><font face=arial size=1>Tax 2:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%tax2%%</font></td></tr>
-<tr><td align=right><font face=arial size=1>Tax 3:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%tax3%%</font></td></tr>
-<tr><td align=right><font face=arial size=1>Shipping:</font></td><td align=right><font face=arial size=1>%%money_symbol%% %%shippingTotal%%</font></td></tr>
-<tr><td align=right><font face=arial size=2><b>Grand Total:</b></font></td><td align=right><font face=arial size=2><b>%%money_symbol%% %%orderTotal%%</b></font></td></tr>
-</table>
-</td></tr>
-<tr bgcolor=#99CC99>
-<td colspan=2 valign=top><center><font face=arial size=2><b>Product Information</b></font></center></td></tr>
-<tr>
-<td colspan=2 valign=top>
-<table width=100% border=0 cellpadding=0 cellspacing=0>
-<td valign=top width=75%><font face=arial size=1><br><b>Product Name</b></font></td>
-<td valign=top width=10%><font face=arial size=1><br><b>Quantity</b></font></td>
-<td valign=top width=15%><font face=arial size=1><br><b>Total Price Each</b></font></td></tr>
-%%cartContents%%
-</table>
-</td></tr>
-<tr bgcolor=#99CC99>
-<td colspan=2 valign=top><center><font face=arial size=2><b>Messages</b></font></center></td></tr>
-<tr>
-<td colspan=2 valign=top><center><font face=arial size=1>%%xcomments%%</font></center></td></tr>
-</table>
-</td></tr>
-</table>
-</BODY>
-</HTML>
\ No newline at end of file
diff -aruN 5.0.000.src/html/pages/mgrpackingslipTemplate.html 5.2.000.src/html/pages/mgrpackingslipTemplate.html
--- 5.0.000.src/html/pages/mgrpackingslipTemplate.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/pages/mgrpackingslipTemplate.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,152 +0,0 @@
-<HTML>
-<head>
-<TITLE> %%month%% %%year%% Packing Slip for Order: %%invoiceNumber%% - %%customerNumber%%</TITLE>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<meta name="copyright" content="%%year%%">
-<meta name="author" content="AgoraCart">
-<meta name="publisher" content="K-Factor Technologies,Inc.">
-</head>
-<BODY bgcolor="#FFFFFF" text="#000000" alink="#FF0000" vlink="#FF00FF" link="#0000FF">
-<!--
-Available Tokens:
-%%year%%
-%%day%%
-%%month%%
-%%invoiceNumber%%
-%%customerNumber%%
-%%orderStatus%%
-%%shiptrackingID%%
-%%firstName%%
-%%lastName%%
-%%fullName%%
-%%companyName%%
-%%customerPhone%%
-%%faxNumber%%
-%%emailAddress%%
-%%orderFromAddress%%
-%%customerAddress2%%
-%%customerAddress3%%
-%%orderFromCity%%
-%%orderFromState%%
-%%orderFromPostal%%
-%%orderFromCountry%%
-%%shipToName%%
-%%shipToAddress%%
-%%shipToAddress2%%
-%%shipToAddress3%%
-%%shipToCity%%
-%%shipToState%%
-%%shipToPostal%%
-%%shipToCountry%%
-%%shipMethod%%
-%%shippingTotal%%
-%%shipToInsured%%
-%%shipToResidential%%
-%%salesTax%%
-%%tax1%%
-%%tax2%%
-%%tax3%%
-%%discounts%%
-%%subTotal%%
-%%orderTotal%%
-%%user1%%
-%%user2%%
-%%user3%%
-%%user4%%
-%%user5%%
-%%adminMessages%%
-%%GatewayUsed%%
-%%cartContents%%
-%%money_symbol%%
-%%shippingMessages%%
-%%xcomments%%
-%%termsOfService%%
--->
-<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td>
-<center><font face=arial size=+3 color=red><b>Packing Slip&nbsp;&nbsp;&nbsp;</b> </font></center>
-<font face=arial size=+2 color=red>AgoraCart.com</font><br>
-<font face=arial size=1>your company address<br>City, State, Postalcode<br>Phone: 800-123-4567<br>Email_address@SomeDomainNameHere.com</font><br>
-<br>
-<table width=98% border=1 cellpadding=10 cellspacing=0>
-<tr bgcolor=#99CC99>
-<td valign=top width=50%>
-<font face=arial size=2>
-<b>Bill To:</b>
-</font>
-</td>
-<td valign=top width=50%>
-<font face=arial size=2>
-<b>Ship To:</b>
-</font>
-</td></tr>
-<tr>
-<td valign=top width=50%>
-<font face=arial size=2><b>
-%%fullName%%<br>
-<!--%%companyName%%<br>-->
-%%orderFromAddress%%<br>
-%%orderFromCity%%, %%orderFromState%%<br>
-%%orderFromPostal%%<br>
-%%orderFromCountry%%<br><br>
-%%customerPhone%%<br>
-%%emailAddress%%<br>
-</b>
-</font>
-</td>
-<td valign=top>
-<font face=arial size=2><b>
-%%shipToName%%<br>
-%%shipToAddress%%<br>
-%%shipToCity%%, %%shipToState%%<br>
-%%shipToPostal%%<br>
-%%shipToCountry%%<br><br>
-</b>
-</font>
-</td></tr>
-<tr bgcolor=#99CC99>
-<td colspan=2 valign=top width=100%>
-<font face=arial size=2>
-<b>Order: %%invoiceNumber%% - %%customerNumber%%</b>
-</font>
-</td></tr>
-<tr>
-<td valign=top width=50%>
-<font face=arial size=1>
-<b>Date of Order:</b> %%month%% %%day%%, %%year%%<br>
-<b>Invoice Number:</b> %%invoiceNumber%%<br>
-<b>Customer ID:</b> %%customerNumber%%<br>
-</font>
-</td>
-<td valign=top width=50%>
-<font face=arial size=1>
-<b>Status of Order:</b> %%orderStatus%%<br><br>
-<b>Ship via:</b> %%shipMethod%%<br>
-<b>Residential?</b> %%shipToResidential%%<br>
-<b>Insure?</b> %%shipToInsured%%<br>
-<b>Tracking ID (if any):</b> %%shiptrackingID%%<br>
-</font>
-</td></tr>
-<tr bgcolor=#99CC99>
-<td colspan=2 valign=top><center><font face=arial size=2><b>Product Information</b></font></center></td></tr>
-<tr>
-<td colspan=2 valign=top>
-<table width=100% border=0 cellpadding=0 cellspacing=0>
-<td valign=top width=75%><font face=arial size=1><br><b>Product Name</b></font></td>
-<td valign=top width=10%><font face=arial size=1><br><b>Quantity</b></font></td>
-<td valign=top width=15%><font face=arial size=1><br><b>Total Price Each</b></font></td></tr>
-%%cartContents%%
-</table>
-</td></tr>
-<tr bgcolor=#99CC99>
-<td colspan=2 valign=top><center><font face=arial size=2><b>Messages</b></font></center></td></tr>
-<tr>
-<td colspan=2 valign=top><center><font face=arial size=1>%%xcomments%%</font></center></td></tr>
-<tr bgcolor=#99CC99>
-<td colspan=2 valign=top><center><font face=arial size=2><b>Packing Instructions / Messages</b></font></center></td></tr>
-<tr>
-<td colspan=2 valign=top><font face=arial size=1>%%shippingMessages%%</font></td></tr>
-</table>
-</td></tr>
-</table>
-</BODY>
-</HTML>
\ No newline at end of file
diff -aruN 5.0.000.src/html/pages/test.html 5.2.000.src/html/pages/test.html
--- 5.0.000.src/html/pages/test.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/html/pages/test.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>AgoraCart %%agoracgi_ver%% ERROR Page</title>
-%%head_info%%
-</head>
-
-<body>
-%%StoreHeader%%
-<div align="center" style="text-align:center; padding: 20px 20px 20px 20px;">
-
-	<div class="ac_vertical_links">
-		<!--agorascript-pre
-		# TO ADJUST THE LOOK OF THESE LINKS
-		# EDIT THE CREATE A NEW CLASS OR
-		# ADJUST THIS ONE
-		&capture_STDOUT;
-		&cartlinks;
-		print $cartlinks;
-		&uncapture_STDOUT;  -->
-	</div>
-
-	<hr/>
-	<p>
-		Testing headers on static pages.<br/>
-		Please hit the browser back button, change what was done in error, and try again.
-	</p>
-	<hr/>
-
-</div>
-%%StoreFooter%%
-</body>
-</html>  <!-- agora.cgi shopping cart 4.99.0 Pro Member Version RC-1 -->
-  <!-- sc_special_page_meta_tags in agora.setup.db -->
-  <meta http-equiv="Expires" content="Wed, 4 October 2005 00:00:00 GMT">
-  <meta http-equiv="Cache-Control" content="no-cache">
-  <meta http-equiv="Pragma" content="no-cache">
-  <!-- sc_browser_meta_tags in agora.setup.db -->
diff -aruN 5.0.000.src/library/2checkout-order_lib.pl 5.2.000.src/library/2checkout-order_lib.pl
--- 5.0.000.src/library/2checkout-order_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/2checkout-order_lib.pl	2007-12-19 23:22:00.000000000 -0600
@@ -2,7 +2,7 @@
 #                    Order Form Definition Variables                  #
 #######################################################################
 
-$versions{'2checkout-order_lib.pl'} = "5.0.000";
+$versions{'2checkout-order_lib.pl'} = "5.0.002";
 $sc_use_secure_header_at_checkout = 'yes';
 $sc_use_secure_footer_for_order_form = 'yes';
 
@@ -76,6 +76,10 @@
 # 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("2checkout_fields_bottom");
+
 }
 ###############################################################################
 sub checkout_verification_table {
@@ -543,6 +547,13 @@
   $orderLoggingHash{'subTotal'} = "$sc_verify_subtotal";
   $orderLoggingHash{'shipMethod'} = "$vform_Ecom_ShipTo_Method";
 
+if (($sc_buySafe_is_enabled =~ /yes/) && ($sc_verify_buySafe > 0)) {
+my $temp = &format_price($sc_verify_buySafe);
+$text_of_cart .= "$sc_buySafe_bond_fee_mini_display_text       $temp\n";
+$text_of_confirm_email .= "$sc_verify_buySafe_display_text       $temp\n";
+$orderLoggingHash{'buySafe'} = "$temp";
+}
+
   if ($form_data{'x_freight'}) {
     $text_of_cart .= "SHIPPING:      $form_data{'x_Freight'}\n";
     $text_of_confirm_email .= "SHIPPING:      $form_data{'x_Freight'}\n";
@@ -705,23 +716,26 @@
 $text_of_admin_email .= &addto_shop_keep_email;
 $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";
+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";
 }
 
-if ($sc_send_order_to_email =~ /yes/i)
-{
-&send_mail($sc_admin_email, $sc_order_email, $x_Description, $text_of_cart);
+# added by Mister Ed Feb 7, 2007
+my $temp_admin_email = "$sc_admin_email";
+if ($sc_use_customer_email_over_admin =~ /yes/i) {
+   $temp_admin_email = "form_data{'x_Email'}";
+}
+
+if ($sc_send_order_to_email =~ /yes/i) {
+   &send_mail($sc_admin_email, $sc_order_email, $x_Description, $text_of_cart);
 }
 
 &log_order($text_of_cart,$form_data{'x_invoice_num'},$form_data{'x_cust_id'});
 
-if (($cartData) && ($form_data{'x_Email'} ne ""))
-{
-&send_mail($sc_admin_email, $form_data{'x_Email'}, $messages{'ordcnf_08'},
+if (($cartData) && ($form_data{'x_Email'} ne "")) {
+   &send_mail($sc_admin_email, $form_data{'x_Email'}, $messages{'ordcnf_08'},
            "$text_of_confirm_email");
 }
 $sc_affiliate_order_unique = $form_data{'x_invoice_num'};
@@ -753,6 +767,7 @@
 
 # This empties the cart after the order is successful
 &empty_cart;
+undef(%form_data);
 
 # and the footer is printed
 
diff -aruN 5.0.000.src/library/additions/BrowserDetect.pm 5.2.000.src/library/additions/BrowserDetect.pm
--- 5.0.000.src/library/additions/BrowserDetect.pm	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/BrowserDetect.pm	2007-12-10 13:52:18.000000000 -0600
@@ -0,0 +1,756 @@
+package HTTP::BrowserDetect;
+
+use strict;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK @ALL_TESTS);
+require Exporter;
+
+@ISA	   = qw(Exporter);
+@EXPORT	   = qw();
+@EXPORT_OK = qw();
+$VERSION   = '0.99';
+
+# Operating Systems
+push @ALL_TESTS,(qw(win16 win3x win31 win95 win98 winnt windows win32 win2k winxp win2k3 winvista winme dotnet mac macosx mac68k macppc os2 unix sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10 aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant dec sinix freebsd bsd vms x11 amiga));
+
+# Devices
+push @ALL_TESTS,(qw(palm audrey iopener wap blackberry));
+
+# Browsers
+push @ALL_TESTS,(qw(mosaic netscape nav2 nav3 nav4 nav4up nav45 nav45up nav6 nav6up navgold firefox safari ie ie3 ie4 ie4up ie5 ie5up ie55 ie55up ie6 ie7 ie8 opera opera3 opera4 opera5 opera6 opera7 opera8 opera9 opera10 lynx links aol aol3 aol4 aol5 aol6 aol7 aol8 aol9 neoplanet neoplanet2 avantgo emacs mozilla gecko konqueror));
+
+# Robots
+push @ALL_TESTS,(qw(wget getright robot yahoo altavista lycos infoseek lwp webcrawler linkexchange slurp webtv staroffice lotusnotes icab google java));
+
+#######################################################################################################
+# BROWSER OBJECT
+
+my $default = undef;
+
+sub new {
+   my ($class, $user_agent) = @_;
+   
+   my $self = {};
+   bless $self, $class;
+
+   unless (defined $user_agent) {
+     $user_agent = $ENV{'HTTP_USER_AGENT'};
+   }
+
+   $self->user_agent($user_agent);
+   return $self;
+}
+
+foreach my $test (@ALL_TESTS) {
+    no strict 'refs';
+    my $key = uc $test;
+    *{$test} = sub { my ($self) = _self_or_default(@_);
+		     return $self->{tests}->{$key} };
+}
+
+sub _self_or_default {
+   my ($self) = $_[0];
+   return @_ if (defined $self &&
+		 ref $self &&
+		 (ref $self eq 'HTTP::BrowserDetect') || UNIVERSAL::isa($self,'HTTP::BrowserDetect'));
+   $default ||= HTTP::BrowserDetect->new();
+   unshift (@_, $default);
+   return @_;
+}
+
+
+sub user_agent {
+  my ($self, $user_agent) = _self_or_default(@_);
+  if (defined $user_agent) {
+    $self->{user_agent} = $user_agent;
+    $self->_test();
+  }
+  return $self->{user_agent};
+}
+
+# Private method -- test the UA string
+sub _test {
+  my ($self) = @_;
+
+  my $ua = lc $self->{user_agent};
+
+  # Browser version
+  my ($major, $minor, $beta) = ($ua =~ / \/			# Version starts with a slash
+				          [A-Za-z]*		# Eat any letters before the major version
+                                          ( [^\.]* )		# Major version number is everything before the first dot
+                                          \.			# The first dot
+                                          ( [\d]* )		# Minor version number is every digit after the first dot
+                                          [\d\.]*		# Throw away remaining numbers and dots
+                                          ( [^\s]* )		# Beta version string is up to next space
+                                        /x);
+     
+  # Firefox version
+  
+  if ($ua =~ /(firefox|firebird|phoenix)/i) {
+      (undef,$major, $minor)    = ($ua =~ / 
+				    (firefox|firebird|phoenix)
+				    \/
+				    ( [^\.]* )			# Major version number is everything before first dot
+				    \.			    	# The first dot
+				    ( [\d]* )			# Minor version nnumber is digits after first dot
+				    /x);                    
+  }
+ 
+  
+  
+  # IE version                               
+  if (index($ua,"compatible") !=-1) {
+      ($major, $minor, $beta)    = ($ua =~ / 
+				    compatible;       
+				    \s*
+				    \w*				# Browser name
+				    [\s|\/]
+				    [A-Za-z]*			# Eat any letters before the major version
+				    ( [^\.]* )			# Major version number is everything before first dot
+				    \.				# The first dot
+				    ( [\d]* )			# Minor version nnumber is digits after first dot
+				    [\d\.]*			# Throw away remaining dots and digits
+				    ( [^;]* )			# Beta version is up to the ;
+				    ;
+				    /x);
+
+  }
+
+  $minor = 0+".$minor"; 
+
+  $self->{tests} = {};
+  my $tests = $self->{tests};
+
+  # Mozilla browsers 
+  
+  $tests->{GECKO}     = (index($ua,"gecko") != -1);
+  $tests->{FIREFOX}   = (index($ua,"firefox") != -1) ||
+                        (index($ua,"firebird") != -1) ||
+                        (index($ua,"phoenix") != -1);
+                        
+  $tests->{SAFARI}    = (index($ua,"safari") != -1) || (index($ua,"applewebkit") != -1);
+  
+  # Safari Version
+  if ($tests->{SAFARI}) {
+      my ($safari_build, $safari_minor);
+      ($safari_build,$safari_minor)    = ($ua =~ / 
+				    safari
+				    \/
+				    ( [^\.]* )			# Major version number is everything before first dot
+				    (?:			    	# The first dot
+				    ( [\d]* ))?			# Minor version nnumber is digits after first dot
+				    /x);                    
+    $major = int($safari_build / 100);
+    $minor = int($safari_build % 100) / 100;
+    $beta = $safari_minor;    
+    #print "major=$major minor=$minor beta=$beta\n";
+    
+  }
+  
+ # Gecko-powered Netscape (i.e. Mozilla) versions
+ $tests->{NETSCAPE}  = (!$tests->{FIREFOX} && !$tests->{SAFARI} && index($ua,"mozilla") != -1 && 
+			 index($ua,"spoofer") == -1 && index($ua,"compatible") == -1 &&
+			 index($ua,"opera") == -1 && index($ua,"webtv") == -1 && 
+			 index($ua,"hotjava") == -1);
+ 
+ 
+  if ($tests->{GECKO} && $tests->{NETSCAPE} && index($ua,"netscape")!=-1) {
+      ($major, $minor, $beta)    = ($ua =~ / 
+				    netscape\/  
+				    ( [^\.]* )			# Major version number is everything before first dot
+				    \.				# The first dot
+				    ( [\d]* )			# Minor version nnumber is digits after first dot
+                    ( [^\s]* )
+                   /x);
+     $minor = 0+".$minor"; 
+    #print "major=$major minor=$minor beta=$beta\n";
+  }
+
+  
+  # Netscape browsers
+  $tests->{NAV2}      = ($tests->{NETSCAPE} && $major == 2);
+  $tests->{NAV3}      = ($tests->{NETSCAPE} && $major == 3);
+  $tests->{NAV4}      = ($tests->{NETSCAPE} && $major == 4);
+  $tests->{NAV4UP}    = ($tests->{NETSCAPE} && $major >= 4); 
+  $tests->{NAV45}     = ($tests->{NETSCAPE} && $major == 4 && $minor == .5);
+  $tests->{NAV45UP}   = ($tests->{NAV4} && $minor >= .5) || ($tests->{NETSCAPE} && $major >= 5);
+  $tests->{NAVGOLD}   = (index($beta,"gold") != -1);
+  $tests->{NAV6}      = ($tests->{NETSCAPE} && $major == 5); # go figure
+  $tests->{NAV6UP}    = ($tests->{NETSCAPE} && $major >= 5);
+  
+  $tests->{MOZILLA}   = ($tests->{NETSCAPE} && $tests->{GECKO});
+    
+  # Internet Explorer browsers
+
+  $tests->{IE}               = (index($ua,"msie") != -1 || index($ua,'microsoft internet explorer') != -1);  
+  $tests->{IE3}              = ($tests->{IE} && $major == 3);
+  $tests->{IE4}              = ($tests->{IE} && $major == 4);
+  $tests->{IE4UP}            = ($tests->{IE} && $major >= 4);
+  $tests->{IE5}              = ($tests->{IE} && $major == 5);
+  $tests->{IE5UP}            = ($tests->{IE} && $major >= 5);
+  $tests->{IE55}             = ($tests->{IE} && $major == 5 && $minor >= .5);
+  $tests->{IE55UP}           = ($tests->{IE5} && $minor >= .5) || ($tests->{IE} && $major >= 6);
+  $tests->{IE6}             =  ($tests->{IE} && $major == 6);
+  $tests->{IE7}             =  ($tests->{IE} && $major == 7);
+  $tests->{IE8}             =  ($tests->{IE} && $major == 8);
+ 
+  # Neoplanet browsers
+
+  $tests->{NEOPLANET}      = (index($ua,"neoplanet") != -1);
+  $tests->{NEOPLANET2}     = ($tests->{NEOPLANET} && index($ua,"2.") != -1); 
+
+  # AOL Browsers
+
+  $tests->{AOL}       = (index($ua,"aol")     != -1);
+  $tests->{AOL3}      = (index($ua,"aol 3.0") != -1) || ($tests->{AOL} && $tests->{IE3});
+  $tests->{AOL4}      = (index($ua,"aol 4.0") != -1) || ($tests->{AOL} && $tests->{IE4});
+  $tests->{AOL5}      = (index($ua,"aol 5.0") != -1);
+  $tests->{AOL6}      = (index($ua,"aol 6.0") != -1);
+  $tests->{AOL7}      = (index($ua,"aol 7.0") != -1);
+  $tests->{AOL8}      = (index($ua,"aol 8.0") != -1);
+  $tests->{AOL9}      = (index($ua,"aol 9.0") != -1);
+  $tests->{AOLTV}     = (index($ua,"navio") != -1) || (index($ua,"navio_aoltv") != -1);
+
+  # Opera browsers
+  
+  $tests->{OPERA}     = (index($ua,"opera")   != -1);
+  $tests->{OPERA3}    = (index($ua,"opera 3") != -1) || (index($ua,"opera/3") != -1);
+  $tests->{OPERA4}    = (index($ua,"opera 4") != -1) || (index($ua,"opera/4") != -1);
+  $tests->{OPERA5}    = (index($ua,"opera 5") != -1) || (index($ua,"opera/5") != -1);
+  $tests->{OPERA6}    = (index($ua,"opera 6") != -1) || (index($ua,"opera/6") != -1);
+  $tests->{OPERA7}    = (index($ua,"opera 7") != -1) || (index($ua,"opera/7") != -1);
+  $tests->{OPERA7}    = (index($ua,"opera 7") != -1) || (index($ua,"opera/7") != -1);
+  $tests->{OPERA8}    = (index($ua,"opera 8") != -1) || (index($ua,"opera/8") != -1);
+  $tests->{OPERA9}    = (index($ua,"opera 9") != -1) || (index($ua,"opera/9") != -1);
+  $tests->{OPERA10}    = (index($ua,"opera 10") != -1) || (index($ua,"opera/10") != -1);
+  
+  # Other browsers
+
+  $tests->{CURL}           = (index($ua,"libcurl") != -1);
+  $tests->{STAROFFICE}     = (index($ua,"staroffice") != -1);
+  $tests->{ICAB}           = (index($ua,"icab") != -1);
+  $tests->{LOTUSNOTES}     = (index($ua,"lotus-notes") != -1);
+  $tests->{KONQUEROR}      = (index($ua,"konqueror") != -1);
+  $tests->{LYNX}           = (index($ua,"lynx") != -1);
+  $tests->{LINKS}          = (index($ua,"links") != -1);
+  $tests->{WEBTV}          = (index($ua,"webtv") != -1);
+  $tests->{MOSAIC}         = (index($ua,"mosaic") != -1);
+  $tests->{WGET}           = (index($ua,"wget") != -1);
+  $tests->{GETRIGHT}       = (index($ua,"getright") != -1);
+  $tests->{LWP}            = (index($ua,"libwww-perl") != -1 ||
+			      index($ua,"lwp-") != -1);
+  $tests->{YAHOO}          = (index($ua,"yahoo") != -1);
+  $tests->{GOOGLE}         = (index($ua,"google") != -1);
+  $tests->{JAVA}           = (index($ua,"java") != -1 ||
+			      index($ua,"jdk") != -1);
+  $tests->{ALTAVISTA}      = (index($ua,"altavista") != -1);
+  $tests->{SCOOTER}        = (index($ua,"scooter") != -1);
+  $tests->{LYCOS}          = (index($ua,"lycos") != -1);
+  $tests->{INFOSEEK}       = (index($ua,"infoseek") != -1);
+  $tests->{WEBCRAWLER}     = (index($ua,"webcrawler") != -1); 
+  $tests->{LINKEXCHANGE}   = (index($ua,"lecodechecker") != -1); 
+  $tests->{SLURP}          = (index($ua,"slurp") != -1);
+  $tests->{ROBOT}          = (($tests->{WGET} ||
+			       $tests->{GETRIGHT} ||
+			       $tests->{LWP} ||
+			       $tests->{YAHOO} ||
+			       $tests->{ALTAVISTA} ||
+			       $tests->{LYCOS} ||
+			       $tests->{INFOSEEK} ||
+			       $tests->{WEBCRAWLER} ||
+			       $tests->{LINKEXCHANGE} ||
+			       $tests->{SLURP} ||
+			       $tests->{GOOGLE}) ||
+			      index($ua,"bot") != -1 ||
+			      index($ua,"spider") != -1 ||
+			      index($ua,"crawl") != -1 ||
+			      index($ua,"agent") != -1 ||
+			      index($ua,"seek") != -1 ||
+			      index($ua,"search") != -1 ||
+			      index($ua,"reap") != -1 ||
+			      index($ua,"worm") != -1 ||
+			      index($ua,"find") != -1 ||
+			      index($ua,"index") != -1 ||
+			      index($ua,"copy") != -1 ||
+			      index($ua,"fetch") != -1 ||
+                  index($ua,"ia_archive") != -1 ||
+                  index($ua,"zyborg") != -1);
+
+  # Devices
+
+  $tests->{BLACKBERRY}        = (index($ua,"blackberry") != -1);
+  $tests->{AUDREY}        = (index($ua,"audrey") != -1);
+  $tests->{IOPENER}       = (index($ua,"i-opener") != -1);
+  $tests->{AVANTGO}        = (index($ua,"avantgo") != -1);
+  $tests->{PALM}          = ($tests->{AVANTGO} || 
+			     index($ua,"palmos") != -1 );
+  $tests->{WAP}           = (index($ua,"up.browser") != -1 ||
+			     index($ua,"nokia") != -1 ||
+			     index($ua,"alcatel") != -1 ||
+			     index($ua,"ericsson") != -1 ||
+			     index($ua,"sie-") == 0 ||
+			     index($ua,"wmlib") != -1 ||
+			     index($ua," wap") != -1 ||
+			     index($ua,"wap ") != -1 ||
+			     index($ua,"wap/") != -1 ||
+			     index($ua,"-wap") != -1 ||
+			     index($ua,"wap-") != -1 ||
+			     index($ua,"wap") == 0 ||
+			     index($ua,"wapper") != -1 ||
+			     index($ua,"zetor") != -1);
+			     
+			     
+  # Operating System
+  
+  $tests->{WIN16}    = (index($ua,"win16") != -1 || index($ua,"16bit") != -1 || index($ua,"windows 3") != -1 ||
+			index($ua,"windows 16-bit") != -1);
+  $tests->{WIN3X}    = (index($ua,"win16") != -1 || index($ua,"windows 3") != -1 || index($ua,"windows 16-bit") != -1);
+  $tests->{WIN31}    = (index($ua,"win16") != -1 || index($ua,"windows 3.1") != -1 || index($ua,"windows 16-bit") != -1);
+  $tests->{WIN95}    = (index($ua,"win95") != -1 || index($ua,"windows 95") != -1);
+  $tests->{WIN98}    = (index($ua,"win98") != -1 || index($ua,"windows 98") != -1);
+  $tests->{WINNT}    = (index($ua,"winnt") != -1 || 
+			index($ua,"windows nt") != -1 || 
+			index($ua,"nt4") != -1 || 
+			index($ua,"nt3") != -1);
+  $tests->{WIN2K}    = (index($ua,"nt 5.0") != -1 || index($ua,"nt5") != -1);
+  $tests->{WINXP}    = (index($ua,"nt 5.1") != -1 );
+  $tests->{WIN2K3}   = (index($ua,"nt 5.2") != -1 );
+  $tests->{WINVISTA} = (index($ua,"nt 6.0") != -1 );
+  $tests->{DOTNET}   = (index($ua,".net clr") != -1);
+  
+  $tests->{WINME}    = (index($ua,"win 9x 4.90") != -1); # whatever
+  $tests->{WIN32}    = (($tests->{WIN95} || $tests->{WIN98} || $tests->{WINME} || $tests->{WINNT} || 
+			 $tests->{WIN2K}) || $tests->{WINXP} ||  $tests->{WIN2K3} || $tests->{WINVISTA} || index($ua,"win32") != -1);
+  $tests->{WINDOWS}  = (($tests->{WIN16} || $tests->{WIN31} || $tests->{WIN95} || $tests->{WIN98} ||
+			 $tests->{WINNT} || $tests->{WIN32} || $tests->{WIN2K} || $tests->{WINXP} || $tests->{WIN2K3} || $tests->{WINVISTA} || $tests->{WINME}) || index($ua,"win") != -1);
+  
+  # Mac operating systems
+  
+  $tests->{MAC}      = (index($ua,"macintosh") != -1 || index($ua,"mac_") != -1);
+  $tests->{MACOSX}   = (index($ua,"macintosh") != -1 && index($ua,"mac os x") != -1);
+  $tests->{MAC68K}   = (($tests->{MAC}) && (index($ua,"68k") != -1 || index($ua,"68000") != -1));
+  $tests->{MACPPC}   = (($tests->{MAC}) && (index($ua,"ppc") != -1 || index($ua,"powerpc") != -1));
+  
+  # Others
+  
+  $tests->{AMIGA}   = (index($ua,'amiga') != -1);
+  
+  $tests->{EMACS}   = (index($ua,'emacs') != -1);
+  $tests->{OS2}     = (index($ua,'os/2') != -1);
+  
+  $tests->{SUN}     = (index($ua,"sun") != -1);
+  $tests->{SUN4}    = (index($ua,"sunos 4") != -1);
+  $tests->{SUN5}    = (index($ua,"sunos 5") != -1);
+  $tests->{SUNI86}  = (($tests->{SUN}) && index($ua,"i86") != -1);
+  
+  $tests->{IRIX}    = (index($ua,"irix") != -1);
+  $tests->{IRIX5}   = (index($ua,"irix5") != -1);
+  $tests->{IRIX6}   = (index($ua,"irix6") != -1);
+  
+  $tests->{HPUX}    = (index($ua,"hp-ux") != -1);
+  $tests->{HPUX9}   = (($tests->{HPUX}) && index($ua,"09.") != -1);
+  $tests->{HPUX10}  = (($tests->{HPUX}) && index($ua,"10.") != -1);
+  
+  $tests->{AIX}   = (index($ua,"aix") != -1);
+  $tests->{AIX1}  = (index($ua,"aix 1") != -1);
+  $tests->{AIX2}  = (index($ua,"aix 2") != -1);
+  $tests->{AIX3}  = (index($ua,"aix 3") != -1);
+  $tests->{AIX4}  = (index($ua,"aix 4") != -1);
+  
+  $tests->{LINUX}     = (index($ua,"inux") != -1);
+  $tests->{SCO}       = (index($ua,"sco") != -1 || index($ua,"unix_sv") != -1);
+  $tests->{UNIXWARE}  = (index($ua,"unix_system_v") != -1);
+  $tests->{MPRAS}     = (index($ua,"ncr") != -1);
+  $tests->{RELIANT}   = (index($ua,"reliantunix") != -1);
+  
+  $tests->{DEC} = (index($ua,"dec") != -1 || index($ua,"osf1") != -1 || index($ua,"declpha") != -1 || 
+		   index($ua,"alphaserver") != -1 || index($ua,"ultrix") != -1 ||
+		   index($ua,"alphastation") != -1);
+  
+  $tests->{SINIX}    = (index($ua,"sinix") != -1);
+  $tests->{FREEBSD}  = (index($ua,"freebsd") != -1);
+  $tests->{BSD}      = (index($ua,"bsd") != -1);
+  $tests->{X11}      = (index($ua,"x11") != -1);
+  $tests->{UNIX}     = ($tests->{X11} || $tests->{SUN} || $tests->{IRIX} || $tests->{HPUX} ||
+			$tests->{SCO} || $tests->{UNIXWARE} || $tests->{MPRAS} ||
+			$tests->{RELIANT} || $tests->{DEC} || $tests->{LINUX} ||
+			$tests->{BSD}); 
+
+  $tests->{VMS} = (index($ua,"vax") != -1 || index($ua,"openvms") != -1);
+
+  # A final try at browser version, if we haven't gotten it so far
+  if ($major eq '') {
+     if ($ua =~ /[A-Za-z]+\/(\d+)\;/) {
+          $major = $1;
+          $minor = 0;
+      }
+  }
+
+  
+  # Gecko version
+  $self->{gecko_version} = undef;
+  if ($tests->{GECKO}) {
+    if( $ua =~ /\([^)]*rv:([\w\.\d]*)/ ) {
+        $self->{gecko_version} = $1;
+    }
+  }
+  
+  $self->{major} = $major;
+  $self->{minor} = $minor;
+  $self->{beta} = $beta;
+}
+    
+sub browser_string {
+    my ($self) = _self_or_default(@_);
+    my $browser_string = undef;
+    my $user_agent = $self->user_agent;
+    if (defined $user_agent) {
+        $browser_string = 'Netscape' if $self->netscape;
+        $browser_string = 'Firefox' if $self->firefox;
+        $browser_string = 'Safari' if $self->safari;
+        $browser_string = 'MSIE' if $self->ie;  
+        $browser_string = 'WebTV' if $self->webtv;
+        $browser_string = 'AOL Browser' if $self->aol;
+        $browser_string = 'Opera' if $self->opera;
+        $browser_string = 'Mosaic' if $self->mosaic;
+        $browser_string = 'Lynx' if $self->lynx;
+    }
+    return $browser_string;
+}
+    
+sub os_string {
+    my ($self) = _self_or_default(@_);
+    my $os_string = undef;
+    my $user_agent = $self->user_agent;
+    if (defined $user_agent) {
+        $os_string = 'Win95' if $self->win95;
+        $os_string = 'Win98' if $self->win98;
+        $os_string = 'WinNT' if $self->winnt;
+        $os_string = 'Win2k' if $self->win2k;
+        $os_string = 'WinXP' if $self->winxp;
+        $os_string = 'Win2k3' if $self->win2k3;
+        $os_string = 'WinVista' if $self->winvista;
+        $os_string = 'Mac' if $self->mac;
+        $os_string = 'Mac OS X' if $self->macosx;
+        $os_string = 'Win3x' if $self->win3x;
+        $os_string = 'OS2' if $self->os2;
+        $os_string = 'Unix' if $self->unix && !$self->linux;
+        $os_string = 'Linux' if $self->linux;
+    }
+    return $os_string;
+}
+
+sub gecko_version {
+  my ($self, $check) = _self_or_default(@_);
+  my $version;
+  $version = $self->{gecko_version};
+  if (defined $check) { 
+    return $check == $version;
+  } else {
+    return $version;
+  }
+}
+
+    
+sub version {
+  my ($self, $check) = _self_or_default(@_);
+  my $version;
+  $version = $self->{major} + $self->{minor};
+  if (defined $check) { 
+    return $check == $version;
+  } else {
+    return $version;
+  }
+}
+    
+sub major {
+  my ($self, $check) = _self_or_default(@_);
+  my ($version) = $self->{major};
+  if (defined $check) { 
+    return $check == $version;
+  } else {
+    return $version;
+  }
+}
+    
+sub minor {
+  my ($self, $check) = _self_or_default(@_);
+  my ($version) = $self->{minor};
+  if (defined $check) { 
+      return ($check == $self->{minor});
+  } else {
+    return $version;
+  }
+}
+    
+sub beta {
+  my ($self, $check) = _self_or_default(@_);
+  my ($version) = $self->{beta};
+  if ($check) { 
+    return $check eq $version;
+  } else {
+    return $version;
+  }
+}
+
+1;
+    
+
+__END__
+
+=head1 NAME
+
+HTTP::BrowserDetect - Determine the Web browser, version, and platform from an HTTP user agent string
+
+=head1 SYNOPSIS
+
+    use HTTP::BrowserDetect;
+
+    my $browser = new HTTP::BrowserDetect($user_agent_string);
+
+    # Detect operating system
+    if ($browser->windows) {
+      if ($browser->winnt) ...
+      if ($brorwser->win95) ...
+    }
+    print $browser->mac;
+
+    # Detect browser vendor and version
+    print $browser->netscape;
+    print $browser->ie;
+    if (browser->major(4)) {
+	if ($browser->minor() > .5) {
+	    ...
+	}
+    }
+    if ($browser->version() > 4) {
+      ...;
+    }
+    
+    # Process a different user agent string
+    $browser->user_agent($another_user_agent_string);
+
+
+
+=head1 DESCRIPTION
+
+The HTTP::BrowserDetect object does a number of tests on an HTTP user
+agent string.  The results of these tests are available via methods of
+the object.
+
+This module is based upon the JavaScript browser detection code
+available at
+B<http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html>.
+
+=head2 CREATING A NEW BROWSER DETECT OBJECT AND SETTING THE USER AGENT STRING
+
+=over 4
+
+=item new HTTP::BrowserDetect($user_agent_string)
+
+The constructor may be called with a user agent string specified.
+Otherwise, it will use the value specified by $ENV{'HTTP_USER_AGENT'},
+which is set by the web server when calling a CGI script.
+
+You may also use a non-object-oriented interface.  For each method,
+you may call HTTP::BrowserDetect::method_name().  You will then be
+working with a default HTTP::BrowserDetect object that is created
+behind the scenes.
+
+=item user_agent($user_agent_string)
+
+Returns the value of the user agent string.  When called with a
+parameter, it resets the user agent and reperforms all tests on the
+string.  This way you can process a series of user agent strings (from
+a log file, perhaps) without creating a new HTTP::BrowserDetect object
+each time.
+
+=back
+
+=head2 DETECTING BROWSER VERSION
+
+=over 4
+
+=item major($major)
+
+Returns the integer portion of the browser version.
+If passed a parameter, returns true if it equals
+the browser major version.
+
+=item minor($minor)
+
+Returns the decimal portion of the browser version as a B<floating-point number> less than 1.  
+For example, if the version is 4.05, this method returns .05; if the version is 4.5, this method returns .5.  
+B<This is a change in behavior from previous versions of this module, which returned a 
+string>.
+
+If passed a parameter, returns true if equals the minor version.  
+
+On occasion a version may have more than one decimal point, such 
+as 'Wget/1.4.5'. The minor version does not include the second decimal point, 
+or any further digits or decimals.
+
+=item version($version)
+
+Returns the version as a floating-point number.  If passed a
+parameter, returns true if it is equal to the version
+specified by the user agent string.
+
+=item beta($beta)
+
+Returns any the beta version, consisting of any non-numeric characters
+after the version number.  For instance, if the user agent string is
+'Mozilla/4.0 (compatible; MSIE 5.0b2; Windows NT)', returns 'b2'.  If
+passed a parameter, returns true if equal to the beta version.  If the beta
+starts with a dot, it is thrown away.
+
+=back
+
+=head2 DETECTING OS PLATFORM AND VERSION
+
+The following methods are available, each returning a true or false
+value.  Some methods also test for the operating system version.  
+The indentations below show the hierarchy of tests (for example, win2k 
+is considered a type of winnt, which is a type of win32)
+
+  windows 
+    win16 win3x win31  
+    win32 
+        winme win95 win98
+        winnt
+            win2k winxp win2k3 winvista
+  dotnet
+  
+  mac 
+    mac68k macppc macosx
+  
+  os2
+  
+  unix 
+    sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10 
+    aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant 
+    dec sinix freebsd bsd
+  
+  vms
+
+  amiga
+
+It may not be possibile to detect Win98 in Netscape 4.x and earlier. 
+On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all Win32, so you can't distinguish between Win95 and WinNT.
+
+=over 
+
+=item os_string()
+
+Returns one of the following strings, or undef.  This method exists solely for compatibility with the
+B<HTTP::Headers::UserAgent> module.
+
+  Win95, Win98, WinNT, Win2K, WinXP, Win2K3, WinVista, Mac, Mac OS X, Win3x, OS2, Unix, Linux
+
+=back
+
+=head2 DETECTING BROWSER VENDOR
+
+The following methods are available, each returning a true or false value.  Some methods also
+test for the browser version, saving you from checking the version separately.
+
+  netscape nav2 nav3 nav4 nav4up nav45 nav45up navgold nav6 nav6up
+  gecko 
+  mozilla
+  firefox 
+  safari
+  ie ie3 ie4 ie4up ie5 ie55 ie6
+  neoplanet neoplanet2 
+  mosaic
+  aol aol3 aol4 aol5 aol6
+  webtv
+  opera opera3 opera4 opera5 opera6 opera7
+  lynx links
+  emacs
+  staroffice
+  lotusnotes
+  icab
+  konqueror
+  java
+  curl
+
+Netscape 6, even though its called six, in the userAgent string has version number 5.  The nav6 and nav6up methods correctly handle this quirk.
+The firefox text correctly detects the older-named versions of the browser (Phoenix, Firebird)
+
+=over
+
+
+=item browser_string()
+
+Returns one of the following strings, or undef.
+
+Netscape, MSIE, WebTV, AOL Browser, Opera, Mosaic, Lynx
+
+=item gecko_version() 
+
+If a Gecko rendering engine is used (as in Mozilla or Firebird), returns the version of the renderer (e.g. 1.3a, 1.7, 1.8)
+This might be more useful than the particular browser name or version when correcting for quirks in different versions of this rendering engine.
+If no Gecko browser is being used, or the version number can't be detected, returns undef.
+
+=back
+
+
+=head2 DETECTING OTHER DEVICES
+
+The following methods are available, each returning a true or false value.
+
+  wap
+  audrey
+  iopener
+  palm
+  avantgo
+  blackberry
+
+=head2 DETECTING ROBOTS
+
+=item robot()
+
+Returns true if the user agent appears to be a robot, spider,
+crawler, or other automated Web client.
+
+The following additional methods are available, each returning a true
+or false value.  This is by no means a complete list of robots that
+exist on the Web.
+
+  wget
+  getright
+  yahoo 
+  altavista 
+  lycos 
+  infoseek 
+  lwp
+  webcrawler 
+  linkexchange 
+  slurp 
+  google
+
+=head1 AUTHOR
+
+Lee Semel, lee@semel.net
+
+Thanks to Leonardo Herrera for additional contributions
+
+=head1 SEE ALSO
+
+"The Ultimate JavaScript Client Sniffer, Version 3.0", B<http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html>.
+
+"Browser ID (User-Agent) Strings" B<http://www.zytrax.com/tech/web/browser_ids.htm>
+
+perl(1), L<HTTP::Headers>, L<HTTP::Headers::UserAgent>.
+
+=head1 COPYRIGHT
+
+Copyright 1999-2004 Lee Semel.  All rights reserved.  This program is free software;
+you can redistribute it and/or modify it under the same terms as Perl itself. 
+
+=cut
+
+
+     
+
+
+
diff -aruN 5.0.000.src/library/additions/BTree/BTree.pm 5.2.000.src/library/additions/BTree/BTree.pm
--- 5.0.000.src/library/additions/BTree/BTree.pm	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/additions/BTree/BTree.pm	1969-12-31 18:00:00.000000000 -0600
@@ -1,353 +0,0 @@
-# -*- mode: perl; perl-indent-level: 2 -*-
-#
-# Btree.pm
-#
-# B-Trees
-#
-# Copyright 1997 M-J. Dominus (mjd@pobox.com)
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of any of:
-#       1. Version 2 of the GNU General Public License as published by
-#          the Free Software Foundation;
-#       2. Any later version of the GNU public license, or
-#       3. The Perl `Artistic License'
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the Artistic License with this
-#    Kit, in the file named "Artistic".  If not, I'll be glad to provide one.
-#
-#    You should also have received a copy of the GNU General Public License
-#    along with this program; if not, write to the Free Software
-#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-
-
-
-package BTree::Node;
-use Carp;
-
-$KEYS = 0;
-$DATA = 1;
-$SUBNODES = 2;
-
-# Each node has k key-data pairs, with B <= k <= 2B, and 
-#     each has k+1 subnodes, which might be null.
-# The node is a blessed reference to a list
-# with three elements:
-#  ($keylist, $datalist, $subnodelist)
-# each is a reference to a list list.
-# The null node is represented by a blessed reference to an empty list.
-
-sub emptynode {
-  new($_[0]);			# Pass package name, but not anything else.
-}
-
-# undef is empty; so is a blessed empty list.
-sub is_empty {
-  my $self = shift;
-  !defined($self) || $#$self < 0;
-}
-
-sub key {
-  my ($self, $n) = @_;
-  $self->[$KEYS][$n];
-}
-
-sub data {
-  my ($self, $n) = @_;
-  $self->[$DATA][$n];
-}
-
-sub kdp {
-  my ($self, $n, $k => $d) = @_;
-  if (defined $k) {
-    $self->[$KEYS][$n] = $k;
-    $self->[$DATA][$n] = $d;
-  }
-  [$self->[$KEYS][$n], 
-   $self->[$DATA][$n]];
-}
-
-sub subnode {
-  my ($self, $n, $newnode) = @_;
-  $self->[$SUBNODES][$n] = $newnode if defined $newnode;
-  $self->[$SUBNODES][$n];
-}
-
-sub is_leaf {
-  my $self = shift;
-  ! defined $self->[$SUBNODES][0]; # undefined subnode means leaf node.
-}
-
-# Arguments: ($keylist, $datalist, $subnodelist)
-# Special case: empty arg list to create empty node
-sub new {
-  my $self = shift;
-  my $package = ref $self || $self;
-  croak "Internal error:  BTree::Node::new called with wrong number of arguments."
-      unless @_ == 3 || @_ == 0;
-  bless [@_] => $package;
-}
-
-# Returns (1, $index) if $key[$index] eq $key.
-# Returns (0, $index) if key could be found in $subnode[$index].
-# In scalar context, just returns 1 or 0.
-sub locate_key {
-  # Use linear search for testing, replace with binary search.
-  my $self = shift;
-  my $key = shift;
-  my $cmp = shift || \&BTree::default_cmp;
-  my $i;
-  my $cmp_result;
-  my $N = $self->size;
-  for ($i = 0; $i < $N; $i++) {
-    $cmp_result = &$cmp($key, $self->key($i));
-    last if $cmp_result <= 0;
-  }
-  
-  # $i is now the index of the first node-key greater than $key
-  # or $N if there is no such.  $cmp_result is 0 iff the key was found.
-  (!$cmp_result, $i);
-}
-
-# Number of KEYS in the node
-sub size {
-  my $self = shift;
-  return scalar(@{$self->[$KEYS]});
-}
-
-# No return value.
-sub insert_kdp {
-  my $self = shift;
-  my ($k => $d) = @_;
-  my ($there, $where) = $self->locate_key($k) unless $self->is_empty;
-
-  if ($there) { croak("Tried to insert `$k => $d' into node where `$k' was already present."); }
-  splice(@{$self->[$KEYS]}, $where, 0, $k);
-  splice(@{$self->[$DATA]}, $where, 0, $d);
-  splice(@{$self->[$SUBNODES]}, $where, 0, undef);
-}
-
-# Accept an index $n
-# Divide into two nodes so that keys 0 .. $n-1 are in one node
-# and keys $n+1 ... $size are in the other.
-sub halves {
-  my $self = shift;
-  my $n = shift;
-  my $s = $self->size;
-  my @right;
-  my @left;
-
-  $left[$KEYS] = [@{$self->[$KEYS]}[0 .. $n-1]];
-  $left[$DATA] = [@{$self->[$DATA]}[0 .. $n-1]];
-  $left[$SUBNODES] = [@{$self->[$SUBNODES]}[0 .. $n]];
-
-  $right[$KEYS] = [@{$self->[$KEYS]}[$n+1 .. $s-1]];
-  $right[$DATA] = [@{$self->[$DATA]}[$n+1 .. $s-1]];
-  $right[$SUBNODES] = [@{$self->[$SUBNODES]}[$n+1 .. $s]];
-
-  my @middle = ($self->[$KEYS][$n], $self->[$DATA][$n]);
-
-  ($self->new(@left), $self->new(@right), \@middle);
-}
-
-sub to_string {
-  my $self = shift;
-  my $indent = shift || 0;
-  my $I = ' ' x $indent;
-  return '' if $self->is_empty;
-  my ($k, $d, $s) = @$self;
-  my $result = '';
-  $result .= defined($s->[0]) ? $s->[0]->to_string($indent+2) : '';
-  my $N = $self->size;
-  my $i;
-  for ($i = 0; $i < $N; $i++) {
-    $result .= $I . "$k->[$i] => $d->[$i]\n";
-    $result .= defined($s->[$i+1]) ? $s->[$i+1]->to_string($indent+2) : '';
-  }
-  $result;
-}
-
-
-
-################################################################
-
-package BTree;
-
-use Exporter;
-@ISA = (Exporter);
-
-BEGIN { import BTree::Node };
-
-use Carp;
-
-
-# Semantics:
-#  If key not found, insert it iff `Insert' arg is present
-#  If key *is* found, replace existing data iff `Replace' arg is present.
-
-sub B_search {
-  my $self = shift;
-  my %args = @_;
-  my $cur_node = $self->root;
-  my $k = $args{Key};
-  my $d = $args{Data};
-  my @path;
-
-  if ($cur_node->is_empty) {	# Special case for empty root
-    if ($args{Insert}) {
-      $cur_node->insert_kdp($k => $d);
-      return $d;
-    } else {
-      return undef;
-    }
-  }
-
-  # Descend tree to leaf
-  for (;;) {
-
-    # Didn't hit bottom yet.
-
-    my($there, $where) = $cur_node->locate_key($k);
-    if ($there) {		# Found it!
-      if ($args{Replace}) {
-	$cur_node->kdp($where, $k => $d);
-      } 
-      return $cur_node->data($where);
-    }
-    
-    # Not here---must be in a subtree.
-    
-    if ($cur_node->is_leaf) {	# But there are no subtrees
-      return undef unless $args{Insert}; # Search failed
-      # Stuff it in
-      $cur_node->insert_kdp($k => $d);
-      if ($self->node_overfull($cur_node)) { # Oops--there was no room.
-	$self->split_and_promote($cur_node, @path);
-      } 
-      return $d;
-    }
-
-    # There are subtrees, and the key is in one of them.
-
-    push @path, [$cur_node, $where];	# Record path from root.
-
-    # Move down to search the subtree
-    $cur_node = $cur_node->subnode($where);
-
-    # and start over.
-  }				# for (;;) ...
-
-  croak ("How did I get here?");
-}
-
-
-
-sub split_and_promote_old {
-  my $self = shift;
-  my ($cur_node, @path) = @_;
-  
-  for (;;) {
-    my ($newleft, $newright, $kdp) = $cur_node->halves($self->B / 2);
-    my ($up, $where) = @{pop @path};
-    if ($up) {
-      $up->insert_kdp(@$kdp);
-      my ($tthere, $twhere) = $up->locate_key($kdp->[0]);
-      croak "Couldn't find key `$kdp->[0]' in node after just inserting it!"
-	  unless $tthere;
-      croak "`$kdp->[0]' went into node at `$twhere' instead of expected `$where'!"
-	  unless $twhere == $where;
-      $up->subnode($where,   $newleft);
-      $up->subnode($where+1, $newright);
-      return unless $self->node_overfull($up);
-      $cur_node = $up;
-    } else { # We're at the top; make a new root.
-      my $newroot = new BTree::Node ([$kdp->[0]], 
-				     [$kdp->[1]], 
-				     [$newleft, $newright]);
-      $self->root($newroot);
-      return;
-    }
-  }
-  
-}
-
-sub split_and_promote {
-  my $self = shift;
-  my ($cur_node, @path) = @_;
-  
-  for (;;) {
-    my ($newleft, $newright, $kdp) = $cur_node->halves($self->B / 2);
-    my ($up, $where) = @{pop @path};
-    if ($up) {
-      $up->insert_kdp(@$kdp);
-      if ($DEBUG) {
-        my ($tthere, $twhere) = $up->locate_key($kdp->[0]);
-        croak "Couldn't find key `$kdp->[0]' in node after just inserting it!"
-  	  unless $tthere;
-        croak "`$kdp->[0]' went into node at `$twhere' instead of expected `$where'!"
-	  unless $twhere == $where;
-      }
-      $up->subnode($where,   $newleft);
-      $up->subnode($where+1, $newright);
-      return unless $self->node_overfull($up);
-      $cur_node = $up;
-    } else { # We're at the top; make a new root.
-      my $newroot = new BTree::Node ([$kdp->[0]], 
-				     [$kdp->[1]], 
-				     [$newleft, $newright]);
-      $self->root($newroot);
-      return;
-    }
-  }
-}
-
-sub B {
-  $_[0]{B};
-}
-
-sub root {
-  my ($self, $newroot) = @_;
-  $self->{Root} = $newroot if defined $newroot;
-  $self->{Root};
-}
-
-sub node_overfull {
-  my $self = shift;
-  my $node = shift;
-  $node->size > $self->B;
-}
-
-
-# Data structure:
-# A B-Tree has a constant, B.  It has a root node, which may have child nodes.
-# The node is an object from BTree::Node;
-
-sub new {
-  my $package = shift;
-  my %ARGV = @_;
-  croak "Usage: {$package}::new(B => number [, Root => root node ])"
-      unless exists $ARGV{B};
-  if ($ARGV{B} % 2) {
-    my $B = $ARGV{B} + 1;
-    carp "B must be an even number.  Using $B instead.";
-    $ARGV{B} = $B;
-  }
-    
-  my $B = $ARGV{B};
-  my $Root = exists($ARGV{Root}) ? $ARGV{Root} : BTree::Node->emptynode;
-  bless { B => $B, Root => $Root } => $package;
-}
-
-sub to_string {
-  $_[0]->root->to_string;
-}
-
-sub default_cmp {
-  $_[0] cmp $_[1];
-}
diff -aruN 5.0.000.src/library/additions/CGI/Ajax.pm 5.2.000.src/library/additions/CGI/Ajax.pm
--- 5.0.000.src/library/additions/CGI/Ajax.pm	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/additions/CGI/Ajax.pm	1969-12-31 18:00:00.000000000 -0600
@@ -1,1207 +0,0 @@
-package CGI::Ajax;
-use strict;
-use Data::Dumper;
-#use base qw(Class::Accessor);
-use overload '""' => 'show_javascript'; # for building web pages, so
-                                        # you can just say: print $pjx
-BEGIN {
-	use vars qw ($VERSION @ISA @METHODS);
-	@METHODS = qw(url_list coderef_list DEBUG JSDEBUG html
-								js_encode_function cgi_header_extra);
-
-	CGI::Ajax->mk_accessors( @METHODS );
-
-	$VERSION     = .695;
-}
-
-########################################### main pod documentation begin ##
-
-=head1 NAME
-
-CGI::Ajax - a perl-specific system for writing Asynchronous web
-applications
-
-=head1 SYNOPSIS
-
-  use strict;
-  use CGI;      # or any other CGI:: form handler/decoder
-  use CGI::Ajax;
-
-  my $cgi = new CGI;
-  my $pjx = new CGI::Ajax( 'exported_func' => \&perl_func );
-
-  print $pjx->build_html( $cgi, \&Show_HTML);
-
-  sub perl_func {
-    my $input = shift;
-    # do something with $input
-    my $output = $input . " was the input!";
-    return( $output );
-  }
-
-  sub Show_HTML {
-    my $html = <<EOHTML;
-    <HTML>
-    <BODY>
-      Enter something: 
-        <input type="text" name="val1" id="val1"
-         onkeyup="exported_func( ['val1'], ['resultdiv'] );">
-      <br>
-      <div id="resultdiv"></div>
-    </BODY>
-    </HTML>
-  EOHTML
-    return $html;
-  }
-
-I<There are several fully-functional examples in the 'scripts/'
-directory of the distribution.>
-
-=head1 DESCRIPTION
-
-CGI::Ajax is an object-oriented module that provides a unique
-mechanism for using perl code asynchronously from javascript-
-enhanced HTML pages.  CGI::Ajax unburdens the user from having to
-write extensive javascript, except for associating an exported
-method with a document-defined event (such as onClick, onKeyUp,
-etc).  CGI::Ajax also mixes well with HTML containing more complex
-javascript.
-
-CGI::Ajax supports methods that return single results or multiple
-results to the web page, and supports returning values to multiple
-DIV elements on the HTML page.
-
-Using CGI::Ajax, the URL for the HTTP GET/POST request is
-automatically generated based on HTML layout and events, and the
-page is then dynamically updated with the output from the perl
-function.  Additionally, CGI::Ajax supports mapping URL's to a
-CGI::Ajax function name, so you can separate your code processing
-over multiple scripts.
-
-Other than using the Class::Accessor module to generate CGI::Ajax'
-accessor methods, CGI::Ajax is completely self-contained - it
-does not require you to install a larger package or a full Content
-Management System, etc.
-
-We have added I<support> for other CGI handler/decoder modules,
-like L<CGI::Simple> or L<CGI::Minimal>, but we can't test these
-since we run mod_perl2 only here.  CGI::Ajax checks to see if a
-header() method is available to the CGI object, and then uses it.
-If method() isn't available, it creates it's own minimal header.
-
-A primary goal of CGI::Ajax is to keep the module streamlined and
-maximally flexible.  We are trying to keep the generated javascript
-code to a minimum, but still provide users with a variety of
-methods for deploying CGI::Ajax. And VERY little user javascript.
-
-=head1 EXAMPLES
-
-The CGI::Ajax module allows a Perl subroutine to be called
-asynchronously, when triggered from a javascript event on the
-HTML page.  To do this, the subroutine must be I<registered>,
-usually done during:
-
-  my $pjx = new CGI::Ajax( 'JSFUNC' => \&PERLFUNC );
-
-This maps a perl subroutine (PERLFUNC) to an automatically
-generated Javascript function (JSFUNC).  Next you setup a trigger this
-function when an event occurs (e.g. "onClick"):
-
-  onClick="JSFUNC(['source1','source2'], ['dest1','dest2']);"
-
-where 'source1', 'dest1', 'source2', 'dest2' are the DIV ids of
-HTML elements in your page...
-
-  <input type=text id=source1>
-  <input type=text id=source2>
-  <div id=dest1></div>
-  <div id=dest2></div>
-
-L<CGI::Ajax> sends the values from source1 and source2 to your
-Perl subroutine and returns the results to dest1 and dest2.
-
-=head2 4 Usage Methods
-
-=over 4
-
-=item 1 Standard CGI::Ajax example
-
-Start by defining a perl subroutine that you want available from
-javascript.  In this case we'll define a subrouting that determines
-whether or not an input is odd, even, or not a number (NaN):
-
-  use strict;
-  use CGI::Ajax;
-  use CGI;
-
-
-  sub evenodd_func {
-    my $input = shift;
-
-    # see if input is defined
-    if ( not defined $input ) {
-      return("input not defined or NaN");
-    }
-
-    # see if value is a number (*thanks Randall!*)
-    if ( $input !~ /\A\d+\z/ ) {
-      return("input is NaN");
-    }
-
-    # got a number, so mod by 2
-    $input % 2 == 0 ? return("EVEN") : return("ODD");
-  }
-
-Alternatively, we could have used coderefs to associate an
-exported name...
-
-  my $evenodd_func = sub {
-    # exactly the same as in the above subroutine
-  };
-
-Next we define a function to generate the web page - this can
-be done many different ways, and can also be defined as an
-anonymous sub.  The only requirement is that the sub send back
-the html of the page.  You can do this via a string containing the
-html, or from a coderef that returns the html, or from a function
-(as shown here)...
-
-  sub Show_HTML {
-    my $html = <<EOT;
-  <HTML>
-  <HEAD><title>CGI::Ajax Example</title>
-  </HEAD>
-  <BODY>
-    Enter a number:&nbsp;
-    <input type="text" name="somename" id="val1" size="6"
-       OnKeyUp="evenodd( ['val1'], ['resultdiv'] );">
-    <br>
-    <hr>
-    <div id="resultdiv">
-    </div>
-  </BODY>
-  </HTML>
-EOT
-    return $html;
-  }
-
-The exported Perl subrouting is triggered using the C<OnKeyUp>
-event handler of the input HTML element.  The subroutine takes one
-value from the form, the input element B<'val1'>, and returns the
-the result to an HTML div element with an id of B<'resultdiv'>.
-Sending in the input id in an array format is required to support
-multiple inputs, and similarly, to output multiple the results,
-you can use an array for the output divs, but this isn't mandatory -
-as will be explained in the B<Advanced> usage.
-
-Now create a CGI object and a CGI::Ajax object, associating a reference
-to our subroutine with the name we want available to javascript.
-
-  my $cgi = new CGI();
-  my $pjx = new CGI::Ajax( 'evenodd' => \&evenodd_func );
-
-And if we used a coderef, it would look like this...
-
-  my $pjx = new CGI::Ajax( 'evenodd' => $evenodd_func );
-
-Now we're ready to print the output page; we send in the cgi
-object and the HTML-generating function.
-
-  print $pjx->build_html($cgi,\&Show_HTML);
-
-CGI::Ajax has support for passing in extra HTML header information
-to the CGI object.  This can be accomplished by adding a third
-argument to the build_html() call.  The argument needs to be a
-hashref containing Key=>value pairs that CGI objects understand:
-
-  print $pjx->build_html($cgi,\&Show_HTML,
-    {-charset=>'UTF-8, -expires=>'-1d'});
-
-See L<CGI> for more header() method options.
-
-That's it for the CGI::Ajax standard method.  Let's look at
-something more advanced.
-
-=item 2 Advanced CGI::Ajax example
-
-Let's say we wanted to have a perl subroutine process multiple
-values from the HTML page, and similarly return multiple values
-back to distinct divs on the page.  This is easy to do, and
-requires no changes to the perl code - you just create it as you
-would any perl subroutine that works with multiple input values
-and returns multiple values.  The significant change happens in
-the event handler javascript in the HTML...
-
-  onClick="exported_func(['input1','input2'],['result1','result2']);"
-
-Here we associate our javascript function ("exported_func") with
-two HTML element ids ('input1','input2'), and also send in two
-HTML element ids to place the results in ('result1','result2').
-
-=item 3 Sending Perl Subroutine Output to a Javascript function
-
-Occassionally, you might want to have a custom javascript function
-process the returned information from your Perl subroutine.
-This is possible, and the only requierment is that you change
-your event handler code...
-
-  onClick="exported_func(['input1'],[js_process_func]);"
-
-In this scenario, C<js_process_func> is a javascript function you
-write to take the returned value from your Perl subroutine and
-process the results.  I<Note that a javascript function is not
-quoted -- if it were, then CGI::Ajax would look for a HTML element
-with that id.>  Beware that with this usage, B<you are responsible
-for distributing the results to the appropriate place on the
-HTML page>.  If the exported Perl subroutine returns, e.g. 2
-values, then C<js_process_func> would need to process the input
-by working through an array, or using the javascript Function
-C<arguments> object.
-
-  function js_process_func() {
-    var input1 = arguments[0]
-    var input2 = arguments[1];
-    // do something and return results, or set HTML divs using
-    // innerHTML
-    document.getElementById('outputdiv').innerHTML = input1;
-  }
-
-=item 4 URL/Outside Script CGI::Ajax example
-
-There are times when you may want a different script to
-return content to your page.  This could be because you have
-an existing script already written to perform a particular
-task, or you want to distribute a part of your application to another
-script.  This can be accomplished in L<CGI::Ajax> by using a URL in
-place of a locally-defined Perl subroutine.  In this usage,
-you alter you creation of the L<CGI::Ajax> object to link an
-exported javascript function name to a local URL instead of
-a coderef or a subroutine.
-
-  my $url = 'scripts/other_script.pl';
-  my $pjx = new CGI::Ajax( 'external' => $url );
-
-This will work as before in terms of how it is called from you
-event handler:
-
-  onClick="external(['input1','input2'],['resultdiv']);"
-
-The other_script.pl will get the values via a CGI object and
-accessing the 'args' key.  The values of the B<'args'> key will
-be an array of everything that was sent into the script.
-
-  my @input = $cgi->params('args');
-  $input[0]; # contains first argument
-  $input[1]; # contains second argument, etc...
-
-This is good, but what if you need to send in arguments to the
-other script which are directly from the calling Perl script,
-i.e. you want a calling Perl script's variable to be sent, not
-the value from an HTML element on the page?  This is possible
-using the following syntax:
-
-  onClick="exported_func(['args__$input1','args__$input2'],
-                         ['resultdiv']);"
-
-Similary, if the external script required a constant as input
-(e.g.  C<script.pl?args=42>, you would use this syntax:
-
-  onClick="exported_func(['args__42'],['resultdiv']);"
-
-In both of the above examples, the result from the external
-script would get placed into the I<resultdiv> element on our
-(the calling script's) page.
-
-If you are sending more than one argument from an external perl
-script back to a javascript function, you will need to split the
-string (AJAX applications communicate in strings only) on something.
-Internally, we use '__pjx__', and this string is checked for.  If
-found, L<CGI::Ajax> will automatically split it.  However, if you
-don't want to use '__pjx__', you can do it yourself:
-
-For example, from your Perl script, you would...
-
-	return("A|B"); # join with "|"
-
-and then in the javascript function you would have something like...
-
-	process_func() {
-		var arr = arguments[0].split("|");
-		// arr[0] eq 'A'
-		// arr[1] eq 'B'
-	}
-
-In order to rename parameters, in case the outside script needs
-specifically-named parameters and not CGI::Ajax' I<'args'> default
-parameter name, change your event handler associated with an HTML
-event like this
-
-  onClick="exported_func(['myname__$input1','myparam__$input2'],
-                         ['resultdiv']);"
-
-The URL generated would look like this...
-
-C<script.pl?myname=input1&myparam=input2>
-
-You would then retrieve the input in the outside script with this...
-
-  my $p1 = $cgi->params('myname');
-  my $p1 = $cgi->params('myparam');
-
-Finally, what if we need to get a value from our HTML page and we
-want to send that value to an outside script but the outside script
-requires a named parameter different from I<'args'>?  You can
-accomplish this with L<CGI::Ajax> using the getVal() javascript
-method (which returns an array, thus the C<getVal()[0]> notation):
-
-  onClick="exported_func(['myparam__' + getVal('div_id')[0]],
-                         ['resultdiv']);"
-
-This will get the value of our HTML element with and
-I<id> of I<div_id>, and submit it to the url attached to
-I<myparam__>.  So if our exported handler referred to a URI
-called I<script/scr.pl>, and the element on our HTML page called
-I<div_id> contained the number '42', then the URL would look
-like this C<script/scr.pl?myparam=42>.  The result from this
-outside URL would get placed back into our HTML page in the
-element I<resultdiv>.  See the example script that comes with
-the distribution called I<pjx_url.pl> and its associated outside
-script I<convert_degrees.pl> for a working example.
-
-B<N.B.> These examples show the use of outside scripts which
-are other perl scripts - I<but you are not limited to Perl>!
-The outside script could just as easily have been PHP or any other
-CGI script, as long as the return from the other script is just
-the result, and not addition HTML code (like FORM elements, etc).
-
-=back
-
-=head2 GET versus POST
-
-Note that all the examples so far have used the following syntax:
-
-  onClick="exported_func(['input1'],['result1']);"
-
-There is an optional third argument to a L<CGI::Ajax> exported
-function that allows change the submit method.  The above event could
-also have been coded like this...
-
-  onClick="exported_func(['input1'],['result1'], 'GET');"
-
-By default, L<CGI::Ajax> sends a I<'GET'> request.  If you need it,
-for example your URL is getting way too long, you can easily switch
-to a I<'POST'> request with this syntax...
-
-  onClick="exported_func(['input1'],['result1'], 'POST');"
-
-I<('POST' and 'post' are supported)>
-
-=head2 Page Caching
-
-We have implemented a method to prevent page cacheing from undermining
-the AJAX methods in a page.  If you send in an input argument to a
-L<CGI::Ajax>-exported function called 'NO_CACHE', the a special
-parameter will get attached to the end or your url with a random
-number in it.  This will prevent a browser from caching your request.
-
-  onClick="exported_func(['input1','NO_CACHE'],['result1']);"
-
-The extra param is called pjxrand, and won't interfere with the order
-of processing for the rest of your parameters.
-
-=head1 METHODS
-
-=cut
-
-################################### main pod documentation end ##
-
-######################################################
-## METHODS - public                                 ##
-######################################################
-
-=over 4
-
-=item build_html()
-
-    Purpose: Associates a cgi obj ($cgi) with pjx object, inserts
-             javascript into <HEAD></HEAD> element and constructs
-             the page, or part of the page.  AJAX applications
-             are designed to update only the section of the
-             page that needs it - the whole page doesn't have
-             to be redrawn.  L<CGI::Ajax> applications use the
-             build_html() method to take care of this: if the CGI
-             parameter C<fname> exists, then the return from the
-             L<CGI::Ajax>-exported function is sent to the page.
-             Otherwise, the entire page is sent, since without
-             an C<fname> param, this has to be the first time
-             the page is being built.
-
-  Arguments: The CGI object, and either a coderef, or a string
-             containing html.  Optionally, you can send in a third
-             parameter containing information that will get passed
-             directly to the CGI object header() call.
-    Returns: html or updated html (including the header)
-  Called By: originating cgi script
-
-=cut
-sub build_html {
-  my ( $self, $cgi, $html_source, $cgi_header_extra ) = @_;
-
-  if ( ref( $cgi ) =~ /CGI.*/ ) {
-    if ( $self->DEBUG() ) {
-      print STDERR "CGI::Ajax->build_html: CGI* object was received\n";
-    }
-    $self->cgi( $cgi ); # associate the cgi obj with the CGI::Ajax object
-  }
-
-  if ( defined $cgi_header_extra ) {
-    if ( $self->DEBUG() ) {
-      print STDERR "CGI::Ajax->build_html: got extra cgi header info\n";
-      if ( ref($cgi_header_extra) eq "HASH" ) {
-        foreach my $k ( keys %$cgi_header_extra ) {
-          print STDERR "\t$k => ", $cgi_header_extra->{$k}, "\n";
-        }
-      } else {
-        print STDERR "\t$cgi_header_extra\n";
-      }
-    }
-    $self->cgi_header_extra( $cgi_header_extra ); 
-  }
-
-  #check if "fname" was defined in the CGI object
-  if ( defined $self->cgi()->param("fname") ) {
-    # it was, so just return the html from the handled request
-    return ( $self->handle_request() );
-  }
-  else {
-    # start with the minimum, a http header line and any extra cgi
-    # header params sent in
-    my $html = "";
-    if ( $self->cgi()->can('header') ) {
-      #$html .= $self->cgi()->header();
-      $html .= $self->cgi()->header( $self->cgi_header_extra() );
-    }
-    else {
-      # don't have an object with a "header()" method, so just create
-      # a mimimal one
-      $html .= "Content-Type: text/html;";
-      $html .= $self->cgi_header_extra();
-      $html .= "\n\n";
-    }
-
-    # check if the user sent in a coderef for generating the html,
-    # or the actual html
-    if ( ref($html_source) eq "CODE" ) {
-      if ( $self->DEBUG() ) {
-        print STDERR "CGI::Ajax->build_html: html_source is a CODEREF\n";
-      }
-      eval { $html .= &$html_source };
-      if ($@) {
-        # there was a problem evaluating the html-generating function
-        # that was sent in, so generate an error page
-        if ( $self->cgi()->can('header') ) {
-          $html = $self->cgi()->header( $self->cgi_header_extra() );
-        }
-        else {
-          # don't have an object with a "header()" method, so just create
-          # a mimimal one
-          $html = "Content-Type: text/html;";
-          $html .= $self->cgi_header_extra();
-          $html .= "\n\n";
-        }
-        $html .= qq!<html><head><title></title></head><body><h2>Problems</h2> with
-          the html-generating function sent to CGI::Ajax
-          object</body></html>!;
-        return $html;
-      }
-      $self->html($html);    # no problems, so set html
-    }
-    else {
-      # user must have sent in raw html, so add it
-      if ( $self->DEBUG() ) {
-        print STDERR "CGI::Ajax->build_html: html_source is HTML\n";
-      }
-      $self->html( $html . $html_source );
-    }
-
-    # now modify the html to insert the javascript
-    $self->insert_js_in_head();
-  }
-  return $self->html();
-}
-
-=item show_javascript()
-
-    Purpose: builds the text of all the javascript that needs to be
-             inserted into the calling scripts html <head> section
-  Arguments:
-    Returns: javascript text
-  Called By: originating web script
-       Note: This method is also overridden so when you just print
-             a CGI::Ajax object it will output all the javascript needed
-             for the web page.
-
-=cut
-
-sub show_javascript {
-  my ($self) = @_;
-  my $rv = $self->show_common_js();    # show the common js
-
-  # build the js for each perl function you want exported to js
-  foreach my $func ( keys %{ $self->coderef_list() }, keys %{ $self->url_list() } ) {
-    $rv .= $self->make_function($func);
-  }
-  # wrap up the return in a CDATA structure for XML compatibility
-  # (thanks Thos Davis)
-  $rv = "\n" . '//<![CDATA[' . "\n" . $rv . "\n" . '//]]>' . "\n";
-  $rv = '<script type="text/javascript">' . $rv . '</script>';
-  return $rv;
-}
-
-## new
-sub new {
-  my ($class) = shift;
-  my $self = bless ({}, ref ($class) || $class);
-#  $self->SUPER::new();
-  $self->JSDEBUG(0); # turn javascript debugging off (if on,
-                     # extra info will be added to the web page output
-                     # if set to 1, then the core js will get
-                     # compressed, but the user-defined functions will
-                     # not be compressed.  If set to 2 (or anything
-                     # greater than 1 or 0), then none of the
-                     # javascript will get compressed.
-                     #
-  $self->DEBUG(0);   # turn debugging off (if on, check web logs)
-
-  #accessorized attributes
-  $self->coderef_list({});
-  $self->url_list({});
-  #$self->html("");
-  #$self->cgi();
-  #$self->cgi_header_extra(""); # set cgi_header_extra to an empty string
-
-  # setup a default endcoding; if you need support for international
-	# charsets, use 'escape' instead of encodeURIComponent.  Due to the
-	# number of browser problems users report about scripts with a default of
-	# encodeURIComponent, we are setting the default to 'escape'
-  $self->js_encode_function('escape');
-
-  if ( @_ < 2 ) {
-    die "incorrect usage: must have fn=>code pairs in new\n";
-  }
-
-  while ( @_ ) {
-    my($function_name,$code) = splice( @_, 0, 2 );
-    if ( ref( $code ) eq "CODE" ) {
-      if ( $self->DEBUG() ) {
-        print STDERR "name = $function_name, code = $code\n";
-      }
-      # add the name/code to hash
-      $self->coderef_list()->{ $function_name } = $code;
-    } elsif ( ref($code) ) {
-      die "Unsuported code block/url\n";
-    } else {
-      if ( $self->DEBUG() ) {
-        print STDERR "Setting function $function_name to url $code\n";
-      }
-      # if it's a url, it is added here
-      $self->url_list()->{ $function_name } = $code;
-    }
-  }
-  return ($self);
-}
-
-######################################################
-## METHODS - private                                ##
-######################################################
-
-# sub cgiobj(), cgi()
-#
-#    Purpose: accessor method to associate a CGI object with our
-#             CGI::Ajax object
-#  Arguments: a CGI object
-#    Returns: CGI::Ajax objects cgi object
-#  Called By: originating cgi script, or build_html()
-#
-sub cgiobj {
-  my $self = shift;
-  # see if any values were sent in...
-  if ( @_ ) {
-    my $cgi = shift;
-    # add support for other CGI::* modules This requires that your web server
-    # be configured properly.  I can't test anything but a mod_perl2
-    # setup, so this prevents me from testing CGI::Lite,CGI::Simple, etc.
-    if ( ref($cgi) =~ /CGI.*/ ) {
-      if ( $self->DEBUG() ) {
-				print STDERR "cgiobj() received a CGI-like object ($cgi)\n";
-      }
-      $self->{'cgi'} = $cgi;
-    } else {
-      die "CGI::Ajax -- Can't set internal CGI object to a non-CGI object ($cgi)\n";
-    }
-  }
-  # return the object
-  return( $self->{'cgi'} );
-}
-
-sub cgi {
-  my $self = shift;
-  if ( @_ ) {
-    return( $self->cgiobj( @_ ) );
-  } else {
-    return( $self->cgiobj() );
-  }
-}
-
-## # sub cgi_header_extra
-## #
-## #    Purpose: accessor method to associate CGI header information
-## #             with the CGI::Ajax object
-## #  Arguments: a hashref with key=>value pairs that get handed off to
-## #             the CGI object's header() method
-## #    Returns: hashref of extra cgi header params
-## #  Called By: originating cgi script, or build_html()
-## 
-## sub cgi_header_extra {
-##   my $self = shift;
-##   if ( @_ ) {
-##     $self->{'cgi_header_extra'} = shift;
-##   }
-##   return( $self->{'cgi_header_extra'} );
-## }
-
-# sub create_js_setRequestHeader
-#
-#    Purpose: create text of the header for the javascript side,
-#             xmlhttprequest call
-#  Arguments: none
-#    Returns: text of header to pass to xmlhttpreq call so it will
-#             match whatever was setup for the main web-page
-#  Called By: originating cgi script, or build_html()
-#
-
-sub create_js_setRequestHeader {
-  my $self = shift;
-  my $cgi_header_extra = $self->cgi_header_extra();
-  my $js_header_string = q{r.setRequestHeader("};
-	#$js_header_string .= $self->cgi()->header( $cgi_header_extra );
-	$js_header_string .= $self->cgi()->header();
-  $js_header_string .= q{");};
-	#if ( ref $cgi_header_extra eq "HASH" ) {
-	#	foreach my $k ( keys(%$cgi_header_extra) ) {
-	#		$js_header_string .= $self->cgi()->header($cgi_headers) 
-	#	}
-	#} else {
-  #print STDERR  $self->cgi()->header($cgi_headers) ;
-  
-	if ( $self->DEBUG() ) {
-		print STDERR "js_header_string is (", $js_header_string, ")\n";
-	}
-
-  return($js_header_string);
-}
-
-# sub show_common_js()
-#
-#    Purpose: create text of the javascript needed to interface with
-#             the perl functions
-#  Arguments: none
-#    Returns: text of common javascript subroutine, 'do_http_request'
-#  Called By: originating cgi script, or build_html()
-#
-
-sub show_common_js {
-  my $self = shift;
-  my $encodefn = $self->js_encode_function();
-  my $decodefn = $encodefn;
-  $decodefn =~ s/^(en)/de/;
-  $decodefn =~ s/^(esc)/unesc/;
-  #my $request_header_str = $self->create_js_setRequestHeader();
-  my $request_header_str = "";
-  my $rv = <<EOT;
-var ajax = [];
-function pjx(args,fname,method) {
-  this.target=args[1];
-  this.args=args[0];
-  method=(method)?method:'GET';
-  if(method=='post'){method='POST';}
-  this.method = method;
-  this.r=ghr();
-  this.url = this.getURL(fname);
-}
-
-function formDump(){
-  var all = [];
-  var fL = document.forms.length;
-  for(var f = 0;f<fL;f++){
-    var els = document.forms[f].elements;
-    for(var e in els){
-      var tmp = els[e].id || els[e].name;
-      if(typeof tmp != 'string'){continue;}
-      if(tmp){ all[all.length]=tmp}
-    }
-  }
-  return all;
-}
-function getVal(id) {
-  if (id.constructor == Function ) { return id(); }
-  if (typeof(id)!= 'string') { return id; }
-  var element = document.getElementById(id) || document.forms[0].elements[id];
-  if(!element){
-     alert('ERROR: Cant find HTML element with id or name: ' +
-     id+'. Check that an element with name or id='+id+' exists');
-     return 0;
-  }
-   if(element.type == 'select-one') { return element[element.selectedIndex].value } 
-  if (element.type == 'select-multiple') {
-  var ans = [];
-  var k =0;
-    for (var i=0;i<element.length;i++) {
-      if (element[i].selected || element[i].checked ) {
-        ans[k++]=element[i].value;
-      }
-    }
-    return ans;
-  }
-    
-  if(element.type == 'radio' || element.type == 'checkbox'){
-    var ans =[];
-    var elms = document.getElementsByTagName('input');
-    var endk = elms.length;
-    var i =0;
-    for(var k=0;k<endk;k++){
-      if(elms[k].type== element.type && elms[k].checked && elms[k].id==id){
-        ans[i++]=elms[k].value;
-      }
-    }
-    return ans;
-  }
-  if( element.value == undefined ){
-    return element.innerHTML;
-  }else{
-    return element.value;
-  }
-}
-function fnsplit(arg) {
-  var url="";
-  if(arg=='NO_CACHE'){return '&pjxrand='+Math.random()}
-  if (arg.indexOf('__') != -1) {
-    arga = arg.split(/__/);
-    url += '&' + arga[0] +'='+ $encodefn(arga[1]);
-  } else {
-    var res = getVal(arg) || '';
-    if(res.constructor != Array){ res = [res] }
-    for(var i=0;i<res.length;i++) {
-      url += '&args=' + $encodefn(res[i]) + '&' + arg + '=' + $encodefn(res[i]);
-    }
-  }
-  return url;
-}
-
-pjx.prototype =  {
-  send2perl : function(){
-    var r = this.r;
-    var dt = this.target;
-    this.pjxInitialized(dt);
-    var url=this.url;
-    var postdata;
-    if(this.method=="POST"){
-      var idx=url.indexOf('?');
-      postdata = url.substr(idx+1);
-      url = url.substr(0,idx);
-    }
-    r.open(this.method,url,true);
-    $request_header_str;
-    if(this.method=="POST"){
-      r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-      r.send(postdata);
-    }
-    if(this.method=="GET"){
-      r.send(null);
-    }
-    r.onreadystatechange = handleReturn;
- },
- pjxInitialized : function(){},
- pjxCompleted : function(){},
- readyState4 : function(){
-    var rsp = $decodefn(this.r.responseText);  /* the response from perl */
-    var splitval = '__pjx__';  /* to split text */
-    /* fix IE problems with undef values in an Array getting squashed*/
-    rsp = rsp.replace(splitval+splitval+'g',splitval+" "+splitval);
-    var data = rsp.split(splitval);  
-    dt = this.target;
-    if (dt.constructor != Array) { dt=[dt]; }
-    if (data.constructor != Array) { data=[data]; }
-    if (typeof(dt[0])!='function') {
-      for ( var i=0; i<dt.length; i++ ) {
-        var div = document.getElementById(dt[i]);
-        if (div.type =='text' || div.type=='textarea' || div.type=='hidden' ) {
-          div.value=data[i];
-        } else{
-          div.innerHTML = data[i];
-        }
-      }
-    } else if (typeof(dt[0])=='function') {
-       dt[0].apply(this,data);
-    }
-    this.pjxCompleted(dt);
- },
-
-  getURL : function(fname) {
-      var args = this.args;
-      var url= 'fname=' + fname;
-      for (var i=0;i<args.length;i++) {
-        url=url + args[i];
-      }
-      return url;
-  }
-};
-
-handleReturn = function() {
-  for( var k=0; k<ajax.length; k++ ) {
-    if (ajax[k].r==null) { ajax.splice(k--,1); continue; }
-    if ( ajax[k].r.readyState== 4) { 
-      ajax[k].readyState4();
-      ajax.splice(k--,1);
-      continue;
-    }
-  }
-};
-
-var ghr=getghr();
-function getghr(){
-    if(typeof XMLHttpRequest != "undefined")
-    {
-        return function(){return new XMLHttpRequest();}
-    }
-    var msv= ["Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0",
-    "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0",
-    "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"];
-    for(var j=0;j<=msv.length;j++){
-        try
-        {
-            A = new ActiveXObject(msv[j]);
-            if(A){ 
-              return function(){return new ActiveXObject(msv[j]);}
-            }
-        }
-        catch(e) { }
-     }
-     return false;
-}
-
-
-function jsdebug(){
-    var tmp = document.getElementById('pjxdebugrequest').innerHTML = "<br><pre>";
-    for( var i=0; i < ajax.length; i++ ) {
-      tmp += '<a href= '+ ajax[i].url +' target=_blank>' +
-      decodeURI(ajax[i].url) + ' </a><br>';
-    }
-    document.getElementById('pjxdebugrequest').innerHTML = tmp + "</pre>";
-}
-
-EOT
-
-  if ( $self->JSDEBUG() <= 1 ) {
-    $rv = $self->compress_js($rv);
-  }
-
-  return($rv);
-}
-
-# sub compress_js()
-#
-#    Purpose: searches the javascript for newlines and spaces and
-#             removes them (if a newline) or shrinks them to a single (if
-#             space).
-#  Arguments: javascript to compress
-#    Returns: compressed js string
-#  Called By: show_common_js(),
-#
-
-sub compress_js {
-  my($self,$js) = @_;
-  return if not defined $js;
-  return if $js eq "";
-  $js =~ s/\n//g;   # drop newlines
-  $js =~ s/\s+/ /g; # replace 1+ spaces with just one space
-  return $js;
-}
-
-
-# sub insert_js_in_head()
-#
-#    Purpose: searches the html value in the CGI::Ajax object and inserts
-#             the ajax javascript code in the <script></script> section,
-#             or if no such section exists, then it creates it.  If
-#             JSDEBUG is set, then an extra div will be added and the
-#             url wil be desplayed as a link
-#  Arguments: none
-#    Returns: none
-#  Called By: build_html()
-#
-
-sub insert_js_in_head{
-  my $self = shift;
-  my $mhtml = $self->html();
-  my $newhtml;
-  my @shtml;
-  my $js = $self->show_javascript();
-
-  if ( $self->JSDEBUG() ) {
-    my $showurl=qq!<br/><div id='pjxdebugrequest'></div><br/>!;
-    # find the terminal </body> so we can insert just before it
-    my @splith = $mhtml =~ /(.*)(<\s*\/\s*body\s*>)(.*)/is;
-    $mhtml = $splith[0].$showurl.$splith[1].$splith[2];
-  }
-
-  # see if we can match on <head>
-  @shtml= $mhtml =~ /(.*)(<\s*head\s*>)(.*)/is;
-  if ( @shtml ) {
-    # yes, there's already a <head></head>, so let's insert inside it,
-    # at the beginning
-    $newhtml = $shtml[0].$shtml[1].$js.$shtml[2];
-  } elsif( @shtml= $mhtml =~ /(.*)(<\s*html.*?>)(.*)/is){
-    # there's no <head>, so look for the <html> tag, and insert out
-    # javascript inside that tag
-    $newhtml = $shtml[0].$shtml[1].$js.$shtml[2];
-  } else {
-    $newhtml .= "<html><head>";
-    $newhtml .= $js;
-    $newhtml .= "</head><body>";
-    $newhtml .= "No head/html tags, nowhere to insert.  Returning javascript anyway<br>";
-    $newhtml .= "</body></html>";
-  }
-  $self->html($newhtml);
-  return;
-}
-
-# sub handle_request()
-#
-#    Purpose: makes sure a fname function name was set in the CGI
-#             object, and then tries to eval the function with
-#             parameters sent in on args
-#  Arguments: none
-#    Returns: the result of the perl subroutine, as text; if multiple
-#             arguments are sent back from the defined, exported perl
-#             method, then join then with a connector (__pjx__).
-#  Called By: build_html()
-#
-
-sub handle_request {
-  my ($self) = shift;
-
-  my $result; # $result takes the output of the function, if it's an
-              # array split on __pjx__
-  my @other = (); # array for catching extra parameters
-
-  # we need to access "fname" in the form from the web page, so make
-  # sure there is a CGI object defined
-  return undef unless defined $self->cgi();
-
-  my $rv = "";
-  if ( $self->cgi()->can('header') ) {
-    $rv = $self->cgi()->header( $self->cgi_header_extra() );
-  } else {
-    # don't have an object with a "header()" method, so just create
-    # a mimimal one
-    $rv = "Content-Type: text/html;";
-    # TODO: 
-    $rv .= $self->cgi_header_extra();
-    $rv .= "\n\n";
-  }
-
-  # get the name of the function
-  my $func_name = $self->cgi()->param("fname");
-
-  # check if the function name was created
-  if ( defined $self->coderef_list()->{$func_name} ) {
-    my $code = $self->coderef_list()->{$func_name};
-
-    # eval the code from the coderef, and append the output to $rv
-    if ( ref($code) eq "CODE" ) {
-      eval { ($result, @other) = $code->( $self->cgi()->param("args") ) };
-
-      if ($@) {
-        # see if the eval caused and error and report it
-        # Should we be more severe and die?
-        if ( $self->DEBUG() ) {
-          print STDERR "Problem with code: $@\n";
-        }
-      }
-
-      if( @other ) {
-          $rv .= join( "__pjx__", ($result, @other) );
-          if ( $self->DEBUG() ) {
-            print STDERR "rv = $rv\n";
-          }
-      } else {
-        if ( defined $result ) {
-          $rv .= $result;
-        }
-      }
-
-    } # end if ref = CODE
-  } else {
-    # # problems with the URL, return a CGI rrror
-    print STDERR "POSSIBLE SECURITY INCIDENT! Browser from ", $self->cgi()->remote_addr();
-    print STDERR "\trequested URL: ", $self->cgi()->url();
-    print STDERR "\tfname request: ", $self->cgi()->param('fname');
-    print STDERR " -- returning Bad Request status 400\n";
-    if ( $self->cgi()->can('header') ) {
-      return($self->cgi()->header( -status=>'400' ));
-    } else {
-      # don't have an object with a "header()" method, so just create
-      # a mimimal one with 400 error
-      $rv = "Status: 400\nContent-Type: text/html;\n\n";
-    }
-  }
-  return $rv;
-}
-
-
-# sub make_function()
-#
-#    Purpose: creates the javascript wrapper for the underlying perl
-#             subroutine
-#  Arguments: CGI object from web form, and the name of the perl
-#             function to export to javascript, or a url if the
-#             function name refers to another cgi script
-#    Returns: text of the javascript-wrapped perl subroutine
-#  Called By: show_javascript; called once for each registered perl
-#             subroutine
-#
-
-sub make_function {
-  my ($self, $func_name ) = @_;
-  return("") if not defined $func_name;
-  return("") if $func_name eq "";
-  my $rv = "";
-  my $script = $0;
-  $script =~ s/.*[\/|\\](.+)$/$1/;
-  my $outside_url = $self->url_list()->{ $func_name };
-  my $url = defined $outside_url ? $outside_url : $script;
-  if ($url =~ /\?/) { $url.='&'; } else {$url.='?'}
-  $url = "'$url'";
-  my $jsdebug = "";
-  if ( $self->JSDEBUG()) {
-    $jsdebug = "jsdebug()";
-  }
-
-  #create the javascript text
-  $rv .= <<EOT;
-function $func_name() {
-  var args = $func_name.arguments;
-  for( var i=0; i<args[0].length;i++ ) {
-    args[0][i] = fnsplit(args[0][i]);
-  }
-  var l = ajax.length;
-  ajax[l]= new pjx(args,"$func_name",args[2]);
-  ajax[l].url = $url + ajax[l].url;
-  ajax[l].send2perl();
-  $jsdebug;
-}
-EOT
-
-  if ( not $self->JSDEBUG() ) {
-    $rv = $self->compress_js($rv);
-  }
-  return $rv;
-}
-
-=item register()
-
-    Purpose: adds a function name and a code ref to the global coderef
-             hash, after the original object was created
-  Arguments: function name, code reference
-    Returns: none
-  Called By: originating web script
-
-=cut
-
-sub register {
-  my ( $self, $fn, $coderef ) = @_;
-  # coderef_list() is a Class::Accessor function
-  # url_list() is a Class::Accessor function
-  if ( ref( $coderef ) eq "CODE" ) {
-    $self->coderef_list()->{$fn} = $coderef;
-  } elsif ( ref($coderef) ) {
-    die "Unsupported code/url type - error\n";
-  } else {
-    $self->url_list()->{$fn} = $coderef;
-  }
-}
-
-=item JSDEBUG()
-
-    Purpose: Show the AJAX URL that is being generated, and stop
-             compression of the generated javascript, both of which can aid
-             during debugging.  If set to 1, then the core js will get
-             compressed, but the user-defined functions will not be
-             compressed.  If set to 2 (or anything greater than 1 or 0), 
-             then none of the javascript will get compressed.
-
-  Arguments: JSDEBUG(0); # turn javascript debugging off
-             JSDEBUG(1); # turn javascript debugging on, some javascript compression
-             JSDEBUG(2); # turn javascript debugging on, no javascript compresstion
-    Returns: prints a link to the url that is being generated automatically by
-             the Ajax object. this is VERY useful for seeing what
-             CGI::Ajax is doing. Following the link, will show a page
-             with the output that the page is generating.
-             
-  Called By: $pjx->JSDEBUG(1) # where $pjx is a CGI::Ajax object;
-
-=item DEBUG()
-
-    Purpose: Show debugging information in web server logs
-  Arguments: DEBUG(0); # turn debugging off (default)
-             DEBUG(1); # turn debugging on
-    Returns: prints debugging information to the web server logs using
-             STDERR
-  Called By: $pjx->DEBUG(1) # where $pjx is a CGI::Ajax object;
-
-=back
-
-=head1 BUGS
-
-Follow any bugs at our homepage....
-
-  http://www.perljax.us
-
-=head1 SUPPORT
-
-Check out the news/discussion/bugs lists at our homepage:
-
-  http://www.perljax.us
-
-=head1 AUTHORS
-
-  Brian C. Thomas     Brent Pedersen
-  CPAN ID: BCT
-  bct.x42@gmail.com   bpederse@gmail.com
-
-=head1 A NOTE ABOUT THE MODULE NAME
-
-This module was initiated using the name "Perljax", but then
-registered with CPAN under the WWW group "CGI::", and so became
-"CGI::Perljax".  Upon further deliberation, we decided to change it's
-name to L<CGI::Ajax>.
-
-=head1 COPYRIGHT
-
-This program is free software; you can redistribute
-it and/or modify it under the same terms as Perl itself.
-
-The full text of the license can be found in the
-LICENSE file included with this module.
-
-=head1 SEE ALSO
-
-L<Data::Javascript>
-L<CGI>
-L<Class::Accessor>
-
-=cut
-
-1;
-__END__
diff -aruN 5.0.000.src/library/additions/HTTP/BrowserDetect_097.pm 5.2.000.src/library/additions/HTTP/BrowserDetect_097.pm
--- 5.0.000.src/library/additions/HTTP/BrowserDetect_097.pm	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/additions/HTTP/BrowserDetect_097.pm	1969-12-31 18:00:00.000000000 -0600
@@ -1,610 +0,0 @@
-package HTTP::BrowserDetect;
-
-use strict;
-use vars qw($VERSION $REVISION @ISA @EXPORT @EXPORT_OK @ALL_TESTS);
-require Exporter;
-
-@ISA	   = qw(Exporter);
-@EXPORT	   = qw();
-@EXPORT_OK = qw();
-$REVISION  = '$Id: BrowserDetect.pm,v 1.4 2001/01/31 17:44:27 lsemel Exp $';
-$VERSION   = '0.97';
-
-# Operating Systems
-push @ALL_TESTS,(qw(win16 win3x win31 win95 win98 winnt windows win32 win2k winme mac mac68k macppc os2 unix sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10 aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant dec sinix freebsd bsd vms x11 amiga));
-
-# Devices
-push @ALL_TESTS,(qw(palm audrey iopener wap));
-
-# Browsers
-push @ALL_TESTS,(qw(mosaic netscape nav2 nav3 nav4 nav4up nav45 nav45up nav6 nav6up navgold ie ie3 ie4 ie4up ie5 ie5up ie55 ie55up opera opera3 opera4 opera5 lynx aol aol3 aol4 aol5 aol6 neoplanet neoplanet2 avantgo emacs gecko));
-
-# Robots
-push @ALL_TESTS,(qw(wget getright robot yahoo altavista lycos infoseek lwp webcrawler linkexchange slurp webtv staroffice lotusnotes konqueror icab google java));
-
-#######################################################################################################
-# BROWSER OBJECT
-
-my $default = undef;
-
-sub new {
-   my ($class, $user_agent) = @_;
-   
-   my $self = {};
-   bless $self, $class;
-
-   unless (defined $user_agent) {
-     $user_agent = $ENV{'HTTP_USER_AGENT'};
-   }
-
-   $self->user_agent($user_agent);
-   return $self;
-}
-
-foreach my $test (@ALL_TESTS) {
-    no strict 'refs';
-    my $key = uc $test;
-    *{$test} = sub { my ($self) = _self_or_default(@_);
-		     return $self->{tests}->{$key} };
-}
-
-sub _self_or_default {
-   my ($self) = $_[0];
-   return @_ if (defined $self &&
-		 ref $self &&
-		 (ref $self eq 'HTTP::BrowserDetect') || UNIVERSAL::isa($self,'HTTP::BrowserDetect'));
-   $default ||= HTTP::BrowserDetect->new();
-   unshift (@_, $default);
-   return @_;
-}
-
-
-sub user_agent {
-  my ($self, $user_agent) = _self_or_default(@_);
-  if (defined $user_agent) {
-    $self->{user_agent} = $user_agent;
-    $self->_test();
-  }
-  return $self->{user_agent};
-}
-
-# Private method -- test the UA string
-sub _test {
-  my ($self) = @_;
-
-  my $ua = lc $self->{user_agent};
-
-  # Browser version
-  my ($major, $minor, $beta) = ($ua =~ / \/			# Version starts with a slash
-				          [A-Za-z]*		# Eat any letters before the major version
-                                          ( [^\.]* )		# Major version number is everything before the first dot
-                                          \.			# The first dot
-                                          ( [\d]* )		# Minor version number is every digit after the first dot
-                                          [\d\.]*		# Throw away remaining numbers and dots
-                                          ( [^\s]* )		# Beta version string is up to next space
-                                        /x);
-
-  if (index($ua,"compatible") !=-1) {
-      ($major, $minor, $beta)    = ($ua =~ / 
-				    compatible;       
-				    \s*
-				    \w*				# Browser name
-				    [\s|\/]
-				    [A-Za-z]*			# Eat any letters before the major version
-				    ( [^\.]* )			# Major version number is everything before first dot
-				    \.				# The first dot
-				    ( [\d]* )			# Minor version nnumber is digits after first dot
-				    [\d\.]*			# Throw away remaining dots and digits
-				    ( [^;]* )			# Beta version is up to the ;
-				    ;
-				    /x);
-
-
-  }
-
-  $minor = 0+".$minor"; 
-
-  $self->{tests} = {};
-  my $tests = $self->{tests};
-
-  # Netscape browsers
-  
-  $tests->{NETSCAPE}  = (index($ua,"mozilla") != -1 && 
-			 index($ua,"spoofer") == -1 && index($ua,"compatible") == -1 &&
-			 index($ua,"opera") == -1 && index($ua,"webtv") == -1 && 
-			 index($ua,"hotjava") == -1);
-  $tests->{NAV2}      = ($tests->{NETSCAPE} && $major == 2);
-  $tests->{NAV3}      = ($tests->{NETSCAPE} && $major == 3);
-  $tests->{NAV4}      = ($tests->{NETSCAPE} && $major == 4);
-  $tests->{NAV4UP}    = ($tests->{NETSCAPE} && $major >= 4); 
-  $tests->{NAV45}     = ($tests->{NETSCAPE} && $major == 4 && $minor == .5);
-  $tests->{NAV45UP}   = ($tests->{NAV4} && $minor >= .5) || ($tests->{NETSCAPE} && $major >= 5);
-  $tests->{NAVGOLD}   = (index($beta,"gold") != -1);
-  $tests->{NAV6}      = ($tests->{NETSCAPE} && $major == 5); # go figure
-  $tests->{NAV6UP}    = ($tests->{NETSCAPE} && $major >= 5);
-  $tests->{GECKO}     = (index($ua,"gecko") != -1);
-  
-  # Internet Explorer browsers
-
-  $tests->{IE}               = (index($ua,"msie") != -1 || index($ua,'microsoft internet explorer') != -1);  
-  $tests->{IE3}              = ($tests->{IE} && $major == 3);
-  $tests->{IE4}              = ($tests->{IE} && $major == 4);
-  $tests->{IE4UP}            = ($tests->{IE} && $major >= 4);
-  $tests->{IE5}              = ($tests->{IE} && $major == 5);
-  $tests->{IE5UP}            = ($tests->{IE} && $major >= 5);
-  $tests->{IE55}             = ($tests->{IE} && $major == 5 && $minor >= .5);
-  $tests->{IE55UP}           = ($tests->{IE5} && $minor >= .5) || ($tests->{IE} && $major >= 6);
- 
-  # Neoplanet browsers
-
-  $tests->{NEOPLANET}      = (index($ua,"neoplanet") != -1);
-  $tests->{NEOPLANET2}     = ($tests->{NEOPLANET} && index($ua,"2.") != -1); 
-
-  # AOL Browsers
-
-  $tests->{AOL}       = (index($ua,"aol")     != -1);
-  $tests->{AOL3}      = (index($ua,"aol 3.0") != -1) || ($tests->{AOL} && $tests->{IE3});
-  $tests->{AOL4}      = (index($ua,"aol 4.0") != -1) || ($tests->{AOL} && $tests->{IE4});
-  $tests->{AOL5}      = (index($ua,"aol 5.0") != -1);
-  $tests->{AOL6}      = (index($ua,"aol 6.0") != -1);
-  $tests->{AOLTV}     = (index($ua,"navio") != -1) || (index($ua,"navio_aoltv") != -1);
-
-  # Opera browsers
-  
-  $tests->{OPERA}     = (index($ua,"opera")   != -1);
-  $tests->{OPERA3}    = (index($ua,"opera 3") != -1) || (index($ua,"opera/3") != -1);
-  $tests->{OPERA4}    = (index($ua,"opera 4") != -1) || (index($ua,"opera/4") != -1);
-  $tests->{OPERA5}    = (index($ua,"opera 5") != -1) || (index($ua,"opera/5") != -1);
-  
-  # Other browsers
-
-  $tests->{STAROFFICE}     = (index($ua,"staroffice") != -1);
-  $tests->{ICAB}           = (index($ua,"icab") != -1);
-  $tests->{LOTUSNOTES}     = (index($ua,"lotus-notes") != -1);
-  $tests->{KONQUEROR}      = (index($ua,"konqueror") != -1);
-  $tests->{LYNX}           = (index($ua,"lynx") != -1);
-  $tests->{WEBTV}          = (index($ua,"webtv") != -1);
-  $tests->{MOSAIC}         = (index($ua,"mosaic") != -1);
-  $tests->{WGET}           = (index($ua,"wget") != -1);
-  $tests->{GETRIGHT}       = (index($ua,"getright") != -1);
-  $tests->{LWP}            = (index($ua,"libwww-perl") != -1 ||
-			      index($ua,"lwp-") != -1);
-  $tests->{YAHOO}          = (index($ua,"yahoo") != -1);
-  $tests->{GOOGLE}         = (index($ua,"google") != -1);
-  $tests->{JAVA}           = (index($ua,"java") != -1 ||
-			      index($ua,"jdk") != -1);
-  $tests->{ALTAVISTA}      = (index($ua,"altavista") != -1);
-  $tests->{SCOOTER}        = (index($ua,"scooter") != -1);
-  $tests->{LYCOS}          = (index($ua,"lycos") != -1);
-  $tests->{INFOSEEK}       = (index($ua,"infoseek") != -1);
-  $tests->{WEBCRAWLER}     = (index($ua,"webcrawler") != -1); 
-  $tests->{LINKEXCHANGE}   = (index($ua,"lecodechecker") != -1); 
-  $tests->{SLURP}          = (index($ua,"slurp") != -1);
-  $tests->{ROBOT}          = (($tests->{WGET} ||
-			       $tests->{GETRIGHT} ||
-			       $tests->{LWP} ||
-			       $tests->{YAHOO} ||
-			       $tests->{ALTAVISTA} ||
-			       $tests->{LYCOS} ||
-			       $tests->{INFOSEEK} ||
-			       $tests->{WEBCRAWLER} ||
-			       $tests->{LINKEXCHANGE} ||
-			       $tests->{SLURP} ||
-			       $tests->{GOOGLE}) ||
-			      index($ua,"bot") != -1 ||
-			      index($ua,"spider") != -1 ||
-			      index($ua,"crawl") != -1 ||
-			      index($ua,"agent") != -1 ||
-			      index($ua,"seek") != -1 ||
-			      index($ua,"search") != -1 ||
-			      index($ua,"reap") != -1 ||
-			      index($ua,"worm") != -1 ||
-			      index($ua,"find") != -1 ||
-			      index($ua,"index") != -1 ||
-			      index($ua,"copy") != -1 ||
-			      index($ua,"fetch") != -1);
-
-  # Devices
-
-  $tests->{AUDREY}        = (index($ua,"audrey") != -1);
-  $tests->{IOPENER}       = (index($ua,"i-opener") != -1);
-  $tests->{AVANTGO}        = (index($ua,"avantgo") != -1);
-  $tests->{PALM}          = ($tests->{AVANTGO} || 
-			     index($ua,"palmos") != -1 );
-  $tests->{WAP}           = (index($ua,"up.browser") != -1 ||
-			     index($ua,"nokia") != -1 ||
-			     index($ua,"alcatel") != -1 ||
-			     index($ua,"ericsson") != -1 ||
-			     index($ua,"sie-") == 0 ||
-			     index($ua,"wmlib") != -1 ||
-			     index($ua," wap") != -1 ||
-			     index($ua,"wap ") != -1 ||
-			     index($ua,"wap/") != -1 ||
-			     index($ua,"-wap") != -1 ||
-			     index($ua,"wap-") != -1 ||
-			     index($ua,"wap") == 0 ||
-			     index($ua,"wapper") != -1 ||
-			     index($ua,"zetor") != -1);
-			     
-			     
-  # Operating System
-  
-  $tests->{WIN16}    = (index($ua,"win16") != -1 || index($ua,"16bit") != -1 || index($ua,"windows 3") != -1 ||
-			index($ua,"windows 16-bit") != -1);
-  $tests->{WIN3X}    = (index($ua,"win16") != -1 || index($ua,"windows 3") != -1 || index($ua,"windows 16-bit") != -1);
-  $tests->{WIN31}    = (index($ua,"win16") != -1 || index($ua,"windows 3.1") != -1 || index($ua,"windows 16-bit") != -1);
-  $tests->{WIN95}    = (index($ua,"win95") != -1 || index($ua,"windows 95") != -1);
-  $tests->{WIN98}    = (index($ua,"win98") != -1 || index($ua,"windows 98") != -1);
-  $tests->{WINNT}    = (index($ua,"winnt") != -1 || 
-			index($ua,"windows nt") != -1 || 
-			index($ua,"nt4") != -1 || 
-			index($ua,"nt3") != -1);
-  $tests->{WIN2K}    = (index($ua,"nt 5") != -1 || index($ua,"nt5") != -1);
-  $tests->{WINME}    = (index($ua,"win 9x 4.90") != -1); # whatever
-  $tests->{WIN32}    = (($tests->{WIN95} || $tests->{WIN98} || $tests->{WINME} || $tests->{WINNT} || 
-			 $tests->{WIN2K}) || index($ua,"win32") != -1);
-  $tests->{WINDOWS}  = (($tests->{WIN16} || $tests->{WIN31} || $tests->{WIN95} || $tests->{WIN98} ||
-			 $tests->{WINNT} || $tests->{WIN32} || $tests->{WIN2K} || $tests->{WINME}) || index($ua,"win") != -1);
-  
-  # Mac operating systems
-  
-  $tests->{MAC}      = (index($ua,"macintosh") != -1 || index($ua,"mac_") != -1);
-  $tests->{MAC68K}   = (($tests->{MAC}) && (index($ua,"68k") != -1 || index($ua,"68000") != -1));
-  $tests->{MACPPC}   = (($tests->{MAC}) && (index($ua,"ppc") != -1 || index($ua,"powerpc") != -1));
-  
-  # Others
-  
-  $tests->{AMIGA}   = (index($ua,'amiga') != -1);
-  $tests->{EMACS}   = (index($ua,'emacs') != -1);
-  $tests->{OS2}     = (index($ua,'os/2') != -1);
-  
-  $tests->{SUN}     = (index($ua,"sun") != -1);
-  $tests->{SUN4}    = (index($ua,"sunos 4") != -1);
-  $tests->{SUN5}    = (index($ua,"sunos 5") != -1);
-  $tests->{SUNI86}  = (($tests->{SUN}) && index($ua,"i86") != -1);
-  
-  $tests->{IRIX}    = (index($ua,"irix") != -1);
-  $tests->{IRIX5}   = (index($ua,"irix5") != -1);
-  $tests->{IRIX6}   = (index($ua,"irix6") != -1);
-  
-  $tests->{HPUX}    = (index($ua,"hp-ux") != -1);
-  $tests->{HPUX9}   = (($tests->{HPUX}) && index($ua,"09.") != -1);
-  $tests->{HPUX10}  = (($tests->{HPUX}) && index($ua,"10.") != -1);
-  
-  $tests->{AIX}   = (index($ua,"aix") != -1);
-  $tests->{AIX1}  = (index($ua,"aix 1") != -1);
-  $tests->{AIX2}  = (index($ua,"aix 2") != -1);
-  $tests->{AIX3}  = (index($ua,"aix 3") != -1);
-  $tests->{AIX4}  = (index($ua,"aix 4") != -1);
-  
-  $tests->{LINUX}     = (index($ua,"inux") != -1);
-  $tests->{SCO}       = (index($ua,"sco") != -1 || index($ua,"unix_sv") != -1);
-  $tests->{UNIXWARE}  = (index($ua,"unix_system_v") != -1);
-  $tests->{MPRAS}     = (index($ua,"ncr") != -1);
-  $tests->{RELIANT}   = (index($ua,"reliantunix") != -1);
-  
-  $tests->{DEC} = (index($ua,"dec") != -1 || index($ua,"osf1") != -1 || index($ua,"declpha") != -1 || 
-		   index($ua,"alphaserver") != -1 || index($ua,"ultrix") != -1 ||
-		   index($ua,"alphastation") != -1);
-  
-  $tests->{SINIX}    = (index($ua,"sinix") != -1);
-  $tests->{FREEBSD}  = (index($ua,"freebsd") != -1);
-  $tests->{BSD}      = (index($ua,"bsd") != -1);
-  $tests->{X11}      = (index($ua,"x11") != -1);
-  $tests->{UNIX}     = ($tests->{X11} || $tests->{SUN} || $tests->{IRIX} || $tests->{HPUX} ||
-			$tests->{SCO} || $tests->{UNIXWARE} || $tests->{MPRAS} ||
-			$tests->{RELIANT} || $tests->{DEC} || $tests->{LINUX} ||
-			$tests->{BSD}); 
-
-  $tests->{VMS} = (index($ua,"vax") != -1 || index($ua,"openvms") != -1);
-
-  $self->{major} = $major;
-  $self->{minor} = $minor;
-  $self->{beta} = $beta;
-}
-    
-sub browser_string {
-    my ($self) = _self_or_default(@_);
-    my $browser_string = undef;
-    my $user_agent = $self->user_agent;
-    if (defined $user_agent) {
-        $browser_string = 'Netscape' if $self->netscape;
-        $browser_string = 'MSIE' if $self->ie;  
-        $browser_string = 'WebTV' if $self->webtv;
-        $browser_string = 'AOL Browser' if $self->aol;
-        $browser_string = 'Opera' if $self->opera;
-        $browser_string = 'Mosaic' if $self->mosaic;
-        $browser_string = 'Lynx' if $self->lynx;
-    }
-    return $browser_string;
-}
-    
-sub os_string {
-    my ($self) = _self_or_default(@_);
-    my $os_string = undef;
-    my $user_agent = $self->user_agent;
-    if (defined $user_agent) {
-        $os_string = 'Win95' if $self->win95;
-        $os_string = 'Win98' if $self->win98;
-        $os_string = 'WinNT' if $self->winnt;
-        $os_string = 'Mac' if $self->mac;
-        $os_string = 'Win3x' if $self->win3x;
-        $os_string = 'OS2' if $self->os2;
-        $os_string = 'Unix' if $self->unix && !$self->linux;
-        $os_string = 'Linux' if $self->linux;
-    }
-    return $os_string;
-}
-    
-sub version {
-  my ($self, $check) = _self_or_default(@_);
-  my $version;
-  $version = $self->{major} + $self->{minor};
-  if (defined $check) { 
-    return $check == $version;
-  } else {
-    return $version;
-  }
-}
-    
-sub major {
-  my ($self, $check) = _self_or_default(@_);
-  my ($version) = $self->{major};
-  if (defined $check) { 
-    return $check == $version;
-  } else {
-    return $version;
-  }
-}
-    
-sub minor {
-  my ($self, $check) = _self_or_default(@_);
-  my ($version) = $self->{minor};
-  if (defined $check) { 
-      return ($check == $self->{minor});
-  } else {
-    return $version;
-  }
-}
-    
-sub beta {
-  my ($self, $check) = _self_or_default(@_);
-  my ($version) = $self->{beta};
-  if ($check) { 
-    return $check eq $version;
-  } else {
-    return $version;
-  }
-}
-
-1;
-    
-
-__END__
-
-=head1 NAME
-
-HTTP::BrowserDetect - Determine the Web browser, version, and platform from an HTTP user agent string
-
-=head1 SYNOPSIS
-
-    use HTTP::BrowserDetect;
-
-    my $browser = new HTTP::BrowserDetect($user_agent_string);
-
-    # Detect operating system
-    if ($browser->windows) {
-      if ($browser->winnt) ...
-      if ($brorwser->win95) ...
-    }
-    print $browser->mac;
-
-    # Detect browser vendor and version
-    print $browser->netscape;
-    print $browser->ie;
-    if (browser->major(4)) {
-	if ($browser->minor() > .5) {
-	    ...
-	}
-    }
-    if ($browser->version() > 4) {
-      ...;
-    }
-    
-    # Process a different user agent string
-    $browser->user_agent($another_user_agent_string);
-
-
-
-=head1 DESCRIPTION
-
-The HTTP::BrowserDetect object does a number of tests on an HTTP user
-agent string.  The results of these tests are available via methods of
-the object.
-
-This module is based upon the JavaScript browser detection code
-available at
-B<http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html>.
-
-=head2 CREATING A NEW BROWSER DETECT OBJECT AND SETTING THE USER AGENT STRING
-
-=over 4
-
-=item new HTTP::BrowserDetect($user_agent_string)
-
-The constructor may be called with a user agent string specified.
-Otherwise, it will use the value specified by $ENV{'HTTP_USER_AGENT'},
-which is set by the web server when calling a CGI script.
-
-You may also use a non-object-oriented interface.  For each method,
-you may call HTTP::BrowserDetect::method_name().  You will then be
-working with a default HTTP::BrowserDetect object that is created
-behind the scenes.
-
-=item user_agent($user_agent_string)
-
-Returns the value of the user agent string.  When called with a
-parameter, it resets the user agent and reperforms all tests on the
-string.  This way you can process a series of user agent strings (from
-a log file, perhaps) without creating a new HTTP::BrowserDetect object
-each time.
-
-=back
-
-=head2 DETECTING BROWSER VERSION
-
-=over 4
-
-=item major($major)
-
-Returns the integer portion of the browser version.
-If passed a parameter, returns true if it equals
-the browser major version.
-
-=item minor($minor)
-
-Returns the decimal portion of the browser version as a B<floating-point number> less than 1.  
-For example, if the version is 4.05, this method returns .05; if the version is 4.5, this method returns .5.  
-B<This is a change in behavior from previous versions of this module, which returned a 
-string>.
-
-If passed a parameter, returns true if equals the minor version.  
-
-On occasion a version may have more than one decimal point, such 
-as 'Wget/1.4.5'. The minor version does not include the second decimal point, 
-or any further digits or decimals.
-
-=item version($version)
-
-Returns the version as a floating-point number.  If passed a
-parameter, returns true if it is equal to the version
-specified by the user agent string.
-
-=item beta($beta)
-
-Returns any the beta version, consisting of any non-numeric characters
-after the version number.  For instance, if the user agent string is
-'Mozilla/4.0 (compatible; MSIE 5.0b2; Windows NT)', returns 'b2'.  If
-passed a parameter, returns true if equal to the beta version.
-
-=back
-
-=head2 DETECTING OS PLATFORM AND VERSION
-
-The following methods are available, each returning a true or false
-value.  Some methods also test for the operating system version.
-
-  windows win16 win3x win31 win95 win98 winnt win32 win2k winme
-  mac mac68k macppc
-  os2
-  unix 
-  sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10 
-  aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant 
-  dec sinix freebsd bsd
-  vms
-  amiga
-
-It may not be possibile to detect Win98 in Netscape 4.x and earlier. 
-On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all Win32, so you can't distinguish between Win95 and WinNT.
-
-=over 
-
-=item os_string()
-
-Returns one of the following strings, or undef.  This method exists solely for compatibility with the
-B<HTTP::Headers::UserAgent> module.
-
-  Win95, Win98, WinNT, Mac, Win3x, OS2, Unix, Linux
-
-=back
-
-=head2 DETECTING BROWSER VENDOR
-
-The following methods are available, each returning a true or false value.  Some methods also
-test for the browser version, saving you from checking the version separately.
-
-  netscape nav2 nav3 nav4 nav4up nav45 nav45up navgold nav6 nav6up
-  gecko
-  ie ie3 ie4 ie4up ie5 ie55
-  neoplanet neoplanet2 
-  mosaic
-  aol aol3 aol4 aol5 aol6
-  webtv
-  opera
-  lynx
-  emacs
-  staroffice
-  lotusnotes
-  icab
-  konqueror
-  java
-
-
-Netscape 6, even though its called six, in the userAgent string has version number 5.  The nav6 and nav6up methods correctly handle this quirk.
-
-=over
-
-=item browser_string()
-
-Returns one of the following strings, or undef.
-
-Netscape, MSIE, WebTV, AOL Browser, Opera, Mosaic, Lynx
-
-=back
-
-=head2 DETECTING OTHER DEVICES
-
-The following methods are available, each returning a true or false value.
-
-  wap
-  audrey
-  iopener
-  palm
-  avantgo
-
-=head2 DETECTING ROBOTS
-
-=item robot()
-
-Returns true if the user agent appears to be a robot, spider,
-crawler, or other automated Web client.
-
-The following additional methods are available, each returning a true
-or false value.  This is by no means a complete list of robots that
-exist on the Web.
-
-  wget
-  getright
-  yahoo 
-  altavista 
-  lycos 
-  infoseek 
-  lwp
-  webcrawler 
-  linkexchange 
-  slurp 
-  google
-
-=head1 AUTHOR
-
-Lee Semel, lee@semel.net
-
-
-=head1 SEE ALSO
-
-"The Ultimate JavaScript Client Sniffer, Version 3.0", B<http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html>.
-
-perl(1), L<HTTP::Headers>, L<HTTP::Headers::UserAgent>.
-
-=head1 COPYRIGHT
-
-Copyright 1999-2001 Lee Semel.  All rights reserved.  This program is free software;
-you can redistribute it and/or modify it under the same terms as Perl itself. 
-
-=cut
-
-
-     
-
-
-
diff -aruN 5.0.000.src/library/additions/HTTP/BrowserDetect.pm 5.2.000.src/library/additions/HTTP/BrowserDetect.pm
--- 5.0.000.src/library/additions/HTTP/BrowserDetect.pm	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/additions/HTTP/BrowserDetect.pm	2007-12-08 20:31:57.000000000 -0600
@@ -1,743 +1,756 @@
-package HTTP::BrowserDetect;
-
-use strict;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK @ALL_TESTS);
-require Exporter;
-
-@ISA	   = qw(Exporter);
-@EXPORT	   = qw();
-@EXPORT_OK = qw();
-$VERSION   = '0.98';
-
-# Operating Systems
-push @ALL_TESTS,(qw(win16 win3x win31 win95 win98 winnt windows win32 win2k winxp winme dotnet mac macosx mac68k macppc os2 unix sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10 aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant dec sinix freebsd bsd vms x11 amiga));
-
-# Devices
-push @ALL_TESTS,(qw(palm audrey iopener wap blackberry));
-
-# Browsers
-push @ALL_TESTS,(qw(mosaic netscape nav2 nav3 nav4 nav4up nav45 nav45up nav6 nav6up navgold firefox safari ie ie3 ie4 ie4up ie5 ie5up ie55 ie55up ie6 opera opera3 opera4 opera5 opera6 opera7 lynx links aol aol3 aol4 aol5 aol6 neoplanet neoplanet2 avantgo emacs mozilla gecko));
-
-# Robots
-push @ALL_TESTS,(qw(wget getright robot yahoo altavista lycos infoseek lwp webcrawler linkexchange slurp webtv staroffice lotusnotes konqueror icab google java));
-
-#######################################################################################################
-# BROWSER OBJECT
-
-my $default = undef;
-
-sub new {
-   my ($class, $user_agent) = @_;
-   
-   my $self = {};
-   bless $self, $class;
-
-   unless (defined $user_agent) {
-     $user_agent = $ENV{'HTTP_USER_AGENT'};
-   }
-
-   $self->user_agent($user_agent);
-   return $self;
-}
-
-foreach my $test (@ALL_TESTS) {
-    no strict 'refs';
-    my $key = uc $test;
-    *{$test} = sub { my ($self) = _self_or_default(@_);
-		     return $self->{tests}->{$key} };
-}
-
-sub _self_or_default {
-   my ($self) = $_[0];
-   return @_ if (defined $self &&
-		 ref $self &&
-		 (ref $self eq 'HTTP::BrowserDetect') || UNIVERSAL::isa($self,'HTTP::BrowserDetect'));
-   $default ||= HTTP::BrowserDetect->new();
-   unshift (@_, $default);
-   return @_;
-}
-
-
-sub user_agent {
-  my ($self, $user_agent) = _self_or_default(@_);
-  if (defined $user_agent) {
-    $self->{user_agent} = $user_agent;
-    $self->_test();
-  }
-  return $self->{user_agent};
-}
-
-# Private method -- test the UA string
-sub _test {
-  my ($self) = @_;
-
-  my $ua = lc $self->{user_agent};
-
-  # Browser version
-  my ($major, $minor, $beta) = ($ua =~ / \/			# Version starts with a slash
-				          [A-Za-z]*		# Eat any letters before the major version
-                                          ( [^\.]* )		# Major version number is everything before the first dot
-                                          \.			# The first dot
-                                          ( [\d]* )		# Minor version number is every digit after the first dot
-                                          [\d\.]*		# Throw away remaining numbers and dots
-                                          ( [^\s]* )		# Beta version string is up to next space
-                                        /x);
-     
-  # Firefox version
-  
-  if ($ua =~ /(firefox|firebird|phoenix)/i) {
-      (undef,$major, $minor)    = ($ua =~ / 
-				    (firefox|firebird|phoenix)
-				    \/
-				    ( [^\.]* )			# Major version number is everything before first dot
-				    \.			    	# The first dot
-				    ( [\d]* )			# Minor version nnumber is digits after first dot
-				    /x);                    
-  }
- 
-  
-  
-  # IE version                               
-  if (index($ua,"compatible") !=-1) {
-      ($major, $minor, $beta)    = ($ua =~ / 
-				    compatible;       
-				    \s*
-				    \w*				# Browser name
-				    [\s|\/]
-				    [A-Za-z]*			# Eat any letters before the major version
-				    ( [^\.]* )			# Major version number is everything before first dot
-				    \.				# The first dot
-				    ( [\d]* )			# Minor version nnumber is digits after first dot
-				    [\d\.]*			# Throw away remaining dots and digits
-				    ( [^;]* )			# Beta version is up to the ;
-				    ;
-				    /x);
-
-  }
-
-  $minor = 0+".$minor"; 
-
-  $self->{tests} = {};
-  my $tests = $self->{tests};
-
-  # Mozilla browsers 
-  
-  $tests->{GECKO}     = (index($ua,"gecko") != -1);
-  $tests->{FIREFOX}   = (index($ua,"firefox") != -1) ||
-                        (index($ua,"firebird") != -1) ||
-                        (index($ua,"phoenix") != -1);
-                        
-  $tests->{SAFARI}    = (index($ua,"safari") != -1) || (index($ua,"applewebkit") != -1);
-  
-  # Safari Version
-  if ($tests->{SAFARI}) {
-      my ($safari_build, $safari_minor);
-      ($safari_build,$safari_minor)    = ($ua =~ / 
-				    safari
-				    \/
-				    ( [^\.]* )			# Major version number is everything before first dot
-				    (?:			    	# The first dot
-				    ( [\d]* ))?			# Minor version nnumber is digits after first dot
-				    /x);                    
-    $major = int($safari_build / 100);
-    $minor = int($safari_build % 100) / 100;
-    $beta = $safari_minor;    
-    #print "major=$major minor=$minor beta=$beta\n";
-    
-  }
-  
- # Gecko-powered Netscape (i.e. Mozilla) versions
- $tests->{NETSCAPE}  = (!$tests->{FIREFOX} && !$tests->{SAFARI} && index($ua,"mozilla") != -1 && 
-			 index($ua,"spoofer") == -1 && index($ua,"compatible") == -1 &&
-			 index($ua,"opera") == -1 && index($ua,"webtv") == -1 && 
-			 index($ua,"hotjava") == -1);
- 
- 
-  if ($tests->{GECKO} && $tests->{NETSCAPE} && index($ua,"netscape")!=-1) {
-      ($major, $minor, $beta)    = ($ua =~ / 
-				    netscape\/  
-				    ( [^\.]* )			# Major version number is everything before first dot
-				    \.				# The first dot
-				    ( [\d]* )			# Minor version nnumber is digits after first dot
-                    ( [^\s]* )
-                   /x);
-     $minor = 0+".$minor"; 
-    #print "major=$major minor=$minor beta=$beta\n";
-  }
-
-  
-  # Netscape browsers
-  $tests->{NAV2}      = ($tests->{NETSCAPE} && $major == 2);
-  $tests->{NAV3}      = ($tests->{NETSCAPE} && $major == 3);
-  $tests->{NAV4}      = ($tests->{NETSCAPE} && $major == 4);
-  $tests->{NAV4UP}    = ($tests->{NETSCAPE} && $major >= 4); 
-  $tests->{NAV45}     = ($tests->{NETSCAPE} && $major == 4 && $minor == .5);
-  $tests->{NAV45UP}   = ($tests->{NAV4} && $minor >= .5) || ($tests->{NETSCAPE} && $major >= 5);
-  $tests->{NAVGOLD}   = (index($beta,"gold") != -1);
-  $tests->{NAV6}      = ($tests->{NETSCAPE} && $major == 5); # go figure
-  $tests->{NAV6UP}    = ($tests->{NETSCAPE} && $major >= 5);
-  
-  $tests->{MOZILLA}   = ($tests->{NETSCAPE} && $tests->{GECKO});
-    
-  # Internet Explorer browsers
-
-  $tests->{IE}               = (index($ua,"msie") != -1 || index($ua,'microsoft internet explorer') != -1);  
-  $tests->{IE3}              = ($tests->{IE} && $major == 3);
-  $tests->{IE4}              = ($tests->{IE} && $major == 4);
-  $tests->{IE4UP}            = ($tests->{IE} && $major >= 4);
-  $tests->{IE5}              = ($tests->{IE} && $major == 5);
-  $tests->{IE5UP}            = ($tests->{IE} && $major >= 5);
-  $tests->{IE55}             = ($tests->{IE} && $major == 5 && $minor >= .5);
-  $tests->{IE55UP}           = ($tests->{IE5} && $minor >= .5) || ($tests->{IE} && $major >= 6);
-  $tests->{IE6}             =  ($tests->{IE} && $major == 6);
- 
-  # Neoplanet browsers
-
-  $tests->{NEOPLANET}      = (index($ua,"neoplanet") != -1);
-  $tests->{NEOPLANET2}     = ($tests->{NEOPLANET} && index($ua,"2.") != -1); 
-
-  # AOL Browsers
-
-  $tests->{AOL}       = (index($ua,"aol")     != -1);
-  $tests->{AOL3}      = (index($ua,"aol 3.0") != -1) || ($tests->{AOL} && $tests->{IE3});
-  $tests->{AOL4}      = (index($ua,"aol 4.0") != -1) || ($tests->{AOL} && $tests->{IE4});
-  $tests->{AOL5}      = (index($ua,"aol 5.0") != -1);
-  $tests->{AOL6}      = (index($ua,"aol 6.0") != -1);
-  $tests->{AOLTV}     = (index($ua,"navio") != -1) || (index($ua,"navio_aoltv") != -1);
-
-  # Opera browsers
-  
-  $tests->{OPERA}     = (index($ua,"opera")   != -1);
-  $tests->{OPERA3}    = (index($ua,"opera 3") != -1) || (index($ua,"opera/3") != -1);
-  $tests->{OPERA4}    = (index($ua,"opera 4") != -1) || (index($ua,"opera/4") != -1);
-  $tests->{OPERA5}    = (index($ua,"opera 5") != -1) || (index($ua,"opera/5") != -1);
-  $tests->{OPERA6}    = (index($ua,"opera 6") != -1) || (index($ua,"opera/6") != -1);
-  $tests->{OPERA7}    = (index($ua,"opera 7") != -1) || (index($ua,"opera/7") != -1);
-  
-  # Other browsers
-
-  $tests->{CURL}           = (index($ua,"libcurl") != -1);
-  $tests->{STAROFFICE}     = (index($ua,"staroffice") != -1);
-  $tests->{ICAB}           = (index($ua,"icab") != -1);
-  $tests->{LOTUSNOTES}     = (index($ua,"lotus-notes") != -1);
-  $tests->{KONQUEROR}      = (index($ua,"konqueror") != -1);
-  $tests->{LYNX}           = (index($ua,"lynx") != -1);
-  $tests->{LINKS}          = (index($ua,"links") != -1);
-  $tests->{WEBTV}          = (index($ua,"webtv") != -1);
-  $tests->{MOSAIC}         = (index($ua,"mosaic") != -1);
-  $tests->{WGET}           = (index($ua,"wget") != -1);
-  $tests->{GETRIGHT}       = (index($ua,"getright") != -1);
-  $tests->{LWP}            = (index($ua,"libwww-perl") != -1 ||
-			      index($ua,"lwp-") != -1);
-  $tests->{YAHOO}          = (index($ua,"yahoo") != -1);
-  $tests->{GOOGLE}         = (index($ua,"google") != -1);
-  $tests->{JAVA}           = (index($ua,"java") != -1 ||
-			      index($ua,"jdk") != -1);
-  $tests->{ALTAVISTA}      = (index($ua,"altavista") != -1);
-  $tests->{SCOOTER}        = (index($ua,"scooter") != -1);
-  $tests->{LYCOS}          = (index($ua,"lycos") != -1);
-  $tests->{INFOSEEK}       = (index($ua,"infoseek") != -1);
-  $tests->{WEBCRAWLER}     = (index($ua,"webcrawler") != -1); 
-  $tests->{LINKEXCHANGE}   = (index($ua,"lecodechecker") != -1); 
-  $tests->{SLURP}          = (index($ua,"slurp") != -1);
-  $tests->{ROBOT}          = (($tests->{WGET} ||
-			       $tests->{GETRIGHT} ||
-			       $tests->{LWP} ||
-			       $tests->{YAHOO} ||
-			       $tests->{ALTAVISTA} ||
-			       $tests->{LYCOS} ||
-			       $tests->{INFOSEEK} ||
-			       $tests->{WEBCRAWLER} ||
-			       $tests->{LINKEXCHANGE} ||
-			       $tests->{SLURP} ||
-			       $tests->{GOOGLE}) ||
-			      index($ua,"bot") != -1 ||
-			      index($ua,"spider") != -1 ||
-			      index($ua,"crawl") != -1 ||
-			      index($ua,"agent") != -1 ||
-			      index($ua,"seek") != -1 ||
-			      index($ua,"search") != -1 ||
-			      index($ua,"reap") != -1 ||
-			      index($ua,"worm") != -1 ||
-			      index($ua,"find") != -1 ||
-			      index($ua,"index") != -1 ||
-			      index($ua,"copy") != -1 ||
-			      index($ua,"fetch") != -1 ||
-                  index($ua,"ia_archive") != -1 ||
-                  index($ua,"zyborg") != -1);
-
-  # Devices
-
-  $tests->{BLACKBERRY}        = (index($ua,"blackberry") != -1);
-  $tests->{AUDREY}        = (index($ua,"audrey") != -1);
-  $tests->{IOPENER}       = (index($ua,"i-opener") != -1);
-  $tests->{AVANTGO}        = (index($ua,"avantgo") != -1);
-  $tests->{PALM}          = ($tests->{AVANTGO} || 
-			     index($ua,"palmos") != -1 );
-  $tests->{WAP}           = (index($ua,"up.browser") != -1 ||
-			     index($ua,"nokia") != -1 ||
-			     index($ua,"alcatel") != -1 ||
-			     index($ua,"ericsson") != -1 ||
-			     index($ua,"sie-") == 0 ||
-			     index($ua,"wmlib") != -1 ||
-			     index($ua," wap") != -1 ||
-			     index($ua,"wap ") != -1 ||
-			     index($ua,"wap/") != -1 ||
-			     index($ua,"-wap") != -1 ||
-			     index($ua,"wap-") != -1 ||
-			     index($ua,"wap") == 0 ||
-			     index($ua,"wapper") != -1 ||
-			     index($ua,"zetor") != -1);
-			     
-			     
-  # Operating System
-  
-  $tests->{WIN16}    = (index($ua,"win16") != -1 || index($ua,"16bit") != -1 || index($ua,"windows 3") != -1 ||
-			index($ua,"windows 16-bit") != -1);
-  $tests->{WIN3X}    = (index($ua,"win16") != -1 || index($ua,"windows 3") != -1 || index($ua,"windows 16-bit") != -1);
-  $tests->{WIN31}    = (index($ua,"win16") != -1 || index($ua,"windows 3.1") != -1 || index($ua,"windows 16-bit") != -1);
-  $tests->{WIN95}    = (index($ua,"win95") != -1 || index($ua,"windows 95") != -1);
-  $tests->{WIN98}    = (index($ua,"win98") != -1 || index($ua,"windows 98") != -1);
-  $tests->{WINNT}    = (index($ua,"winnt") != -1 || 
-			index($ua,"windows nt") != -1 || 
-			index($ua,"nt4") != -1 || 
-			index($ua,"nt3") != -1);
-  $tests->{WIN2K}    = (index($ua,"nt 5.0") != -1 || index($ua,"nt5") != -1);
-  $tests->{WINXP}    = (index($ua,"nt 5.1") != -1 );
-  $tests->{DOTNET}   = (index($ua,".net clr") != -1);
-  
-  $tests->{WINME}    = (index($ua,"win 9x 4.90") != -1); # whatever
-  $tests->{WIN32}    = (($tests->{WIN95} || $tests->{WIN98} || $tests->{WINME} || $tests->{WINNT} || 
-			 $tests->{WIN2K}) || $tests->{WINXP} || index($ua,"win32") != -1);
-  $tests->{WINDOWS}  = (($tests->{WIN16} || $tests->{WIN31} || $tests->{WIN95} || $tests->{WIN98} ||
-			 $tests->{WINNT} || $tests->{WIN32} || $tests->{WIN2K} || $tests->{WINME}) || index($ua,"win") != -1);
-  
-  # Mac operating systems
-  
-  $tests->{MAC}      = (index($ua,"macintosh") != -1 || index($ua,"mac_") != -1);
-  $tests->{MACOSX}   = (index($ua,"macintosh") != -1 && index($ua,"mac os x") != -1);
-  $tests->{MAC68K}   = (($tests->{MAC}) && (index($ua,"68k") != -1 || index($ua,"68000") != -1));
-  $tests->{MACPPC}   = (($tests->{MAC}) && (index($ua,"ppc") != -1 || index($ua,"powerpc") != -1));
-  
-  # Others
-  
-  $tests->{AMIGA}   = (index($ua,'amiga') != -1);
-  
-  $tests->{EMACS}   = (index($ua,'emacs') != -1);
-  $tests->{OS2}     = (index($ua,'os/2') != -1);
-  
-  $tests->{SUN}     = (index($ua,"sun") != -1);
-  $tests->{SUN4}    = (index($ua,"sunos 4") != -1);
-  $tests->{SUN5}    = (index($ua,"sunos 5") != -1);
-  $tests->{SUNI86}  = (($tests->{SUN}) && index($ua,"i86") != -1);
-  
-  $tests->{IRIX}    = (index($ua,"irix") != -1);
-  $tests->{IRIX5}   = (index($ua,"irix5") != -1);
-  $tests->{IRIX6}   = (index($ua,"irix6") != -1);
-  
-  $tests->{HPUX}    = (index($ua,"hp-ux") != -1);
-  $tests->{HPUX9}   = (($tests->{HPUX}) && index($ua,"09.") != -1);
-  $tests->{HPUX10}  = (($tests->{HPUX}) && index($ua,"10.") != -1);
-  
-  $tests->{AIX}   = (index($ua,"aix") != -1);
-  $tests->{AIX1}  = (index($ua,"aix 1") != -1);
-  $tests->{AIX2}  = (index($ua,"aix 2") != -1);
-  $tests->{AIX3}  = (index($ua,"aix 3") != -1);
-  $tests->{AIX4}  = (index($ua,"aix 4") != -1);
-  
-  $tests->{LINUX}     = (index($ua,"inux") != -1);
-  $tests->{SCO}       = (index($ua,"sco") != -1 || index($ua,"unix_sv") != -1);
-  $tests->{UNIXWARE}  = (index($ua,"unix_system_v") != -1);
-  $tests->{MPRAS}     = (index($ua,"ncr") != -1);
-  $tests->{RELIANT}   = (index($ua,"reliantunix") != -1);
-  
-  $tests->{DEC} = (index($ua,"dec") != -1 || index($ua,"osf1") != -1 || index($ua,"declpha") != -1 || 
-		   index($ua,"alphaserver") != -1 || index($ua,"ultrix") != -1 ||
-		   index($ua,"alphastation") != -1);
-  
-  $tests->{SINIX}    = (index($ua,"sinix") != -1);
-  $tests->{FREEBSD}  = (index($ua,"freebsd") != -1);
-  $tests->{BSD}      = (index($ua,"bsd") != -1);
-  $tests->{X11}      = (index($ua,"x11") != -1);
-  $tests->{UNIX}     = ($tests->{X11} || $tests->{SUN} || $tests->{IRIX} || $tests->{HPUX} ||
-			$tests->{SCO} || $tests->{UNIXWARE} || $tests->{MPRAS} ||
-			$tests->{RELIANT} || $tests->{DEC} || $tests->{LINUX} ||
-			$tests->{BSD}); 
-
-  $tests->{VMS} = (index($ua,"vax") != -1 || index($ua,"openvms") != -1);
-
-  # A final try at browser version, if we haven't gotten it so far
-  if ($major eq '') {
-     if ($ua =~ /[A-Za-z]+\/(\d+)\;/) {
-          $major = $1;
-          $minor = 0;
-      }
-  }
-
-  
-  # Gecko version
-  $self->{gecko_version} = undef;
-  if ($tests->{GECKO}) {
-    if( $ua =~ /\([^)]*rv:([\w\.\d]*)/ ) {
-        $self->{gecko_version} = $1;
-    }
-  }
-  
-  $self->{major} = $major;
-  $self->{minor} = $minor;
-  $self->{beta} = $beta;
-}
-    
-sub browser_string {
-    my ($self) = _self_or_default(@_);
-    my $browser_string = undef;
-    my $user_agent = $self->user_agent;
-    if (defined $user_agent) {
-        $browser_string = 'Netscape' if $self->netscape;
-        $browser_string = 'Firefox' if $self->firefox;
-        $browser_string = 'Safari' if $self->safari;
-        $browser_string = 'MSIE' if $self->ie;  
-        $browser_string = 'WebTV' if $self->webtv;
-        $browser_string = 'AOL Browser' if $self->aol;
-        $browser_string = 'Opera' if $self->opera;
-        $browser_string = 'Mosaic' if $self->mosaic;
-        $browser_string = 'Lynx' if $self->lynx;
-    }
-    return $browser_string;
-}
-    
-sub os_string {
-    my ($self) = _self_or_default(@_);
-    my $os_string = undef;
-    my $user_agent = $self->user_agent;
-    if (defined $user_agent) {
-        $os_string = 'Win95' if $self->win95;
-        $os_string = 'Win98' if $self->win98;
-        $os_string = 'WinNT' if $self->winnt;
-        $os_string = 'Win2k' if $self->win2k;
-        $os_string = 'WinXP' if $self->winxp;
-        $os_string = 'Mac' if $self->mac;
-        $os_string = 'Mac OS X' if $self->macosx;
-        $os_string = 'Win3x' if $self->win3x;
-        $os_string = 'OS2' if $self->os2;
-        $os_string = 'Unix' if $self->unix && !$self->linux;
-        $os_string = 'Linux' if $self->linux;
-    }
-    return $os_string;
-}
-
-sub gecko_version {
-  my ($self, $check) = _self_or_default(@_);
-  my $version;
-  $version = $self->{gecko_version};
-  if (defined $check) { 
-    return $check == $version;
-  } else {
-    return $version;
-  }
-}
-
-    
-sub version {
-  my ($self, $check) = _self_or_default(@_);
-  my $version;
-  $version = $self->{major} + $self->{minor};
-  if (defined $check) { 
-    return $check == $version;
-  } else {
-    return $version;
-  }
-}
-    
-sub major {
-  my ($self, $check) = _self_or_default(@_);
-  my ($version) = $self->{major};
-  if (defined $check) { 
-    return $check == $version;
-  } else {
-    return $version;
-  }
-}
-    
-sub minor {
-  my ($self, $check) = _self_or_default(@_);
-  my ($version) = $self->{minor};
-  if (defined $check) { 
-      return ($check == $self->{minor});
-  } else {
-    return $version;
-  }
-}
-    
-sub beta {
-  my ($self, $check) = _self_or_default(@_);
-  my ($version) = $self->{beta};
-  if ($check) { 
-    return $check eq $version;
-  } else {
-    return $version;
-  }
-}
-
-1;
-    
-
-__END__
-
-=head1 NAME
-
-HTTP::BrowserDetect - Determine the Web browser, version, and platform from an HTTP user agent string
-
-=head1 SYNOPSIS
-
-    use HTTP::BrowserDetect;
-
-    my $browser = new HTTP::BrowserDetect($user_agent_string);
-
-    # Detect operating system
-    if ($browser->windows) {
-      if ($browser->winnt) ...
-      if ($brorwser->win95) ...
-    }
-    print $browser->mac;
-
-    # Detect browser vendor and version
-    print $browser->netscape;
-    print $browser->ie;
-    if (browser->major(4)) {
-	if ($browser->minor() > .5) {
-	    ...
-	}
-    }
-    if ($browser->version() > 4) {
-      ...;
-    }
-    
-    # Process a different user agent string
-    $browser->user_agent($another_user_agent_string);
-
-
-
-=head1 DESCRIPTION
-
-The HTTP::BrowserDetect object does a number of tests on an HTTP user
-agent string.  The results of these tests are available via methods of
-the object.
-
-This module is based upon the JavaScript browser detection code
-available at
-B<http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html>.
-
-=head2 CREATING A NEW BROWSER DETECT OBJECT AND SETTING THE USER AGENT STRING
-
-=over 4
-
-=item new HTTP::BrowserDetect($user_agent_string)
-
-The constructor may be called with a user agent string specified.
-Otherwise, it will use the value specified by $ENV{'HTTP_USER_AGENT'},
-which is set by the web server when calling a CGI script.
-
-You may also use a non-object-oriented interface.  For each method,
-you may call HTTP::BrowserDetect::method_name().  You will then be
-working with a default HTTP::BrowserDetect object that is created
-behind the scenes.
-
-=item user_agent($user_agent_string)
-
-Returns the value of the user agent string.  When called with a
-parameter, it resets the user agent and reperforms all tests on the
-string.  This way you can process a series of user agent strings (from
-a log file, perhaps) without creating a new HTTP::BrowserDetect object
-each time.
-
-=back
-
-=head2 DETECTING BROWSER VERSION
-
-=over 4
-
-=item major($major)
-
-Returns the integer portion of the browser version.
-If passed a parameter, returns true if it equals
-the browser major version.
-
-=item minor($minor)
-
-Returns the decimal portion of the browser version as a B<floating-point number> less than 1.  
-For example, if the version is 4.05, this method returns .05; if the version is 4.5, this method returns .5.  
-B<This is a change in behavior from previous versions of this module, which returned a 
-string>.
-
-If passed a parameter, returns true if equals the minor version.  
-
-On occasion a version may have more than one decimal point, such 
-as 'Wget/1.4.5'. The minor version does not include the second decimal point, 
-or any further digits or decimals.
-
-=item version($version)
-
-Returns the version as a floating-point number.  If passed a
-parameter, returns true if it is equal to the version
-specified by the user agent string.
-
-=item beta($beta)
-
-Returns any the beta version, consisting of any non-numeric characters
-after the version number.  For instance, if the user agent string is
-'Mozilla/4.0 (compatible; MSIE 5.0b2; Windows NT)', returns 'b2'.  If
-passed a parameter, returns true if equal to the beta version.  If the beta
-starts with a dot, it is thrown away.
-
-=back
-
-=head2 DETECTING OS PLATFORM AND VERSION
-
-The following methods are available, each returning a true or false
-value.  Some methods also test for the operating system version.  
-The indentations below show the hierarchy of tests (for example, win2k 
-is considered a type of winnt, which is a type of win32)
-
-  windows 
-    win16 win3x win31  
-    win32 
-        winme win95 win98
-        winnt
-            win2k winxp
-  dotnet
-  
-  mac 
-    mac68k macppc macosx
-  
-  os2
-  
-  unix 
-    sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10 
-    aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant 
-    dec sinix freebsd bsd
-  
-  vms
-
-  amiga
-
-It may not be possibile to detect Win98 in Netscape 4.x and earlier. 
-On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all Win32, so you can't distinguish between Win95 and WinNT.
-
-=over 
-
-=item os_string()
-
-Returns one of the following strings, or undef.  This method exists solely for compatibility with the
-B<HTTP::Headers::UserAgent> module.
-
-  Win95, Win98, WinNT, Win2K, WinXP, Mac, Mac OS X, Win3x, OS2, Unix, Linux
-
-=back
-
-=head2 DETECTING BROWSER VENDOR
-
-The following methods are available, each returning a true or false value.  Some methods also
-test for the browser version, saving you from checking the version separately.
-
-  netscape nav2 nav3 nav4 nav4up nav45 nav45up navgold nav6 nav6up
-  gecko 
-  mozilla
-  firefox 
-  safari
-  ie ie3 ie4 ie4up ie5 ie55 ie6
-  neoplanet neoplanet2 
-  mosaic
-  aol aol3 aol4 aol5 aol6
-  webtv
-  opera opera3 opera4 opera5 opera6 opera7
-  lynx links
-  emacs
-  staroffice
-  lotusnotes
-  icab
-  konqueror
-  java
-  curl
-
-Netscape 6, even though its called six, in the userAgent string has version number 5.  The nav6 and nav6up methods correctly handle this quirk.
-The firefox text correctly detects the older-named versions of the browser (Phoenix, Firebird)
-
-=over
-
-
-=item browser_string()
-
-Returns one of the following strings, or undef.
-
-Netscape, MSIE, WebTV, AOL Browser, Opera, Mosaic, Lynx
-
-=item gecko_version() 
-
-If a Gecko rendering engine is used (as in Mozilla or Firebird), returns the version of the renderer (e.g. 1.3a, 1.7, 1.8)
-This might be more useful than the particular browser name or version when correcting for quirks in different versions of this rendering engine.
-If no Gecko browser is being used, or the version number can't be detected, returns undef.
-
-=back
-
-
-=head2 DETECTING OTHER DEVICES
-
-The following methods are available, each returning a true or false value.
-
-  wap
-  audrey
-  iopener
-  palm
-  avantgo
-  blackberry
-
-=head2 DETECTING ROBOTS
-
-=item robot()
-
-Returns true if the user agent appears to be a robot, spider,
-crawler, or other automated Web client.
-
-The following additional methods are available, each returning a true
-or false value.  This is by no means a complete list of robots that
-exist on the Web.
-
-  wget
-  getright
-  yahoo 
-  altavista 
-  lycos 
-  infoseek 
-  lwp
-  webcrawler 
-  linkexchange 
-  slurp 
-  google
-
-=head1 AUTHOR
-
-Lee Semel, lee@semel.net
-
-Thanks to Leonardo Herrera for additional contributions
-
-=head1 SEE ALSO
-
-"The Ultimate JavaScript Client Sniffer, Version 3.0", B<http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html>.
-
-"Browser ID (User-Agent) Strings" B<http://www.zytrax.com/tech/web/browser_ids.htm>
-
-perl(1), L<HTTP::Headers>, L<HTTP::Headers::UserAgent>.
-
-=head1 COPYRIGHT
-
-Copyright 1999-2004 Lee Semel.  All rights reserved.  This program is free software;
-you can redistribute it and/or modify it under the same terms as Perl itself. 
-
-=cut
-
-
-     
-
-
-
+package HTTP::BrowserDetect;
+
+use strict;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK @ALL_TESTS);
+require Exporter;
+
+@ISA	   = qw(Exporter);
+@EXPORT	   = qw();
+@EXPORT_OK = qw();
+$VERSION   = '0.99';
+
+# Operating Systems
+push @ALL_TESTS,(qw(win16 win3x win31 win95 win98 winnt windows win32 win2k winxp win2k3 winvista winme dotnet mac macosx mac68k macppc os2 unix sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10 aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant dec sinix freebsd bsd vms x11 amiga));
+
+# Devices
+push @ALL_TESTS,(qw(palm audrey iopener wap blackberry));
+
+# Browsers
+push @ALL_TESTS,(qw(mosaic netscape nav2 nav3 nav4 nav4up nav45 nav45up nav6 nav6up navgold firefox safari ie ie3 ie4 ie4up ie5 ie5up ie55 ie55up ie6 ie7 ie8 opera opera3 opera4 opera5 opera6 opera7 opera8 opera9 opera10 lynx links aol aol3 aol4 aol5 aol6 aol7 aol8 aol9 neoplanet neoplanet2 avantgo emacs mozilla gecko konqueror));
+
+# Robots
+push @ALL_TESTS,(qw(wget getright robot yahoo altavista lycos infoseek lwp webcrawler linkexchange slurp webtv staroffice lotusnotes icab google java));
+
+#######################################################################################################
+# BROWSER OBJECT
+
+my $default = undef;
+
+sub new {
+   my ($class, $user_agent) = @_;
+   
+   my $self = {};
+   bless $self, $class;
+
+   unless (defined $user_agent) {
+     $user_agent = $ENV{'HTTP_USER_AGENT'};
+   }
+
+   $self->user_agent($user_agent);
+   return $self;
+}
+
+foreach my $test (@ALL_TESTS) {
+    no strict 'refs';
+    my $key = uc $test;
+    *{$test} = sub { my ($self) = _self_or_default(@_);
+		     return $self->{tests}->{$key} };
+}
+
+sub _self_or_default {
+   my ($self) = $_[0];
+   return @_ if (defined $self &&
+		 ref $self &&
+		 (ref $self eq 'HTTP::BrowserDetect') || UNIVERSAL::isa($self,'HTTP::BrowserDetect'));
+   $default ||= HTTP::BrowserDetect->new();
+   unshift (@_, $default);
+   return @_;
+}
+
+
+sub user_agent {
+  my ($self, $user_agent) = _self_or_default(@_);
+  if (defined $user_agent) {
+    $self->{user_agent} = $user_agent;
+    $self->_test();
+  }
+  return $self->{user_agent};
+}
+
+# Private method -- test the UA string
+sub _test {
+  my ($self) = @_;
+
+  my $ua = lc $self->{user_agent};
+
+  # Browser version
+  my ($major, $minor, $beta) = ($ua =~ / \/			# Version starts with a slash
+				          [A-Za-z]*		# Eat any letters before the major version
+                                          ( [^\.]* )		# Major version number is everything before the first dot
+                                          \.			# The first dot
+                                          ( [\d]* )		# Minor version number is every digit after the first dot
+                                          [\d\.]*		# Throw away remaining numbers and dots
+                                          ( [^\s]* )		# Beta version string is up to next space
+                                        /x);
+     
+  # Firefox version
+  
+  if ($ua =~ /(firefox|firebird|phoenix)/i) {
+      (undef,$major, $minor)    = ($ua =~ / 
+				    (firefox|firebird|phoenix)
+				    \/
+				    ( [^\.]* )			# Major version number is everything before first dot
+				    \.			    	# The first dot
+				    ( [\d]* )			# Minor version nnumber is digits after first dot
+				    /x);                    
+  }
+ 
+  
+  
+  # IE version                               
+  if (index($ua,"compatible") !=-1) {
+      ($major, $minor, $beta)    = ($ua =~ / 
+				    compatible;       
+				    \s*
+				    \w*				# Browser name
+				    [\s|\/]
+				    [A-Za-z]*			# Eat any letters before the major version
+				    ( [^\.]* )			# Major version number is everything before first dot
+				    \.				# The first dot
+				    ( [\d]* )			# Minor version nnumber is digits after first dot
+				    [\d\.]*			# Throw away remaining dots and digits
+				    ( [^;]* )			# Beta version is up to the ;
+				    ;
+				    /x);
+
+  }
+
+  $minor = 0+".$minor"; 
+
+  $self->{tests} = {};
+  my $tests = $self->{tests};
+
+  # Mozilla browsers 
+  
+  $tests->{GECKO}     = (index($ua,"gecko") != -1);
+  $tests->{FIREFOX}   = (index($ua,"firefox") != -1) ||
+                        (index($ua,"firebird") != -1) ||
+                        (index($ua,"phoenix") != -1);
+                        
+  $tests->{SAFARI}    = (index($ua,"safari") != -1) || (index($ua,"applewebkit") != -1);
+  
+  # Safari Version
+  if ($tests->{SAFARI}) {
+      my ($safari_build, $safari_minor);
+      ($safari_build,$safari_minor)    = ($ua =~ / 
+				    safari
+				    \/
+				    ( [^\.]* )			# Major version number is everything before first dot
+				    (?:			    	# The first dot
+				    ( [\d]* ))?			# Minor version nnumber is digits after first dot
+				    /x);                    
+    $major = int($safari_build / 100);
+    $minor = int($safari_build % 100) / 100;
+    $beta = $safari_minor;    
+    #print "major=$major minor=$minor beta=$beta\n";
+    
+  }
+  
+ # Gecko-powered Netscape (i.e. Mozilla) versions
+ $tests->{NETSCAPE}  = (!$tests->{FIREFOX} && !$tests->{SAFARI} && index($ua,"mozilla") != -1 && 
+			 index($ua,"spoofer") == -1 && index($ua,"compatible") == -1 &&
+			 index($ua,"opera") == -1 && index($ua,"webtv") == -1 && 
+			 index($ua,"hotjava") == -1);
+ 
+ 
+  if ($tests->{GECKO} && $tests->{NETSCAPE} && index($ua,"netscape")!=-1) {
+      ($major, $minor, $beta)    = ($ua =~ / 
+				    netscape\/  
+				    ( [^\.]* )			# Major version number is everything before first dot
+				    \.				# The first dot
+				    ( [\d]* )			# Minor version nnumber is digits after first dot
+                    ( [^\s]* )
+                   /x);
+     $minor = 0+".$minor"; 
+    #print "major=$major minor=$minor beta=$beta\n";
+  }
+
+  
+  # Netscape browsers
+  $tests->{NAV2}      = ($tests->{NETSCAPE} && $major == 2);
+  $tests->{NAV3}      = ($tests->{NETSCAPE} && $major == 3);
+  $tests->{NAV4}      = ($tests->{NETSCAPE} && $major == 4);
+  $tests->{NAV4UP}    = ($tests->{NETSCAPE} && $major >= 4); 
+  $tests->{NAV45}     = ($tests->{NETSCAPE} && $major == 4 && $minor == .5);
+  $tests->{NAV45UP}   = ($tests->{NAV4} && $minor >= .5) || ($tests->{NETSCAPE} && $major >= 5);
+  $tests->{NAVGOLD}   = (index($beta,"gold") != -1);
+  $tests->{NAV6}      = ($tests->{NETSCAPE} && $major == 5); # go figure
+  $tests->{NAV6UP}    = ($tests->{NETSCAPE} && $major >= 5);
+  
+  $tests->{MOZILLA}   = ($tests->{NETSCAPE} && $tests->{GECKO});
+    
+  # Internet Explorer browsers
+
+  $tests->{IE}               = (index($ua,"msie") != -1 || index($ua,'microsoft internet explorer') != -1);  
+  $tests->{IE3}              = ($tests->{IE} && $major == 3);
+  $tests->{IE4}              = ($tests->{IE} && $major == 4);
+  $tests->{IE4UP}            = ($tests->{IE} && $major >= 4);
+  $tests->{IE5}              = ($tests->{IE} && $major == 5);
+  $tests->{IE5UP}            = ($tests->{IE} && $major >= 5);
+  $tests->{IE55}             = ($tests->{IE} && $major == 5 && $minor >= .5);
+  $tests->{IE55UP}           = ($tests->{IE5} && $minor >= .5) || ($tests->{IE} && $major >= 6);
+  $tests->{IE6}             =  ($tests->{IE} && $major == 6);
+  $tests->{IE7}             =  ($tests->{IE} && $major == 7);
+  $tests->{IE8}             =  ($tests->{IE} && $major == 8);
+ 
+  # Neoplanet browsers
+
+  $tests->{NEOPLANET}      = (index($ua,"neoplanet") != -1);
+  $tests->{NEOPLANET2}     = ($tests->{NEOPLANET} && index($ua,"2.") != -1); 
+
+  # AOL Browsers
+
+  $tests->{AOL}       = (index($ua,"aol")     != -1);
+  $tests->{AOL3}      = (index($ua,"aol 3.0") != -1) || ($tests->{AOL} && $tests->{IE3});
+  $tests->{AOL4}      = (index($ua,"aol 4.0") != -1) || ($tests->{AOL} && $tests->{IE4});
+  $tests->{AOL5}      = (index($ua,"aol 5.0") != -1);
+  $tests->{AOL6}      = (index($ua,"aol 6.0") != -1);
+  $tests->{AOL7}      = (index($ua,"aol 7.0") != -1);
+  $tests->{AOL8}      = (index($ua,"aol 8.0") != -1);
+  $tests->{AOL9}      = (index($ua,"aol 9.0") != -1);
+  $tests->{AOLTV}     = (index($ua,"navio") != -1) || (index($ua,"navio_aoltv") != -1);
+
+  # Opera browsers
+  
+  $tests->{OPERA}     = (index($ua,"opera")   != -1);
+  $tests->{OPERA3}    = (index($ua,"opera 3") != -1) || (index($ua,"opera/3") != -1);
+  $tests->{OPERA4}    = (index($ua,"opera 4") != -1) || (index($ua,"opera/4") != -1);
+  $tests->{OPERA5}    = (index($ua,"opera 5") != -1) || (index($ua,"opera/5") != -1);
+  $tests->{OPERA6}    = (index($ua,"opera 6") != -1) || (index($ua,"opera/6") != -1);
+  $tests->{OPERA7}    = (index($ua,"opera 7") != -1) || (index($ua,"opera/7") != -1);
+  $tests->{OPERA7}    = (index($ua,"opera 7") != -1) || (index($ua,"opera/7") != -1);
+  $tests->{OPERA8}    = (index($ua,"opera 8") != -1) || (index($ua,"opera/8") != -1);
+  $tests->{OPERA9}    = (index($ua,"opera 9") != -1) || (index($ua,"opera/9") != -1);
+  $tests->{OPERA10}    = (index($ua,"opera 10") != -1) || (index($ua,"opera/10") != -1);
+  
+  # Other browsers
+
+  $tests->{CURL}           = (index($ua,"libcurl") != -1);
+  $tests->{STAROFFICE}     = (index($ua,"staroffice") != -1);
+  $tests->{ICAB}           = (index($ua,"icab") != -1);
+  $tests->{LOTUSNOTES}     = (index($ua,"lotus-notes") != -1);
+  $tests->{KONQUEROR}      = (index($ua,"konqueror") != -1);
+  $tests->{LYNX}           = (index($ua,"lynx") != -1);
+  $tests->{LINKS}          = (index($ua,"links") != -1);
+  $tests->{WEBTV}          = (index($ua,"webtv") != -1);
+  $tests->{MOSAIC}         = (index($ua,"mosaic") != -1);
+  $tests->{WGET}           = (index($ua,"wget") != -1);
+  $tests->{GETRIGHT}       = (index($ua,"getright") != -1);
+  $tests->{LWP}            = (index($ua,"libwww-perl") != -1 ||
+			      index($ua,"lwp-") != -1);
+  $tests->{YAHOO}          = (index($ua,"yahoo") != -1);
+  $tests->{GOOGLE}         = (index($ua,"google") != -1);
+  $tests->{JAVA}           = (index($ua,"java") != -1 ||
+			      index($ua,"jdk") != -1);
+  $tests->{ALTAVISTA}      = (index($ua,"altavista") != -1);
+  $tests->{SCOOTER}        = (index($ua,"scooter") != -1);
+  $tests->{LYCOS}          = (index($ua,"lycos") != -1);
+  $tests->{INFOSEEK}       = (index($ua,"infoseek") != -1);
+  $tests->{WEBCRAWLER}     = (index($ua,"webcrawler") != -1); 
+  $tests->{LINKEXCHANGE}   = (index($ua,"lecodechecker") != -1); 
+  $tests->{SLURP}          = (index($ua,"slurp") != -1);
+  $tests->{ROBOT}          = (($tests->{WGET} ||
+			       $tests->{GETRIGHT} ||
+			       $tests->{LWP} ||
+			       $tests->{YAHOO} ||
+			       $tests->{ALTAVISTA} ||
+			       $tests->{LYCOS} ||
+			       $tests->{INFOSEEK} ||
+			       $tests->{WEBCRAWLER} ||
+			       $tests->{LINKEXCHANGE} ||
+			       $tests->{SLURP} ||
+			       $tests->{GOOGLE}) ||
+			      index($ua,"bot") != -1 ||
+			      index($ua,"spider") != -1 ||
+			      index($ua,"crawl") != -1 ||
+			      index($ua,"agent") != -1 ||
+			      index($ua,"seek") != -1 ||
+			      index($ua,"search") != -1 ||
+			      index($ua,"reap") != -1 ||
+			      index($ua,"worm") != -1 ||
+			      index($ua,"find") != -1 ||
+			      index($ua,"index") != -1 ||
+			      index($ua,"copy") != -1 ||
+			      index($ua,"fetch") != -1 ||
+                  index($ua,"ia_archive") != -1 ||
+                  index($ua,"zyborg") != -1);
+
+  # Devices
+
+  $tests->{BLACKBERRY}        = (index($ua,"blackberry") != -1);
+  $tests->{AUDREY}        = (index($ua,"audrey") != -1);
+  $tests->{IOPENER}       = (index($ua,"i-opener") != -1);
+  $tests->{AVANTGO}        = (index($ua,"avantgo") != -1);
+  $tests->{PALM}          = ($tests->{AVANTGO} || 
+			     index($ua,"palmos") != -1 );
+  $tests->{WAP}           = (index($ua,"up.browser") != -1 ||
+			     index($ua,"nokia") != -1 ||
+			     index($ua,"alcatel") != -1 ||
+			     index($ua,"ericsson") != -1 ||
+			     index($ua,"sie-") == 0 ||
+			     index($ua,"wmlib") != -1 ||
+			     index($ua," wap") != -1 ||
+			     index($ua,"wap ") != -1 ||
+			     index($ua,"wap/") != -1 ||
+			     index($ua,"-wap") != -1 ||
+			     index($ua,"wap-") != -1 ||
+			     index($ua,"wap") == 0 ||
+			     index($ua,"wapper") != -1 ||
+			     index($ua,"zetor") != -1);
+			     
+			     
+  # Operating System
+  
+  $tests->{WIN16}    = (index($ua,"win16") != -1 || index($ua,"16bit") != -1 || index($ua,"windows 3") != -1 ||
+			index($ua,"windows 16-bit") != -1);
+  $tests->{WIN3X}    = (index($ua,"win16") != -1 || index($ua,"windows 3") != -1 || index($ua,"windows 16-bit") != -1);
+  $tests->{WIN31}    = (index($ua,"win16") != -1 || index($ua,"windows 3.1") != -1 || index($ua,"windows 16-bit") != -1);
+  $tests->{WIN95}    = (index($ua,"win95") != -1 || index($ua,"windows 95") != -1);
+  $tests->{WIN98}    = (index($ua,"win98") != -1 || index($ua,"windows 98") != -1);
+  $tests->{WINNT}    = (index($ua,"winnt") != -1 || 
+			index($ua,"windows nt") != -1 || 
+			index($ua,"nt4") != -1 || 
+			index($ua,"nt3") != -1);
+  $tests->{WIN2K}    = (index($ua,"nt 5.0") != -1 || index($ua,"nt5") != -1);
+  $tests->{WINXP}    = (index($ua,"nt 5.1") != -1 );
+  $tests->{WIN2K3}   = (index($ua,"nt 5.2") != -1 );
+  $tests->{WINVISTA} = (index($ua,"nt 6.0") != -1 );
+  $tests->{DOTNET}   = (index($ua,".net clr") != -1);
+  
+  $tests->{WINME}    = (index($ua,"win 9x 4.90") != -1); # whatever
+  $tests->{WIN32}    = (($tests->{WIN95} || $tests->{WIN98} || $tests->{WINME} || $tests->{WINNT} || 
+			 $tests->{WIN2K}) || $tests->{WINXP} ||  $tests->{WIN2K3} || $tests->{WINVISTA} || index($ua,"win32") != -1);
+  $tests->{WINDOWS}  = (($tests->{WIN16} || $tests->{WIN31} || $tests->{WIN95} || $tests->{WIN98} ||
+			 $tests->{WINNT} || $tests->{WIN32} || $tests->{WIN2K} || $tests->{WINXP} || $tests->{WIN2K3} || $tests->{WINVISTA} || $tests->{WINME}) || index($ua,"win") != -1);
+  
+  # Mac operating systems
+  
+  $tests->{MAC}      = (index($ua,"macintosh") != -1 || index($ua,"mac_") != -1);
+  $tests->{MACOSX}   = (index($ua,"macintosh") != -1 && index($ua,"mac os x") != -1);
+  $tests->{MAC68K}   = (($tests->{MAC}) && (index($ua,"68k") != -1 || index($ua,"68000") != -1));
+  $tests->{MACPPC}   = (($tests->{MAC}) && (index($ua,"ppc") != -1 || index($ua,"powerpc") != -1));
+  
+  # Others
+  
+  $tests->{AMIGA}   = (index($ua,'amiga') != -1);
+  
+  $tests->{EMACS}   = (index($ua,'emacs') != -1);
+  $tests->{OS2}     = (index($ua,'os/2') != -1);
+  
+  $tests->{SUN}     = (index($ua,"sun") != -1);
+  $tests->{SUN4}    = (index($ua,"sunos 4") != -1);
+  $tests->{SUN5}    = (index($ua,"sunos 5") != -1);
+  $tests->{SUNI86}  = (($tests->{SUN}) && index($ua,"i86") != -1);
+  
+  $tests->{IRIX}    = (index($ua,"irix") != -1);
+  $tests->{IRIX5}   = (index($ua,"irix5") != -1);
+  $tests->{IRIX6}   = (index($ua,"irix6") != -1);
+  
+  $tests->{HPUX}    = (index($ua,"hp-ux") != -1);
+  $tests->{HPUX9}   = (($tests->{HPUX}) && index($ua,"09.") != -1);
+  $tests->{HPUX10}  = (($tests->{HPUX}) && index($ua,"10.") != -1);
+  
+  $tests->{AIX}   = (index($ua,"aix") != -1);
+  $tests->{AIX1}  = (index($ua,"aix 1") != -1);
+  $tests->{AIX2}  = (index($ua,"aix 2") != -1);
+  $tests->{AIX3}  = (index($ua,"aix 3") != -1);
+  $tests->{AIX4}  = (index($ua,"aix 4") != -1);
+  
+  $tests->{LINUX}     = (index($ua,"inux") != -1);
+  $tests->{SCO}       = (index($ua,"sco") != -1 || index($ua,"unix_sv") != -1);
+  $tests->{UNIXWARE}  = (index($ua,"unix_system_v") != -1);
+  $tests->{MPRAS}     = (index($ua,"ncr") != -1);
+  $tests->{RELIANT}   = (index($ua,"reliantunix") != -1);
+  
+  $tests->{DEC} = (index($ua,"dec") != -1 || index($ua,"osf1") != -1 || index($ua,"declpha") != -1 || 
+		   index($ua,"alphaserver") != -1 || index($ua,"ultrix") != -1 ||
+		   index($ua,"alphastation") != -1);
+  
+  $tests->{SINIX}    = (index($ua,"sinix") != -1);
+  $tests->{FREEBSD}  = (index($ua,"freebsd") != -1);
+  $tests->{BSD}      = (index($ua,"bsd") != -1);
+  $tests->{X11}      = (index($ua,"x11") != -1);
+  $tests->{UNIX}     = ($tests->{X11} || $tests->{SUN} || $tests->{IRIX} || $tests->{HPUX} ||
+			$tests->{SCO} || $tests->{UNIXWARE} || $tests->{MPRAS} ||
+			$tests->{RELIANT} || $tests->{DEC} || $tests->{LINUX} ||
+			$tests->{BSD}); 
+
+  $tests->{VMS} = (index($ua,"vax") != -1 || index($ua,"openvms") != -1);
+
+  # A final try at browser version, if we haven't gotten it so far
+  if ($major eq '') {
+     if ($ua =~ /[A-Za-z]+\/(\d+)\;/) {
+          $major = $1;
+          $minor = 0;
+      }
+  }
+
+  
+  # Gecko version
+  $self->{gecko_version} = undef;
+  if ($tests->{GECKO}) {
+    if( $ua =~ /\([^)]*rv:([\w\.\d]*)/ ) {
+        $self->{gecko_version} = $1;
+    }
+  }
+  
+  $self->{major} = $major;
+  $self->{minor} = $minor;
+  $self->{beta} = $beta;
+}
+    
+sub browser_string {
+    my ($self) = _self_or_default(@_);
+    my $browser_string = undef;
+    my $user_agent = $self->user_agent;
+    if (defined $user_agent) {
+        $browser_string = 'Netscape' if $self->netscape;
+        $browser_string = 'Firefox' if $self->firefox;
+        $browser_string = 'Safari' if $self->safari;
+        $browser_string = 'MSIE' if $self->ie;  
+        $browser_string = 'WebTV' if $self->webtv;
+        $browser_string = 'AOL Browser' if $self->aol;
+        $browser_string = 'Opera' if $self->opera;
+        $browser_string = 'Mosaic' if $self->mosaic;
+        $browser_string = 'Lynx' if $self->lynx;
+    }
+    return $browser_string;
+}
+    
+sub os_string {
+    my ($self) = _self_or_default(@_);
+    my $os_string = undef;
+    my $user_agent = $self->user_agent;
+    if (defined $user_agent) {
+        $os_string = 'Win95' if $self->win95;
+        $os_string = 'Win98' if $self->win98;
+        $os_string = 'WinNT' if $self->winnt;
+        $os_string = 'Win2k' if $self->win2k;
+        $os_string = 'WinXP' if $self->winxp;
+        $os_string = 'Win2k3' if $self->win2k3;
+        $os_string = 'WinVista' if $self->winvista;
+        $os_string = 'Mac' if $self->mac;
+        $os_string = 'Mac OS X' if $self->macosx;
+        $os_string = 'Win3x' if $self->win3x;
+        $os_string = 'OS2' if $self->os2;
+        $os_string = 'Unix' if $self->unix && !$self->linux;
+        $os_string = 'Linux' if $self->linux;
+    }
+    return $os_string;
+}
+
+sub gecko_version {
+  my ($self, $check) = _self_or_default(@_);
+  my $version;
+  $version = $self->{gecko_version};
+  if (defined $check) { 
+    return $check == $version;
+  } else {
+    return $version;
+  }
+}
+
+    
+sub version {
+  my ($self, $check) = _self_or_default(@_);
+  my $version;
+  $version = $self->{major} + $self->{minor};
+  if (defined $check) { 
+    return $check == $version;
+  } else {
+    return $version;
+  }
+}
+    
+sub major {
+  my ($self, $check) = _self_or_default(@_);
+  my ($version) = $self->{major};
+  if (defined $check) { 
+    return $check == $version;
+  } else {
+    return $version;
+  }
+}
+    
+sub minor {
+  my ($self, $check) = _self_or_default(@_);
+  my ($version) = $self->{minor};
+  if (defined $check) { 
+      return ($check == $self->{minor});
+  } else {
+    return $version;
+  }
+}
+    
+sub beta {
+  my ($self, $check) = _self_or_default(@_);
+  my ($version) = $self->{beta};
+  if ($check) { 
+    return $check eq $version;
+  } else {
+    return $version;
+  }
+}
+
+1;
+    
+
+__END__
+
+=head1 NAME
+
+HTTP::BrowserDetect - Determine the Web browser, version, and platform from an HTTP user agent string
+
+=head1 SYNOPSIS
+
+    use HTTP::BrowserDetect;
+
+    my $browser = new HTTP::BrowserDetect($user_agent_string);
+
+    # Detect operating system
+    if ($browser->windows) {
+      if ($browser->winnt) ...
+      if ($brorwser->win95) ...
+    }
+    print $browser->mac;
+
+    # Detect browser vendor and version
+    print $browser->netscape;
+    print $browser->ie;
+    if (browser->major(4)) {
+	if ($browser->minor() > .5) {
+	    ...
+	}
+    }
+    if ($browser->version() > 4) {
+      ...;
+    }
+    
+    # Process a different user agent string
+    $browser->user_agent($another_user_agent_string);
+
+
+
+=head1 DESCRIPTION
+
+The HTTP::BrowserDetect object does a number of tests on an HTTP user
+agent string.  The results of these tests are available via methods of
+the object.
+
+This module is based upon the JavaScript browser detection code
+available at
+B<http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html>.
+
+=head2 CREATING A NEW BROWSER DETECT OBJECT AND SETTING THE USER AGENT STRING
+
+=over 4
+
+=item new HTTP::BrowserDetect($user_agent_string)
+
+The constructor may be called with a user agent string specified.
+Otherwise, it will use the value specified by $ENV{'HTTP_USER_AGENT'},
+which is set by the web server when calling a CGI script.
+
+You may also use a non-object-oriented interface.  For each method,
+you may call HTTP::BrowserDetect::method_name().  You will then be
+working with a default HTTP::BrowserDetect object that is created
+behind the scenes.
+
+=item user_agent($user_agent_string)
+
+Returns the value of the user agent string.  When called with a
+parameter, it resets the user agent and reperforms all tests on the
+string.  This way you can process a series of user agent strings (from
+a log file, perhaps) without creating a new HTTP::BrowserDetect object
+each time.
+
+=back
+
+=head2 DETECTING BROWSER VERSION
+
+=over 4
+
+=item major($major)
+
+Returns the integer portion of the browser version.
+If passed a parameter, returns true if it equals
+the browser major version.
+
+=item minor($minor)
+
+Returns the decimal portion of the browser version as a B<floating-point number> less than 1.  
+For example, if the version is 4.05, this method returns .05; if the version is 4.5, this method returns .5.  
+B<This is a change in behavior from previous versions of this module, which returned a 
+string>.
+
+If passed a parameter, returns true if equals the minor version.  
+
+On occasion a version may have more than one decimal point, such 
+as 'Wget/1.4.5'. The minor version does not include the second decimal point, 
+or any further digits or decimals.
+
+=item version($version)
+
+Returns the version as a floating-point number.  If passed a
+parameter, returns true if it is equal to the version
+specified by the user agent string.
+
+=item beta($beta)
+
+Returns any the beta version, consisting of any non-numeric characters
+after the version number.  For instance, if the user agent string is
+'Mozilla/4.0 (compatible; MSIE 5.0b2; Windows NT)', returns 'b2'.  If
+passed a parameter, returns true if equal to the beta version.  If the beta
+starts with a dot, it is thrown away.
+
+=back
+
+=head2 DETECTING OS PLATFORM AND VERSION
+
+The following methods are available, each returning a true or false
+value.  Some methods also test for the operating system version.  
+The indentations below show the hierarchy of tests (for example, win2k 
+is considered a type of winnt, which is a type of win32)
+
+  windows 
+    win16 win3x win31  
+    win32 
+        winme win95 win98
+        winnt
+            win2k winxp win2k3 winvista
+  dotnet
+  
+  mac 
+    mac68k macppc macosx
+  
+  os2
+  
+  unix 
+    sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10 
+    aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant 
+    dec sinix freebsd bsd
+  
+  vms
+
+  amiga
+
+It may not be possibile to detect Win98 in Netscape 4.x and earlier. 
+On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all Win32, so you can't distinguish between Win95 and WinNT.
+
+=over 
+
+=item os_string()
+
+Returns one of the following strings, or undef.  This method exists solely for compatibility with the
+B<HTTP::Headers::UserAgent> module.
+
+  Win95, Win98, WinNT, Win2K, WinXP, Win2K3, WinVista, Mac, Mac OS X, Win3x, OS2, Unix, Linux
+
+=back
+
+=head2 DETECTING BROWSER VENDOR
+
+The following methods are available, each returning a true or false value.  Some methods also
+test for the browser version, saving you from checking the version separately.
+
+  netscape nav2 nav3 nav4 nav4up nav45 nav45up navgold nav6 nav6up
+  gecko 
+  mozilla
+  firefox 
+  safari
+  ie ie3 ie4 ie4up ie5 ie55 ie6
+  neoplanet neoplanet2 
+  mosaic
+  aol aol3 aol4 aol5 aol6
+  webtv
+  opera opera3 opera4 opera5 opera6 opera7
+  lynx links
+  emacs
+  staroffice
+  lotusnotes
+  icab
+  konqueror
+  java
+  curl
+
+Netscape 6, even though its called six, in the userAgent string has version number 5.  The nav6 and nav6up methods correctly handle this quirk.
+The firefox text correctly detects the older-named versions of the browser (Phoenix, Firebird)
+
+=over
+
+
+=item browser_string()
+
+Returns one of the following strings, or undef.
+
+Netscape, MSIE, WebTV, AOL Browser, Opera, Mosaic, Lynx
+
+=item gecko_version() 
+
+If a Gecko rendering engine is used (as in Mozilla or Firebird), returns the version of the renderer (e.g. 1.3a, 1.7, 1.8)
+This might be more useful than the particular browser name or version when correcting for quirks in different versions of this rendering engine.
+If no Gecko browser is being used, or the version number can't be detected, returns undef.
+
+=back
+
+
+=head2 DETECTING OTHER DEVICES
+
+The following methods are available, each returning a true or false value.
+
+  wap
+  audrey
+  iopener
+  palm
+  avantgo
+  blackberry
+
+=head2 DETECTING ROBOTS
+
+=item robot()
+
+Returns true if the user agent appears to be a robot, spider,
+crawler, or other automated Web client.
+
+The following additional methods are available, each returning a true
+or false value.  This is by no means a complete list of robots that
+exist on the Web.
+
+  wget
+  getright
+  yahoo 
+  altavista 
+  lycos 
+  infoseek 
+  lwp
+  webcrawler 
+  linkexchange 
+  slurp 
+  google
+
+=head1 AUTHOR
+
+Lee Semel, lee@semel.net
+
+Thanks to Leonardo Herrera for additional contributions
+
+=head1 SEE ALSO
+
+"The Ultimate JavaScript Client Sniffer, Version 3.0", B<http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html>.
+
+"Browser ID (User-Agent) Strings" B<http://www.zytrax.com/tech/web/browser_ids.htm>
+
+perl(1), L<HTTP::Headers>, L<HTTP::Headers::UserAgent>.
+
+=head1 COPYRIGHT
+
+Copyright 1999-2004 Lee Semel.  All rights reserved.  This program is free software;
+you can redistribute it and/or modify it under the same terms as Perl itself. 
+
+=cut
+
+
+     
+
+
+
diff -aruN 5.0.000.src/library/additions/MIME/Base64_216.pm 5.2.000.src/library/additions/MIME/Base64_216.pm
--- 5.0.000.src/library/additions/MIME/Base64_216.pm	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/additions/MIME/Base64_216.pm	2008-01-14 21:17:10.000000000 -0600
@@ -1,202 +1,202 @@
-#
-# $Id: Base64.pm,v 2.16 2001/02/24 06:28:10 gisle Exp $
-
-package MIME::Base64;
-
-=head1 NAME
-
-MIME::Base64 - Encoding and decoding of base64 strings
-
-=head1 SYNOPSIS
-
- use MIME::Base64;
-
- $encoded = encode_base64('Aladdin:open sesame');
- $decoded = decode_base64($encoded);
-
-=head1 DESCRIPTION
-
-This module provides functions to encode and decode strings into the
-Base64 encoding specified in RFC 2045 - I<MIME (Multipurpose Internet
-Mail Extensions)>. The Base64 encoding is designed to represent
-arbitrary sequences of octets in a form that need not be humanly
-readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used,
-enabling 6 bits to be represented per printable character.
-
-The following functions are provided:
-
-=over 4
-
-=item encode_base64($str, [$eol])
-
-Encode data by calling the encode_base64() function.  The first
-argument is the string to encode.  The second argument is the line
-ending sequence to use (it is optional and defaults to C<"\n">).  The
-returned encoded string is broken into lines of no more than 76
-characters each and it will end with $eol unless it is empty.  Pass an
-empty string as second argument if you do not want the encoded string
-broken into lines.
-
-=item decode_base64($str)
-
-Decode a base64 string by calling the decode_base64() function.  This
-function takes a single argument which is the string to decode and
-returns the decoded data.
-
-Any character not part of the 65-character base64 subset set is
-silently ignored.  Characters occuring after a '=' padding character
-are never decoded.
-
-If the length of the string to decode (after ignoring
-non-base64 chars) is not a multiple of 4 or padding occurs too ealy,
-then a warning is generated if perl is running under C<-w>.
-
-=back
-
-If you prefer not to import these routines into your namespace you can
-call them as:
-
-    use MIME::Base64 ();
-    $encoded = MIME::Base64::encode($decoded);
-    $decoded = MIME::Base64::decode($encoded);
-
-=head1 DIAGNOSTICS
-
-The following warnings might be generated if perl is invoked with the
-C<-w> switch:
-
-=over 4
-
-=item Premature end of base64 data
-
-The number of characters to decode is not a multiple of 4.  Legal
-base64 data should be padded with one or two "=" characters to make
-its length a multiple of 4.  The decoded result will anyway be as if
-the padding was there.
-
-=item Premature padding of base64 data
-
-The '=' padding character occurs as the first or second character
-in a base64 quartet.
-
-=back
-
-=head1 EXAMPLES
-
-If you want to encode a large file, you should encode it in chunks
-that are a multiple of 57 bytes.  This ensures that the base64 lines
-line up and that you do not end up with padding in the middle. 57
-bytes of data fills one complete base64 line (76 == 57*4/3):
-
-   use MIME::Base64 qw(encode_base64);
-
-   open(FILE, "/var/log/wtmp") or die "$!";
-   while (read(FILE, $buf, 60*57)) {
-       print encode_base64($buf);
-   }
-
-or if you know you have enough memory
-
-   use MIME::Base64 qw(encode_base64);
-   local($/) = undef;  # slurp
-   print encode_base64(<STDIN>);
-
-The same approach as a command line:
-
-   perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)' <file
-
-Decoding does not need slurp mode if all the lines contains a multiple
-of 4 base64 chars:
-
-   perl -MMIME::Base64 -ne 'print decode_base64($_)' <file
-
-=head1 COPYRIGHT
-
-Copyright 1995-1999, 2001 Gisle Aas.
-
-This library is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself.
-
-Distantly based on LWP::Base64 written by Martijn Koster
-<m.koster@nexor.co.uk> and Joerg Reichelt <j.reichelt@nexor.co.uk> and
-code posted to comp.lang.perl <3pd2lp$6gf@wsinti07.win.tue.nl> by Hans
-Mulder <hansm@wsinti07.win.tue.nl>
-
-The XS implementation use code from metamail.  Copyright 1991 Bell
-Communications Research, Inc. (Bellcore)
-
-=cut
-
-use strict;
-use vars qw(@ISA @EXPORT $VERSION $OLD_CODE);
-
-require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
-@EXPORT = qw(encode_base64 decode_base64);
-
-$VERSION = '2.12';
-
-eval { bootstrap MIME::Base64 $VERSION; };
-if ($@) {
-    # can't bootstrap XS implementation, use perl implementation
-    *encode_base64 = \&old_encode_base64;
-    *decode_base64 = \&old_decode_base64;
-
-    $OLD_CODE = $@;
-    #warn $@ if $^W;
-}
-
-# Historically this module has been implemented as pure perl code.
-# The XS implementation runs about 20 times faster, but the Perl
-# code might be more portable, so it is still here.
-
-use integer;
-
-sub old_encode_base64 ($;$)
-{
-    my $res = "";
-    my $eol = $_[1];
-    $eol = "\n" unless defined $eol;
-    pos($_[0]) = 0;                          # ensure start at the beginning
-
-    $res = join '', map( pack('u',$_)=~ /^.(\S*)/, ($_[0]=~/(.{1,45})/gs));
-
-    $res =~ tr|` -_|AA-Za-z0-9+/|;               # `# help emacs
-    # fix padding at the end
-    my $padding = (3 - length($_[0]) % 3) % 3;
-    $res =~ s/.{$padding}$/'=' x $padding/e if $padding;
-    # break encoded string into lines of no more than 76 characters each
-    if (length $eol) {
-	$res =~ s/(.{1,76})/$1$eol/g;
-    }
-    return $res;
-}
-
-
-sub old_decode_base64 ($)
-{
-    local($^W) = 0; # unpack("u",...) gives bogus warning in 5.00[123]
-
-    my $str = shift;
-    $str =~ tr|A-Za-z0-9+=/||cd;            # remove non-base64 chars
-    if (length($str) % 4) {
-	require Carp;
-	Carp::carp("Length of base64 data not a multiple of 4")
-    }
-    $str =~ s/=+$//;                        # remove padding
-    $str =~ tr|A-Za-z0-9+/| -_|;            # convert to uuencoded format
-
-    return join'', map( unpack("u", chr(32 + length($_)*3/4) . $_),
-	                $str =~ /(.{1,60})/gs);
-}
-
-# Set up aliases so that these functions also can be called as
-#
-#    MIME::Base64::encode();
-#    MIME::Base64::decode();
-
-*encode = \&encode_base64;
-*decode = \&decode_base64;
-
-1;
+#
+# $Id: Base64.pm,v 2.16 2001/02/24 06:28:10 gisle Exp $
+
+package MIME::Base64;
+
+=head1 NAME
+
+MIME::Base64 - Encoding and decoding of base64 strings
+
+=head1 SYNOPSIS
+
+ use MIME::Base64;
+
+ $encoded = encode_base64('Aladdin:open sesame');
+ $decoded = decode_base64($encoded);
+
+=head1 DESCRIPTION
+
+This module provides functions to encode and decode strings into the
+Base64 encoding specified in RFC 2045 - I<MIME (Multipurpose Internet
+Mail Extensions)>. The Base64 encoding is designed to represent
+arbitrary sequences of octets in a form that need not be humanly
+readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used,
+enabling 6 bits to be represented per printable character.
+
+The following functions are provided:
+
+=over 4
+
+=item encode_base64($str, [$eol])
+
+Encode data by calling the encode_base64() function.  The first
+argument is the string to encode.  The second argument is the line
+ending sequence to use (it is optional and defaults to C<"\n">).  The
+returned encoded string is broken into lines of no more than 76
+characters each and it will end with $eol unless it is empty.  Pass an
+empty string as second argument if you do not want the encoded string
+broken into lines.
+
+=item decode_base64($str)
+
+Decode a base64 string by calling the decode_base64() function.  This
+function takes a single argument which is the string to decode and
+returns the decoded data.
+
+Any character not part of the 65-character base64 subset set is
+silently ignored.  Characters occuring after a '=' padding character
+are never decoded.
+
+If the length of the string to decode (after ignoring
+non-base64 chars) is not a multiple of 4 or padding occurs too ealy,
+then a warning is generated if perl is running under C<-w>.
+
+=back
+
+If you prefer not to import these routines into your namespace you can
+call them as:
+
+    use MIME::Base64 ();
+    $encoded = MIME::Base64::encode($decoded);
+    $decoded = MIME::Base64::decode($encoded);
+
+=head1 DIAGNOSTICS
+
+The following warnings might be generated if perl is invoked with the
+C<-w> switch:
+
+=over 4
+
+=item Premature end of base64 data
+
+The number of characters to decode is not a multiple of 4.  Legal
+base64 data should be padded with one or two "=" characters to make
+its length a multiple of 4.  The decoded result will anyway be as if
+the padding was there.
+
+=item Premature padding of base64 data
+
+The '=' padding character occurs as the first or second character
+in a base64 quartet.
+
+=back
+
+=head1 EXAMPLES
+
+If you want to encode a large file, you should encode it in chunks
+that are a multiple of 57 bytes.  This ensures that the base64 lines
+line up and that you do not end up with padding in the middle. 57
+bytes of data fills one complete base64 line (76 == 57*4/3):
+
+   use MIME::Base64 qw(encode_base64);
+
+   open(FILE, "/var/log/wtmp") or die "$!";
+   while (read(FILE, $buf, 60*57)) {
+       print encode_base64($buf);
+   }
+
+or if you know you have enough memory
+
+   use MIME::Base64 qw(encode_base64);
+   local($/) = undef;  # slurp
+   print encode_base64(<STDIN>);
+
+The same approach as a command line:
+
+   perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)' <file
+
+Decoding does not need slurp mode if all the lines contains a multiple
+of 4 base64 chars:
+
+   perl -MMIME::Base64 -ne 'print decode_base64($_)' <file
+
+=head1 COPYRIGHT
+
+Copyright 1995-1999, 2001 Gisle Aas.
+
+This library is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+Distantly based on LWP::Base64 written by Martijn Koster
+<m.koster@nexor.co.uk> and Joerg Reichelt <j.reichelt@nexor.co.uk> and
+code posted to comp.lang.perl <3pd2lp$6gf@wsinti07.win.tue.nl> by Hans
+Mulder <hansm@wsinti07.win.tue.nl>
+
+The XS implementation use code from metamail.  Copyright 1991 Bell
+Communications Research, Inc. (Bellcore)
+
+=cut
+
+use strict;
+use vars qw(@ISA @EXPORT $VERSION $OLD_CODE);
+
+require Exporter;
+require DynaLoader;
+@ISA = qw(Exporter DynaLoader);
+@EXPORT = qw(encode_base64 decode_base64);
+
+$VERSION = '2.12';
+
+eval { bootstrap MIME::Base64 $VERSION; };
+if ($@) {
+    # can't bootstrap XS implementation, use perl implementation
+    *encode_base64 = \&old_encode_base64;
+    *decode_base64 = \&old_decode_base64;
+
+    $OLD_CODE = $@;
+    #warn $@ if $^W;
+}
+
+# Historically this module has been implemented as pure perl code.
+# The XS implementation runs about 20 times faster, but the Perl
+# code might be more portable, so it is still here.
+
+use integer;
+
+sub old_encode_base64 ($;$)
+{
+    my $res = "";
+    my $eol = $_[1];
+    $eol = "\n" unless defined $eol;
+    pos($_[0]) = 0;                          # ensure start at the beginning
+
+    $res = join '', map( pack('u',$_)=~ /^.(\S*)/, ($_[0]=~/(.{1,45})/gs));
+
+    $res =~ tr|` -_|AA-Za-z0-9+/|;               # `# help emacs
+    # fix padding at the end
+    my $padding = (3 - length($_[0]) % 3) % 3;
+    $res =~ s/.{$padding}$/'=' x $padding/e if $padding;
+    # break encoded string into lines of no more than 76 characters each
+    if (length $eol) {
+	$res =~ s/(.{1,76})/$1$eol/g;
+    }
+    return $res;
+}
+
+
+sub old_decode_base64 ($)
+{
+    local($^W) = 0; # unpack("u",...) gives bogus warning in 5.00[123]
+
+    my $str = shift;
+    $str =~ tr|A-Za-z0-9+=/||cd;            # remove non-base64 chars
+    if (length($str) % 4) {
+	require Carp;
+	Carp::carp("Length of base64 data not a multiple of 4")
+    }
+    $str =~ s/=+$//;                        # remove padding
+    $str =~ tr|A-Za-z0-9+/| -_|;            # convert to uuencoded format
+
+    return join'', map( unpack("u", chr(32 + length($_)*3/4) . $_),
+	                $str =~ /(.{1,60})/gs);
+}
+
+# Set up aliases so that these functions also can be called as
+#
+#    MIME::Base64::encode();
+#    MIME::Base64::decode();
+
+*encode = \&encode_base64;
+*decode = \&decode_base64;
+
+1;
diff -aruN 5.0.000.src/library/additions/MIME/Base64_305.pm 5.2.000.src/library/additions/MIME/Base64_305.pm
--- 5.0.000.src/library/additions/MIME/Base64_305.pm	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/MIME/Base64_305.pm	2008-01-14 21:17:11.000000000 -0600
@@ -0,0 +1,152 @@
+package MIME::Base64;
+
+# $Id: Base64.pm,v 3.5 2004/09/20 09:23:23 gisle Exp $
+
+use strict;
+use vars qw(@ISA @EXPORT $VERSION);
+
+require Exporter;
+require DynaLoader;
+@ISA = qw(Exporter DynaLoader);
+@EXPORT = qw(encode_base64 decode_base64);
+
+$VERSION = '3.05';
+
+MIME::Base64->bootstrap($VERSION);
+
+*encode = \&encode_base64;
+*decode = \&decode_base64;
+
+1;
+
+__END__
+
+=head1 NAME
+
+MIME::Base64 - Encoding and decoding of base64 strings
+
+=head1 SYNOPSIS
+
+ use MIME::Base64;
+
+ $encoded = encode_base64('Aladdin:open sesame');
+ $decoded = decode_base64($encoded);
+
+=head1 DESCRIPTION
+
+This module provides functions to encode and decode strings into and from the
+base64 encoding specified in RFC 2045 - I<MIME (Multipurpose Internet
+Mail Extensions)>. The base64 encoding is designed to represent
+arbitrary sequences of octets in a form that need not be humanly
+readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used,
+enabling 6 bits to be represented per printable character.
+
+The following functions are provided:
+
+=over 4
+
+=item encode_base64($str)
+
+=item encode_base64($str, $eol);
+
+Encode data by calling the encode_base64() function.  The first
+argument is the string to encode.  The second argument is the
+line-ending sequence to use.  It is optional and defaults to "\n".  The
+returned encoded string is broken into lines of no more than 76
+characters each and it will end with $eol unless it is empty.  Pass an
+empty string as second argument if you do not want the encoded string
+to be broken into lines.
+
+=item decode_base64($str)
+
+Decode a base64 string by calling the decode_base64() function.  This
+function takes a single argument which is the string to decode and
+returns the decoded data.
+
+Any character not part of the 65-character base64 subset is
+silently ignored.  Characters occurring after a '=' padding character
+are never decoded.
+
+If the length of the string to decode, after ignoring
+non-base64 chars, is not a multiple of 4 or if padding occurs too early,
+then a warning is generated if perl is running under C<-w>.
+
+=back
+
+If you prefer not to import these routines into your namespace, you can
+call them as:
+
+    use MIME::Base64 ();
+    $encoded = MIME::Base64::encode($decoded);
+    $decoded = MIME::Base64::decode($encoded);
+
+=head1 DIAGNOSTICS
+
+The following warnings can be generated if perl is invoked with the
+C<-w> switch:
+
+=over 4
+
+=item Premature end of base64 data
+
+The number of characters to decode is not a multiple of 4.  Legal
+base64 data should be padded with one or two "=" characters to make
+its length a multiple of 4.  The decoded result will anyway be as if
+the padding was there.
+
+=item Premature padding of base64 data
+
+The '=' padding character occurs as the first or second character
+in a base64 quartet.
+
+=back
+
+=head1 EXAMPLES
+
+If you want to encode a large file, you should encode it in chunks
+that are a multiple of 57 bytes.  This ensures that the base64 lines
+line up and that you do not end up with padding in the middle. 57
+bytes of data fills one complete base64 line (76 == 57*4/3):
+
+   use MIME::Base64 qw(encode_base64);
+
+   open(FILE, "/var/log/wtmp") or die "$!";
+   while (read(FILE, $buf, 60*57)) {
+       print encode_base64($buf);
+   }
+
+or if you know you have enough memory
+
+   use MIME::Base64 qw(encode_base64);
+   local($/) = undef;  # slurp
+   print encode_base64(<STDIN>);
+
+The same approach as a command line:
+
+   perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)' <file
+
+Decoding does not need slurp mode if every line contains a multiple
+of four base64 chars:
+
+   perl -MMIME::Base64 -ne 'print decode_base64($_)' <file
+
+=head1 COPYRIGHT
+
+Copyright 1995-1999, 2001-2004 Gisle Aas.
+
+This library is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+Distantly based on LWP::Base64 written by Martijn Koster
+<m.koster@nexor.co.uk> and Joerg Reichelt <j.reichelt@nexor.co.uk> and
+code posted to comp.lang.perl <3pd2lp$6gf@wsinti07.win.tue.nl> by Hans
+Mulder <hansm@wsinti07.win.tue.nl>
+
+The XS implementation uses code from metamail.  Copyright 1991 Bell
+Communications Research, Inc. (Bellcore)
+
+=head1 SEE ALSO
+
+L<MIME::QuotedPrint>
+
+=cut
diff -aruN 5.0.000.src/library/additions/MIME/Base64_311.pm 5.2.000.src/library/additions/MIME/Base64_311.pm
--- 5.0.000.src/library/additions/MIME/Base64_311.pm	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/MIME/Base64_311.pm	2008-01-14 21:17:11.000000000 -0600
@@ -0,0 +1,177 @@
+package MIME::Base64;
+
+# $Id: Base64.pm,v 3.11 2005/11/29 20:59:55 gisle Exp $
+
+use strict;
+use vars qw(@ISA @EXPORT $VERSION);
+
+require Exporter;
+@ISA = qw(Exporter);
+@EXPORT = qw(encode_base64 decode_base64);
+
+$VERSION = '3.07';
+
+require XSLoader;
+XSLoader::load('MIME::Base64', $VERSION);
+
+*encode = \&encode_base64;
+*decode = \&decode_base64;
+
+1;
+
+__END__
+
+=head1 NAME
+
+MIME::Base64 - Encoding and decoding of base64 strings
+
+=head1 SYNOPSIS
+
+ use MIME::Base64;
+
+ $encoded = encode_base64('Aladdin:open sesame');
+ $decoded = decode_base64($encoded);
+
+=head1 DESCRIPTION
+
+This module provides functions to encode and decode strings into and from the
+base64 encoding specified in RFC 2045 - I<MIME (Multipurpose Internet
+Mail Extensions)>. The base64 encoding is designed to represent
+arbitrary sequences of octets in a form that need not be humanly
+readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used,
+enabling 6 bits to be represented per printable character.
+
+The following functions are provided:
+
+=over 4
+
+=item encode_base64($str)
+
+=item encode_base64($str, $eol);
+
+Encode data by calling the encode_base64() function.  The first
+argument is the string to encode.  The second argument is the
+line-ending sequence to use.  It is optional and defaults to "\n".  The
+returned encoded string is broken into lines of no more than 76
+characters each and it will end with $eol unless it is empty.  Pass an
+empty string as second argument if you do not want the encoded string
+to be broken into lines.
+
+=item decode_base64($str)
+
+Decode a base64 string by calling the decode_base64() function.  This
+function takes a single argument which is the string to decode and
+returns the decoded data.
+
+Any character not part of the 65-character base64 subset is
+silently ignored.  Characters occurring after a '=' padding character
+are never decoded.
+
+If the length of the string to decode, after ignoring
+non-base64 chars, is not a multiple of 4 or if padding occurs too early,
+then a warning is generated if perl is running under C<-w>.
+
+=back
+
+If you prefer not to import these routines into your namespace, you can
+call them as:
+
+    use MIME::Base64 ();
+    $encoded = MIME::Base64::encode($decoded);
+    $decoded = MIME::Base64::decode($encoded);
+
+=head1 DIAGNOSTICS
+
+The following warnings can be generated if perl is invoked with the
+C<-w> switch:
+
+=over 4
+
+=item Premature end of base64 data
+
+The number of characters to decode is not a multiple of 4.  Legal
+base64 data should be padded with one or two "=" characters to make
+its length a multiple of 4.  The decoded result will be the same
+whether the padding is present or not.
+
+=item Premature padding of base64 data
+
+The '=' padding character occurs as the first or second character
+in a base64 quartet.
+
+=back
+
+The following exception can be raised:
+
+=over 4
+
+=item Wide character in subroutine entry
+
+The string passed to encode_base64() contains characters with code
+above 255.  The base64 encoding is only defined for single-byte
+characters.  Use the Encode module to select the byte encoding you
+want.
+
+=back
+
+=head1 EXAMPLES
+
+If you want to encode a large file, you should encode it in chunks
+that are a multiple of 57 bytes.  This ensures that the base64 lines
+line up and that you do not end up with padding in the middle. 57
+bytes of data fills one complete base64 line (76 == 57*4/3):
+
+   use MIME::Base64 qw(encode_base64);
+
+   open(FILE, "/var/log/wtmp") or die "$!";
+   while (read(FILE, $buf, 60*57)) {
+       print encode_base64($buf);
+   }
+
+or if you know you have enough memory
+
+   use MIME::Base64 qw(encode_base64);
+   local($/) = undef;  # slurp
+   print encode_base64(<STDIN>);
+
+The same approach as a command line:
+
+   perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)' <file
+
+Decoding does not need slurp mode if every line contains a multiple
+of four base64 chars:
+
+   perl -MMIME::Base64 -ne 'print decode_base64($_)' <file
+
+Perl v5.8 and better allow extended Unicode characters in strings.
+Such strings cannot be encoded directly, as the base64
+encoding is only defined for single-byte characters.  The solution is
+to use the Encode module to select the byte encoding you want.  For
+example:
+
+    use MIME::Base64 qw(encode_base64);
+    use Encode qw(encode);
+
+    $encoded = encode_base64(encode("UTF-8", "\x{FFFF}\n"));
+    print $encoded;
+
+=head1 COPYRIGHT
+
+Copyright 1995-1999, 2001-2004 Gisle Aas.
+
+This library is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+Distantly based on LWP::Base64 written by Martijn Koster
+<m.koster@nexor.co.uk> and Joerg Reichelt <j.reichelt@nexor.co.uk> and
+code posted to comp.lang.perl <3pd2lp$6gf@wsinti07.win.tue.nl> by Hans
+Mulder <hansm@wsinti07.win.tue.nl>
+
+The XS implementation uses code from metamail.  Copyright 1991 Bell
+Communications Research, Inc. (Bellcore)
+
+=head1 SEE ALSO
+
+L<MIME::QuotedPrint>
+
+=cut
diff -aruN 5.0.000.src/library/additions/MIME/Base64.pm 5.2.000.src/library/additions/MIME/Base64.pm
--- 5.0.000.src/library/additions/MIME/Base64.pm	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/additions/MIME/Base64.pm	1969-12-31 18:00:00.000000000 -0600
@@ -1,152 +0,0 @@
-package MIME::Base64;
-
-# $Id: Base64.pm,v 3.5 2004/09/20 09:23:23 gisle Exp $
-
-use strict;
-use vars qw(@ISA @EXPORT $VERSION);
-
-require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
-@EXPORT = qw(encode_base64 decode_base64);
-
-$VERSION = '3.05';
-
-MIME::Base64->bootstrap($VERSION);
-
-*encode = \&encode_base64;
-*decode = \&decode_base64;
-
-1;
-
-__END__
-
-=head1 NAME
-
-MIME::Base64 - Encoding and decoding of base64 strings
-
-=head1 SYNOPSIS
-
- use MIME::Base64;
-
- $encoded = encode_base64('Aladdin:open sesame');
- $decoded = decode_base64($encoded);
-
-=head1 DESCRIPTION
-
-This module provides functions to encode and decode strings into and from the
-base64 encoding specified in RFC 2045 - I<MIME (Multipurpose Internet
-Mail Extensions)>. The base64 encoding is designed to represent
-arbitrary sequences of octets in a form that need not be humanly
-readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used,
-enabling 6 bits to be represented per printable character.
-
-The following functions are provided:
-
-=over 4
-
-=item encode_base64($str)
-
-=item encode_base64($str, $eol);
-
-Encode data by calling the encode_base64() function.  The first
-argument is the string to encode.  The second argument is the
-line-ending sequence to use.  It is optional and defaults to "\n".  The
-returned encoded string is broken into lines of no more than 76
-characters each and it will end with $eol unless it is empty.  Pass an
-empty string as second argument if you do not want the encoded string
-to be broken into lines.
-
-=item decode_base64($str)
-
-Decode a base64 string by calling the decode_base64() function.  This
-function takes a single argument which is the string to decode and
-returns the decoded data.
-
-Any character not part of the 65-character base64 subset is
-silently ignored.  Characters occurring after a '=' padding character
-are never decoded.
-
-If the length of the string to decode, after ignoring
-non-base64 chars, is not a multiple of 4 or if padding occurs too early,
-then a warning is generated if perl is running under C<-w>.
-
-=back
-
-If you prefer not to import these routines into your namespace, you can
-call them as:
-
-    use MIME::Base64 ();
-    $encoded = MIME::Base64::encode($decoded);
-    $decoded = MIME::Base64::decode($encoded);
-
-=head1 DIAGNOSTICS
-
-The following warnings can be generated if perl is invoked with the
-C<-w> switch:
-
-=over 4
-
-=item Premature end of base64 data
-
-The number of characters to decode is not a multiple of 4.  Legal
-base64 data should be padded with one or two "=" characters to make
-its length a multiple of 4.  The decoded result will anyway be as if
-the padding was there.
-
-=item Premature padding of base64 data
-
-The '=' padding character occurs as the first or second character
-in a base64 quartet.
-
-=back
-
-=head1 EXAMPLES
-
-If you want to encode a large file, you should encode it in chunks
-that are a multiple of 57 bytes.  This ensures that the base64 lines
-line up and that you do not end up with padding in the middle. 57
-bytes of data fills one complete base64 line (76 == 57*4/3):
-
-   use MIME::Base64 qw(encode_base64);
-
-   open(FILE, "/var/log/wtmp") or die "$!";
-   while (read(FILE, $buf, 60*57)) {
-       print encode_base64($buf);
-   }
-
-or if you know you have enough memory
-
-   use MIME::Base64 qw(encode_base64);
-   local($/) = undef;  # slurp
-   print encode_base64(<STDIN>);
-
-The same approach as a command line:
-
-   perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)' <file
-
-Decoding does not need slurp mode if every line contains a multiple
-of four base64 chars:
-
-   perl -MMIME::Base64 -ne 'print decode_base64($_)' <file
-
-=head1 COPYRIGHT
-
-Copyright 1995-1999, 2001-2004 Gisle Aas.
-
-This library is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself.
-
-Distantly based on LWP::Base64 written by Martijn Koster
-<m.koster@nexor.co.uk> and Joerg Reichelt <j.reichelt@nexor.co.uk> and
-code posted to comp.lang.perl <3pd2lp$6gf@wsinti07.win.tue.nl> by Hans
-Mulder <hansm@wsinti07.win.tue.nl>
-
-The XS implementation uses code from metamail.  Copyright 1991 Bell
-Communications Research, Inc. (Bellcore)
-
-=head1 SEE ALSO
-
-L<MIME::QuotedPrint>
-
-=cut
diff -aruN 5.0.000.src/library/additions/MIME/Base64.xs 5.2.000.src/library/additions/MIME/Base64.xs
--- 5.0.000.src/library/additions/MIME/Base64.xs	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/MIME/Base64.xs	2008-01-14 21:17:10.000000000 -0600
@@ -0,0 +1,453 @@
+/* $Id: Base64.xs,v 3.5 2005/11/26 10:44:14 gisle Exp $
+
+Copyright 1997-2004 Gisle Aas
+
+This library is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+
+The tables and some of the code that used to be here was borrowed from
+metamail, which comes with this message:
+
+  Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
+
+  Permission to use, copy, modify, and distribute this material
+  for any purpose and without fee is hereby granted, provided
+  that the above copyright notice and this permission notice
+  appear in all copies, and that the name of Bellcore not be
+  used in advertising or publicity pertaining to this
+  material without the specific, prior written permission
+  of an authorized representative of Bellcore.	BELLCORE
+  MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY
+  OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS",
+  WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
+
+*/
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define PERL_NO_GET_CONTEXT     /* we want efficiency */
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#ifdef __cplusplus
+}
+#endif
+
+#ifndef PATCHLEVEL
+#    include <patchlevel.h>
+#    if !(defined(PERL_VERSION) || (SUBVERSION > 0 && defined(PATCHLEVEL)))
+#        include <could_not_find_Perl_patchlevel.h>
+#    endif
+#endif
+
+#if PATCHLEVEL <= 4 && !defined(PL_dowarn)
+   #define PL_dowarn dowarn
+#endif
+
+#ifdef G_WARN_ON
+   #define DOWARN (PL_dowarn & G_WARN_ON)
+#else
+   #define DOWARN PL_dowarn
+#endif
+
+
+#define MAX_LINE  76 /* size of encoded lines */
+
+static const char basis_64[] =
+   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+#define XX      255	/* illegal base64 char */
+#define EQ      254	/* padding */
+#define INVALID XX
+
+static const unsigned char index_64[256] = {
+    XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX,
+    XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX,
+    XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,62, XX,XX,XX,63,
+    52,53,54,55, 56,57,58,59, 60,61,XX,XX, XX,EQ,XX,XX,
+    XX, 0, 1, 2,  3, 4, 5, 6,  7, 8, 9,10, 11,12,13,14,
+    15,16,17,18, 19,20,21,22, 23,24,25,XX, XX,XX,XX,XX,
+    XX,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
+    41,42,43,44, 45,46,47,48, 49,50,51,XX, XX,XX,XX,XX,
+
+    XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX,
+    XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX,
+    XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX,
+    XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX,
+    XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX,
+    XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX,
+    XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX,
+    XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX,
+};
+
+#ifdef SvPVbyte
+#   if PERL_REVISION == 5 && PERL_VERSION < 7
+       /* SvPVbyte does not work in perl-5.6.1, borrowed version for 5.7.3 */
+#       undef SvPVbyte
+#       define SvPVbyte(sv, lp) \
+          ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
+           ? ((lp = SvCUR(sv)), SvPVX(sv)) : my_sv_2pvbyte(aTHX_ sv, &lp))
+       static char *
+       my_sv_2pvbyte(pTHX_ register SV *sv, STRLEN *lp)
+       {   
+           sv_utf8_downgrade(sv,0);
+           return SvPV(sv,*lp);
+       }
+#   endif
+#else
+#   define SvPVbyte SvPV
+#endif
+
+#ifndef isXDIGIT
+#   define isXDIGIT isxdigit
+#endif
+
+#ifndef NATIVE_TO_ASCII
+#   define NATIVE_TO_ASCII(ch) (ch)
+#endif
+
+MODULE = MIME::Base64		PACKAGE = MIME::Base64
+
+SV*
+encode_base64(sv,...)
+	SV* sv
+	PROTOTYPE: $;$
+
+	PREINIT:
+	char *str;     /* string to encode */
+	SSize_t len;   /* length of the string */
+	char *eol;     /* the end-of-line sequence to use */
+	STRLEN eollen; /* length of the EOL sequence */
+	char *r;       /* result string */
+	STRLEN rlen;   /* length of result string */
+	unsigned char c1, c2, c3;
+	int chunk;
+
+	CODE:
+#if PERL_REVISION == 5 && PERL_VERSION >= 6
+	sv_utf8_downgrade(sv, FALSE);
+#endif
+	str = SvPV(sv, rlen); /* SvPV(sv, len) gives warning for signed len */
+	len = (SSize_t)rlen;
+
+	/* set up EOL from the second argument if present, default to "\n" */
+	if (items > 1 && SvOK(ST(1))) {
+	    eol = SvPV(ST(1), eollen);
+	} else {
+	    eol = "\n";
+	    eollen = 1;
+	}
+
+	/* calculate the length of the result */
+	rlen = (len+2) / 3 * 4;	 /* encoded bytes */
+	if (rlen) {
+	    /* add space for EOL */
+	    rlen += ((rlen-1) / MAX_LINE + 1) * eollen;
+	}
+
+	/* allocate a result buffer */
+	RETVAL = newSV(rlen ? rlen : 1);
+	SvPOK_on(RETVAL);	
+	SvCUR_set(RETVAL, rlen);
+	r = SvPVX(RETVAL);
+
+	/* encode */
+	for (chunk=0; len > 0; len -= 3, chunk++) {
+	    if (chunk == (MAX_LINE/4)) {
+		char *c = eol;
+		char *e = eol + eollen;
+		while (c < e)
+		    *r++ = *c++;
+		chunk = 0;
+	    }
+	    c1 = *str++;
+	    c2 = len > 1 ? *str++ : '\0';
+	    *r++ = basis_64[c1>>2];
+	    *r++ = basis_64[((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)];
+	    if (len > 2) {
+		c3 = *str++;
+		*r++ = basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)];
+		*r++ = basis_64[c3 & 0x3F];
+	    } else if (len == 2) {
+		*r++ = basis_64[(c2 & 0xF) << 2];
+		*r++ = '=';
+	    } else { /* len == 1 */
+		*r++ = '=';
+		*r++ = '=';
+	    }
+	}
+	if (rlen) {
+	    /* append eol to the result string */
+	    char *c = eol;
+	    char *e = eol + eollen;
+	    while (c < e)
+		*r++ = *c++;
+	}
+	*r = '\0';  /* every SV in perl should be NUL-terminated */
+
+	OUTPUT:
+	RETVAL
+
+SV*
+decode_base64(sv)
+	SV* sv
+	PROTOTYPE: $
+
+	PREINIT:
+	STRLEN len;
+	register unsigned char *str = (unsigned char*)SvPVbyte(sv, len);
+	unsigned char const* end = str + len;
+	char *r;
+	unsigned char c[4];
+
+	CODE:
+	{
+	    /* always enough, but might be too much */
+	    STRLEN rlen = len * 3 / 4;
+	    RETVAL = newSV(rlen ? rlen : 1);
+	}
+        SvPOK_on(RETVAL);
+        r = SvPVX(RETVAL);
+
+	while (str < end) {
+	    int i = 0;
+            do {
+		unsigned char uc = index_64[NATIVE_TO_ASCII(*str++)];
+		if (uc != INVALID)
+		    c[i++] = uc;
+
+		if (str == end) {
+		    if (i < 4) {
+			if (i && DOWARN)
+			    warn("Premature end of base64 data");
+			if (i < 2) goto thats_it;
+			if (i == 2) c[2] = EQ;
+			c[3] = EQ;
+		    }
+		    break;
+		}
+            } while (i < 4);
+	
+	    if (c[0] == EQ || c[1] == EQ) {
+		if (DOWARN) warn("Premature padding of base64 data");
+		break;
+            }
+	    /* printf("c0=%d,c1=%d,c2=%d,c3=%d\n", c[0],c[1],c[2],c[3]);*/
+
+	    *r++ = (c[0] << 2) | ((c[1] & 0x30) >> 4);
+
+	    if (c[2] == EQ)
+		break;
+	    *r++ = ((c[1] & 0x0F) << 4) | ((c[2] & 0x3C) >> 2);
+
+	    if (c[3] == EQ)
+		break;
+	    *r++ = ((c[2] & 0x03) << 6) | c[3];
+	}
+
+      thats_it:
+	SvCUR_set(RETVAL, r - SvPVX(RETVAL));
+	*r = '\0';
+
+	OUTPUT:
+	RETVAL
+
+
+MODULE = MIME::Base64		PACKAGE = MIME::QuotedPrint
+
+#define qp_isplain(c) ((c) == '\t' || (((c) >= ' ' && (c) <= '~') && (c) != '='))
+
+SV*
+encode_qp(sv,...)
+	SV* sv
+	PROTOTYPE: $;$$
+
+	PREINIT:
+	char *eol;
+	STRLEN eol_len;
+	int binary;
+	STRLEN sv_len;
+	STRLEN linelen;
+	char *beg;
+	char *end;
+	char *p;
+	char *p_beg;
+	STRLEN p_len;
+
+	CODE:
+#if PERL_REVISION == 5 && PERL_VERSION >= 6
+	sv_utf8_downgrade(sv, FALSE);
+#endif
+	/* set up EOL from the second argument if present, default to "\n" */
+	if (items > 1 && SvOK(ST(1))) {
+	    eol = SvPV(ST(1), eol_len);
+	} else {
+	    eol = "\n";
+	    eol_len = 1;
+	}
+
+	binary = (items > 2 && SvTRUE(ST(2)));
+
+	beg = SvPV(sv, sv_len);
+	end = beg + sv_len;
+
+	RETVAL = newSV(sv_len + 1);
+	sv_setpv(RETVAL, "");
+	linelen = 0;
+
+	p = beg;
+	while (1) {
+	    p_beg = p;
+
+	    /* skip past as much plain text as possible */
+	    while (p < end && qp_isplain(*p)) {
+	        p++;
+	    }
+	    if (p == end || *p == '\n') {
+		/* whitespace at end of line must be encoded */
+		while (p > p_beg && (*(p - 1) == '\t' || *(p - 1) == ' '))
+		    p--;
+	    }
+
+	    p_len = p - p_beg;
+	    if (p_len) {
+	        /* output plain text (with line breaks) */
+	        if (eol_len) {
+		    STRLEN max_last_line = (p == end || *p == '\n')
+					      ? MAX_LINE         /* .......\n */
+					      : ((p + 1) == end || *(p + 1) == '\n')
+	                                        ? MAX_LINE - 3   /* ....=XX\n */
+	                                        : MAX_LINE - 4;  /* ...=XX=\n */
+		    while (p_len + linelen > max_last_line) {
+			STRLEN len = MAX_LINE - 1 - linelen;
+			if (len > p_len)
+			    len = p_len;
+			sv_catpvn(RETVAL, p_beg, len);
+			p_beg += len;
+			p_len -= len;
+			sv_catpvn(RETVAL, "=", 1);
+			sv_catpvn(RETVAL, eol, eol_len);
+		        linelen = 0;
+		    }
+                }
+		if (p_len) {
+	            sv_catpvn(RETVAL, p_beg, p_len);
+	            linelen += p_len;
+		}
+	    }
+
+	    if (p == end) {
+		break;
+            }
+	    else if (*p == '\n' && eol_len && !binary) {
+	        sv_catpvn(RETVAL, eol, eol_len);
+	        p++;
+		linelen = 0;
+	    }
+	    else {
+		/* output escaped char (with line breaks) */
+	        assert(p < end);
+		if (eol_len && linelen > MAX_LINE - 4) {
+		    sv_catpvn(RETVAL, "=", 1);
+		    sv_catpvn(RETVAL, eol, eol_len);
+		    linelen = 0;
+		}
+	        sv_catpvf(RETVAL, "=%02X", (unsigned char)*p);
+	        p++;
+	        linelen += 3;
+	    }
+
+	    /* optimize reallocs a bit */
+	    if (SvLEN(RETVAL) > 80 && SvLEN(RETVAL) - SvCUR(RETVAL) < 3) {
+		STRLEN expected_len = (SvCUR(RETVAL) * sv_len) / (p - beg);
+     		SvGROW(RETVAL, expected_len);
+	    }
+        }
+
+	if (SvCUR(RETVAL) && eol_len && linelen) {
+	    sv_catpvn(RETVAL, "=", 1);
+	    sv_catpvn(RETVAL, eol, eol_len);
+	}
+
+	OUTPUT:
+	RETVAL
+
+SV*
+decode_qp(sv)
+	SV* sv
+	PROTOTYPE: $
+
+        PREINIT:
+	STRLEN len;
+	char *str = SvPVbyte(sv, len);
+	char const* end = str + len;
+	char *r;
+	char *whitespace = 0;
+
+        CODE:
+	RETVAL = newSV(len ? len : 1);
+        SvPOK_on(RETVAL);
+        r = SvPVX(RETVAL);
+	while (str < end) {
+	    if (*str == ' ' || *str == '\t') {
+		if (!whitespace)
+		    whitespace = str;
+		str++;
+	    }
+	    else if (*str == '\r' && (str + 1) < end && str[1] == '\n') {
+		str++;
+	    }
+	    else if (*str == '\n') {
+		whitespace = 0;
+		*r++ = *str++;
+	    }
+	    else {
+		if (whitespace) {
+		    while (whitespace < str) {
+			*r++ = *whitespace++;
+		    }
+		    whitespace = 0;
+                }
+            	if (*str == '=') {
+		    if ((str + 2) < end && isXDIGIT(str[1]) && isXDIGIT(str[2])) {
+	                char buf[3];
+                        str++;
+	                buf[0] = *str++;
+		        buf[1] = *str++;
+	                buf[2] = '\0';
+		        *r++ = (char)strtol(buf, 0, 16);
+	            }
+		    else {
+		        /* look for soft line break */
+		        char *p = str + 1;
+		        while (p < end && (*p == ' ' || *p == '\t'))
+		            p++;
+		        if (p < end && *p == '\n')
+		     	    str = p + 1;
+		        else if ((p + 1) < end && *p == '\r' && *(p + 1) == '\n')
+		            str = p + 2;
+		        else
+		            *r++ = *str++; /* give up */
+		    }
+		}
+		else {
+		    *r++ = *str++;
+		}
+	    }
+	}
+	if (whitespace) {
+	    while (whitespace < str) {
+		*r++ = *whitespace++;
+	    }
+        }
+	*r = '\0';
+	SvCUR_set(RETVAL, r - SvPVX(RETVAL));
+
+        OUTPUT:
+	RETVAL
+
+
+MODULE = MIME::Base64		PACKAGE = MIME::Base64
diff -aruN 5.0.000.src/library/additions/MIME/Changes 5.2.000.src/library/additions/MIME/Changes
--- 5.0.000.src/library/additions/MIME/Changes	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/MIME/Changes	2008-01-14 21:17:11.000000000 -0600
@@ -0,0 +1,368 @@
+2005-11-30   Gisle Aas <gisle@ActiveState.com>
+
+   Release 3.07
+
+   Use a Makefile.PL that is also suitable for core perl.
+
+
+
+2005-11-26   Gisle Aas <gisle@ActiveState.com>
+
+   Release 3.06
+
+   Documentation tweaks.
+
+   use XSLoader; perl-5.6 now required.
+
+   Some consting from bleadperl.
+
+   Unbundled the {en,de}code-{base64,qp} utility scripts.
+   These are now found in the MIME-Base64-Scripts package.
+
+
+
+2004-09-20   Gisle Aas <gisle@ActiveState.com>
+
+   Release 3.05
+
+   Steve Hay <steve.hay@uk.radan.com> found the warn test broken
+   on Windows and provided a fix.
+
+
+
+2004-09-18   Gisle Aas <gisle@ActiveState.com>
+
+   Release 3.04
+   
+   Fixed the bad-sv.t test script to actually contain the
+   correct expected result as of v3.02.
+
+
+
+2004-08-25   Gisle Aas <gisle@ActiveState.com>
+
+   Release 3.03
+
+   Forgot to increment version number in MIME::QuotedPrint even
+   if its interface changed in 3.02.  As a result you will now
+   need to require MIME::QuotedPrint 3.03 if you want to ensure
+   it provides the binmode interface.
+
+
+
+2004-08-24   Gisle Aas <gisle@ActiveState.com>
+
+   Release 3.02
+
+   The encode_qp() function now takes an optional third argument
+   to select binary encoding mode.
+   <https://rt.cpan.org/Ticket/Display.html?id=7456>
+
+   The result of encode_qp($non_empty, $eol) will now always be
+   $eol terminated.  If the string to encode does not end with "\n"
+   then a soft line break is appended to the result.  As an example
+   encode_qp("foo") used to be encoded as "foo", but now encodes as
+   "foo=\n".
+
+
+
+2004-03-29   Gisle Aas <gisle@ActiveState.com>
+
+   Release 3.01
+
+   By compiling the extension with PERL_NO_GET_CONTEXT we can
+   make it slightly faster on a threaded perl.  No change on a
+   regular perl.  Patch provided by Beau E. Cox <beau@beaucox.com>.
+
+   Fixed missing ";" with assert.   Patch provided by
+   Brendan O'Dea <bod@debian.org>.
+
+
+
+2004-01-14   Gisle Aas <gisle@ActiveState.com>
+
+   Release 3.00
+
+   Drop the pure Perl implementations of the encoders and
+   decoders.  They are bloat that hides real problems in
+   the XS implementations.  I will re-release them separately
+   in the new MIME-Base64-Perl distribution.
+
+   The 'gcc -Wall' fix in 2.22 broke support for perl5.005,
+   as the isXDIGIT() macro is not available in that perl.
+   This problem has now been fixed.
+
+
+
+2004-01-08   Gisle Aas <gisle@ActiveState.com>
+
+   Release 2.23
+
+   Documentation fixes by Paul Croome <Paul.Croome@softwareag.com>.
+
+
+
+2004-01-08   Gisle Aas <gisle@ActiveState.com>
+
+   Release 2.22
+
+   Fix 'gcc -Wall' complaints.
+
+
+
+2003-10-09   Gisle Aas <gisle@ActiveState.com>
+
+   Release 2.21
+
+   Documentation tweaks.
+
+   Don't rely on SvEND(sv) == '\0' as discussed in the perl5-porters
+   mailing list thread that starts with
+   http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-10/msg00258.html
+
+   Should now pass test suite even without XS support.
+
+   Perl v5.005 or better is now required.
+
+
+
+2003-05-13   Gisle Aas <gisle@ActiveState.com>
+
+   Release 2.20
+
+   decode_qp() recognize soft whitespace when there is whitespace
+   between the '=' and the '\n'.
+
+
+
+2003-05-13   Gisle Aas <gisle@ActiveState.com>
+
+   Release 2.19
+
+   decode_qp() did eat up all trailing whitespace in the string decoded.
+   Only whitespace in front of "\n" should go.
+
+   Win32 fix for t/warn.t by Reini Urban <rurban@x-ray.at>.
+
+
+
+2003-03-09   Gisle Aas <gisle@ActiveState.com>
+
+   Release 2.18
+
+   Fix up INSTALLDIRS for perl-5.8 and newer.
+
+
+
+2003-03-09   Gisle Aas <gisle@ActiveState.com>
+
+   Release 2.17
+
+   Make it reliable to disable base64 decoding warnings by
+   resetting $^W in recent perls.  Would really like to be
+   able to do real lexical warnings but the current mechanism
+   does not seems suitable for XS code.
+
+   Passing "" as $eol to encode_qp() disable soft line
+   breaks as well.
+
+   Sync up with changes in bleadperl:
+       - safer patchlevel.h include
+       - bad cast
+
+
+
+2003-01-05   Gisle Aas <gisle@ActiveState.com>
+
+   Release 2.16
+
+   Fixed the encode_qp() line breaking code.  It sometimes
+   made lines longer than 76 chars and it could even get into
+   an infinite loop on certain inputs.
+
+
+
+2003-01-03   Gisle Aas <gisle@ActiveState.com>
+
+   Release 2.15
+
+   Fixed the XS based decode_qp() for strings where a =XX
+   sequence was followed by digits.
+
+   Faster encode_qp() for long strings with lots of chars
+   that need escaping.
+
+   The old_decode_base64() function introduced in 2.13
+   was returning undef for empty input on olders perls.
+   This problem has been fixed.
+
+
+
+2003-01-01   Gisle Aas <gisle@ActiveState.com>
+
+   Release 2.14
+
+   MIME::QuotedPrint functions now also implemented using XS
+   which make them faster.  2-3 times faster when encoding line by
+   line and as much as 200 times faster on long binary input.  There
+   is probably some breakage on non-ASCII systems from this.
+
+   The encode_qp() function now takes an $eol argument in the
+   same way as encode_base64() does.
+
+   Slight change in behaviour: the decode_qp() function now turns
+   \r\n terminated lines into \n terminated lines.  This makes is
+   more likely that encode_qp(decode_qp()) round-trip properly.
+
+   Included {en,de}code-{base64,qp} utility scripts.
+
+
+
+2002-12-27   Gisle Aas <gisle@ActiveState.com>
+
+   Release 2.13
+
+   Sync up with bleadperl:
+       - Documentation update
+       - EBCDIC support
+       - Whitespace tweaks
+       - Improved Unicode support
+       - Test suite tweaks
+
+   Improved version of the old_{en,de}code_base64 functions
+   contributed by Paul Szabo <psz@maths.usyd.edu.au>.
+
+
+
+2001-02-23   Gisle Aas <gisle@ActiveState.com>
+
+   Release 2.12
+
+   Speed up pure perl base64 encoder/decoder by using join/map instead
+   of while loop.  Contributed by Arno Beckmann <arno@gmx.de>
+
+   Doc update contributed by Jerrad Pierce <belg4mit@CALLOWAY.MIT.EDU>
+
+   Downgrade UTF8 strings before starting to encode.
+
+
+
+1999-02-27   Gisle Aas <gisle@aas.no>
+
+   Release 2.11
+
+   Fixed bogus "Premature end of base64 data" warning.  Bug spotted
+   by Dwayne Jacques Fontenot.
+
+   Workaround for Redhat shipping trial releases of perl.
+
+
+
+1998-12-18   Gisle Aas <aas@sn.no>
+
+   Release 2.10
+
+   A tweak that should make compilation with some old perl5.00[23]
+   perls better.
+
+   A cast that make some compilers more happy.
+
+
+
+1998-11-13   Gisle Aas <aas@sn.no>
+
+   Release 2.09
+
+   The 2.08 release did not compile with perl5.005_53, because
+   all simple globals now need to be prefixed with "PL_".
+
+
+
+1998-10-22   Gisle Aas <aas@sn.no>
+
+   Release 2.08
+
+   Found another tweak to speed up decode_base64() with another 3%.
+
+   Improved MIME::Base64 documentation a little.
+
+
+
+1998-10-21   Gisle Aas <aas@sn.no>
+
+   Release 2.07
+
+   Faster and smarter C implementation of the decode_base64()
+   function.  The new decode_base64() was 25% faster when tested
+   on Linux, i586, gcc -O2.
+
+
+
+1998-07-15   Gisle Aas <aas@sn.no>
+
+   Release 2.06
+
+   The decode_base64() implemented in pure perl will only carp
+   (not croak) if length of data to decode is not a multiple 4.  This
+   actually made 'make test' fail after 'rm Base64.xs'.
+
+
+
+1998-01-27   Gisle Aas <aas@sn.no>
+
+   Release 2.05
+
+   The decode_base64() would previously allocate a too short buffer for the
+   result string when the trailing "==" padding was missing in the string to
+   be decoded.
+
+   The encode_base64() now allocate one byte less space in the result
+   strings returned.
+
+
+
+1997-12-02   Gisle Aas <aas@sn.no>
+
+   Release 2.04
+
+   Documentation expanded a bit.
+
+
+
+1997-07-10   Gisle Aas <aas@sn.no>
+
+   Release 2.03
+
+   Decode_base64() doesn't croak on premature ended data any more.
+   A warning is generated instead if running under -w.
+   
+
+
+1997-06-27   Gisle Aas <aas@sn.no>
+
+   Release 2.02
+
+   QuotedPrint fix by Roderick Schertler <roderick@argon.org>:
+
+      - Long lines were not broken unless they're at the beginning
+        of the text
+
+      - Lines near but not over 76 chars were broken when they
+        shouldn't be
+
+
+
+1997-06-13   Gisle Aas <aas@sn.no>
+
+   Release 2.01
+
+   Base64.xs: Avoid type convertion warnings with some compilers
+
+   Minor documentation updates
+
+
+
+1997-04-24   Gisle Aas <aas@sn.no>
+
+   Release 2.00, based on libwww-perl-5.08.
+
diff -aruN 5.0.000.src/library/additions/MIME/QuotedPrint_203.pm 5.2.000.src/library/additions/MIME/QuotedPrint_203.pm
--- 5.0.000.src/library/additions/MIME/QuotedPrint_203.pm	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/MIME/QuotedPrint_203.pm	2008-01-14 21:17:11.000000000 -0600
@@ -0,0 +1,115 @@
+#
+# $Id: QuotedPrint.pm,v 2.3 1997/12/02 10:24:27 aas Exp $
+
+package MIME::QuotedPrint;
+
+=head1 NAME
+
+MIME::QuotedPrint - Encoding and decoding of quoted-printable strings
+
+=head1 SYNOPSIS
+
+ use MIME::QuotedPrint;
+
+ $encoded = encode_qp($decoded);
+ $decoded = decode_qp($encoded);
+
+=head1 DESCRIPTION
+
+This module provides functions to encode and decode strings into the
+Quoted-Printable encoding specified in RFC 2045 - I<MIME (Multipurpose
+Internet Mail Extensions)>.  The Quoted-Printable encoding is intended
+to represent data that largely consists of bytes that correspond to
+printable characters in the ASCII character set.  Non-printable
+characters (as defined by english americans) are represented by a
+triplet consisting of the character "=" followed by two hexadecimal
+digits.
+
+The following functions are provided:
+
+=over 4
+
+=item encode_qp($str)
+
+This function will return an encoded version of the string given as
+argument.
+
+Note that encode_qp() does not change newlines C<"\n"> to the CRLF
+sequence even though this might be considered the right thing to do
+(RFC 2045 (Q-P Rule #4)).
+
+=item decode_qp($str);
+
+This function will return the plain text version of the string given
+as argument.
+
+=back
+
+
+If you prefer not to import these routines into your namespace you can
+call them as:
+
+  use MIME::QuotedPrint ();
+  $encoded = MIME::QuotedPrint::encode($decoded);
+  $decoded = MIME::QuotedPrint::decode($encoded);
+
+=head1 COPYRIGHT
+
+Copyright 1995-1997 Gisle Aas.
+
+This library is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut
+
+use strict;
+use vars qw(@ISA @EXPORT $VERSION);
+
+require Exporter;
+@ISA = qw(Exporter);
+@EXPORT = qw(encode_qp decode_qp);
+
+$VERSION = sprintf("%d.%02d", q$Revision: 2.3 $ =~ /(\d+)\.(\d+)/);
+
+
+sub encode_qp ($)
+{
+    my $res = shift;
+    $res =~ s/([^ \t\n!-<>-~])/sprintf("=%02X", ord($1))/eg;  # rule #2,#3
+    $res =~ s/([ \t]+)$/
+      join('', map { sprintf("=%02X", ord($_)) }
+		   split('', $1)
+      )/egm;                        # rule #3 (encode whitespace at eol)
+
+    # rule #5 (lines must be shorter than 76 chars, but we are not allowed
+    # to break =XX escapes.  This makes things complicated :-( )
+    my $brokenlines = "";
+    $brokenlines .= "$1=\n"
+	while $res =~ s/(.*?^[^\n]{73} (?:
+		 [^=\n]{2} (?! [^=\n]{0,1} $) # 75 not followed by .?\n
+		|[^=\n]    (?! [^=\n]{0,2} $) # 74 not followed by .?.?\n
+		|          (?! [^=\n]{0,3} $) # 73 not followed by .?.?.?\n
+	    ))//xsm;
+
+    "$brokenlines$res";
+}
+
+
+sub decode_qp ($)
+{
+    my $res = shift;
+    $res =~ s/[ \t]+?(\r?\n)/$1/g;  # rule #3 (trailing space must be deleted)
+    $res =~ s/=\r?\n//g;            # rule #5 (soft line breaks)
+    $res =~ s/=([\da-fA-F]{2})/pack("C", hex($1))/ge;
+    $res;
+}
+
+# Set up aliases so that these functions also can be called as
+#
+# MIME::QuotedPrint::encode();
+# MIME::QuotedPrint::decode();
+
+*encode = \&encode_qp;
+*decode = \&decode_qp;
+
+1;
diff -aruN 5.0.000.src/library/additions/MIME/QuotedPrint_307.pm 5.2.000.src/library/additions/MIME/QuotedPrint_307.pm
--- 5.0.000.src/library/additions/MIME/QuotedPrint_307.pm	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/MIME/QuotedPrint_307.pm	2008-01-14 21:17:11.000000000 -0600
@@ -0,0 +1,116 @@
+package MIME::QuotedPrint;
+
+# $Id: QuotedPrint.pm,v 3.7 2005/11/29 20:49:46 gisle Exp $
+
+use strict;
+use vars qw(@ISA @EXPORT $VERSION);
+
+require Exporter;
+@ISA = qw(Exporter);
+@EXPORT = qw(encode_qp decode_qp);
+
+$VERSION = "3.07";
+
+use MIME::Base64;  # will load XS version of {en,de}code_qp()
+
+*encode = \&encode_qp;
+*decode = \&decode_qp;
+
+1;
+
+__END__
+
+=head1 NAME
+
+MIME::QuotedPrint - Encoding and decoding of quoted-printable strings
+
+=head1 SYNOPSIS
+
+ use MIME::QuotedPrint;
+
+ $encoded = encode_qp($decoded);
+ $decoded = decode_qp($encoded);
+
+=head1 DESCRIPTION
+
+This module provides functions to encode and decode strings into and from the
+quoted-printable encoding specified in RFC 2045 - I<MIME (Multipurpose
+Internet Mail Extensions)>.  The quoted-printable encoding is intended
+to represent data that largely consists of bytes that correspond to
+printable characters in the ASCII character set.  Each non-printable
+character (as defined by English Americans) is represented by a
+triplet consisting of the character "=" followed by two hexadecimal
+digits.
+
+The following functions are provided:
+
+=over 4
+
+=item encode_qp($str)
+
+=item encode_qp($str, $eol)
+
+=item encode_qp($str, $eol, $binmode)
+
+This function returns an encoded version of the string ($str) given as
+argument.
+
+The second argument ($eol) is the line-ending sequence to use.  It is
+optional and defaults to "\n".  Every occurrence of "\n" is replaced
+with this string, and it is also used for additional "soft line
+breaks" to ensure that no line end up longer than 76 characters.  Pass
+it as "\015\012" to produce data suitable for external consumption.
+The string "\r\n" produces the same result on many platforms, but not
+all.
+
+The third argument ($binmode) will select binary mode if passed as a
+TRUE value.  In binary mode "\n" will be encoded in the same way as
+any other non-printable character.  This ensures that a decoder will
+end up with exactly the same string whatever line ending sequence it
+uses.  In general it is preferable to use the base64 encoding for
+binary data; see L<MIME::Base64>.
+
+An $eol of "" (the empty string) is special.  In this case, no "soft
+line breaks" are introduced and binary mode is effectively enabled so
+that any "\n" in the original data is encoded as well.
+
+=item decode_qp($str);
+
+This function returns the plain text version of the string given
+as argument.  The lines of the result are "\n" terminated, even if
+the $str argument contains "\r\n" terminated lines.
+
+=back
+
+
+If you prefer not to import these routines into your namespace, you can
+call them as:
+
+  use MIME::QuotedPrint ();
+  $encoded = MIME::QuotedPrint::encode($decoded);
+  $decoded = MIME::QuotedPrint::decode($encoded);
+
+Perl v5.8 and better allow extended Unicode characters in strings.
+Such strings cannot be encoded directly, as the quoted-printable
+encoding is only defined for single-byte characters.  The solution is
+to use the Encode module to select the byte encoding you want.  For
+example:
+
+    use MIME::QuotedPrint qw(encode_qp);
+    use Encode qw(encode);
+
+    $encoded = encode_qp(encode("UTF-8", "\x{FFFF}\n"));
+    print $encoded;
+
+=head1 COPYRIGHT
+
+Copyright 1995-1997,2002-2004 Gisle Aas.
+
+This library is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+L<MIME::Base64>
+
+=cut
diff -aruN 5.0.000.src/library/additions/MIME/QuotedPrint.pm 5.2.000.src/library/additions/MIME/QuotedPrint.pm
--- 5.0.000.src/library/additions/MIME/QuotedPrint.pm	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/additions/MIME/QuotedPrint.pm	1969-12-31 18:00:00.000000000 -0600
@@ -1,115 +0,0 @@
-#
-# $Id: QuotedPrint.pm,v 2.3 1997/12/02 10:24:27 aas Exp $
-
-package MIME::QuotedPrint;
-
-=head1 NAME
-
-MIME::QuotedPrint - Encoding and decoding of quoted-printable strings
-
-=head1 SYNOPSIS
-
- use MIME::QuotedPrint;
-
- $encoded = encode_qp($decoded);
- $decoded = decode_qp($encoded);
-
-=head1 DESCRIPTION
-
-This module provides functions to encode and decode strings into the
-Quoted-Printable encoding specified in RFC 2045 - I<MIME (Multipurpose
-Internet Mail Extensions)>.  The Quoted-Printable encoding is intended
-to represent data that largely consists of bytes that correspond to
-printable characters in the ASCII character set.  Non-printable
-characters (as defined by english americans) are represented by a
-triplet consisting of the character "=" followed by two hexadecimal
-digits.
-
-The following functions are provided:
-
-=over 4
-
-=item encode_qp($str)
-
-This function will return an encoded version of the string given as
-argument.
-
-Note that encode_qp() does not change newlines C<"\n"> to the CRLF
-sequence even though this might be considered the right thing to do
-(RFC 2045 (Q-P Rule #4)).
-
-=item decode_qp($str);
-
-This function will return the plain text version of the string given
-as argument.
-
-=back
-
-
-If you prefer not to import these routines into your namespace you can
-call them as:
-
-  use MIME::QuotedPrint ();
-  $encoded = MIME::QuotedPrint::encode($decoded);
-  $decoded = MIME::QuotedPrint::decode($encoded);
-
-=head1 COPYRIGHT
-
-Copyright 1995-1997 Gisle Aas.
-
-This library is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself.
-
-=cut
-
-use strict;
-use vars qw(@ISA @EXPORT $VERSION);
-
-require Exporter;
-@ISA = qw(Exporter);
-@EXPORT = qw(encode_qp decode_qp);
-
-$VERSION = sprintf("%d.%02d", q$Revision: 2.3 $ =~ /(\d+)\.(\d+)/);
-
-
-sub encode_qp ($)
-{
-    my $res = shift;
-    $res =~ s/([^ \t\n!-<>-~])/sprintf("=%02X", ord($1))/eg;  # rule #2,#3
-    $res =~ s/([ \t]+)$/
-      join('', map { sprintf("=%02X", ord($_)) }
-		   split('', $1)
-      )/egm;                        # rule #3 (encode whitespace at eol)
-
-    # rule #5 (lines must be shorter than 76 chars, but we are not allowed
-    # to break =XX escapes.  This makes things complicated :-( )
-    my $brokenlines = "";
-    $brokenlines .= "$1=\n"
-	while $res =~ s/(.*?^[^\n]{73} (?:
-		 [^=\n]{2} (?! [^=\n]{0,1} $) # 75 not followed by .?\n
-		|[^=\n]    (?! [^=\n]{0,2} $) # 74 not followed by .?.?\n
-		|          (?! [^=\n]{0,3} $) # 73 not followed by .?.?.?\n
-	    ))//xsm;
-
-    "$brokenlines$res";
-}
-
-
-sub decode_qp ($)
-{
-    my $res = shift;
-    $res =~ s/[ \t]+?(\r?\n)/$1/g;  # rule #3 (trailing space must be deleted)
-    $res =~ s/=\r?\n//g;            # rule #5 (soft line breaks)
-    $res =~ s/=([\da-fA-F]{2})/pack("C", hex($1))/ge;
-    $res;
-}
-
-# Set up aliases so that these functions also can be called as
-#
-# MIME::QuotedPrint::encode();
-# MIME::QuotedPrint::decode();
-
-*encode = \&encode_qp;
-*decode = \&decode_qp;
-
-1;
diff -aruN 5.0.000.src/library/additions/MIME/README 5.2.000.src/library/additions/MIME/README
--- 5.0.000.src/library/additions/MIME/README	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/MIME/README	2008-01-14 21:17:12.000000000 -0600
@@ -0,0 +1,27 @@
+This package contains a base64 encoder/decoder and a quoted-printable
+encoder/decoder.  These encoding methods are specified in RFC 2045 -
+MIME (Multipurpose Internet Mail Extensions).
+
+The base64 encoding is designed to represent arbitrary sequences of
+octets in a form that need not be humanly readable. A 65-character
+subset ([A-Za-z0-9+/=]) of US-ASCII is used, enabling 6 bits to be
+represented per printable character.
+
+The quoted-printable encoding is intended to represent data that
+largely consists of bytes that correspond to printable characters in
+the ASCII character set.  Each non-printable character is represented by
+a triplet consisting of the character "=" followed by two hexadecimal
+digits.
+
+In order to install and use this package you will need Perl version
+5.6 or better.  Installation as usual:
+
+   perl Makefile.PL
+   make
+   make test
+   make install
+
+Copyright 1995-1999,2001-2004 Gisle Aas <gisle@ActiveState.com>
+
+This library is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
diff -aruN 5.0.000.src/library/additions/Parser/Expat.pm 5.2.000.src/library/additions/Parser/Expat.pm
--- 5.0.000.src/library/additions/Parser/Expat.pm	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/Parser/Expat.pm	2007-12-10 13:50:38.000000000 -0600
@@ -0,0 +1,1230 @@
+package XML::Parser::Expat;
+
+require 5.004;
+
+use strict;
+use vars qw($VERSION @ISA %Handler_Setters %Encoding_Table @Encoding_Path
+            $have_File_Spec);
+use Carp;
+
+require DynaLoader;
+
+@ISA = qw(DynaLoader);
+$VERSION = "2.34" ;
+
+$have_File_Spec = $INC{'File/Spec.pm'} || do 'File/Spec.pm';
+
+%Encoding_Table = ();
+if ($have_File_Spec) {
+  @Encoding_Path = (grep(-d $_,
+                         map(File::Spec->catdir($_, qw(XML Parser Encodings)),
+                             @INC)),
+                    File::Spec->curdir);
+}
+else {
+  @Encoding_Path = (grep(-d $_, map($_ . '/XML/Parser/Encodings', @INC)), '.');
+}
+  
+
+bootstrap XML::Parser::Expat $VERSION;
+
+%Handler_Setters = (
+                    Start => \&SetStartElementHandler,
+                    End   => \&SetEndElementHandler,
+                    Char  => \&SetCharacterDataHandler,
+                    Proc  => \&SetProcessingInstructionHandler,
+                    Comment => \&SetCommentHandler,
+                    CdataStart => \&SetStartCdataHandler,
+                    CdataEnd   => \&SetEndCdataHandler,
+                    Default => \&SetDefaultHandler,
+                    Unparsed => \&SetUnparsedEntityDeclHandler,
+                    Notation => \&SetNotationDeclHandler,
+                    ExternEnt => \&SetExternalEntityRefHandler,
+                    ExternEntFin => \&SetExtEntFinishHandler,
+                    Entity => \&SetEntityDeclHandler,
+                    Element => \&SetElementDeclHandler,
+                    Attlist => \&SetAttListDeclHandler,
+                    Doctype => \&SetDoctypeHandler,
+                    DoctypeFin => \&SetEndDoctypeHandler,
+                    XMLDecl => \&SetXMLDeclHandler
+                    );
+
+sub new {
+  my ($class, %args) = @_;
+  my $self = bless \%args, $_[0];
+  $args{_State_} = 0;
+  $args{Context} = [];
+  $args{Namespaces} ||= 0;
+  $args{ErrorMessage} ||= '';
+  if ($args{Namespaces}) {
+    $args{Namespace_Table} = {};
+    $args{Namespace_List} = [undef];
+    $args{Prefix_Table} = {};
+    $args{New_Prefixes} = [];
+  }
+  $args{_Setters} = \%Handler_Setters;
+  $args{Parser} = ParserCreate($self, $args{ProtocolEncoding},
+                               $args{Namespaces});
+  $self;
+}
+
+sub load_encoding {
+  my ($file) = @_;
+
+  $file =~ s!([^/]+)$!\L$1\E!;
+  $file .= '.enc' unless $file =~ /\.enc$/;
+  unless ($file =~ m!^/!) {
+    foreach (@Encoding_Path) {
+      my $tmp = ($have_File_Spec
+                 ? File::Spec->catfile($_, $file)
+                 : "$_/$file");
+      if (-e $tmp) {
+        $file = $tmp;
+        last;
+      }
+    }
+  }
+
+  local(*ENC);
+  open(ENC, $file) or croak("Couldn't open encmap $file:\n$!\n");
+  binmode(ENC);
+  my $data;
+  my $br = sysread(ENC, $data, -s $file);
+  croak("Trouble reading $file:\n$!\n")
+    unless defined($br);
+  close(ENC);
+
+  my $name = LoadEncoding($data, $br);
+  croak("$file isn't an encmap file")
+    unless defined($name);
+
+  $name;
+}  # End load_encoding
+
+sub setHandlers {
+  my ($self, @handler_pairs) = @_;
+
+  croak("Uneven number of arguments to setHandlers method")
+    if (int(@handler_pairs) & 1);
+
+  my @ret;
+
+  while (@handler_pairs) {
+    my $type = shift @handler_pairs;
+    my $handler = shift @handler_pairs;
+    croak "Handler for $type not a Code ref"
+      unless (! defined($handler) or ! $handler or ref($handler) eq 'CODE');
+
+    my $hndl = $self->{_Setters}->{$type};
+
+    unless (defined($hndl)) {
+      my @types = sort keys %{$self->{_Setters}};
+      croak("Unknown Expat handler type: $type\n Valid types: @types");
+    }
+
+    my $old = &$hndl($self->{Parser}, $handler);
+    push (@ret, $type, $old);
+  }
+
+  return @ret;
+}
+
+sub xpcroak
+ {
+  my ($self, $message) = @_;
+
+  my $eclines = $self->{ErrorContext};
+  my $line = GetCurrentLineNumber($_[0]->{Parser});
+  $message .= " at line $line";
+  $message .= ":\n" . $self->position_in_context($eclines)
+    if defined($eclines);
+  croak $message;
+}
+
+sub xpcarp {
+  my ($self, $message) = @_;
+
+  my $eclines = $self->{ErrorContext};
+  my $line = GetCurrentLineNumber($_[0]->{Parser});
+  $message .= " at line $line";
+  $message .= ":\n" . $self->position_in_context($eclines)
+    if defined($eclines);
+  carp $message;
+}
+
+sub default_current {
+  my $self = shift;
+  if ($self->{_State_} == 1) {
+    return DefaultCurrent($self->{Parser});
+  }
+}
+
+sub recognized_string {
+  my $self = shift;
+  if ($self->{_State_} == 1) {
+    return RecognizedString($self->{Parser});
+  }
+}
+
+sub original_string {
+  my $self = shift;
+  if ($self->{_State_} == 1) {
+    return OriginalString($self->{Parser});
+  }
+}
+
+sub current_line {
+  my $self = shift;
+  if ($self->{_State_} == 1) {
+    return GetCurrentLineNumber($self->{Parser});
+  }
+}
+
+sub current_column {
+  my $self = shift;
+  if ($self->{_State_} == 1) {
+    return GetCurrentColumnNumber($self->{Parser});
+  }
+}
+
+sub current_byte {
+  my $self = shift;
+  if ($self->{_State_} == 1) {
+    return GetCurrentByteIndex($self->{Parser});
+  }
+}
+
+sub base {
+  my ($self, $newbase) = @_;
+  my $p = $self->{Parser};
+  my $oldbase = GetBase($p);
+  SetBase($p, $newbase) if @_ > 1;
+  return $oldbase;
+}
+
+sub context {
+  my $ctx = $_[0]->{Context};
+  @$ctx;
+}
+
+sub current_element {
+  my ($self) = @_;
+  @{$self->{Context}} ? $self->{Context}->[-1] : undef;
+}
+
+sub in_element {
+  my ($self, $element) = @_;
+  @{$self->{Context}} ? $self->eq_name($self->{Context}->[-1], $element)
+    : undef;
+}
+
+sub within_element {
+  my ($self, $element) = @_;
+  my $cnt = 0;
+  foreach (@{$self->{Context}}) {
+    $cnt++ if $self->eq_name($_, $element);
+  }
+  return $cnt;
+}
+
+sub depth {
+  my ($self) = @_;
+  int(@{$self->{Context}});
+}
+
+sub element_index {
+  my ($self) = @_;
+
+  if ($self->{_State_} == 1) {
+    return ElementIndex($self->{Parser});
+  }
+}
+
+################
+# Namespace methods
+
+sub namespace {
+  my ($self, $name) = @_;
+  local($^W) = 0;
+  $self->{Namespace_List}->[int($name)];
+}
+
+sub eq_name {
+  my ($self, $nm1, $nm2) = @_;
+  local($^W) = 0;
+
+  int($nm1) == int($nm2) and $nm1 eq $nm2;
+}
+
+sub generate_ns_name {
+  my ($self, $name, $namespace) = @_;
+
+  $namespace ?
+    GenerateNSName($name, $namespace, $self->{Namespace_Table},
+                   $self->{Namespace_List})
+      : $name;
+}
+
+sub new_ns_prefixes {
+  my ($self) = @_;
+  if ($self->{Namespaces}) {
+    return @{$self->{New_Prefixes}};
+  }
+  return ();
+}
+
+sub expand_ns_prefix {
+  my ($self, $prefix) = @_;
+
+  if ($self->{Namespaces}) {
+    my $stack = $self->{Prefix_Table}->{$prefix};
+    return (defined($stack) and @$stack) ? $stack->[-1] : undef;
+  }
+
+  return undef;
+}
+
+sub current_ns_prefixes {
+  my ($self) = @_;
+
+  if ($self->{Namespaces}) {
+    my %set = %{$self->{Prefix_Table}};
+
+    if (exists $set{'#default'} and not defined($set{'#default'}->[-1])) {
+      delete $set{'#default'};
+    }
+
+    return keys %set;
+  }
+
+  return ();
+}
+
+
+################################################################
+# Namespace declaration handlers
+#
+
+sub NamespaceStart {
+  my ($self, $prefix, $uri) = @_;
+
+  $prefix = '#default' unless defined $prefix;
+  my $stack = $self->{Prefix_Table}->{$prefix}; 
+
+  if (defined $stack) {
+    push(@$stack, $uri);
+  }
+  else {
+    $self->{Prefix_Table}->{$prefix} = [$uri];
+  }
+
+  # The New_Prefixes list gets emptied at end of startElement function
+  # in Expat.xs
+
+  push(@{$self->{New_Prefixes}}, $prefix);
+}
+
+sub NamespaceEnd {
+  my ($self, $prefix) = @_;
+
+  $prefix = '#default' unless defined $prefix;
+
+  my $stack = $self->{Prefix_Table}->{$prefix};
+  if (@$stack > 1) {
+    pop(@$stack);
+  }
+  else {
+    delete $self->{Prefix_Table}->{$prefix};
+  }
+}
+
+################
+
+sub specified_attr {
+  my $self = shift;
+  
+  if ($self->{_State_} == 1) {
+    return GetSpecifiedAttributeCount($self->{Parser});
+  }
+}
+
+sub finish {
+  my ($self) = @_;
+  if ($self->{_State_} == 1) {
+    my $parser = $self->{Parser};
+    UnsetAllHandlers($parser);
+  }
+}
+
+sub position_in_context {
+  my ($self, $lines) = @_;
+  if ($self->{_State_} == 1) {
+    my $parser = $self->{Parser};
+    my ($string, $linepos) = PositionContext($parser, $lines);
+
+    return '' unless defined($string);
+
+    my $col = GetCurrentColumnNumber($parser);
+    my $ptr = ('=' x ($col - 1)) . '^' . "\n";
+    my $ret;
+    my $dosplit = $linepos < length($string);
+  
+    $string .= "\n" unless $string =~ /\n$/;
+  
+    if ($dosplit) {
+      $ret = substr($string, 0, $linepos) . $ptr
+        . substr($string, $linepos);
+    } else {
+      $ret = $string . $ptr;
+    }
+  
+    return $ret;
+  }
+}
+
+sub xml_escape {
+  my $self = shift;
+  my $text = shift;
+
+  study $text;
+  $text =~ s/\&/\&amp;/g;
+  $text =~ s/</\&lt;/g;
+  foreach (@_) {
+    croak "xml_escape: '$_' isn't a single character" if length($_) > 1;
+
+    if ($_ eq '>') {
+      $text =~ s/>/\&gt;/g;
+    }
+    elsif ($_ eq '"') {
+      $text =~ s/\"/\&quot;/;
+    }
+    elsif ($_ eq "'") {
+      $text =~ s/\'/\&apos;/;
+    }
+    else {
+      my $rep = '&#' . sprintf('x%X', ord($_)) . ';';
+      if (/\W/) {
+        my $ptrn = "\\$_";
+        $text =~ s/$ptrn/$rep/g;
+      }
+      else {
+        $text =~ s/$_/$rep/g;
+      }
+    }
+  }
+  $text;
+}
+
+sub skip_until {
+  my $self = shift;
+  if ($self->{_State_} <= 1) {
+    SkipUntil($self->{Parser}, $_[0]);
+  }
+}
+
+sub release {
+  my $self = shift;
+  ParserRelease($self->{Parser});
+}
+
+sub DESTROY {
+  my $self = shift;
+  ParserFree($self->{Parser});
+}
+
+sub parse {
+  my $self = shift;
+  my $arg = shift;
+  croak "Parse already in progress (Expat)" if $self->{_State_};
+  $self->{_State_} = 1;
+  my $parser = $self->{Parser};
+  my $ioref;
+  my $result = 0;
+  
+  if (defined $arg) {
+    if (ref($arg) and UNIVERSAL::isa($arg, 'IO::Handle')) {
+      $ioref = $arg;
+    } elsif (tied($arg)) {
+      my $class = ref($arg);
+      no strict 'refs';
+      $ioref = $arg if defined &{"${class}::TIEHANDLE"};
+    }
+    else {
+      require IO::Handle;
+      eval {
+        no strict 'refs';
+        $ioref = *{$arg}{IO} if defined *{$arg};
+      };
+      undef $@;
+    }
+  }
+  
+  if (defined($ioref)) {
+    my $delim = $self->{Stream_Delimiter};
+    my $prev_rs;
+    
+    $prev_rs = ref($ioref)->input_record_separator("\n$delim\n")
+      if defined($delim);
+    
+    $result = ParseStream($parser, $ioref, $delim);
+    
+    ref($ioref)->input_record_separator($prev_rs)
+      if defined($delim);
+  } else {
+    $result = ParseString($parser, $arg);
+  }
+  
+  $self->{_State_} = 2;
+  $result or croak $self->{ErrorMessage};
+}
+
+sub parsestring {
+  my $self = shift;
+  $self->parse(@_);
+}
+
+sub parsefile {
+  my $self = shift;
+  croak "Parser has already been used" if $self->{_State_};
+  local(*FILE);
+  open(FILE, $_[0]) or  croak "Couldn't open $_[0]:\n$!";
+  binmode(FILE);
+  my $ret = $self->parse(*FILE);
+  close(FILE);
+  $ret;
+}
+
+################################################################
+package XML::Parser::ContentModel;
+use overload '""' => \&asString, 'eq' => \&thiseq;
+
+sub EMPTY  () {1}
+sub ANY    () {2}
+sub MIXED  () {3}
+sub NAME   () {4}
+sub CHOICE () {5}
+sub SEQ    () {6}
+
+
+sub isempty {
+  return $_[0]->{Type} == EMPTY;
+}
+
+sub isany {
+  return $_[0]->{Type} == ANY;
+}
+
+sub ismixed {
+  return $_[0]->{Type} == MIXED;
+}
+
+sub isname {
+  return $_[0]->{Type} == NAME;
+}
+
+sub name {
+  return $_[0]->{Tag};
+}
+
+sub ischoice {
+  return $_[0]->{Type} == CHOICE;
+}
+
+sub isseq {
+  return $_[0]->{Type} == SEQ;
+}
+
+sub quant {
+  return $_[0]->{Quant};
+}
+
+sub children {
+  my $children = $_[0]->{Children};
+  if (defined $children) {
+    return @$children;
+  }
+  return undef;
+}
+
+sub asString {
+  my ($self) = @_;
+  my $ret;
+
+  if ($self->{Type} == NAME) {
+    $ret = $self->{Tag};
+  }
+  elsif ($self->{Type} == EMPTY) {
+    return "EMPTY";
+  }
+  elsif ($self->{Type} == ANY) {
+    return "ANY";
+  }
+  elsif ($self->{Type} == MIXED) {
+    $ret = '(#PCDATA';
+    foreach (@{$self->{Children}}) {
+      $ret .= '|' . $_;
+    }
+    $ret .= ')';
+  }
+  else {
+    my $sep = $self->{Type} == CHOICE ? '|' : ',';
+    $ret = '(' . join($sep, map { $_->asString } @{$self->{Children}}) . ')';
+  }
+
+  $ret .= $self->{Quant} if $self->{Quant};
+  return $ret;
+}
+
+sub thiseq {
+  my $self = shift;
+
+  return $self->asString eq $_[0];
+}
+
+################################################################
+package XML::Parser::ExpatNB;
+
+use vars qw(@ISA);
+use Carp;
+
+@ISA = qw(XML::Parser::Expat);
+
+sub parse {
+  my $self = shift;
+  my $class = ref($self);
+  croak "parse method not supported in $class";
+}
+
+sub parsestring {
+  my $self = shift;
+  my $class = ref($self);
+  croak "parsestring method not supported in $class";
+}
+
+sub parsefile {
+  my $self = shift;
+  my $class = ref($self);
+  croak "parsefile method not supported in $class";
+}
+
+sub parse_more {
+  my ($self, $data) = @_;
+
+  $self->{_State_} = 1;
+  my $ret = XML::Parser::Expat::ParsePartial($self->{Parser}, $data);
+
+  croak $self->{ErrorMessage} unless $ret;
+}
+
+sub parse_done {
+  my $self = shift;
+
+  my $ret = XML::Parser::Expat::ParseDone($self->{Parser});
+  unless ($ret) {
+    my $msg = $self->{ErrorMessage};
+    $self->release;
+    croak $msg;
+  }
+
+  $self->{_State_} = 2;
+
+  my $result = $ret;
+  my @result = ();
+  my $final = $self->{FinalHandler};
+  if (defined $final) {
+    if (wantarray) {
+      @result = &$final($self);
+    }
+    else {
+      $result = &$final($self);
+    }
+  }
+
+  $self->release;
+
+  return unless defined wantarray;
+  return wantarray ? @result : $result;
+}
+
+################################################################
+
+package XML::Parser::Encinfo;
+
+sub DESTROY {
+  my $self = shift;
+  XML::Parser::Expat::FreeEncoding($self);
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+XML::Parser::Expat - Lowlevel access to James Clark's expat XML parser
+
+=head1 SYNOPSIS
+
+ use XML::Parser::Expat;
+
+ $parser = new XML::Parser::Expat;
+ $parser->setHandlers('Start' => \&sh,
+                      'End'   => \&eh,
+                      'Char'  => \&ch);
+ open(FOO, 'info.xml') or die "Couldn't open";
+ $parser->parse(*FOO);
+ close(FOO);
+ # $parser->parse('<foo id="me"> here <em>we</em> go </foo>');
+
+ sub sh
+ {
+   my ($p, $el, %atts) = @_;
+   $p->setHandlers('Char' => \&spec)
+     if ($el eq 'special');
+   ...
+ }
+
+ sub eh
+ {
+   my ($p, $el) = @_;
+   $p->setHandlers('Char' => \&ch)  # Special elements won't contain
+     if ($el eq 'special');         # other special elements
+   ...
+ } 
+
+=head1 DESCRIPTION
+
+This module provides an interface to James Clark's XML parser, expat. As in
+expat, a single instance of the parser can only parse one document. Calls
+to parsestring after the first for a given instance will die.
+
+Expat (and XML::Parser::Expat) are event based. As the parser recognizes
+parts of the document (say the start or end of an XML element), then any
+handlers registered for that type of an event are called with suitable
+parameters.
+
+=head1 METHODS
+
+=over 4
+
+=item new
+
+This is a class method, the constructor for XML::Parser::Expat. Options are
+passed as keyword value pairs. The recognized options are:
+
+=over 4
+
+=item * ProtocolEncoding
+
+The protocol encoding name. The default is none. The expat built-in
+encodings are: C<UTF-8>, C<ISO-8859-1>, C<UTF-16>, and C<US-ASCII>.
+Other encodings may be used if they have encoding maps in one of the
+directories in the @Encoding_Path list. Setting the protocol encoding
+overrides any encoding in the XML declaration.
+
+=item * Namespaces
+
+When this option is given with a true value, then the parser does namespace
+processing. By default, namespace processing is turned off. When it is
+turned on, the parser consumes I<xmlns> attributes and strips off prefixes
+from element and attributes names where those prefixes have a defined
+namespace. A name's namespace can be found using the L<"namespace"> method
+and two names can be checked for absolute equality with the L<"eq_name">
+method.
+
+=item * NoExpand
+
+Normally, the parser will try to expand references to entities defined in
+the internal subset. If this option is set to a true value, and a default
+handler is also set, then the default handler will be called when an
+entity reference is seen in text. This has no effect if a default handler
+has not been registered, and it has no effect on the expansion of entity
+references inside attribute values.
+
+=item * Stream_Delimiter
+
+This option takes a string value. When this string is found alone on a line
+while parsing from a stream, then the parse is ended as if it saw an end of
+file. The intended use is with a stream of xml documents in a MIME multipart
+format. The string should not contain a trailing newline.
+
+=item * ErrorContext
+
+When this option is defined, errors are reported in context. The value
+of ErrorContext should be the number of lines to show on either side of
+the line in which the error occurred.
+
+=item * ParseParamEnt
+
+Unless standalone is set to "yes" in the XML declaration, setting this to
+a true value allows the external DTD to be read, and parameter entities
+to be parsed and expanded.
+
+=item * Base
+
+The base to use for relative pathnames or URLs. This can also be done by
+using the base method.
+
+=back
+
+=item setHandlers(TYPE, HANDLER [, TYPE, HANDLER [...]])
+
+This method registers handlers for the various events. If no handlers are
+registered, then a call to parsestring or parsefile will only determine if
+the corresponding XML document is well formed (by returning without error.)
+This may be called from within a handler, after the parse has started.
+
+Setting a handler to something that evaluates to false unsets that
+handler.
+
+This method returns a list of type, handler pairs corresponding to the
+input. The handlers returned are the ones that were in effect before the
+call to setHandlers.
+
+The recognized events and the parameters passed to the corresponding
+handlers are:
+
+=over 4
+
+=item * Start             (Parser, Element [, Attr, Val [,...]])
+
+This event is generated when an XML start tag is recognized. Parser is
+an XML::Parser::Expat instance. Element is the name of the XML element that
+is opened with the start tag. The Attr & Val pairs are generated for each
+attribute in the start tag.
+
+=item * End               (Parser, Element)
+
+This event is generated when an XML end tag is recognized. Note that
+an XML empty tag (<foo/>) generates both a start and an end event.
+
+There is always a lower level start and end handler installed that wrap
+the corresponding callbacks. This is to handle the context mechanism.
+A consequence of this is that the default handler (see below) will not
+see a start tag or end tag unless the default_current method is called.
+
+=item * Char              (Parser, String)
+
+This event is generated when non-markup is recognized. The non-markup
+sequence of characters is in String. A single non-markup sequence of
+characters may generate multiple calls to this handler. Whatever the
+encoding of the string in the original document, this is given to the
+handler in UTF-8.
+
+=item * Proc              (Parser, Target, Data)
+
+This event is generated when a processing instruction is recognized.
+
+=item * Comment           (Parser, String)
+
+This event is generated when a comment is recognized.
+
+=item * CdataStart        (Parser)
+
+This is called at the start of a CDATA section.
+
+=item * CdataEnd          (Parser)
+
+This is called at the end of a CDATA section.
+
+=item * Default           (Parser, String)
+
+This is called for any characters that don't have a registered handler.
+This includes both characters that are part of markup for which no
+events are generated (markup declarations) and characters that
+could generate events, but for which no handler has been registered.
+
+Whatever the encoding in the original document, the string is returned to
+the handler in UTF-8.
+
+=item * Unparsed          (Parser, Entity, Base, Sysid, Pubid, Notation)
+
+This is called for a declaration of an unparsed entity. Entity is the name
+of the entity. Base is the base to be used for resolving a relative URI.
+Sysid is the system id. Pubid is the public id. Notation is the notation
+name. Base and Pubid may be undefined.
+
+=item * Notation          (Parser, Notation, Base, Sysid, Pubid)
+
+This is called for a declaration of notation. Notation is the notation name.
+Base is the base to be used for resolving a relative URI. Sysid is the system
+id. Pubid is the public id. Base, Sysid, and Pubid may all be undefined.
+
+=item * ExternEnt         (Parser, Base, Sysid, Pubid)
+
+This is called when an external entity is referenced. Base is the base to be
+used for resolving a relative URI. Sysid is the system id. Pubid is the public
+id. Base, and Pubid may be undefined.
+
+This handler should either return a string, which represents the contents of
+the external entity, or return an open filehandle that can be read to obtain
+the contents of the external entity, or return undef, which indicates the
+external entity couldn't be found and will generate a parse error.
+
+If an open filehandle is returned, it must be returned as either a glob
+(*FOO) or as a reference to a glob (e.g. an instance of IO::Handle).
+
+=item * ExternEntFin      (Parser)
+
+This is called after an external entity has been parsed. It allows
+applications to perform cleanup on actions performed in the above
+ExternEnt handler.
+
+=item * Entity            (Parser, Name, Val, Sysid, Pubid, Ndata, IsParam)
+
+This is called when an entity is declared. For internal entities, the Val
+parameter will contain the value and the remaining three parameters will
+be undefined. For external entities, the Val parameter
+will be undefined, the Sysid parameter will have the system id, the Pubid
+parameter will have the public id if it was provided (it will be undefined
+otherwise), the Ndata parameter will contain the notation for unparsed
+entities. If this is a parameter entity declaration, then the IsParam
+parameter is true.
+
+Note that this handler and the Unparsed handler above overlap. If both are
+set, then this handler will not be called for unparsed entities.
+
+=item * Element           (Parser, Name, Model)
+
+The element handler is called when an element declaration is found. Name is
+the element name, and Model is the content model as an
+XML::Parser::ContentModel object. See L<"XML::Parser::ContentModel Methods">
+for methods available for this class.
+
+=item * Attlist           (Parser, Elname, Attname, Type, Default, Fixed)
+
+This handler is called for each attribute in an ATTLIST declaration.
+So an ATTLIST declaration that has multiple attributes
+will generate multiple calls to this handler. The Elname parameter is the
+name of the element with which the attribute is being associated. The Attname
+parameter is the name of the attribute. Type is the attribute type, given as
+a string. Default is the default value, which will either be "#REQUIRED",
+"#IMPLIED" or a quoted string (i.e. the returned string will begin and end
+with a quote character). If Fixed is true, then this is a fixed attribute.
+
+=item * Doctype           (Parser, Name, Sysid, Pubid, Internal)
+
+This handler is called for DOCTYPE declarations. Name is the document type
+name. Sysid is the system id of the document type, if it was provided,
+otherwise it's undefined. Pubid is the public id of the document type,
+which will be undefined if no public id was given. Internal will be
+true or false, indicating whether or not the doctype declaration contains
+an internal subset.
+
+=item * DoctypeFin        (Parser)
+
+This handler is called after parsing of the DOCTYPE declaration has finished,
+including any internal or external DTD declarations.
+
+=item * XMLDecl           (Parser, Version, Encoding, Standalone)
+
+This handler is called for XML declarations. Version is a string containg
+the version. Encoding is either undefined or contains an encoding string.
+Standalone is either undefined, or true or false. Undefined indicates
+that no standalone parameter was given in the XML declaration. True or
+false indicates "yes" or "no" respectively.
+
+=back
+
+=item namespace(name)
+
+Return the URI of the namespace that the name belongs to. If the name doesn't
+belong to any namespace, an undef is returned. This is only valid on names
+received through the Start or End handlers from a single document, or through
+a call to the generate_ns_name method. In other words, don't use names
+generated from one instance of XML::Parser::Expat with other instances.
+
+=item eq_name(name1, name2)
+
+Return true if name1 and name2 are identical (i.e. same name and from
+the same namespace.) This is only meaningful if both names were obtained
+through the Start or End handlers from a single document, or through
+a call to the generate_ns_name method.
+
+=item generate_ns_name(name, namespace)
+
+Return a name, associated with a given namespace, good for using with the
+above 2 methods. The namespace argument should be the namespace URI, not
+a prefix.
+
+=item new_ns_prefixes
+
+When called from a start tag handler, returns namespace prefixes declared
+with this start tag. If called elsewere (or if there were no namespace
+prefixes declared), it returns an empty list. Setting of the default
+namespace is indicated with '#default' as a prefix.
+
+=item expand_ns_prefix(prefix)
+
+Return the uri to which the given prefix is currently bound. Returns
+undef if the prefix isn't currently bound. Use '#default' to find the
+current binding of the default namespace (if any).
+
+=item current_ns_prefixes
+
+Return a list of currently bound namespace prefixes. The order of the
+the prefixes in the list has no meaning. If the default namespace is
+currently bound, '#default' appears in the list.
+
+=item recognized_string
+
+Returns the string from the document that was recognized in order to call
+the current handler. For instance, when called from a start handler, it
+will give us the the start-tag string. The string is encoded in UTF-8.
+This method doesn't return a meaningful string inside declaration handlers.
+
+=item original_string
+
+Returns the verbatim string from the document that was recognized in
+order to call the current handler. The string is in the original document
+encoding. This method doesn't return a meaningful string inside declaration
+handlers.
+
+=item default_current
+
+When called from a handler, causes the sequence of characters that generated
+the corresponding event to be sent to the default handler (if one is
+registered). Use of this method is deprecated in favor the recognized_string
+method, which you can use without installing a default handler. This
+method doesn't deliver a meaningful string to the default handler when
+called from inside declaration handlers.
+
+=item xpcroak(message)
+
+Concatenate onto the given message the current line number within the
+XML document plus the message implied by ErrorContext. Then croak with
+the formed message.
+
+=item xpcarp(message)
+
+Concatenate onto the given message the current line number within the
+XML document plus the message implied by ErrorContext. Then carp with
+the formed message.
+
+=item current_line
+
+Returns the line number of the current position of the parse.
+
+=item current_column
+
+Returns the column number of the current position of the parse.
+
+=item current_byte
+
+Returns the current position of the parse.
+
+=item base([NEWBASE]);
+
+Returns the current value of the base for resolving relative URIs. If
+NEWBASE is supplied, changes the base to that value.
+
+=item context
+
+Returns a list of element names that represent open elements, with the
+last one being the innermost. Inside start and end tag handlers, this
+will be the tag of the parent element.
+
+=item current_element
+
+Returns the name of the innermost currently opened element. Inside
+start or end handlers, returns the parent of the element associated
+with those tags.
+
+=item in_element(NAME)
+
+Returns true if NAME is equal to the name of the innermost currently opened
+element. If namespace processing is being used and you want to check
+against a name that may be in a namespace, then use the generate_ns_name
+method to create the NAME argument.
+
+=item within_element(NAME)
+
+Returns the number of times the given name appears in the context list.
+If namespace processing is being used and you want to check
+against a name that may be in a namespace, then use the generate_ns_name
+method to create the NAME argument.
+
+=item depth
+
+Returns the size of the context list.
+
+=item element_index
+
+Returns an integer that is the depth-first visit order of the current
+element. This will be zero outside of the root element. For example,
+this will return 1 when called from the start handler for the root element
+start tag.
+
+=item skip_until(INDEX)
+
+INDEX is an integer that represents an element index. When this method
+is called, all handlers are suspended until the start tag for an element
+that has an index number equal to INDEX is seen. If a start handler has
+been set, then this is the first tag that the start handler will see
+after skip_until has been called.
+
+
+=item position_in_context(LINES)
+
+Returns a string that shows the current parse position. LINES should be
+an integer >= 0 that represents the number of lines on either side of the
+current parse line to place into the returned string.
+
+=item xml_escape(TEXT [, CHAR [, CHAR ...]])
+
+Returns TEXT with markup characters turned into character entities. Any
+additional characters provided as arguments are also turned into character
+references where found in TEXT.
+
+=item parse (SOURCE)
+
+The SOURCE parameter should either be a string containing the whole XML
+document, or it should be an open IO::Handle. Only a single document
+may be parsed for a given instance of XML::Parser::Expat, so this will croak
+if it's been called previously for this instance.
+
+=item parsestring(XML_DOC_STRING)
+
+Parses the given string as an XML document. Only a single document may be
+parsed for a given instance of XML::Parser::Expat, so this will die if either
+parsestring or parsefile has been called for this instance previously.
+
+This method is deprecated in favor of the parse method.
+
+=item parsefile(FILENAME)
+
+Parses the XML document in the given file. Will die if parsestring or
+parsefile has been called previously for this instance.
+
+=item is_defaulted(ATTNAME)
+
+NO LONGER WORKS. To find out if an attribute is defaulted please use
+the specified_attr method.
+
+=item specified_attr
+
+When the start handler receives lists of attributes and values, the
+non-defaulted (i.e. explicitly specified) attributes occur in the list
+first. This method returns the number of specified items in the list.
+So if this number is equal to the length of the list, there were no
+defaulted values. Otherwise the number points to the index of the
+first defaulted attribute name.
+
+=item finish
+
+Unsets all handlers (including internal ones that set context), but expat
+continues parsing to the end of the document or until it finds an error.
+It should finish up a lot faster than with the handlers set.
+
+=item release
+
+There are data structures used by XML::Parser::Expat that have circular
+references. This means that these structures will never be garbage
+collected unless these references are explicitly broken. Calling this
+method breaks those references (and makes the instance unusable.)
+
+Normally, higher level calls handle this for you, but if you are using
+XML::Parser::Expat directly, then it's your responsibility to call it.
+
+=back
+
+=head2 XML::Parser::ContentModel Methods
+
+The element declaration handlers are passed objects of this class as the
+content model of the element declaration. They also represent content
+particles, components of a content model.
+
+When referred to as a string, these objects are automagicly converted to a
+string representation of the model (or content particle).
+
+=over 4
+
+=item isempty
+
+This method returns true if the object is "EMPTY", false otherwise.
+
+=item isany
+
+This method returns true if the object is "ANY", false otherwise.
+
+=item ismixed
+
+This method returns true if the object is "(#PCDATA)" or "(#PCDATA|...)*",
+false otherwise.
+
+=item isname
+
+This method returns if the object is an element name.
+
+=item ischoice
+
+This method returns true if the object is a choice of content particles.
+
+
+=item isseq
+
+This method returns true if the object is a sequence of content particles.
+
+=item quant
+
+This method returns undef or a string representing the quantifier
+('?', '*', '+') associated with the model or particle.
+
+=item children
+
+This method returns undef or (for mixed, choice, and sequence types)
+an array of component content particles. There will always be at least
+one component for choices and sequences, but for a mixed content model
+of pure PCDATA, "(#PCDATA)", then an undef is returned.
+
+=back
+
+=head2 XML::Parser::ExpatNB Methods
+
+The class XML::Parser::ExpatNB is a subclass of XML::Parser::Expat used
+for non-blocking access to the expat library. It does not support the parse,
+parsestring, or parsefile methods, but it does have these additional methods:
+
+=over 4
+
+=item parse_more(DATA)
+
+Feed expat more text to munch on.
+
+=item parse_done
+
+Tell expat that it's gotten the whole document.
+
+=back
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item XML::Parser::Expat::load_encoding(ENCODING)
+
+Load an external encoding. ENCODING is either the name of an encoding or
+the name of a file. The basename is converted to lowercase and a '.enc'
+extension is appended unless there's one already there. Then, unless
+it's an absolute pathname (i.e. begins with '/'), the first file by that
+name discovered in the @Encoding_Path path list is used.
+
+The encoding in the file is loaded and kept in the %Encoding_Table
+table. Earlier encodings of the same name are replaced.
+
+This function is automaticly called by expat when it encounters an encoding
+it doesn't know about. Expat shouldn't call this twice for the same
+encoding name. The only reason users should use this function is to
+explicitly load an encoding not contained in the @Encoding_Path list.
+
+=back
+
+=head1 AUTHORS
+
+Larry Wall <F<larry@wall.org>> wrote version 1.0.
+
+Clark Cooper <F<coopercc@netheaven.com>> picked up support, changed the API
+for this version (2.x), provided documentation, and added some standard
+package features.
+
+=cut
diff -aruN 5.0.000.src/library/additions/Parser.pm 5.2.000.src/library/additions/Parser.pm
--- 5.0.000.src/library/additions/Parser.pm	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/Parser.pm	2007-12-10 13:50:30.000000000 -0600
@@ -0,0 +1,840 @@
+# XML::Parser
+#
+# Copyright (c) 1998-2000 Larry Wall and Clark Cooper
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the same terms as Perl itself.
+
+package XML::Parser;
+
+use Carp;
+
+BEGIN {
+  require XML::Parser::Expat;
+  $VERSION = '2.34';
+  die "Parser.pm and Expat.pm versions don't match"
+    unless $VERSION eq $XML::Parser::Expat::VERSION;
+}
+
+use strict;
+
+use vars qw($VERSION $LWP_load_failed);
+
+$LWP_load_failed = 0;
+
+sub new {
+  my ($class, %args) = @_;
+  my $style = $args{Style};
+  
+  my $nonexopt = $args{Non_Expat_Options} ||= {};
+  
+  $nonexopt->{Style}             = 1;
+  $nonexopt->{Non_Expat_Options} = 1;
+  $nonexopt->{Handlers}          = 1;
+  $nonexopt->{_HNDL_TYPES}       = 1;
+  $nonexopt->{NoLWP}             = 1;
+  
+  $args{_HNDL_TYPES} = {%XML::Parser::Expat::Handler_Setters};
+  $args{_HNDL_TYPES}->{Init} = 1;
+  $args{_HNDL_TYPES}->{Final} = 1;
+  
+  $args{Handlers} ||= {};
+  my $handlers = $args{Handlers};
+  
+  if (defined($style)) {
+    my $stylepkg = $style;
+    
+    if ($stylepkg !~ /::/) {
+      $stylepkg = "\u$style";
+      
+      eval {
+          my $fullpkg = 'XML::Parser::Style::' . $stylepkg;
+          my $stylefile = $fullpkg;
+          $stylefile =~ s/::/\//g;
+          require "$stylefile.pm";
+          $stylepkg = $fullpkg;
+      };
+      if ($@) {
+          # fallback to old behaviour
+          $stylepkg = 'XML::Parser::' . $stylepkg;
+      }
+    }
+    
+    my $htype;
+    foreach $htype (keys %{$args{_HNDL_TYPES}}) {
+      # Handlers explicity given override
+      # handlers from the Style package
+      unless (defined($handlers->{$htype})) {
+        
+        # A handler in the style package must either have
+        # exactly the right case as the type name or a
+        # completely lower case version of it.
+        
+        my $hname = "${stylepkg}::$htype";
+        if (defined(&$hname)) {
+          $handlers->{$htype} = \&$hname;
+          next;
+        }
+        
+        $hname = "${stylepkg}::\L$htype";
+        if (defined(&$hname)) {
+          $handlers->{$htype} = \&$hname;
+          next;
+        }
+      }
+    }
+  }
+  
+  unless (defined($handlers->{ExternEnt})
+          or defined ($handlers->{ExternEntFin})) {
+    
+    if ($args{NoLWP} or $LWP_load_failed) {
+      $handlers->{ExternEnt} = \&file_ext_ent_handler;
+      $handlers->{ExternEntFin} = \&file_ext_ent_cleanup;
+    }
+    else {
+      # The following just bootstraps the real LWP external entity
+      # handler
+
+      $handlers->{ExternEnt} = \&initial_ext_ent_handler;
+
+      # No cleanup function available until LWPExternEnt.pl loaded
+    }
+  }
+
+  $args{Pkg} ||= caller;
+  bless \%args, $class;
+}                                # End of new
+
+sub setHandlers {
+  my ($self, @handler_pairs) = @_;
+  
+  croak("Uneven number of arguments to setHandlers method")
+    if (int(@handler_pairs) & 1);
+  
+  my @ret;
+  while (@handler_pairs) {
+    my $type = shift @handler_pairs;
+    my $handler = shift @handler_pairs;
+    unless (defined($self->{_HNDL_TYPES}->{$type})) {
+      my @types = sort keys %{$self->{_HNDL_TYPES}};
+      
+      croak("Unknown Parser handler type: $type\n Valid types: @types");
+    }
+    push(@ret, $type, $self->{Handlers}->{$type});
+    $self->{Handlers}->{$type} = $handler;
+  }
+
+  return @ret;
+}
+
+sub parse_start {
+  my $self = shift;
+  my @expat_options = ();
+
+  my ($key, $val);
+  while (($key, $val) = each %{$self}) {
+    push (@expat_options, $key, $val)
+      unless exists $self->{Non_Expat_Options}->{$key};
+  }
+
+  my %handlers = %{$self->{Handlers}};
+  my $init = delete $handlers{Init};
+  my $final = delete $handlers{Final};
+
+  my $expatnb = new XML::Parser::ExpatNB(@expat_options, @_);
+  $expatnb->setHandlers(%handlers);
+
+  &$init($expatnb)
+    if defined($init);
+
+  $expatnb->{_State_} = 1;
+
+  $expatnb->{FinalHandler} = $final
+    if defined($final);
+
+  return $expatnb;
+}
+
+sub parse {
+  my $self = shift;
+  my $arg  = shift;
+  my @expat_options = ();
+  my ($key, $val);
+  while (($key, $val) = each %{$self}) {
+    push(@expat_options, $key, $val)
+      unless exists $self->{Non_Expat_Options}->{$key};
+  }
+  
+  my $expat = new XML::Parser::Expat(@expat_options, @_);
+  my %handlers = %{$self->{Handlers}};
+  my $init = delete $handlers{Init};
+  my $final = delete $handlers{Final};
+  
+  $expat->setHandlers(%handlers);
+  
+  if ($self->{Base}) {
+    $expat->base($self->{Base});
+  }
+
+  &$init($expat)
+    if defined($init);
+  
+  my @result = ();
+  my $result;
+  eval {
+    $result = $expat->parse($arg);
+  };
+  my $err = $@;
+  if ($err) {
+    $expat->release;
+    die $err;
+  }
+  
+  if ($result and defined($final)) {
+    if (wantarray) {
+      @result = &$final($expat);
+    }
+    else {
+      $result = &$final($expat);
+    }
+  }
+  
+  $expat->release;
+
+  return unless defined wantarray;
+  return wantarray ? @result : $result;
+}
+
+sub parsestring {
+  my $self = shift;
+  $self->parse(@_);
+}
+
+sub parsefile {
+  my $self = shift;
+  my $file = shift;
+  local(*FILE);
+  open(FILE, $file) or  croak "Couldn't open $file:\n$!";
+  binmode(FILE);
+  my @ret;
+  my $ret;
+
+  $self->{Base} = $file;
+
+  if (wantarray) {
+    eval {
+      @ret = $self->parse(*FILE, @_);
+    };
+  }
+  else {
+    eval {
+      $ret = $self->parse(*FILE, @_);
+    };
+  }
+  my $err = $@;
+  close(FILE);
+  die $err if $err;
+  
+  return unless defined wantarray;
+  return wantarray ? @ret : $ret;
+}
+
+sub initial_ext_ent_handler {
+  # This just bootstraps in the real lwp_ext_ent_handler which
+  # also loads the URI and LWP modules.
+
+  unless ($LWP_load_failed) {
+    local($^W) = 0;
+
+    my $stat =
+      eval {
+        require('XML/Parser/LWPExternEnt.pl');
+      };
+      
+    if ($stat) {
+      $_[0]->setHandlers(ExternEnt    => \&lwp_ext_ent_handler,
+                         ExternEntFin => \&lwp_ext_ent_cleanup);
+                       
+      goto &lwp_ext_ent_handler;
+    }
+
+    # Failed to load lwp handler, act as if NoLWP
+
+    $LWP_load_failed = 1;
+
+    my $cmsg = "Couldn't load LWP based external entity handler\n";
+    $cmsg .= "Switching to file-based external entity handler\n";
+    $cmsg .= " (To avoid this message, use NoLWP option to XML::Parser)\n";
+    warn($cmsg);
+  }
+
+  $_[0]->setHandlers(ExternEnt    => \&file_ext_ent_handler,
+                     ExternEntFin => \&file_ext_ent_cleanup);
+  goto &file_ext_ent_handler;
+
+}
+
+sub file_ext_ent_handler {
+  my ($xp, $base, $path) = @_;
+
+  # Prepend base only for relative paths
+
+  if (defined($base)
+      and not ($path =~ m!^(?:[\\/]|\w+:)!))
+    {
+      my $newpath = $base;
+      $newpath =~ s![^\\/:]*$!$path!;
+      $path = $newpath;
+    }
+
+  if ($path =~ /^\s*[|>+]/
+      or $path =~ /\|\s*$/) {
+    $xp->{ErrorMessage}
+        .= "System ID ($path) contains Perl IO control characters";
+    return undef;
+  }
+
+  require IO::File;
+  my $fh = new IO::File($path);
+  unless (defined $fh) {
+    $xp->{ErrorMessage}
+      .= "Failed to open $path:\n$!";
+    return undef;
+  }
+
+  $xp->{_BaseStack} ||= [];
+  $xp->{_FhStack} ||= [];
+
+  push(@{$xp->{_BaseStack}}, $base);
+  push(@{$xp->{_FhStack}}, $fh);
+
+  $xp->base($path);
+  
+  return $fh;
+}
+
+sub file_ext_ent_cleanup {
+  my ($xp) = @_;
+
+  my $fh = pop(@{$xp->{_FhStack}});
+  $fh->close;
+
+  my $base = pop(@{$xp->{_BaseStack}});
+  $xp->base($base);
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+XML::Parser - A perl module for parsing XML documents
+
+=head1 SYNOPSIS
+
+  use XML::Parser;
+  
+  $p1 = new XML::Parser(Style => 'Debug');
+  $p1->parsefile('REC-xml-19980210.xml');
+  $p1->parse('<foo id="me">Hello World</foo>');
+
+  # Alternative
+  $p2 = new XML::Parser(Handlers => {Start => \&handle_start,
+                                     End   => \&handle_end,
+                                     Char  => \&handle_char});
+  $p2->parse($socket);
+
+  # Another alternative
+  $p3 = new XML::Parser(ErrorContext => 2);
+
+  $p3->setHandlers(Char    => \&text,
+                   Default => \&other);
+
+  open(FOO, 'xmlgenerator |');
+  $p3->parse(*FOO, ProtocolEncoding => 'ISO-8859-1');
+  close(FOO);
+
+  $p3->parsefile('junk.xml', ErrorContext => 3);
+
+=begin man
+.ds PI PI
+
+=end man
+
+=head1 DESCRIPTION
+
+This module provides ways to parse XML documents. It is built on top of
+L<XML::Parser::Expat>, which is a lower level interface to James Clark's
+expat library. Each call to one of the parsing methods creates a new
+instance of XML::Parser::Expat which is then used to parse the document.
+Expat options may be provided when the XML::Parser object is created.
+These options are then passed on to the Expat object on each parse call.
+They can also be given as extra arguments to the parse methods, in which
+case they override options given at XML::Parser creation time.
+
+The behavior of the parser is controlled either by C<L</Style>> and/or
+C<L</Handlers>> options, or by L</setHandlers> method. These all provide
+mechanisms for XML::Parser to set the handlers needed by XML::Parser::Expat.
+If neither C<Style> nor C<Handlers> are specified, then parsing just
+checks the document for being well-formed.
+
+When underlying handlers get called, they receive as their first parameter
+the I<Expat> object, not the Parser object.
+
+=head1 METHODS
+
+=over 4
+
+=item new
+
+This is a class method, the constructor for XML::Parser. Options are passed
+as keyword value pairs. Recognized options are:
+
+=over 4
+
+=item * Style
+
+This option provides an easy way to create a given style of parser. The
+built in styles are: L<"Debug">, L<"Subs">, L<"Tree">, L<"Objects">,
+and L<"Stream">. These are all defined in separate packages under
+C<XML::Parser::Style::*>, and you can find further documentation for
+each style both below, and in those packages.
+
+Custom styles can be provided by giving a full package name containing
+at least one '::'. This package should then have subs defined for each
+handler it wishes to have installed. See L<"STYLES"> below
+for a discussion of each built in style.
+
+=item * Handlers
+
+When provided, this option should be an anonymous hash containing as
+keys the type of handler and as values a sub reference to handle that
+type of event. All the handlers get passed as their 1st parameter the
+instance of expat that is parsing the document. Further details on
+handlers can be found in L<"HANDLERS">. Any handler set here
+overrides the corresponding handler set with the Style option.
+
+=item * Pkg
+
+Some styles will refer to subs defined in this package. If not provided,
+it defaults to the package which called the constructor.
+
+=item * ErrorContext
+
+This is an Expat option. When this option is defined, errors are reported
+in context. The value should be the number of lines to show on either side
+of the line in which the error occurred.
+
+=item * ProtocolEncoding
+
+This is an Expat option. This sets the protocol encoding name. It defaults
+to none. The built-in encodings are: C<UTF-8>, C<ISO-8859-1>, C<UTF-16>, and
+C<US-ASCII>. Other encodings may be used if they have encoding maps in one
+of the directories in the @Encoding_Path list. Check L<"ENCODINGS"> for
+more information on encoding maps. Setting the protocol encoding overrides
+any encoding in the XML declaration.
+
+=item * Namespaces
+
+This is an Expat option. If this is set to a true value, then namespace
+processing is done during the parse. See L<XML::Parser::Expat/"Namespaces">
+for further discussion of namespace processing.
+
+=item * NoExpand
+
+This is an Expat option. Normally, the parser will try to expand references
+to entities defined in the internal subset. If this option is set to a true
+value, and a default handler is also set, then the default handler will be
+called when an entity reference is seen in text. This has no effect if a
+default handler has not been registered, and it has no effect on the expansion
+of entity references inside attribute values.
+
+=item * Stream_Delimiter
+
+This is an Expat option. It takes a string value. When this string is found
+alone on a line while parsing from a stream, then the parse is ended as if it
+saw an end of file. The intended use is with a stream of xml documents in a
+MIME multipart format. The string should not contain a trailing newline.
+
+=item * ParseParamEnt
+
+This is an Expat option. Unless standalone is set to "yes" in the XML
+declaration, setting this to a true value allows the external DTD to be read,
+and parameter entities to be parsed and expanded.
+
+=item * NoLWP
+
+This option has no effect if the ExternEnt or ExternEntFin handlers are
+directly set. Otherwise, if true, it forces the use of a file based external
+entity handler.
+
+=item * Non-Expat-Options
+
+If provided, this should be an anonymous hash whose keys are options that
+shouldn't be passed to Expat. This should only be of concern to those
+subclassing XML::Parser.
+
+=back
+
+=item  setHandlers(TYPE, HANDLER [, TYPE, HANDLER [...]])
+
+This method registers handlers for various parser events. It overrides any
+previous handlers registered through the Style or Handler options or through
+earlier calls to setHandlers. By providing a false or undefined value as
+the handler, the existing handler can be unset.
+
+This method returns a list of type, handler pairs corresponding to the
+input. The handlers returned are the ones that were in effect prior to
+the call.
+
+See a description of the handler types in L<"HANDLERS">.
+
+=item parse(SOURCE [, OPT => OPT_VALUE [...]])
+
+The SOURCE parameter should either be a string containing the whole XML
+document, or it should be an open IO::Handle. Constructor options to
+XML::Parser::Expat given as keyword-value pairs may follow the SOURCE
+parameter. These override, for this call, any options or attributes passed
+through from the XML::Parser instance.
+
+A die call is thrown if a parse error occurs. Otherwise it will return 1
+or whatever is returned from the B<Final> handler, if one is installed.
+In other words, what parse may return depends on the style.
+
+=item parsestring
+
+This is just an alias for parse for backwards compatibility.
+
+=item parsefile(FILE [, OPT => OPT_VALUE [...]])
+
+Open FILE for reading, then call parse with the open handle. The file
+is closed no matter how parse returns. Returns what parse returns.
+
+=item parse_start([ OPT => OPT_VALUE [...]])
+
+Create and return a new instance of XML::Parser::ExpatNB. Constructor
+options may be provided. If an init handler has been provided, it is
+called before returning the ExpatNB object. Documents are parsed by
+making incremental calls to the parse_more method of this object, which
+takes a string. A single call to the parse_done method of this object,
+which takes no arguments, indicates that the document is finished.
+
+If there is a final handler installed, it is executed by the parse_done
+method before returning and the parse_done method returns whatever is
+returned by the final handler.
+
+=back
+
+=head1 HANDLERS
+
+Expat is an event based parser. As the parser recognizes parts of the
+document (say the start or end tag for an XML element), then any handlers
+registered for that type of an event are called with suitable parameters.
+All handlers receive an instance of XML::Parser::Expat as their first
+argument. See L<XML::Parser::Expat/"METHODS"> for a discussion of the
+methods that can be called on this object.
+
+=head2 Init                (Expat)
+
+This is called just before the parsing of the document starts.
+
+=head2 Final                (Expat)
+
+This is called just after parsing has finished, but only if no errors
+occurred during the parse. Parse returns what this returns.
+
+=head2 Start                (Expat, Element [, Attr, Val [,...]])
+
+This event is generated when an XML start tag is recognized. Element is the
+name of the XML element type that is opened with the start tag. The Attr &
+Val pairs are generated for each attribute in the start tag.
+
+=head2 End                (Expat, Element)
+
+This event is generated when an XML end tag is recognized. Note that
+an XML empty tag (<foo/>) generates both a start and an end event.
+
+=head2 Char                (Expat, String)
+
+This event is generated when non-markup is recognized. The non-markup
+sequence of characters is in String. A single non-markup sequence of
+characters may generate multiple calls to this handler. Whatever the
+encoding of the string in the original document, this is given to the
+handler in UTF-8.
+
+=head2 Proc                (Expat, Target, Data)
+
+This event is generated when a processing instruction is recognized.
+
+=head2 Comment                (Expat, Data)
+
+This event is generated when a comment is recognized.
+
+=head2 CdataStart        (Expat)
+
+This is called at the start of a CDATA section.
+
+=head2 CdataEnd                (Expat)
+
+This is called at the end of a CDATA section.
+
+=head2 Default                (Expat, String)
+
+This is called for any characters that don't have a registered handler.
+This includes both characters that are part of markup for which no
+events are generated (markup declarations) and characters that
+could generate events, but for which no handler has been registered.
+
+Whatever the encoding in the original document, the string is returned to
+the handler in UTF-8.
+
+=head2 Unparsed                (Expat, Entity, Base, Sysid, Pubid, Notation)
+
+This is called for a declaration of an unparsed entity. Entity is the name
+of the entity. Base is the base to be used for resolving a relative URI.
+Sysid is the system id. Pubid is the public id. Notation is the notation
+name. Base and Pubid may be undefined.
+
+=head2 Notation                (Expat, Notation, Base, Sysid, Pubid)
+
+This is called for a declaration of notation. Notation is the notation name.
+Base is the base to be used for resolving a relative URI. Sysid is the system
+id. Pubid is the public id. Base, Sysid, and Pubid may all be undefined.
+
+=head2 ExternEnt        (Expat, Base, Sysid, Pubid)
+
+This is called when an external entity is referenced. Base is the base to be
+used for resolving a relative URI. Sysid is the system id. Pubid is the public
+id. Base, and Pubid may be undefined.
+
+This handler should either return a string, which represents the contents of
+the external entity, or return an open filehandle that can be read to obtain
+the contents of the external entity, or return undef, which indicates the
+external entity couldn't be found and will generate a parse error.
+
+If an open filehandle is returned, it must be returned as either a glob
+(*FOO) or as a reference to a glob (e.g. an instance of IO::Handle).
+
+A default handler is installed for this event. The default handler is
+XML::Parser::lwp_ext_ent_handler unless the NoLWP option was provided with
+a true value, otherwise XML::Parser::file_ext_ent_handler is the default
+handler for external entities. Even without the NoLWP option, if the
+URI or LWP modules are missing, the file based handler ends up being used
+after giving a warning on the first external entity reference.
+
+The LWP external entity handler will use proxies defined in the environment
+(http_proxy, ftp_proxy, etc.).
+
+Please note that the LWP external entity handler reads the entire
+entity into a string and returns it, where as the file handler opens a
+filehandle.
+
+Also note that the file external entity handler will likely choke on
+absolute URIs or file names that don't fit the conventions of the local
+operating system.
+
+The expat base method can be used to set a basename for
+relative pathnames. If no basename is given, or if the basename is itself
+a relative name, then it is relative to the current working directory.
+
+=head2 ExternEntFin        (Expat)
+
+This is called after parsing an external entity. It's not called unless
+an ExternEnt handler is also set. There is a default handler installed
+that pairs with the default ExternEnt handler.
+
+If you're going to install your own ExternEnt handler, then you should
+set (or unset) this handler too.
+
+=head2 Entity                (Expat, Name, Val, Sysid, Pubid, Ndata, IsParam)
+
+This is called when an entity is declared. For internal entities, the Val
+parameter will contain the value and the remaining three parameters will be
+undefined. For external entities, the Val parameter will be undefined, the
+Sysid parameter will have the system id, the Pubid parameter will have the
+public id if it was provided (it will be undefined otherwise), the Ndata
+parameter will contain the notation for unparsed entities. If this is a
+parameter entity declaration, then the IsParam parameter is true.
+
+Note that this handler and the Unparsed handler above overlap. If both are
+set, then this handler will not be called for unparsed entities.
+
+=head2 Element                (Expat, Name, Model)
+
+The element handler is called when an element declaration is found. Name
+is the element name, and Model is the content model as an XML::Parser::Content
+object. See L<XML::Parser::Expat/"XML::Parser::ContentModel Methods">
+for methods available for this class.
+
+=head2 Attlist                (Expat, Elname, Attname, Type, Default, Fixed)
+
+This handler is called for each attribute in an ATTLIST declaration.
+So an ATTLIST declaration that has multiple attributes will generate multiple
+calls to this handler. The Elname parameter is the name of the element with
+which the attribute is being associated. The Attname parameter is the name
+of the attribute. Type is the attribute type, given as a string. Default is
+the default value, which will either be "#REQUIRED", "#IMPLIED" or a quoted
+string (i.e. the returned string will begin and end with a quote character).
+If Fixed is true, then this is a fixed attribute.
+
+=head2 Doctype                (Expat, Name, Sysid, Pubid, Internal)
+
+This handler is called for DOCTYPE declarations. Name is the document type
+name. Sysid is the system id of the document type, if it was provided,
+otherwise it's undefined. Pubid is the public id of the document type,
+which will be undefined if no public id was given. Internal is the internal
+subset, given as a string. If there was no internal subset, it will be
+undefined. Internal will contain all whitespace, comments, processing
+instructions, and declarations seen in the internal subset. The declarations
+will be there whether or not they have been processed by another handler
+(except for unparsed entities processed by the Unparsed handler). However,
+comments and processing instructions will not appear if they've been processed
+by their respective handlers.
+
+=head2 * DoctypeFin                (Parser)
+
+This handler is called after parsing of the DOCTYPE declaration has finished,
+including any internal or external DTD declarations.
+
+=head2 XMLDecl                (Expat, Version, Encoding, Standalone)
+
+This handler is called for xml declarations. Version is a string containg
+the version. Encoding is either undefined or contains an encoding string.
+Standalone will be either true, false, or undefined if the standalone attribute
+is yes, no, or not made respectively.
+
+=head1 STYLES
+
+=head2 Debug
+
+This just prints out the document in outline form. Nothing special is
+returned by parse.
+
+=head2 Subs
+
+Each time an element starts, a sub by that name in the package specified
+by the Pkg option is called with the same parameters that the Start
+handler gets called with.
+
+Each time an element ends, a sub with that name appended with an underscore
+("_"), is called with the same parameters that the End handler gets called
+with.
+
+Nothing special is returned by parse.
+
+=head2 Tree
+
+Parse will return a parse tree for the document. Each node in the tree
+takes the form of a tag, content pair. Text nodes are represented with
+a pseudo-tag of "0" and the string that is their content. For elements,
+the content is an array reference. The first item in the array is a
+(possibly empty) hash reference containing attributes. The remainder of
+the array is a sequence of tag-content pairs representing the content
+of the element.
+
+So for example the result of parsing:
+
+  <foo><head id="a">Hello <em>there</em></head><bar>Howdy<ref/></bar>do</foo>
+
+would be:
+
+             Tag   Content
+  ==================================================================
+  [foo, [{}, head, [{id => "a"}, 0, "Hello ",  em, [{}, 0, "there"]],
+              bar, [         {}, 0, "Howdy",  ref, [{}]],
+                0, "do"
+        ]
+  ]
+
+The root document "foo", has 3 children: a "head" element, a "bar"
+element and the text "do". After the empty attribute hash, these are
+represented in it's contents by 3 tag-content pairs.
+
+=head2 Objects
+
+This is similar to the Tree style, except that a hash object is created for
+each element. The corresponding object will be in the class whose name
+is created by appending "::" and the element name to the package set with
+the Pkg option. Non-markup text will be in the ::Characters class. The
+contents of the corresponding object will be in an anonymous array that
+is the value of the Kids property for that object.
+
+=head2 Stream
+
+This style also uses the Pkg package. If none of the subs that this
+style looks for is there, then the effect of parsing with this style is
+to print a canonical copy of the document without comments or declarations.
+All the subs receive as their 1st parameter the Expat instance for the
+document they're parsing.
+
+It looks for the following routines:
+
+=over 4
+
+=item * StartDocument
+
+Called at the start of the parse .
+
+=item * StartTag
+
+Called for every start tag with a second parameter of the element type. The $_
+variable will contain a copy of the tag and the %_ variable will contain
+attribute values supplied for that element.
+
+=item * EndTag
+
+Called for every end tag with a second parameter of the element type. The $_
+variable will contain a copy of the end tag.
+
+=item * Text
+
+Called just before start or end tags with accumulated non-markup text in
+the $_ variable.
+
+=item * PI
+
+Called for processing instructions. The $_ variable will contain a copy of
+the PI and the target and data are sent as 2nd and 3rd parameters
+respectively.
+
+=item * EndDocument
+
+Called at conclusion of the parse.
+
+=back
+
+=head1 ENCODINGS
+
+XML documents may be encoded in character sets other than Unicode as
+long as they may be mapped into the Unicode character set. Expat has
+further restrictions on encodings. Read the xmlparse.h header file in
+the expat distribution to see details on these restrictions.
+
+Expat has built-in encodings for: C<UTF-8>, C<ISO-8859-1>, C<UTF-16>, and
+C<US-ASCII>. Encodings are set either through the XML declaration
+encoding attribute or through the ProtocolEncoding option to XML::Parser
+or XML::Parser::Expat.
+
+For encodings other than the built-ins, expat calls the function
+load_encoding in the Expat package with the encoding name. This function
+looks for a file in the path list @XML::Parser::Expat::Encoding_Path, that
+matches the lower-cased name with a '.enc' extension. The first one it
+finds, it loads.
+
+If you wish to build your own encoding maps, check out the XML::Encoding
+module from CPAN.
+
+=head1 AUTHORS
+
+Larry Wall <F<larry@wall.org>> wrote version 1.0.
+
+Clark Cooper <F<coopercc@netheaven.com>> picked up support, changed the API
+for this version (2.x), provided documentation,
+and added some standard package features.
+
+Matt Sergeant <F<matt@sergeant.org>> is now maintaining XML::Parser
+
+=cut
diff -aruN 5.0.000.src/library/additions/SAX/DocumentLocator.pm 5.2.000.src/library/additions/SAX/DocumentLocator.pm
--- 5.0.000.src/library/additions/SAX/DocumentLocator.pm	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/SAX/DocumentLocator.pm	2007-12-10 13:50:38.000000000 -0600
@@ -0,0 +1,121 @@
+# $Id: DocumentLocator.pm,v 1.2 2002/01/22 21:38:06 matt Exp $
+
+package XML::SAX::DocumentLocator;
+use strict;
+
+sub new {
+    my $class = shift;
+    my %object;
+    tie %object, $class, @_;
+
+    return bless \%object, $class;
+}
+
+sub TIEHASH {
+    my $class = shift;
+    my ($pubmeth, $sysmeth, $linemeth, $colmeth) = @_;
+    return bless { 
+        pubmeth => $pubmeth,
+        sysmeth => $sysmeth,
+        linemeth => $linemeth,
+        colmeth => $colmeth,
+    }, $class;
+}
+
+sub FETCH {
+    my ($self, $key) = @_;
+    my $method;
+    if ($key eq 'PublicId') {
+        $method = $self->{pubmeth};
+    }
+    elsif ($key eq 'SystemId') {
+        $method = $self->{sysmeth};
+    }
+    elsif ($key eq 'LineNumber') {
+        $method = $self->{linemeth};
+    }
+    elsif ($key eq 'ColumnNumber') {
+        $method = $self->{colmeth};
+    }
+    if ($method) {
+        my $value = $method->($key);
+        return $value;
+    }
+    return undef;
+}
+
+sub EXISTS {
+    my ($self, $key) = @_;
+    if ($key =~ /^(PublicId|SystemId|LineNumber|ColumnNumber)$/) {
+        return 1;
+    }
+    return 0;
+}
+
+sub STORE {
+    my ($self, $key, $value) = @_;
+}
+
+sub DELETE {
+    my ($self, $key) = @_;
+}
+
+sub CLEAR {
+    my ($self) = @_;
+}
+
+sub FIRSTKEY {
+    my ($self) = @_;
+    # assignment resets.
+    $self->{keys} = {
+        PublicId => 1,
+        SystemId => 1,
+        LineNumber => 1,
+        ColumnNumber => 1,
+    };
+    return each %{$self->{keys}};
+}
+
+sub NEXTKEY {
+    my ($self, $lastkey) = @_;
+    return each %{$self->{keys}};
+}
+
+1;
+__END__
+
+=head1 NAME
+
+XML::SAX::DocumentLocator - Helper class for document locators
+
+=head1 SYNOPSIS
+
+  my $locator = XML::SAX::DocumentLocator->new(
+      sub { $object->get_public_id },
+      sub { $object->get_system_id },
+      sub { $reader->current_line },
+      sub { $reader->current_column },
+  );
+
+=head1 DESCRIPTION
+
+This module gives you a tied hash reference that calls the
+specified closures when asked for PublicId, SystemId,
+LineNumber and ColumnNumber.
+
+It is useful for writing SAX Parsers so that you don't have
+to constantly update the line numbers in a hash reference on
+the object you pass to set_document_locator(). See the source
+code for XML::SAX::PurePerl for a usage example.
+
+=head1 API
+
+There is only 1 method: C<new>. Simply pass it a list of
+closures that when called will return the PublicId, the
+SystemId, the LineNumber and the ColumnNumber, respectively.
+
+The closures are passed a single parameter, the key being
+requested. But you're free to ignore that.
+
+=cut
+
diff -aruN 5.0.000.src/library/additions/SAX/ParserFactory.pm 5.2.000.src/library/additions/SAX/ParserFactory.pm
--- 5.0.000.src/library/additions/SAX/ParserFactory.pm	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/SAX/ParserFactory.pm	2007-12-10 13:50:38.000000000 -0600
@@ -0,0 +1,232 @@
+# $Id: ParserFactory.pm,v 1.13 2002/11/19 18:25:47 matt Exp $
+
+package XML::SAX::ParserFactory;
+
+use strict;
+use vars qw($VERSION);
+
+$VERSION = '1.01';
+
+use Symbol qw(gensym);
+use XML::SAX;
+use XML::SAX::Exception;
+
+sub new {
+    my $class = shift;
+    my %params = @_; # TODO : Fix this in spec.
+    my $self = bless \%params, $class;
+    $self->{KnownParsers} = XML::SAX->parsers();
+    return $self;
+}
+
+sub parser {
+    my $self = shift;
+    my @parser_params = @_;
+    if (!ref($self)) {
+        $self = $self->new();
+    }
+    
+    my $parser_class = $self->_parser_class();
+
+    my $version = '';
+    if ($parser_class =~ s/\s*\(([\d\.]+)\)\s*$//) {
+        $version = " $1";
+    }
+
+    {
+        no strict 'refs';
+        if (!keys %{"${parser_class}::"}) {
+            eval "use $parser_class $version;";
+        }
+    }
+
+    return $parser_class->new(@parser_params);
+}
+
+sub require_feature {
+    my $self = shift;
+    my ($feature) = @_;
+    $self->{RequiredFeatures}{$feature}++;
+    return $self;
+}
+
+sub _parser_class {
+    my $self = shift;
+
+    # First try ParserPackage
+    if ($XML::SAX::ParserPackage) {
+        return $XML::SAX::ParserPackage;
+    }
+
+    # Now check if required/preferred is there
+    if ($self->{RequiredFeatures}) {
+        my %required = %{$self->{RequiredFeatures}};
+        # note - we never go onto the next try (ParserDetails.ini),
+        # because if we can't provide the requested feature
+        # we need to throw an exception.
+        PARSER:
+        foreach my $parser (reverse @{$self->{KnownParsers}}) {
+            foreach my $feature (keys %required) {
+                if (!exists $parser->{Features}{$feature}) {
+                    next PARSER;
+                }
+            }
+            # got here - all features must exist!
+            return $parser->{Name};
+        }
+        # TODO : should this be NotSupported() ?
+        throw XML::SAX::Exception (
+                Message => "Unable to provide required features",
+            );
+    }
+
+    # Next try SAX.ini
+    for my $dir (@INC) {
+        my $fh = gensym();
+        if (open($fh, "$dir/SAX.ini")) {
+            my $param_list = XML::SAX->_parse_ini_file($fh);
+            my $params = $param_list->[0]->{Features};
+            if ($params->{ParserPackage}) {
+                return $params->{ParserPackage};
+            }
+            else {
+                # we have required features (or nothing?)
+                PARSER:
+                foreach my $parser (reverse @{$self->{KnownParsers}}) {
+                    foreach my $feature (keys %$params) {
+                        if (!exists $parser->{Features}{$feature}) {
+                            next PARSER;
+                        }
+                    }
+                    return $parser->{Name};
+                }
+                XML::SAX->do_warn("Unable to provide SAX.ini required features. Using fallback\n");
+            } 
+            last; # stop after first INI found
+        }
+    }
+
+    if (@{$self->{KnownParsers}}) {
+        return $self->{KnownParsers}[-1]{Name};
+    }
+    else {
+        return "XML::SAX::PurePerl"; # backup plan!
+    }
+}
+
+1;
+__END__
+
+=head1 NAME
+
+XML::SAX::ParserFactory - Obtain a SAX parser
+
+=head1 SYNOPSIS
+
+  use XML::SAX::ParserFactory;
+  use XML::SAX::XYZHandler;
+  my $handler = XML::SAX::XYZHandler->new();
+  my $p = XML::SAX::ParserFactory->parser(Handler => $handler);
+  $p->parse_uri("foo.xml");
+  # or $p->parse_string("<foo/>") or $p->parse_file($fh);
+
+=head1 DESCRIPTION
+
+XML::SAX::ParserFactory is a factory class for providing an application
+with a Perl SAX2 XML parser. It is akin to DBI - a front end for other
+parser classes. Each new SAX2 parser installed will register itself
+with XML::SAX, and then it will become available to all applications
+that use XML::SAX::ParserFactory to obtain a SAX parser.
+
+Unlike DBI however, XML/SAX parsers almost all work alike (especially
+if they subclass XML::SAX::Base, as they should), so rather than
+specifying the parser you want in the call to C<parser()>, XML::SAX
+has several ways to automatically choose which parser to use:
+
+=over 4
+
+=item * $XML::SAX::ParserPackage
+
+If this package variable is set, then this package is C<require()>d
+and an instance of this package is returned by calling the C<new()>
+class method in that package. If it cannot be loaded or there is
+an error, an exception will be thrown. The variable can also contain
+a version number:
+
+  $XML::SAX::ParserPackage = "XML::SAX::Expat (0.72)";
+
+And the number will be treated as a minimum version number.
+
+=item * Required features
+
+It is possible to require features from the parsers. For example, you
+may wish for a parser that supports validation via a DTD. To do that,
+use the following code:
+
+  use XML::SAX::ParserFactory;
+  my $factory = XML::SAX::ParserFactory->new();
+  $factory->require_feature('http://xml.org/sax/features/validation');
+  my $parser = $factory->parser(...);
+
+Alternatively, specify the required features in the call to the
+ParserFactory constructor:
+
+  my $factory = XML::SAX::ParserFactory->new(
+          RequiredFeatures => {
+               'http://xml.org/sax/features/validation' => 1,
+               }
+          );
+
+If the features you have asked for are unavailable (for example the
+user might not have a validating parser installed), then an
+exception will be thrown.
+
+The list of known parsers is searched in reverse order, so it will
+always return the last installed parser that supports all of your
+requested features (Note: this is subject to change if someone
+comes up with a better way of making this work).
+
+=item * SAX.ini
+
+ParserFactory will search @INC for a file called SAX.ini, which
+is in a simple format:
+
+  # a comment looks like this,
+  ; or like this, and are stripped anywhere in the file
+  key = value # SAX.in contains key/value pairs.
+
+All whitespace is non-significant.
+
+This file can contain either a line:
+
+  ParserPackage = MyParserModule (1.02)
+
+Where MyParserModule is the module to load and use for the parser,
+and the number in brackets is a minimum version to load.
+
+Or you can list required features:
+
+  http://xml.org/sax/features/validation = 1
+
+And each feature with a true value will be required.
+
+=item * Fallback
+
+If none of the above works, the last parser installed on the user's
+system will be used. The XML::SAX package ships with a pure perl
+XML parser, XML::SAX::PurePerl, so that there will always be a
+fallback parser.
+
+=back
+
+=head1 AUTHOR
+
+Matt Sergeant, matt@sergeant.org
+
+=head1 LICENSE
+
+This is free software, you may use it and distribute it under the same
+terms as Perl itself.
+
+=cut
+
diff -aruN 5.0.000.src/library/additions/SAX/PurePerl.pm 5.2.000.src/library/additions/SAX/PurePerl.pm
--- 5.0.000.src/library/additions/SAX/PurePerl.pm	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/SAX/PurePerl.pm	2007-12-10 13:50:39.000000000 -0600
@@ -0,0 +1,748 @@
+# $Id: PurePerl.pm,v 1.15 2002/02/05 17:33:52 matt Exp $
+
+package XML::SAX::PurePerl;
+
+use strict;
+use vars qw/$VERSION/;
+
+$VERSION = '0.90';
+
+use XML::SAX::PurePerl::Productions qw($Any $CharMinusDash $SingleChar);
+use XML::SAX::PurePerl::Reader;
+use XML::SAX::PurePerl::EncodingDetect ();
+use XML::SAX::Exception;
+use XML::SAX::PurePerl::DocType ();
+use XML::SAX::PurePerl::DTDDecls ();
+use XML::SAX::PurePerl::XMLDecl ();
+use XML::SAX::DocumentLocator ();
+use XML::SAX::Base ();
+use XML::SAX qw(Namespaces);
+use XML::NamespaceSupport ();
+use IO::File;
+
+if ($] < 5.006) {
+    require XML::SAX::PurePerl::NoUnicodeExt;
+}
+else {
+    require XML::SAX::PurePerl::UnicodeExt;
+}
+
+use vars qw(@ISA);
+@ISA = ('XML::SAX::Base');
+
+my %int_ents = (
+        amp => '&',
+        lt => '<',
+        gt => '>',
+        quot => '"',
+        apos => "'",
+        );
+
+my $xmlns_ns = "http://www.w3.org/2000/xmlns/";
+my $xml_ns = "http://www.w3.org/XML/1998/namespace";
+
+use Carp;
+sub _parse_characterstream {
+    my $self = shift;
+    my ($fh) = @_;
+    confess("CharacterStream is not yet correctly implemented");
+    my $reader = XML::SAX::PurePerl::Reader::Stream->new($fh);
+    return $self->_parse($reader);
+}
+
+sub _parse_bytestream {
+    my $self = shift;
+    my ($fh) = @_;
+    my $reader = XML::SAX::PurePerl::Reader::Stream->new($fh);
+    return $self->_parse($reader);
+}
+
+sub _parse_string {
+    my $self = shift;
+    my ($str) = @_;
+    my $reader = XML::SAX::PurePerl::Reader::String->new($str);
+    return $self->_parse($reader);
+}
+
+sub _parse_systemid {
+    my $self = shift;
+    my ($uri) = @_;
+    my $reader = XML::SAX::PurePerl::Reader::URI->new($uri);
+    return $self->_parse($reader);
+}
+
+sub _parse {
+    my ($self, $reader) = @_;
+    
+    $reader->public_id($self->{ParseOptions}{Source}{PublicId});
+    $reader->system_id($self->{ParseOptions}{Source}{SystemId});
+    $reader->next;
+
+    $self->{NSHelper} = XML::NamespaceSupport->new({xmlns => 1});
+
+    $self->set_document_locator(
+        XML::SAX::DocumentLocator->new(
+            sub { $reader->public_id },
+            sub { $reader->system_id },
+            sub { $reader->line },
+            sub { $reader->column },
+        ),
+    );
+    
+    $self->start_document({});
+
+    if (defined $self->{ParseOptions}{Source}{Encoding}) {
+        $reader->set_encoding($self->{ParseOptions}{Source}{Encoding});
+    }
+    else {
+        $self->encoding_detect($reader);
+    }
+    
+    # parse a document
+    $self->document($reader);
+    
+    return $self->end_document({});
+}
+
+sub parser_error {
+    my $self = shift;
+    my ($error, $reader) = @_;
+    
+# warn("parser error: $error from ", $reader->line, " : ", $reader->column, "\n");
+    my $exception = XML::SAX::Exception::Parse->new(
+                Message => $error,
+                ColumnNumber => $reader->column,
+                LineNumber => $reader->line,
+                PublicId => $reader->public_id,
+                SystemId => $reader->system_id,
+            );
+
+    $self->fatal_error($exception);
+    $exception->throw;
+}
+
+sub document {
+    my ($self, $reader) = @_;
+    
+    # document ::= prolog element Misc*
+    
+    $self->prolog($reader);
+    $self->element($reader) ||
+        $self->parser_error("Document requires an element", $reader);
+    
+    while(!$reader->eof) {
+        $self->Misc($reader) || 
+                $self->parser_error("Only Comments, PIs and whitespace allowed at end of document", $reader);
+    }
+}
+
+sub prolog {
+    my ($self, $reader) = @_;
+    
+    $self->XMLDecl($reader);
+    
+    # consume all misc bits
+    1 while($self->Misc($reader));
+    
+    if ($self->doctypedecl($reader)) {
+        while (!$reader->eof) {
+            $self->Misc($reader) || last;
+        }
+    }
+}
+
+sub element {
+    my ($self, $reader) = @_;
+    
+    if ($reader->match_char('<')) {
+        my $name = $self->Name($reader) ||
+                $self->parser_error("Invalid element name", $reader);
+
+        my %attribs;
+        
+        while( my ($k, $v) = $self->Attribute($reader) ) {
+            $attribs{$k} = $v;
+        }
+        
+        $self->skip_whitespace($reader);
+        
+        my $content;
+        unless ($reader->match_sequence('/', '>')) {
+            $reader->match_char('>') ||
+                $self->parser_error("No close element tag", $reader);
+            
+            # only push onto _el_stack if not an empty element
+            push @{$self->{_el_stack}}, $name;
+            $content++;
+        }
+        
+        # Namespace processing
+        $self->{NSHelper}->push_context;
+        my @new_ns;
+#        my %attrs = @attribs;
+#        while (my ($k,$v) = each %attrs) {
+        if ($self->get_feature(Namespaces)) {
+            while ( my ($k, $v) = each %attribs ) {
+                if ($k =~ m/^xmlns(:(.*))?$/) {
+                    my $prefix = $2 || '';
+                    $self->{NSHelper}->declare_prefix($prefix, $v);
+                    my $ns = 
+                        {
+                            Prefix       => $prefix,
+                            NamespaceURI => $v,
+                        };
+                    push @new_ns, $ns;
+                    $self->SUPER::start_prefix_mapping($ns);
+                }
+            }
+        }
+
+        # Create element object and fire event
+        my %attrib_hash;
+        while (my ($name, $value) = each %attribs ) {
+            # TODO normalise value here
+            my ($ns, $prefix, $lname);
+            if ($self->get_feature(Namespaces)) {
+                ($ns, $prefix, $lname) = $self->{NSHelper}->process_attribute_name($name);
+            }
+            $ns ||= ''; $prefix ||= ''; $lname ||= '';
+            $attrib_hash{"{$ns}$lname"} = {
+                Name => $name,
+                LocalName => $lname,
+                Prefix => $prefix,
+                NamespaceURI => $ns,
+                Value => $value,
+            };
+        }
+        
+        %attribs = (); # lose the memory since we recurse deep
+        
+        my ($ns, $prefix, $lname);
+        if ($self->get_feature(Namespaces)) {
+            ($ns, $prefix, $lname) = $self->{NSHelper}->process_element_name($name);
+        }
+        $ns ||= ''; $prefix ||= ''; $lname ||= '';
+
+        my $el = 
+        {
+            Name => $name,
+            LocalName => $lname,
+            Prefix => $prefix,
+            NamespaceURI => $ns,
+            Attributes => \%attrib_hash,
+        };
+        $self->start_element($el);
+        
+        # warn("($name\n");
+        
+        if ($content) {
+            $self->content($reader);
+            
+            $reader->match_sequence('<', '/') || $self->parser_error("No close tag marker", $reader);
+            my $end_name = $self->Name($reader);
+            $end_name eq $name || $self->parser_error("End tag mismatch ($end_name != $name)", $reader);
+            $self->skip_whitespace($reader);
+            $reader->match_char('>') || $self->parser_error("No close '>' on end tag", $reader);
+        }
+        
+        my %end_el = %$el;
+        delete $end_el{Attributes};
+        $self->end_element(\%end_el);
+
+        for my $ns (@new_ns) {
+            $self->end_prefix_mapping($ns);
+        }
+        $self->{NSHelper}->pop_context;
+        
+        return 1;
+    }
+    
+    return 0;
+}
+
+sub content {
+    my ($self, $reader) = @_;
+    
+    $self->CharData($reader);
+    
+    while (1) {
+        if ($reader->match_sequence('<', '/')) {
+            $reader->buffer('</');
+            return 1;
+        }
+        elsif ( $self->Reference($reader) ||
+                $self->CDSect($reader) || 
+                $self->PI($reader) || 
+                $self->Comment($reader) ||
+                $self->element($reader) 
+               )
+        {
+            $self->CharData($reader);
+            next;
+        }
+        else {
+            last;
+        }
+    }
+    
+    return 1;
+}
+
+sub CDSect {
+    my ($self, $reader) = @_;
+    
+    if ($reader->match_sequence('<', '!', '[', 'C', 'D', 'A', 'T', 'A', '[')) {
+        $self->start_cdata({});
+        my $chars = '';
+        while (1) {
+            if ($reader->eof) {
+                $self->parser_error("EOF looking for CDATA section end", $reader);
+            }
+            $reader->consume_not(']');
+            $chars .= $reader->consumed;
+            if ($reader->match_char(']')) {
+                if ($reader->match_sequence(']', '>')) {
+                    # end of CDATA section
+                    
+                    $self->characters({Data => $chars});
+                    last;
+                }
+                $chars .= ']';
+            }
+        }
+        $self->end_cdata({});
+        return 1;
+    }
+    
+    return 0;
+}
+
+sub CharData {
+    my ($self, $reader) = @_;
+    
+    my $chars = '';
+    while (1) {
+        $reader->consume_not('<', '&', ']');
+        $chars .= $reader->consumed;
+        if ($reader->match_char(']')) {
+            if ($reader->match_sequence(']', '>')) {
+                $self->parser_error("String ']]>' not allowed in character data", $reader);
+            }
+            else {
+                $chars .= ']';
+            }
+            next;
+        }
+        last;
+    }
+    
+    $self->characters({ Data => $chars }) if length($chars);
+}
+
+sub Misc {
+    my ($self, $reader) = @_;
+    if ($self->Comment($reader)) {
+        return 1;
+    }
+    elsif ($self->PI($reader)) {
+        return 1;
+    }
+    elsif ($self->skip_whitespace($reader)) {
+        return 1;
+    }
+    
+    return 0;
+}
+
+sub Reference {
+    my ($self, $reader) = @_;
+    
+    if (!$reader->match_char('&')) {
+        return 0;
+    }
+    
+    if ($reader->match_char('#')) {
+        # CharRef
+        my $char;
+        my $ref;
+        if ($reader->match_char('x')) {
+            $reader->consume(qr/[0-9a-fA-F]/) ||
+                $self->parser_error("Hex character reference contains illegal characters", $reader);
+            $ref = $reader->consumed;
+            $char = chr_ref(hex($ref));
+            $ref = "x$ref";
+        }
+        else {
+            $reader->consume(qr/[0-9]/) ||
+                $self->parser_error("Decimal character reference contains illegal characters", $reader);
+            $ref = $reader->consumed;
+            $char = chr_ref($ref);
+        }
+        $reader->match_char(';') ||
+                $self->parser_error("No semi-colon found after character reference", $reader);
+        if ($char !~ $SingleChar) { # match a single character
+            $self->parser_error("Character reference &#$ref; refers to an illegal XML character ($char)", $reader);
+        }
+        $self->characters({ Data => $char });
+        return 1;
+    }
+    else {
+        # EntityRef
+        my $name = $self->Name($reader);
+        $reader->match_char(';') ||
+                $self->parser_error("No semi-colon found after entity name", $reader);
+        
+        # expand it
+        if ($self->_is_entity($name)) {
+            
+            if ($self->_is_external($name)) {
+                my $value = $self->_get_entity($name);
+                my $ent_reader = XML::SAX::PurePerl::Reader::URI->new($value);
+                $self->encoding_detect($ent_reader);
+                $self->extParsedEnt($ent_reader);
+            }
+            else {
+                my $value = $self->_stringify_entity($name);
+                my $ent_reader = XML::SAX::PurePerl::Reader::String->new($value);
+                $self->content($ent_reader);
+            }
+            return 1;
+        }
+        elsif (_is_internal($name)) {
+            $self->characters({ Data => $int_ents{$name} });
+            return 1;
+        }
+        else {
+            $self->parser_error("Undeclared entity", $reader);
+        }
+    }
+}
+
+sub AttReference {
+    # a reference in an attribute value.
+    my ($self, $reader) = @_;
+    
+    if ($reader->match_char('#')) {
+        # CharRef
+        my $char;
+        my $ref;
+        if ($reader->match_char('x')) {
+            $reader->consume(qr/[0-9a-fA-F]/) ||
+                $self->parser_error("Hex character reference contains illegal characters", $reader);
+            $ref = $reader->consumed;
+            $char = chr_ref(hex($ref));
+            $ref = "x$ref";
+        }
+        else {
+            $reader->consume(qr/[0-9]/) ||
+                $self->parser_error("Decimal character reference contains illegal characters", $reader);
+            $ref = $reader->consumed;
+            $char = chr_ref($ref);
+        }
+        $reader->match_char(';') ||
+                $self->parser_error("No semi-colon found after character reference", $reader);
+        if ($char !~ $SingleChar) { # match a single character
+            $self->parser_error("Character reference '&#$ref;' refers to an illegal XML character ($char)", $reader);
+        }
+        return $char;
+    }
+    else {
+        # EntityRef
+        my $name = $self->Name($reader);
+        $reader->match_char(';') ||
+                $self->parser_error("No semi-colon found after entity name", $reader);
+        
+        # expand it
+        if ($self->_is_entity($name)) {
+            if ($self->_is_external($name)) {
+                $self->parser_error("No external entity references allowed in attribute values", $reader);
+            }
+            else {
+                my $value = $self->_stringify_entity($name);
+                return $value;
+            }
+        }
+        elsif (_is_internal($name)) {
+            return $int_ents{$name};
+        }
+        else {
+            $self->parser_error("Undeclared entity '$name'", $reader);
+        }
+    }
+        
+}
+
+sub extParsedEnt {
+    my ($self, $reader) = @_;
+    
+    $self->TextDecl($reader);
+    $self->content($reader);
+}
+
+sub _is_internal {
+    my $e = shift;
+    return 1 if $e eq 'amp' || $e eq 'lt' || $e eq 'gt' || $e eq 'quot' || $e eq 'apos';
+    return 0;
+}
+
+sub _is_external {
+    my ($self, $name) = @_;
+# TODO: Fix this to use $reader to store the entities perhaps.
+    if ($self->{ParseOptions}{external_entities}{$name}) {
+        return 1;
+    }
+    return ;
+}
+
+sub _is_entity {
+    my ($self, $name) = @_;
+# TODO: ditto above
+    if (exists $self->{ParseOptions}{entities}{$name}) {
+        return 1;
+    }
+    return 0;
+}
+
+sub _stringify_entity {
+    my ($self, $name) = @_;
+# TODO: ditto above
+    if (exists $self->{ParseOptions}{expanded_entity}{$name}) {
+        return $self->{ParseOptions}{expanded_entity}{$name};
+    }
+    # expand
+    my $reader = XML::SAX::PurePerl::Reader::URI->new($self->{ParseOptions}{entities}{$name});
+    $reader->consume(qr/./);
+    return $self->{ParseOptions}{expanded_entity}{$name} = $reader->consumed;
+}
+
+sub _get_entity {
+    my ($self, $name) = @_;
+# TODO: ditto above
+    return $self->{ParseOptions}{entities}{$name};
+}
+
+sub skip_whitespace {
+    my ($self, $reader) = @_;
+    
+    my $found = 0;
+    while (1) {
+        if ($reader->match_char("\x20") ||
+            $reader->match_char("\x0A") ||
+            $reader->match_char("\x0D") ||
+            $reader->match_char("\x09"))
+        {
+            $found++;
+        }
+        else {
+            last;
+        }
+    }
+    return $found;
+}
+
+sub Attribute {
+    my ($self, $reader) = @_;
+    
+    $self->skip_whitespace($reader) || return;
+    if ($reader->match_sequence('/', '>')) {
+        $reader->buffer("/>");
+        return;
+    }
+    if ($reader->match_char(">")) {
+        $reader->buffer(">");
+        return;
+    }
+    if (my $name = $self->Name($reader)) {
+        $self->skip_whitespace($reader);
+        $reader->match_char('=') ||
+                $self->parser_error("No '=' in Attribute", $reader);
+        $self->skip_whitespace($reader);
+        my $value = $self->AttValue($reader);
+
+        if (!$self->cdata_attrib($name)) {
+            $value =~ s/^\x20*//; # discard leading spaces
+            $value =~ s/\x20*$//; # discard trailing spaces
+            $value =~ s/ {1,}/ /g; # all >1 space to single space
+        }
+        
+        return $name, $value;
+    }
+    
+    return;
+}
+
+sub cdata_attrib {
+    # TODO implement this!
+    return 0;
+}
+
+sub AttValue {
+    my ($self, $reader) = @_;
+    
+    my $quote = '"';
+    if (!$reader->match_char($quote)) {
+        $quote = "'";
+        $reader->match_char($quote) ||
+                $self->parser_error("Not a quote character", $reader);
+    }
+    
+    my $value = '';
+    
+    while (1) {
+        if ($reader->consume_not('<', '&', $quote)) {
+            my $to_append = $reader->consumed;
+            $to_append =~ s/[\x09\x0A\x0D]/\x20/g; # Attrib value normalize
+            $value .= $to_append;
+        }
+        elsif ($reader->match_char('&')) {
+            $value .= $self->AttReference($reader);
+        }
+        elsif ($reader->match_char($quote)) {
+            # end of attrib
+            last;
+        }
+        else {
+            $self->parser_error("Invalid character in attribute value", $reader);
+        }
+    }
+
+    return $value;
+}
+
+sub Comment {
+    my ($self, $reader) = @_;
+    
+    if ($reader->match_sequence('<', '!', '-', '-')) {
+        my $comment_str = '';
+        while (1) {
+            if ($reader->match_char('-')) {
+                if ($reader->match_char('-')) {
+                    $reader->match_char('>') ||
+                        $self->parser_error("Invalid string in comment field", $reader);
+                    last;
+                }
+                $comment_str .= '-';
+                $reader->consume($CharMinusDash) ||
+                    $self->parser_error("Invalid string in comment field", $reader);
+                $comment_str .= $reader->consumed;
+            }
+            elsif ($reader->consume($CharMinusDash)) {
+                $comment_str .= $reader->consumed;
+            }
+            else {
+                $self->parser_error("Invalid string in comment field", $reader);
+            }
+        }
+        
+        $self->comment({ Data => $comment_str });
+        
+        return 1;
+    }
+    return 0;
+}
+
+sub PI {
+    my ($self, $reader) = @_;
+    if ($reader->match_sequence('<', '?')) {
+        my ($target, $data);
+        $target = $self->Name($reader) ||
+            $self->parser_error("PI has no target", $reader);
+        if ($self->skip_whitespace($reader)) {
+            while (1) {
+                if ($reader->match_sequence('?', '>')) {
+                    last;
+                }
+                elsif ($reader->match_re($Any)) {
+                    $data .= $reader->matched;
+                }
+                else {
+                    last;
+                }
+            }
+        }
+        else {
+            $reader->match_sequence('?', '>') ||
+                $self->parser_error("PI closing sequence not found", $reader);
+        }
+        $self->processing_instruction({ Target => $target, Data => $data });
+        
+        return 1;
+    }
+    return 0;
+}
+
+sub Name {
+    my ($self, $reader) = @_;
+    
+    return $reader->consume_name();
+}
+
+sub quote {
+    my ($self, $reader) = @_;
+    my $quote = '"';
+    
+    if (!$reader->match_char($quote)) {
+        $quote = "'";
+        $reader->match_char($quote) ||
+            $self->parser_error("Invalid quote token", $reader);
+    }
+    return $quote;
+}
+
+1;
+__END__
+
+=head1 NAME
+
+XML::SAX::PurePerl - Pure Perl XML Parser with SAX2 interface
+
+=head1 SYNOPSIS
+
+  use XML::Handler::Foo;
+  use XML::SAX::PurePerl;
+  my $handler = XML::Handler::Foo->new();
+  my $parser = XML::SAX::PurePerl->new(Handler => $handler);
+  $parser->parse_uri("myfile.xml");
+
+=head1 DESCRIPTION
+
+This module implements an XML parser in pure perl. It is written around the
+upcoming perl 5.8's unicode support and support for multiple document 
+encodings (using the PerlIO layer), however it has been ported to work with
+ASCII/UTF8 documents under lower perl versions.
+
+The SAX2 API is described in detail at http://sourceforge.net/projects/perl-xml/, in
+the CVS archive, under libxml-perl/docs. Hopefully those documents will be in a
+better location soon.
+
+Please refer to the SAX2 documentation for how to use this module - it is merely a
+front end to SAX2, and implements nothing that is not in that spec (or at least tries
+not to - please email me if you find errors in this implementation).
+
+=head1 BUGS
+
+XML::SAX::PurePerl is B<slow>. Very slow. I suggest you use something else
+in fact. However it is great as a fallback parser for XML::SAX, where the
+user might not be able to install an XS based parser or C library.
+
+Currently lots, probably. At the moment the weakest area is parsing DOCTYPE declarations,
+though the code is in place to start doing this. Also parsing parameter entity
+references is causing me much confusion, since it's not exactly what I would call
+trivial, or well documented in the XML grammar. XML documents with internal subsets
+are likely to fail.
+
+I am however trying to work towards full conformance using the Oasis test suite.
+
+=head1 AUTHOR
+
+Matt Sergeant, matt@sergeant.org. Copyright 2001.
+
+Please report all bugs to the Perl-XML mailing list at perl-xml@listserv.activestate.com.
+
+=head1 LICENSE
+
+This is free software. You may use it or redistribute it under the same terms as
+Perl 5.7.2 itself.
+
+=cut
+
diff -aruN 5.0.000.src/library/additions/SAX.pm 5.2.000.src/library/additions/SAX.pm
--- 5.0.000.src/library/additions/SAX.pm	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/additions/SAX.pm	2007-12-10 13:50:31.000000000 -0600
@@ -0,0 +1,375 @@
+# $Id: SAX.pm,v 1.24 2002/11/19 18:25:45 matt Exp $
+
+package XML::SAX;
+
+use strict;
+use vars qw($VERSION @ISA @EXPORT_OK);
+
+$VERSION = '0.12';
+
+use Exporter ();
+@ISA = ('Exporter');
+
+@EXPORT_OK = qw(Namespaces Validation);
+
+use File::Basename qw(dirname);
+use File::Spec ();
+use Symbol qw(gensym);
+use XML::SAX::ParserFactory (); # loaded for simplicity
+
+use constant PARSER_DETAILS => "ParserDetails.ini";
+
+use constant Namespaces => "http://xml.org/sax/features/namespaces";
+use constant Validation => "http://xml.org/sax/features/validation";
+
+my $known_parsers = undef;
+
+# load_parsers takes the ParserDetails.ini file out of the same directory
+# that XML::SAX is in, and looks at it. Format in POD below
+
+=begin EXAMPLE
+
+[XML::SAX::PurePerl]
+http://xml.org/sax/features/namespaces = 1
+http://xml.org/sax/features/validation = 0
+# a comment
+
+# blank lines ignored
+
+[XML::SAX::AnotherParser]
+http://xml.org/sax/features/namespaces = 0
+http://xml.org/sax/features/validation = 1
+
+=end EXAMPLE
+
+=cut
+
+sub load_parsers {
+    my $class = shift;
+    my $dir = shift;
+    
+    # reset parsers
+    $known_parsers = [];
+    
+    # get directory from wherever XML::SAX is installed
+    if (!$dir) {
+        $dir = $INC{'XML/SAX.pm'};
+        $dir = dirname($dir);
+    }
+    
+    my $fh = gensym();
+    if (!open($fh, File::Spec->catfile($dir, "SAX", PARSER_DETAILS))) {
+        XML::SAX->do_warn("could not find " . PARSER_DETAILS . " in $dir/SAX\n");
+        return $class;
+    }
+
+    $known_parsers = $class->_parse_ini_file($fh);
+
+    return $class;
+}
+
+sub _parse_ini_file {
+    my $class = shift;
+    my ($fh) = @_;
+
+    my @config;
+    
+    my $lineno = 0;
+    while (defined(my $line = <$fh>)) {
+        $lineno++;
+        my $original = $line;
+        # strip whitespace
+        $line =~ s/\s*$//m;
+        $line =~ s/^\s*//m;
+        # strip comments
+        $line =~ s/[#;].*$//m;
+        # ignore blanks
+        next if $line =~ /^$/m;
+        
+        # heading
+        if ($line =~ /^\[\s*(.*)\s*\]$/m) {
+            push @config, { Name => $1 };
+            next;
+        }
+        
+        # instruction
+        elsif ($line =~ /^(.*?)\s*?=\s*(.*)$/) {
+            unless(@config) {
+                push @config, { Name => '' };
+            }
+            $config[-1]{Features}{$1} = $2;
+        }
+
+        # not whitespace, comment, or instruction
+        else {
+            die "Invalid line in ini: $lineno\n>>> $original\n";
+        }
+    }
+
+    return \@config;
+}
+
+sub parsers {
+    my $class = shift;
+    if (!$known_parsers) {
+        $class->load_parsers();
+    }
+    return $known_parsers;
+}
+
+sub remove_parser {
+    my $class = shift;
+    my ($parser_module) = @_;
+
+    if (!$known_parsers) {
+        $class->load_parsers();
+    }
+    
+    @$known_parsers = grep { $_->{Name} ne $parser_module } @$known_parsers;
+
+    return $class;
+}
+ 
+sub add_parser {
+    my $class = shift;
+    my ($parser_module) = @_;
+
+    if (!$known_parsers) {
+        $class->load_parsers();
+    }
+    
+    # first load module, then query features, then push onto known_parsers,
+    
+    my $parser_file = $parser_module;
+    $parser_file =~ s/::/\//g;
+    $parser_file .= ".pm";
+
+    require $parser_file;
+
+    my @features = $parser_module->supported_features();
+    
+    my $new = { Name => $parser_module };
+    foreach my $feature (@features) {
+        $new->{Features}{$feature} = 1;
+    }
+
+    # If exists in list already, move to end.
+    my $done = 0;
+    my $pos = undef;
+    for (my $i = 0; $i < @$known_parsers; $i++) {
+        my $p = $known_parsers->[$i];
+        if ($p->{Name} eq $parser_module) {
+            $pos = $i;
+        }
+    }
+    if (defined $pos) {
+        splice(@$known_parsers, $pos, 1);
+        push @$known_parsers, $new;
+        $done++;
+    }
+
+    # Otherwise (not in list), add at end of list.
+    if (!$done) {
+        push @$known_parsers, $new;
+    }
+    
+    return $class;
+}
+
+sub save_parsers {
+    my $class = shift;
+    
+    # get directory from wherever XML::SAX is installed
+    my $dir = $INC{'XML/SAX.pm'};
+    $dir = dirname($dir);
+    
+    my $file = File::Spec->catfile($dir, "SAX", PARSER_DETAILS);
+    chmod 0644, $file;
+    unlink($file);
+    
+    my $fh = gensym();
+    open($fh, ">$file") ||
+        die "Cannot write to $file: $!";
+
+    foreach my $p (@$known_parsers) {
+        print $fh "[$p->{Name}]\n";
+        foreach my $key (keys %{$p->{Features}}) {
+            print $fh "$key = $p->{Features}{$key}\n";
+        }
+        print $fh "\n";
+    }
+
+    print $fh "\n";
+
+    close $fh;
+
+    return $class;
+}
+
+sub do_warn {
+    my $class = shift;
+    # Don't output warnings if running under Test::Harness
+    warn(@_) unless $ENV{HARNESS_ACTIVE};
+}
+
+1;
+__END__
+
+=head1 NAME
+
+XML::SAX - Simple API for XML
+
+=head1 SYNOPSIS
+
+  use XML::SAX;
+  
+  # get a list of known parsers
+  my $parsers = XML::SAX->parsers();
+  
+  # add/update a parser
+  XML::SAX->add_parser(q(XML::SAX::PurePerl));
+
+  # remove parser
+  XML::SAX->remove_parser(q(XML::SAX::Foodelberry));
+
+  # save parsers
+  XML::SAX->save_parsers();
+
+=head1 DESCRIPTION
+
+XML::SAX is a SAX parser access API for Perl. It includes classes
+and APIs required for implementing SAX drivers, along with a factory
+class for returning any SAX parser installed on the user's system.
+
+=head1 USING A SAX2 PARSER
+
+The factory class is XML::SAX::ParserFactory. Please see the
+documentation of that module for how to instantiate a SAX parser:
+L<XML::SAX::ParserFactory>. However if you don't want to load up
+another manual page, here's a short synopsis:
+
+  use XML::SAX::ParserFactory;
+  use XML::SAX::XYZHandler;
+  my $handler = XML::SAX::XYZHandler->new();
+  my $p = XML::SAX::ParserFactory->parser(Handler => $handler);
+  $p->parse_uri("foo.xml");
+  # or $p->parse_string("<foo/>") or $p->parse_file($fh);
+
+This will automatically load a SAX2 parser (defaulting to
+XML::SAX::PurePerl if no others are found) and return it to you.
+
+In order to learn how to use SAX to parse XML, you will need to read
+L<XML::SAX::Intro> and for reference, L<XML::SAX::Specification>.
+
+=head1 WRITING A SAX2 PARSER
+
+The first thing to remember in writing a SAX2 parser is to subclass
+XML::SAX::Base. This will make your life infinitely easier, by providing
+a number of methods automagically for you. See L<XML::SAX::Base> for more
+details.
+
+When writing a SAX2 parser that is compatible with XML::SAX, you need
+to inform XML::SAX of the presence of that driver when you install it.
+In order to do that, XML::SAX contains methods for saving the fact that
+the parser exists on your system to a "INI" file, which is then loaded
+to determine which parsers are installed.
+
+The best way to do this is to follow these rules:
+
+=over 4
+
+=item * Add XML::SAX as a prerequisite in Makefile.PL:
+
+  WriteMakefile(
+      ...
+      PREREQ_PM => { 'XML::SAX' => 0 },
+      ...
+  );
+
+Alternatively you may wish to check for it in other ways that will
+cause more than just a warning.
+
+=item * Add the following code snippet to your Makefile.PL:
+
+  sub MY::install {
+    package MY;
+    my $script = shift->SUPER::install(@_);
+    if (ExtUtils::MakeMaker::prompt(
+      "Do you want to modify ParserDetails.ini?", 'Y')
+      =~ /^y/i) {
+      $script =~ s/install :: (.*)$/install :: $1 install_sax_driver/m;
+      $script .= <<"INSTALL";
+  
+  install_sax_driver :
+  \t\@\$(PERL) -MXML::SAX -e "XML::SAX->add_parser(q(\$(NAME)))->save_parsers()"
+  
+  INSTALL
+    }
+    return $script;
+  }
+
+Note that you should check the output of this - \$(NAME) will use the name of
+your distribution, which may not be exactly what you want. For example XML::LibXML
+has a driver called XML::LibXML::SAX::Generator, which is used in place of
+\$(NAME) in the above.
+
+=item * Add an XML::SAX test:
+
+A test file should be added to your t/ directory containing something like the
+following:
+
+  use Test;
+  BEGIN { plan tests => 3 }
+  use XML::SAX;
+  use XML::SAX::PurePerl::DebugHandler;
+  XML::SAX->add_parser(q(XML::SAX::MyDriver));
+  local $XML::SAX::ParserPackage = 'XML::SAX::MyDriver';
+  eval {
+    my $handler = XML::SAX::PurePerl::DebugHandler->new();
+    ok($handler);
+    my $parser = XML::SAX::ParserFactory->parser(Handler => $handler);
+    ok($parser);
+    ok($parser->isa('XML::SAX::MyDriver');
+    $parser->parse_string("<tag/>");
+    ok($handler->{seen}{start_element});
+  };
+
+=back
+
+=head1 EXPORTS
+
+By default, XML::SAX exports nothing into the caller's namespace. However you
+can request the symbols C<Namespaces> and C<Validation> which are the
+URIs for those features, allowing an easier way to request those features
+via ParserFactory:
+
+  use XML::SAX qw(Namespaces Validation);
+  my $factory = XML::SAX::ParserFactory->new();
+  $factory->require_feature(Namespaces);
+  $factory->require_feature(Validation);
+  my $parser = $factory->parser();
+
+=head1 AUTHOR
+
+Matt Sergeant, matt@sergeant.org
+
+Kip Hampton, khampton@totalcinema.com
+
+Robin Berjon, robin@knowscape.com
+
+=head1 LICENSE
+
+This is free software, you may use it and distribute it under
+the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+L<XML::SAX::Base> for writing SAX Filters and Parsers
+
+L<XML::SAX::PurePerl> for an XML parser written in 100%
+pure perl.
+
+L<XML::SAX::Exception> for details on exception handling
+
+=cut
+
diff -aruN 5.0.000.src/library/agora_db_lib.pl 5.2.000.src/library/agora_db_lib.pl
--- 5.0.000.src/library/agora_db_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/agora_db_lib.pl	2007-12-19 23:22:01.000000000 -0600
@@ -1,6 +1,7 @@
 ###########################################################
-$versions{'agora_db_lib.pl 5 user'} = "5.0.000";
+$versions{'agora_db_lib.pl 5 user'} = "5.0.001";
 $sc_db_engine='flatfile';
+$shipfilename = "$sc_data_file_dir/shipping_dimensions.file";
 
 # Written by Steve Kneizys for AgoraCart
 #
@@ -282,6 +283,26 @@
  }
 close (NEWFILE);
 &release_file_lock("${filename}.lock");
+#################### delete shipping file ##################
+my ($sku,$indicator,$length,$width,$height,$girth,$boxtype,$alt_origin_postalcode,$alt_origin_stateprov);
+
+&get_file_lock("${shipfilename}.lock");
+open(OLDSHIPFILE, "$shipfilename") || &my_die("Can't Open $shipfilename");
+@lines = <OLDSHIPFILE>;
+#print @lines;
+$result=0;
+close (OLDSHIPFILE);
+open(NEWSHIPFILE,">$shipfilename") || &my_die("Can't Open $shipfilename");
+
+foreach $line (@lines){
+  ($sku,$boxindicator,$length,$width,$height,$girth,$boxtype,$alt_origin_postalcode,$alt_origin_stateprov) = split(/\|/,$line);
+  if ($sku ne $product_id) {
+   print NEWSHIPFILE $line;
+  }
+ }
+close (NEWSHIPFILE);
+&release_file_lock("${shipfilename}.lock");
+#################### end delete shipping file ##################
 if ($db_cache{$ProductEditSku} ne "") {
   $db_cache{$ProductEditSku} = "";
  }
@@ -583,6 +604,43 @@
     return @patch_db_query_criteria ;
 }
 ############################################################
+#
+# get a row from the product shipping dimensions database.
+# added by Mister Ed May 17, 2007
+#
+############################################################
+
+sub get_prod_shipping_dimensions_in_db_row {
+  my ($product_id) = @_;
+  my ($db_product_id,$save_the_line,$result);
+  my (@ds_db_row);
+  $db_product_id = "";
+                #
+                # First we open the data file.
+                # If the open fails. We call the
+                # file open error routine in order
+                # to log the error
+                #
+
+  open(DATAFILE, "$shipfilename ") || &file_open_error("$shipfilename ",
+      "Read Database",__FILE__,__LINE__);
+
+  while (($line = <DATAFILE>) && ($product_id ne $db_product_id)) {
+    chomp($line);
+    @ds_db_row = split(/\|/,$line);
+    $save_the_line = $line;
+    $db_product_id = $ds_db_row[0];
+  }
+
+  if ($product_id eq $db_product_id) { 
+	$result = "$ds_db_row[6],$ds_db_row[1],$ds_db_row[2],$ds_db_row[3],$ds_db_row[4],$ds_db_row[5],$ds_db_row[7],$ds_db_row[8]";
+  }
+  close (DATAFILE);
+
+  return $result;
+
+} 
+############################################################
 # added by Mister Ed Jan 27, 2005
 sub check_db_with_product_id_for_info {
   local($product_id, $data_field_thingy, *db_row) = @_;
diff -aruN 5.0.000.src/library/agora_html_lib.pl 5.2.000.src/library/agora_html_lib.pl
--- 5.0.000.src/library/agora_html_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/agora_html_lib.pl	2008-01-21 21:07:53.000000000 -0600
@@ -1,5 +1,5 @@
 #######################################################################
-$versions{'agora_html_lib.pl'} = "5.0.000";
+$versions{'agora_html_lib.pl'} = "5.2.001";
 #######################################################################
 if ($sc_main_script_post_url eq '') { 
   $sc_main_script_post_url = $sc_main_script_url;
@@ -83,7 +83,9 @@
 sub agora_cookie_save {
   local($inx,$temp);
   foreach $inx (keys %form_data) {
-    $temp .= "$inx\x01$form_data{$inx}\x01";
+      if ($inx !~ /Payment_/) {
+         $temp .= "$inx\x01$form_data{$inx}\x01";
+      }
    }
   &set_agora("PREVIOUS_FORM_VALUES",$temp);
   open(SERVCOOKIE,">$sc_server_cookie_path");
@@ -208,21 +210,6 @@
   return $field;
  }
 #######################################################################
-sub cart_web_options {
- local($a1) = @_;
- my $a2;
- if ($a1 eq "") { $a1 = "&nbsp;";}
- my @xx = split(/$sc_opt_sep_marker/,$a1); 
- if ($sc_opt_web_strip_part_number =~ /yes/i) {
-   for ($a2=0; $a2 <= $#xx; $a2++) {
-     if (substr($xx[$a2],0,1) eq "#") {
-       ($temp,$xx[$a2]) = split(/ /,$xx[$a2],2); 
-      }
-    }
-  }
-  return join "<br>",@xx;
- }
-#######################################################################
 sub cart_email_options {
  local($a1) = @_;
  my $a2,$jchar;
@@ -281,10 +268,12 @@
 local ($page_title,$prod_message) = @_;
 local ($hidden_fields) = &make_hidden_fields;
 local ($my_hdr);
+my $temp_product_title = $form_data{'product'};
+$temp_product_title =~ s/_/ /g;
 $my_hdr = qq~$sc_doctype
 <html>
 <head>
-  <title>$page_title - $form_data{'product'}</title>
+  <title>$page_title $temp_product_title</title>
   $sc_standard_head_info
 </head>
 <body>~;
@@ -485,7 +474,6 @@
 #######################################################################
 sub script_and_substitute_footer {
  local ($footer) = @_;
- local ($cart_id_for_html);
  local($offlineSecureURL)="";
 
  if($sc_gateway_name eq "Offline") {
@@ -555,15 +543,20 @@
 sub make_hidden_fields {
 local($hidden,$db_query_row,$temp,$db_form_field);
 local($special_stuff)='';
-$cart_id_for_html = &cart_id_for_html;
+&xss_FormData_cleaner;
 if ($sc_running_an_SSI_store =~ /yes/i) {
   $special_stuff.='  <input type="hidden" name="SSI" value="1">'."\n";
   $special_stuff.='  <input type="hidden" name="crtmod" value="';
   $special_stuff.= &make_random_chars . "\">\n";  
  }
-$hidden = qq!$special_stuff
-  <input type="hidden" name="cart_id" value="$cart_id_for_html">
+$hidden = qq!$special_stuff!;
+if ($sc_global_bot_tracker eq '1') {
+$hidden .= qq!<input type="hidden" name="page" value="$form_data{'page'}">!;
+}
+else {
+$hidden .= qq!<input type="hidden" name="cart_id" value="$cart_id">
   <input type="hidden" name="page" value="$form_data{'page'}">!;
+}
 if ($form_data{'keywords'} ne "") 
 {
 $temp = $form_data{'keywords'};
@@ -637,60 +630,143 @@
 sub make_href_fields {
 local($href) = "";
 local($db_query_row, $db_form_field, $temp);
-$cart_id_for_html = &str_encode(&cart_id_for_html);
-$href = "cart_id=$cart_id_for_html";
+&xss_FormData_cleaner;
+my $temp_first_amper_count = 1;
+
+if ($sc_global_bot_tracker ne "1") {
+$href = "cart_id=" . &str_encode($cart_id);
+$temp_first_amper_count++;
+}
+
 if ($form_data{'page'} ne "")
 { 
+if ($temp_first_amper_count > 1) {
 $href .= "&amp;page=" . &str_encode($form_data{'page'});
 }
+else {
+$href .= "page=" . &str_encode($form_data{'page'});
+$temp_first_amper_count++;
+}
+}
+
 if ($form_data{'keywords'} ne "") 
 {
 $temp = $form_data{'keywords'};
 $temp = &str_encode($temp);
+if ($temp_first_amper_count > 1) {
 $href .= "&amp;keywords=$temp";
 }
+else {
+$href .= "keywords=$temp";
+$temp_first_amper_count++;
+}
+}
+
 if ($form_data{'next'} ne "") 
 {
+if ($temp_first_amper_count > 1) {
 $href .= "&amp;next=$form_data{'next'}";
 }
+else {
+$href .= "next=$form_data{'next'}";
+$temp_first_amper_count++;
+}
+}
+
 if ($form_data{'maxp'} ne "") 
 {
+if ($temp_first_amper_count > 1) {
 $href .= "&amp;maxp=$form_data{'maxp'}";
 }
+else {
+$href .= "maxp=$form_data{'maxp'}";
+$temp_first_amper_count++;
+}
+}
+
 if ($form_data{'ppinc'} ne "") 
 {
+if ($temp_first_amper_count > 1) {
 $href .= "&amp;ppinc=" . &str_encode($form_data{'ppinc'});
 }
+else {
+$href .= "ppinc=" . &str_encode($form_data{'ppinc'});
+$temp_first_amper_count++;
+}
+}
+
 if ($form_data{'exact_match'} ne "") 
 {
+if ($temp_first_amper_count > 1) {
 $href .= "&amp;exact_match=$form_data{'exact_match'}";
 }
+else {
+$href .= "exact_match=$form_data{'exact_match'}";
+$temp_first_amper_count++;
+}
+}
+
 if ($form_data{'case_sensitive'} ne "") 
 {
+if ($temp_first_amper_count > 1) {
 $href .= "&amp;case_sensitive=$form_data{'case_sensitive'}";
 }
+else {
+$href .= "case_sensitive=$form_data{'case_sensitive'}";
+$temp_first_amper_count++;
+}
+}
+
 # Added by Mister Ed June 20, 2005
 if ($form_data{'affiliate'} ne "") 
 {
+if ($temp_first_amper_count > 1) {
 $href .= "&amp;affiliate=$form_data{'affiliate'}";
 }
+else {
+$href .= "affiliate=$form_data{'affiliate'}";
+$temp_first_amper_count++;
+}
+}
+
 # Added by Mister Ed June 20, 2005
 if ($form_data{'member'} ne "") 
 {
+if ($temp_first_amper_count > 1) {
 $href .= "&amp;member=$form_data{'member'}";
 }
+else {
+$href .= "member=$form_data{'member'}";
+$temp_first_amper_count++;
+}
+}
+
 # Added by Mister Ed June 20, 2005
 if ($form_data{'pricing'} ne "") 
 {
+if ($temp_first_amper_count > 1) {
 $href .= "&amp;pricing=$form_data{'pricing'}";
 }
+else {
+$href .= "pricing=$form_data{'pricing'}";
+$temp_first_amper_count++;
+}
+}
+
 foreach $db_query_row (@sc_db_query_criteria) 
 {
 $db_form_field = (split(/\|/, $db_query_row))[0];
 if ($form_data{$db_form_field} ne "" && $db_form_field ne "keywords") 
 {
+if ($temp_first_amper_count > 1) {
 $href .= "&amp;$db_form_field=" . &str_encode($form_data{$db_form_field});
 }
+else {
+$href .= "$db_form_field=" . &str_encode($form_data{$db_form_field});
+$temp_first_amper_count++;
+}
+}
+
 }
 &codehook("make_href_fields_bot");
 return ($href);
@@ -856,9 +932,16 @@
 $the_file =~ s/%%ScriptURL%%/$sc_main_script_url/ig;
 $the_file =~ s/%%ScriptPostURL%%/$sc_main_script_post_url/ig;
 $the_file =~ s/%%gateway_username%%/$sc_gateway_username/g;
+if ($sc_global_bot_tracker eq "1") {
+$the_file =~ s/cart_id=%%cart_id%%/cart_id=/g;
+$the_file =~ s/cart_id=//g;
+$the_file =~ s/%%cart_id%%//g;
+}
+else {
 $the_file =~ s/cart_id=%%cart_id%%/cart_id=/g;
 $the_file =~ s/cart_id=/cart_id=$cart_id_for_html/g;
 $the_file =~ s/%%cart_id%%/$cart_id_for_html/g;
+}
 $the_file =~ s/%%href_fields%%/$href_fields/g;
 $the_file =~ s/%%make_hidden_fields%%/$hidden_fields/g;
 $the_file =~ s/%%ppinc%%/$form_data{'ppinc'}/g;
@@ -879,9 +962,10 @@
 $the_file =~ s/%%TemplateName%%/$sc_headerTemplateName/ig;
 $the_file =~ s/%%sc_money_symbol%%/$sc_money_symbol/ig;
 $the_file =~ s/%%ButtonSetURL%%/$sc_buttonSetURL/ig;
+if ($sc_global_bot_tracker ne "1") {
 while ($the_file =~ /%%ZZZ%%/) {
-  $cart_id_for_html = &cart_id_for_html;
-  $the_file =~ s/%%ZZZ%%/$cart_id_for_html/;
+  $the_file =~ s/%%ZZZ%%/$cart_id/;
+}
 }
 $the_file = &agorascript($the_file,"post","$ztitle",__FILE,__LINE__);
 return $the_file;
@@ -896,6 +980,9 @@
 # otherwise use default.  Added by Mister Ed Jan 11, 2005
  if (($sc_use_category_name_as_header =~ /yes/i) && ($form_data{'order_form_button.x'} eq "") && ($form_data{'dc'} eq "")) { 
    my $myproduct = "$form_data{'product'}";
+  if ($sc_convert_product_token_underlines ne "") {
+    $myproduct =~ s/\_/$sc_convert_product_token_underlines/g;
+   }
     if (-f "$sc_templates_dir/header-$myproduct.inc") {
        $temp_header_thingy = "$sc_templates_dir/header-$myproduct.inc";
       }
@@ -912,6 +999,9 @@
 # otherwise use default.  Added by Mister Ed Jan 11, 2005
  if (($sc_use_category_name_as_header =~ /yes/i) && ($form_data{'order_form_button.x'} eq "") && ($form_data{'order_form_button'} ne 1) && ($form_data{'dc'} eq "")&& ($form_data{'dc'} ne 1)) { 
    my $myproduct = "$form_data{'product'}";
+  if ($sc_convert_product_token_underlines ne "") {
+    $myproduct =~ s/\_/$sc_convert_product_token_underlines/g;
+   }
     if (-f "$sc_templates_dir/footer-$myproduct.inc") { 
        $temp_footer_thingy = "$sc_templates_dir/footer-$myproduct.inc";
       }
@@ -1078,9 +1168,13 @@
 }
 $itemID = join("\|",@item_ids);
 $ppinc_root_name = 'productPage';
- if ($sc_use_category_name_as_ppinc_root eq "yes"  && $form_data{'ppinc'} ne "search" && $form_data{'ppinc'} ne "search2") { 
-    if (-f "$sc_templates_dir/$database_fields[$db{'product'}].inc") {
-       $ppinc_root_name = $database_fields[$db{'product'}];
+ if ($sc_use_category_name_as_ppinc_root eq "yes"  && $form_data{'ppinc'} ne "search" && $form_data{'ppinc'} ne "search2"  && $form_data{'ppinc'} eq "") { 
+  my $myproduct = $database_fields[$db{'product'}];
+  if ($sc_convert_product_token_underlines ne "") {
+    $myproduct =~ s/\_/$sc_convert_product_token_underlines/g;
+   }
+    if (-f "$sc_templates_dir/$myproduct.inc") {
+       $ppinc_root_name = $myproduct;
       }
  } 
 &codehook("create_display_fields_bot");
@@ -1203,17 +1297,32 @@
   $the_whole_page =~ s/(%%prodID-)([^%]+)(%%)/$myans/i;
 }
 $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;
+$the_whole_page =~ s/%%userFieldThree%%/$display_fields[8]/ig;
+$the_whole_page =~ s/%%userFieldFour%%/$display_fields[9]/ig;
+$the_whole_page =~ s/%%userFieldFive%%/$display_fields[10]/ig;
 $the_whole_page =~ s/%%URLofImages%%/$URL_of_images_directory/ig;
 $the_whole_page =~ s/%%scriptURL%%/$sc_main_script_url/ig;
 $the_whole_page =~ s/%%ScriptPostURL%%/$sc_main_script_post_url/ig;
 $the_whole_page =~ s/%%StepOneURL%%/$sc_stepone_order_script_url/ig;
 $the_whole_page =~ s/%%gateway_username%%/$sc_gateway_username/ig;
+
+if ($sc_global_bot_tracker eq "1") {
+$the_whole_page =~ s/%%CartID%%//g;
+$the_whole_page =~ s/%%cartID%%//g;
+$the_whole_page =~ s/cart_id=%%cart_id%%//g;
+$the_whole_page =~ s/cart_id=//g;
+$the_whole_page =~ s/%%cart_id%%//g;
+}
+else {
 $the_whole_page =~ s/%%CartID%%/%%cart_id%%/ig;
 $the_whole_page =~ s/%%cartID%%/%%cart_id%%/ig;
-$the_whole_page =~ s/cart_id=%%cart_id%%/cart_id=/ig;
-$the_whole_page =~ s/cart_id=/cart_id=$cart_id_for_html/ig;
-$the_whole_page =~ s/%%cartID%%/$cart_id_for_html/ig;
-$the_whole_page =~ s/%%cart_id%%/$cart_id_for_html/ig;
+$the_whole_page =~ s/cart_id=%%cart_id%%/cart_id=/g;
+$the_whole_page =~ s/cart_id=/cart_id=$cart_id_for_html/g;
+$the_whole_page =~ s/%%cart_id%%/$cart_id_for_html/g;
+}
+
 $the_whole_page =~ s/%%agoracgi_ver%%/$versions{'agora.cgi'}/ig;
 $the_whole_page =~ s/%%make_hidden_fields%%/$hidden_fields/ig;
 $the_whole_page =~ s/%%ppinc%%/$form_data{'ppinc'}/ig;
@@ -1240,11 +1349,6 @@
 $the_whole_page =~ s/%%shippingPrice%%/$display_fields[5]/ig;
 $the_whole_page =~ s/%%shipping%%/$display_fields[5]/ig;
 $the_whole_page =~ s/%%shippingWeight%%/$display_fields[5]/ig;
-$the_whole_page =~ s/%%userFieldOne%%/$display_fields[6]/ig;
-$the_whole_page =~ s/%%userFieldTwo%%/$display_fields[7]/ig;
-$the_whole_page =~ s/%%userFieldThree%%/$display_fields[8]/ig;
-$the_whole_page =~ s/%%userFieldFour%%/$display_fields[9]/ig;
-$the_whole_page =~ s/%%userFieldFive%%/$display_fields[10]/ig;
 $the_whole_page =~ s/%%itemID%%/item-$itemID/ig;
 $the_whole_page =~ s/%%Product_ID%%/%%prodID%%/ig;
 $the_whole_page =~ s/%%ProductID%%/%%prodID%%/ig;
@@ -1254,8 +1358,7 @@
 $the_whole_page =~ s/%%sc_money_symbol%%/$sc_money_symbol/ig;
 $the_whole_page =~ s/%%ButtonSetURL%%/$sc_buttonSetURL/ig;
 while ($the_whole_page =~ /%%ZZZ%%/) {
-  $cart_id_for_html = &cart_id_for_html;
-  $the_whole_page =~ s/%%ZZZ%%/$cart_id_for_html/;
+  $the_whole_page =~ s/%%ZZZ%%/$cart_id/;
 }
 while ($the_whole_page =~ /%%AutoOptionNo%%/i) {
   $auto_opt_no = $auto_opt_no + 1;
diff -aruN 5.0.000.src/library/agora_order_lib.pl 5.2.000.src/library/agora_order_lib.pl
--- 5.0.000.src/library/agora_order_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/agora_order_lib.pl	2007-12-19 23:22:12.000000000 -0600
@@ -1,6 +1,6 @@
 ############################################################
 
-$versions{'agora_order_lib.pl'} = "5.0.000";
+$versions{'agora_order_lib.pl'} = "5.0.007";
 # last modified by Mister Ed from K-Factor Technologies, Inc /  AgoraCart.com
 # August 17, 2006
 #
@@ -134,13 +134,35 @@
 $item_user1 = "";
 $item_user2 = "";
 
-# alt origin postal code assigns to cart user3 by Mister Ed Feb 9, 2005
+#make one read on alt origin and dimensional thingies
+# add in alt origin state or province  by Mister Ed May 22, 2007
+if (($sc_alt_origin_enabled =~ /yes/i)||($sc_dimensional_shipping_enabled =~ /yes/i)) {
+my $shipping_string = &get_prod_shipping_dimensions_in_db_row($item_id_number);
+my @shippingstuff =  split(/\,/,$shipping_string);
+
 if ($sc_alt_origin_enabled =~ /yes/i) {
-my $data_field_thingy = "$sc_alt_origin_db_counter";
-$item_user3 = &check_db_with_product_id_for_info($item_id_number,$data_field_thingy,*database_fields);
+$item_user3 = "$shippingstuff[6],$shippingstuff[7]";
 } else {
 $item_user3 = "";
 }
+
+#old alt origin version
+# alt origin postal code assigns to cart user3 by Mister Ed Feb 9, 2005
+# if ($sc_alt_origin_enabled =~ /yes/i) {
+# my $data_field_thingy = "$sc_alt_origin_db_counter";
+#$item_user3 = &check_db_with_product_id_for_info($item_id_number,$data_field_thingy,*database_fields);
+#} else {
+#$item_user3 = "";
+#}
+
+#  shipping dimensions. added by Mister Ed May 13, 2007
+if ($sc_dimensional_shipping_enabled =~ /yes/i) {
+$item_user5 = "$shippingstuff[0],$shippingstuff[1],$shippingstuff[2],$shippingstuff[3],$shippingstuff[4],$shippingstuff[5]";
+} else {
+$item_user5 = "";
+}
+undef(@shippingstuff);
+} # End if alt origin OR dimensions
 # taxable or non-table. added by Mister Ed Sept 13, 2005
 if ($sc_non_taxables_enabled =~ /yes/i) {
 my $data_field_thingy = "$sc_non_taxables_db_counter";
@@ -148,7 +170,7 @@
 } else {
 $item_user4 = "";
 }
-$item_user5 = "";
+
 $item_user6 = "";
 $item_agorascript = "";
 undef(%item_opt_verify);
@@ -384,14 +406,20 @@
  } else { # have the first tag
   $have_form_tag = "yes";
  }
+
 if ($sc_replace_orderform_form_tags =~ /yes/i) {
-  print qq!\n<form method="post" action="$sc_order_script_url">!;
+
+# changed for buysafe updates.
+#  print qq!\n<form method="post" action="$sc_order_script_url">!;
+  print qq!\n<form method="post" action="$sc_stepone_order_script_url">!;
   print $hidden_fields;
  } else {
   print "\n$line\n$hidden_fields\n";
  }
+
 $line = "";
 } 
+
 if ($line =~ /<h2>cart.*contents.*h2>/i) {
 if (($have_form_tag eq "yes") && ($have_terminated_form_tag eq "no")) {
   print "</form>\n\n";
@@ -501,16 +529,93 @@
 ~;
 }
 
+# buySafe
+if (($sc_buySafe_is_enabled =~ /yes/) && ($zfinal_buySafe > 0) && ($zsubtotal > 0)) {
+if ($sc_buySafe_bond_fee_mini_display_text eq '') {$sc_buySafe_bond_fee_mini_display_text = "buySafe Bond :";}
+$val =  &format_price($zfinal_buySafe);
+print qq~<tr>
+<td>$sc_buySafe_bond_fee_mini_display_text</td>
+<td>$val</td>
+</tr>
+~;
+}
+
 print qq~<tr>
 <td colspan=2>
   <img src=\"picserve.cgi?secpicserve=line.gif\" height="2" width="46" alt="------" />
 </td>
 </tr>
 <tr>
+~;
+
+if (($sc_show_subtotal_label_box =~ /yes/i) && ($are_we_before_or_at_process_form =~ /before/i)) {
+print qq~
+<td>$sc_totals_table_subtot_label</td>
+<td>$grand_total</td>
+
+~;
+} else {
+print qq~
 <td>$sc_totals_table_gtot_label</td>
 <td>$grand_total</td>
+~;
+}
+print qq~
 </tr>
 </table>
+~;
+
+# buysafe bonding button display, if successful and enabled
+if (($sc_buySafe_is_enabled =~ /yes/) && ($sc_processing_order ne "yes") && ($sc_buySafe_bonding_signal !~ /HASH\(/i) && ($zsubtotal > 0)) {
+my @buysafearraythingy = split(/&/,$sc_buySafe_bonding_signal,6);
+my ($junk,$temp_buysafe_thingy) = split(/=/,$buysafearraythingy[4]);
+my $buySafe_page_url = '';
+
+    if (&form_check('display_cart')) {
+        $buySafe_page_url = '&dc=1';
+    } elsif (&form_check('dc')) {
+        $buySafe_page_url = '&dc=1';
+    } elsif (&form_check('order_form_button')) {
+        $buySafe_page_url = '&order_form_button.x=1';
+    }
+
+    if ($temp_buysafe_thingy eq '') {
+        $temp_buysafe_thingy = 'False';
+    }
+
+if (($temp_buysafe_thingy eq "True") && ($sc_buySafe_customer_desires_bond ne "") && ($sc_buySafe_customer_desires_bond eq "true")) { # print buysafe bond flash button
+
+print qq|
+<input type="hidden" name="removebuysafebond" value="true">
+<input type="hidden" name="buySAFE" value="true">|;
+print $sc_buySafe_bonding_signal;
+
+    if ($sc_buySafe_bond_call_success =~ /true/i) {
+print qq|<br /><br />
+<span class="buysafe">
+<a href="$sc_buySafe_cart_details_URL">
+$sc_buySafe_cart_details_text</a>
+<br /></span>
+|;
+    }
+} else { # print add new buysafe bond button
+print qq|
+<input type="hidden" name="addbuysafebond" value="true">
+<input type="hidden" name="buySAFE" value="false">
+$sc_buySafe_bonding_signal<br /><br />
+|;
+    if ($sc_buySafe_bond_call_success =~ /true/i) {
+print qq|
+<span class="buysafe">
+<a href="$sc_buySafe_cart_details_URL">
+$sc_buySafe_cart_details_text</a>
+<br /></span>
+|;
+    }
+} #end of if/else on
+} #end of buysafe bonding signal button display
+
+print qq~
 </div>
 ~;
 }
@@ -523,6 +628,7 @@
 local($hidden_fields) = &make_hidden_fields;
 local($continue) = 1;
 local($taxable_grand_total);
+my $we_need_to_exit = 0;
 &codehook("process_order_form_top");
 if ($continue == 0) { return;}
 print qq~$sc_doctype
@@ -550,7 +656,7 @@
 $mustbegreaterthanthis = .0001;
 if ($subtotal < $mustbegreaterthanthis) {
 $we_need_to_exit++;
-if ($we_need_to_exit = 1)
+if ($we_need_to_exit eq 1)
 {
   print '<div align="center">';
 }
@@ -565,7 +671,7 @@
 # Added by Mister Ed (K-Factor Technologies, Inc) 10/17/2003
 if ($subtotal < $sc_minimum_order_amount) { 
 $we_need_to_exit++;
-if ($we_need_to_exit = 1)
+if ($we_need_to_exit eq 1)
 {
   print '<div align="center">';
 }
@@ -579,7 +685,7 @@
 if ($form_data{$required_field} eq "") {
     $required_fields_filled_in = "no";
 $we_need_to_exit++;
-if ($we_need_to_exit = 1)
+if ($we_need_to_exit eq 1)
 {
   print '<div align="center">';
 }
@@ -643,7 +749,7 @@
   
     print qq~
     <hr>
-    <div align="center"
+    <div align="center">
     <form method="post" action="$sc_stepone_order_script_url">
 <input type="hidden" name="order_form_button" VALUE="1">
 $hidden_fields
@@ -717,6 +823,7 @@
   local($final_extra_tax1, $extra_tax1) = 0;
   local($final_extra_tax2, $extra_tax2) = 0;
   local($final_extra_tax3, $extra_tax3) = 0;
+  local($final_buySafe) = 0;
   local($calc_loop) = 0;
 $temp_total = $subtotal;
 my $temp_taxable_total = $taxable_grand_total;
@@ -826,7 +933,12 @@
 $temp_total = $temp_total - $discount + $shipping + $sales_tax 
                + $extra_tax1 + $extra_tax2 + $extra_tax3;
 &codehook("end_final_values_loop_iteration_after_calc");
-} 
+}
+# add in buySafe
+$final_buySafe = $sc_buySafe_bond_fee if (($sc_buySafe_bond_fee > 0) && ($subtotal > 0));
+if (($sc_buySafe_is_enabled =~ /yes/) && ($subtotal > 0)) {
+    $temp_total += $final_buySafe;
+}
 $grand_total = $temp_total;
 if ($sc_verify_inv_no eq '') {
   open(MYFILE,"$sc_verify_order_path");
@@ -866,6 +978,15 @@
   print MYFILE "\$sc_verify_etax2 = ",(0+$final_extra_tax2),";\n";
   print MYFILE "\$sc_verify_etax3 = ",(0+$final_extra_tax3),";\n";
   print MYFILE "\$sc_verify_subtotal = ",(0+$subtotal),";\n";
+  if ($sc_buySafe_is_enabled =~ /yes/) {
+      print MYFILE "\$sc_verify_buySafe = ",(0+$final_buySafe),";\n";
+      print MYFILE "\$sc_verify_buySafe_display_text = \"$sc_buySafe_bond_fee_display_text\";\n";
+      print MYFILE "\$sc_verify_buySafe_customer_desires_bond = \"$sc_buySafe_customer_desires_bond\";\n";
+      print MYFILE "\$sc_buySafe_customer_desires_bond = \"$sc_buySafe_customer_desires_bond\";\n";
+      print MYFILE "\$sc_buySafe_bond_fee_display_text = \"$sc_buySafe_bond_fee_display_text\";\n";
+      print MYFILE "\$sc_buySafe_bonding_signal = qq|$sc_buySafe_bonding_signal|;\n";
+      print MYFILE "\$sc_buySafe_bond_fee_mini_display_text = \"$sc_buySafe_bond_fee_mini_display_text\";\n";
+  }
   print MYFILE "\$sc_verify_grand_total = ",(0+$grand_total),";\n";
   print MYFILE "\$sc_verify_boxes_max_wt = \"",$sc_verify_boxes_max_wt,"\";\n";
   print MYFILE "\$sc_verify_Origin_ZIP = \"",$sc_verify_Origin_ZIP,"\";\n";
@@ -936,7 +1057,7 @@
         $final_extra_tax1,
         $final_extra_tax2,
         $final_extra_tax3,
-        &format_price($grand_total));
+        &format_price($grand_total),$final_buySafe);
 
 } 
 ############################################################
@@ -1231,8 +1352,8 @@
    # fax number added March 11, 2006
    # tos Added March 18, 2006
    # Residential & insurance added April 5, 2006
-   $orderLogString = "$year\t$month\t$day\t$orderLoggingHash{'invoiceNumber'}\t$orderLoggingHash{'customerNumber'}\t$orderLoggingHash{'orderStatus'}\t$orderLoggingHash{'shiptrackingID'}\t$orderLoggingHash{'firstName'}\t$orderLoggingHash{'lastName'}\t$orderLoggingHash{'fullName'}\t$orderLoggingHash{'companyName'}\t$orderLoggingHash{'customerPhone'}\t$orderLoggingHash{'faxNumber'}\t$orderLoggingHash{'emailAddress'}\t$orderLoggingHash{'orderFromAddress'}\t$orderLoggingHash{'customerAddress2'}\t$orderLoggingHash{'customerAddress3'}\t$orderLoggingHash{'orderFromCity'}\t$orderLoggingHash{'orderFromState'}\t$orderLoggingHash{'orderFromPostal'}\t$orderLoggingHash{'orderFromCountry'}\t$orderLoggingHash{'shipToName'}\t$orderLoggingHash{'shipToAddress'}\t$orderLoggingHash{'shipToAddress2'}\t$orderLoggingHash{'shipToAddress3'}\t$orderLoggingHash{'shipToCity'}\t$orderLoggingHash{'shipToState'}\t$orderLoggingHash{'shipToPostal'}\t$orderLoggingHash{'shipToCountry'}\t$orderLoggingHash{'shiptoResidential'}\t$orderLoggingHash{'insureShipment'}\t$orderLoggingHash{'shipMethod'}\t$orderLoggingHash{'shippingTotal'}\t$orderLoggingHash{'salesTax'}\t$orderLoggingHash{'tax1'}\t$orderLoggingHash{'tax2'}\t$orderLoggingHash{'tax3'}\t$orderLoggingHash{'discounts'}\t$orderLoggingHash{'netProfit'}\t$orderLoggingHash{'subTotal'}\t$orderLoggingHash{'orderTotal'}\t$orderLoggingHash{'affiliateTotal'}\t$orderLoggingHash{'affiliateID'}\t$orderLoggingHash{'affiliateMisc'}\t$orderLoggingHash{'user1'}\t$orderLoggingHash{'user2'}\t$orderLoggingHash{'user3'}\t$orderLoggingHash{'user4'}\t$orderLoggingHash{'user5'}\t$orderLoggingHash{'adminMessages'}\t$orderLoggingHash{'cartContents'}\t$orderLoggingHash{'GatewayUsed'}\t$orderLoggingHash{'shippingMessages'}\t$orderLoggingHash{'xcomments'}\t$orderLoggingHash{'termsOfService'}\t$orderLoggingHash{'discountCode'}\n";
-   $orderShortLogString = "$year\t$month\t$day\t$orderLoggingHash{'invoiceNumber'}\t$orderLoggingHash{'customerNumber'}\t$orderLoggingHash{'orderStatus'}\t$orderLoggingHash{'firstName'}\t$orderLoggingHash{'lastName'}\t$orderLoggingHash{'fullName'}\t$orderLoggingHash{'companyName'}\t$orderLoggingHash{'emailAddress'}\t$orderLoggingHash{'orderFromState'}\t$orderLoggingHash{'orderFromPostal'}\t$orderLoggingHash{'orderFromCountry'}\t$orderLoggingHash{'shipMethod'}\t$orderLoggingHash{'shippingTotal'}\t$orderLoggingHash{'salesTax'}\t$orderLoggingHash{'tax1'}\t$orderLoggingHash{'tax2'}\t$orderLoggingHash{'tax3'}\t$orderLoggingHash{'discounts'}\t$orderLoggingHash{'netProfit'}\t$orderLoggingHash{'subTotal'}\t$orderLoggingHash{'orderTotal'}\t$orderLoggingHash{'affiliateTotal'}\t$orderLoggingHash{'affiliateID'}\t$orderLoggingHash{'affiliateMisc'}\n";
+   $orderLogString = "$year\t$month\t$day\t$orderLoggingHash{'invoiceNumber'}\t$orderLoggingHash{'customerNumber'}\t$orderLoggingHash{'orderStatus'}\t$orderLoggingHash{'shiptrackingID'}\t$orderLoggingHash{'firstName'}\t$orderLoggingHash{'lastName'}\t$orderLoggingHash{'fullName'}\t$orderLoggingHash{'companyName'}\t$orderLoggingHash{'customerPhone'}\t$orderLoggingHash{'faxNumber'}\t$orderLoggingHash{'emailAddress'}\t$orderLoggingHash{'orderFromAddress'}\t$orderLoggingHash{'customerAddress2'}\t$orderLoggingHash{'customerAddress3'}\t$orderLoggingHash{'orderFromCity'}\t$orderLoggingHash{'orderFromState'}\t$orderLoggingHash{'orderFromPostal'}\t$orderLoggingHash{'orderFromCountry'}\t$orderLoggingHash{'shipToName'}\t$orderLoggingHash{'shipToAddress'}\t$orderLoggingHash{'shipToAddress2'}\t$orderLoggingHash{'shipToAddress3'}\t$orderLoggingHash{'shipToCity'}\t$orderLoggingHash{'shipToState'}\t$orderLoggingHash{'shipToPostal'}\t$orderLoggingHash{'shipToCountry'}\t$orderLoggingHash{'shiptoResidential'}\t$orderLoggingHash{'insureShipment'}\t$orderLoggingHash{'shipMethod'}\t$orderLoggingHash{'shippingTotal'}\t$orderLoggingHash{'salesTax'}\t$orderLoggingHash{'tax1'}\t$orderLoggingHash{'tax2'}\t$orderLoggingHash{'tax3'}\t$orderLoggingHash{'discounts'}\t$orderLoggingHash{'netProfit'}\t$orderLoggingHash{'subTotal'}\t$orderLoggingHash{'orderTotal'}\t$orderLoggingHash{'affiliateTotal'}\t$orderLoggingHash{'affiliateID'}\t$orderLoggingHash{'affiliateMisc'}\t$orderLoggingHash{'user1'}\t$orderLoggingHash{'user2'}\t$orderLoggingHash{'user3'}\t$orderLoggingHash{'user4'}\t$orderLoggingHash{'user5'}\t$orderLoggingHash{'adminMessages'}\t$orderLoggingHash{'cartContents'}\t$orderLoggingHash{'GatewayUsed'}\t$orderLoggingHash{'shippingMessages'}\t$orderLoggingHash{'xcomments'}\t$orderLoggingHash{'termsOfService'}\t$orderLoggingHash{'discountCode'}\t$orderLoggingHash{'user6'}\t$orderLoggingHash{'user7'}\t$orderLoggingHash{'user8'}\t$orderLoggingHash{'user9'}\t$orderLoggingHash{'user10'}\t$orderLoggingHash{'buySafe'}\t$orderLoggingHash{'order_payment_type_user1'}\t$orderLoggingHash{'order_payment_type_user2'}\t$orderLoggingHash{'GiftCard_number'}\t$orderLoggingHash{'GiftCard_amount_used'}\t$orderLoggingHash{'internal_company_notes1'}\t$orderLoggingHash{'internal_company_notes2'}\t$orderLoggingHash{'internal_company_notes2'}\t$orderLoggingHash{'customer_order_notes1'}\t$orderLoggingHash{'customer_order_notes2'}\t$orderLoggingHash{'customer_order_notes3'}\t$orderLoggingHash{'customer_order_notes4'}\t$orderLoggingHash{'customer_order_notes5'}\t$orderLoggingHash{'mailinglist_subscribe'}\t$orderLoggingHash{'wishlist_subscribe'}\t$orderLoggingHash{'insurance_cost'}\t$orderLoggingHash{'trade_in_allowance'}\t$orderLoggingHash{'rma_number'}\t$orderLoggingHash{'customer_contact_notes1'}\t$orderLoggingHash{'customer_contact_notes2'}\t$orderLoggingHash{'account_number'}\t$orderLoggingHash{'sales_rep'}\t$orderLoggingHash{'sales_rep_notes1'}\t$orderLoggingHash{'sales_rep_notes2'}\t$orderLoggingHash{'how_did_you_find_us'}\t$orderLoggingHash{'suggestion_box'}\t$orderLoggingHash{'preferrred_shipping_date'}\t$orderLoggingHash{'ship_order_items_as_available'}\n";
+   $orderShortLogString = "$year\t$month\t$day\t$orderLoggingHash{'invoiceNumber'}\t$orderLoggingHash{'customerNumber'}\t$orderLoggingHash{'orderStatus'}\t$orderLoggingHash{'firstName'}\t$orderLoggingHash{'lastName'}\t$orderLoggingHash{'fullName'}\t$orderLoggingHash{'companyName'}\t$orderLoggingHash{'emailAddress'}\t$orderLoggingHash{'orderFromState'}\t$orderLoggingHash{'orderFromPostal'}\t$orderLoggingHash{'orderFromCountry'}\t$orderLoggingHash{'shipMethod'}\t$orderLoggingHash{'shippingTotal'}\t$orderLoggingHash{'salesTax'}\t$orderLoggingHash{'tax1'}\t$orderLoggingHash{'tax2'}\t$orderLoggingHash{'tax3'}\t$orderLoggingHash{'discounts'}\t$orderLoggingHash{'netProfit'}\t$orderLoggingHash{'subTotal'}\t$orderLoggingHash{'orderTotal'}\t$orderLoggingHash{'affiliateTotal'}\t$orderLoggingHash{'affiliateID'}\t$orderLoggingHash{'affiliateMisc'}\t$orderLoggingHash{'GatewayUsed'}\t$orderLoggingHash{'buySafe'}\n";
 &codehook("log_order_top");
 # test for year and months as directory names for logging purposes.
 #added by Mister Ed October 2005
@@ -1408,7 +1529,7 @@
   $final_extra_tax1,
   $final_extra_tax2,
   $final_extra_tax3,
-        $grand_total);
+        $grand_total,$final_buySafe);
 if ($sc_use_verify_values_for_display =~ /yes/i) {
   ($sc_ship_method_shortname,$junk) = 
     split(/\(/,$sc_verify_shipto_method,2);
@@ -1417,12 +1538,13 @@
   $final_sales_tax,
   $final_extra_tax1,
   $final_extra_tax2,
-  $final_extra_tax3,
-        $grand_total) =
+  $grand_total,
+       $final_buySafe) =
   ($sc_verify_shipping,$sc_verify_discount,
   $sc_verify_tax,$sc_verify_etax1,
   $sc_verify_etax2,$sc_verify_etax3,
-  $sc_verify_grand_total);
+  $sc_verify_grand_total,
+  $sc_verify_buySafe);
  } else {
   ($final_shipping,
   $final_discount,
@@ -1430,7 +1552,8 @@
   $final_extra_tax1,
   $final_extra_tax2,
   $final_extra_tax3,
-        $grand_total) =
+  $grand_total,
+      $final_buySafe) =
   &calculate_final_values($taxable_grand_total,$subtotal,
   $total_quantity,
   $total_measured_quantity,
@@ -1443,6 +1566,10 @@
 $zfinal_extra_tax1 = $final_extra_tax1;
 $zfinal_extra_tax2 = $final_extra_tax2;
 $zfinal_extra_tax3 = $final_extra_tax3;
+$zfinal_buySafe = $final_buySafe;
+if ($subtotal < .000000001) {
+    $zfinal_buySafe = '';
+}
 $zgrand_total = $grand_total;
 
 if ($final_shipping > 0)
@@ -1470,6 +1597,17 @@
 $text_of_cart .= &format_text_field("Sales Tax:") . 
 "= $final_sales_tax\n\n";
 }
+# buySafe
+if (($final_buySafe > 0) && ($subtotal > 0)) {
+    $final_buySafe = &format_price($final_buySafe);
+    $pass_final_buySafe = &format_price($final_buySafe);
+    $final_buySafe = &display_price($final_buySafe);
+
+    $text_of_cart .= &format_text_field("buySAFE Bond Fee: ") . 
+      "= $final_buySafe\n\n";
+} else {
+   $final_buySafe = '';
+}
 $authPrice = $grand_total;
 $grand_total = &display_price($grand_total);
 &print_order_totals;
@@ -1765,19 +1903,37 @@
 if ($special_message ne "") {
   print $special_message;
  }
-print qq~<form method="post" action="$sc_main_script_url">
+
+# buysafe adjustment
+if (($sc_use_secure_header_at_checkout =~ /yes/i) && 
+  (($reason_to_display_cart =~ /orderform/i) || 
+   ($reason_to_display_cart =~ /verify/i))) {
+  print qq|<form method="post" action="$sc_stepone_order_script_url" id="cartForm" name="cartForm">
+<input type="hidden" name="order_form_button" value="1">
+|;
+ } else {
+  print qq|<form method="post" action="$sc_main_script_url" id="cartForm" name="cartForm">|;
+ }
+
+print qq~
 $hidden_fields
 <div align="center">
 <table class="ac_cart_table">
 <tr>
 $modify_type
 ~;
+my $temp_index = "0";
 foreach $field (@sc_cart_display_fields)
 {
-$cart_heading_item = "<th>$field</th>\n";
 
 &codehook("display_cart_heading_item");
-print $cart_heading_item;
+
+   if (!(($sc_col_name[$temp_index] eq "web_options")||($sc_col_name[$temp_index] eq "options")||($sc_col_name[$temp_index] eq "email_options"))) { 
+      $cart_heading_item = "<th>$field</th>\n";
+      print $cart_heading_item;
+   }
+
+$temp_index++;
 }
 }
 #######################################################################
@@ -1808,6 +1964,7 @@
 local($unformatted_taxable_grand_total);
 local($taxable_grand_total);
 &codehook("display_cart_top");
+if ($sc_global_bot_tracker ne "1") { # run only if not a bot
 if ($reason_to_display_cart =~ /change*quantity/i) 
 {
 &cart_table_header("New Quantity");
@@ -1920,6 +2077,15 @@
 }
 $display_counter = 0;
 $text_of_cart .= "\n\n";
+
+my $temp_fieldname_indicator = '';
+foreach $field_name (@sc_col_name)
+{ 
+   if (($field_name eq "web_options")||($field_name eq "options")||($field_name eq "email_options")) {
+       $temp_fieldname_indicator ="1";
+   }
+}
+
 foreach $field_name (@sc_col_name)
 { 
  $display_index = $cart{$field_name};
@@ -2015,7 +2181,19 @@
 }
 else
 {
-print qq!<td>$display_me</td>\n!;
+
+if ($field_name eq "name") {
+    if (($temp_fieldname_indicator eq "1") && ($cart_fields[15] ne '')) {
+        my @ans_opts = split(/$sc_opt_sep_marker/,$cart_fields[15]); 
+        my $ans2 = join "<br /> &nbsp;&nbsp;&nbsp; + &nbsp; ",@ans_opts;
+        print qq!<td><div align="left">&nbsp; <b>$display_me</b> <br /> &nbsp;&nbsp;&nbsp; + &nbsp; $ans2 </div></td>\n!;
+    } else {
+        print qq!<td><div align="left">&nbsp; <b>$display_me</b></div></td>\n!;
+    }
+} else {
+    print qq!<td>$display_me</td>\n!;
+}
+
   if ($display_index != 5)
   {
   $text_of_cart .= &format_text_field(
@@ -2028,12 +2206,19 @@
 $total_measured_quantity = $total_measured_quantity + $quantity*$cart_fields[6];  
 $shipping_total = $total_measured_quantity;
 # alt origin postal code adds postal code to stevo for shipping by Mister Ed Feb 9, 2005
+# added alt origin state/prov by Mister Ed May 22, 2007
 if ($sc_alt_origin_enabled =~ /yes/i) {
+    my($zip,$stateprov,$junk) = split(/\,/,$cart_fields[11],3);
         $stevo_shipping_thing .= '|' . $quantity . '*' . $cart_fields[6] 
-        . '*' . $cart_fields[$sc_cart_index_of_price_after_options] . '*' . $cart_fields[11];
+        . '*' . $cart_fields[$sc_cart_index_of_price_after_options] . '*' . $zip . '*' . $stateprov . '*';
 } else {
         $stevo_shipping_thing .= '|' . $quantity . '*' . $cart_fields[6] 
-        . '*' . $cart_fields[$sc_cart_index_of_price_after_options];
+        . '*' . $cart_fields[$sc_cart_index_of_price_after_options] . '*' . '*' . '*';
+}
+
+# dimensional shipping data added to stevo for shipping by Mister Ed May 17, 2007
+if ($sc_dimensional_shipping_enabled =~ /yes/i) {
+        $stevo_shipping_thing .= $cart_fields[13];
 }
 $unformatted_subtotal = ($cart_fields[$sc_cart_index_of_price_after_options]);
 $subtotal = &format_price($quantity*$unformatted_subtotal);
@@ -2070,6 +2255,9 @@
 "= $price\n\n";
 return($taxable_grand_total, $grand_total, $total_quantity, $total_measured_quantity,
 $text_of_cart, $stevo_shipping_thing);
+
+}# end of "run only if not a bot"
+
 }
 #######################################################################
 # empty cart footer message added.  Closing table cells added to closing
@@ -2077,7 +2265,7 @@
 sub cart_table_footer {
 local($price, $shipping_total) = @_;
 local($footer);
-if ($price = $0.00) {
+if ($price == 0) {
 print $sc_empty_cart_footer_msg;
 }
 $footer = qq~</tr>
diff -aruN 5.0.000.src/library/AgoraPay-mgr_lib.pl 5.2.000.src/library/AgoraPay-mgr_lib.pl
--- 5.0.000.src/library/AgoraPay-mgr_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/AgoraPay-mgr_lib.pl	2007-12-19 23:22:14.000000000 -0600
@@ -8,7 +8,7 @@
 # All Rights Reserved.
 # November 10, 2001 to Present
 
-$versions{'AgoraPay-mgr_lib.pl'} = "5.0.000";
+$versions{'AgoraPay-mgr_lib.pl'} = "5.0.001";
 &add_codehook("gateway_admin_screen","AgoraPay_mgr_check");
 &add_codehook("gateway_admin_settings","AgoraPay_settings");
 $mc_gateways .= "|AgoraPay";
@@ -43,20 +43,16 @@
          &my_escape($in{'AgoraPay_fontcolor'}) . "\";\n");
    print (GW "\$AgoraPay_linkcolor = \"" . 
          &my_escape($in{'AgoraPay_linkcolor'}) . "\";\n");
+   print (GW "\$AgoraPay_alinkcolor = \"" . 
+         &my_escape($in{'AgoraPay_alinkcolor'}) . "\";\n");
+   print (GW "\$AgoraPay_vlinkcolor = \"" . 
+         &my_escape($in{'AgoraPay_vlinkcolor'}) . "\";\n");
    print (GW "\$AgoraPay_enablebodytags = \"$in{'AgoraPay_enablebodytags'}\";\n");
    print (GW "\$AgoraPay_Logo_URL = \"$in{'AgoraPay_Logo_URL'}\";\n");
    print (GW "\$AgoraPay_backimage_URL = \"$in{'AgoraPay_backimage_URL'}\";\n");
-
-  
-   print (GW "\$acceptcards = \"$in{'acceptcards'}\";\n");
-if ($in{'acceptcards'} eq 1) {
-   print (GW "\$acceptvisa = \"$in{'acceptvisa'}\";\n");
-   print (GW "\$acceptmastercard = \"$in{'acceptmastercard'}\";\n");
-   print (GW "\$acceptdiscover = \"$in{'acceptdiscover'}\";\n");
-   print (GW "\$acceptamex = \"$in{'acceptamex'}\";\n");
-   print (GW "\$acceptdiners = \"$in{'acceptdiners'}\";\n");
-}
-
+   print (GW "\$AgoraPay_disable_cards = \"$in{'AgoraPay_disable_cards'}\";\n");
+   print (GW "\$AgoraPay_disable_checks = \"$in{'AgoraPay_disable_checks'}\";\n");
+   print (GW "\$AgoraPay_disable_paypal = \"$in{'AgoraPay_disable_paypal'}\";\n");
    print (GW "\$acceptchecks = \"$in{'acceptchecks'}\";\n");
    print (GW "\$accepteft = \"$in{'accepteft'}\";\n");
    print (GW "\$altaddr = \"$in{'altaddr'}\";\n");
@@ -216,7 +212,7 @@
 <TR>
 <TD>
 Are setup to accept credit cards through AgoraPay? 
-Select '0' for no, '1' for yes.  (applies to card types below as well)
+Select '0' for no, '1' for yes.
 </TD>
 <TD>
 <SELECT NAME="acceptcards">
@@ -228,35 +224,57 @@
 </TR>
 
 <TR>
-<TD COLSPAN=2><table>
-	<tr>
-		<td><font size=2 face =arial>Accept Visa?<br><SELECT NAME="acceptvisa">
-<OPTION>$acceptvisa</OPTION>
-<OPTION VALUE="0">0</OPTION>
-<OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-		<td><font size=2 face =arial>Accept MasterCard?<br><SELECT NAME="acceptmastercard">
-<OPTION>$acceptmastercard</OPTION>
-<OPTION VALUE="0">0</OPTION>
-<OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-		<td><font size=2 face =arial>Accept AMEX?<br><SELECT NAME="acceptamex">
-<OPTION>$acceptamex</OPTION>
+<TD COLSPAN=2><HR></TD>
+</TR>
+
+<TR>
+<TD>
+Are you setup to accept checks through AgoraPay?
+Select '0' for no, '1' for yes
+</TD>
+<TD>
+<SELECT NAME="acceptchecks">
+<OPTION>$acceptchecks</OPTION>
 <OPTION VALUE="0">0</OPTION>
 <OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-		<td><font size=2 face =arial>Accept Discover?<br><SELECT NAME="acceptdiscover">
-<OPTION>$acceptdiscover</OPTION>
+</SELECT>
+</TD>
+</TR>
+
+<TR>
+<TD COLSPAN=2><HR></TD>
+</TR>
+
+<TR>
+<TD>
+Are you setup to accept EFT through AgoraPay?
+Select '0' for no, '1' for yes.
+</TD>
+<TD>
+<SELECT NAME="accepteft">
+<OPTION>$accepteft</OPTION>
 <OPTION VALUE="0">0</OPTION>
 <OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-		<td><font size=2 face =arial>Accept Diners?<br><SELECT NAME="acceptdiners">
-<OPTION>$acceptdiners</OPTION>
+</SELECT>
+</TD>
+</TR>
+
+<TR>
+<TD COLSPAN=2><HR></TD>
+</TR>
+
+<TR>
+<TD>
+Disable Credit Cards at AgoraPay checkout for this store? 
+Select '0' for no, '1' for yes.
+</TD>
+<TD>
+<SELECT NAME="AgoraPay_disable_cards">
+<OPTION>$AgoraPay_disable_cards</OPTION>
 <OPTION VALUE="0">0</OPTION>
 <OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-	</tr>
-</table></TD>
+</SELECT>
+</TD>
 </TR>
 
 <TR>
@@ -265,12 +283,12 @@
 
 <TR>
 <TD>
-Are you setup to accept checks through AgoraPay?
-Select '0' for no, '1' for yes
+Disable Checks at AgoraPay checkout for this store? 
+Select '0' for no, '1' for yes.
 </TD>
 <TD>
-<SELECT NAME="acceptchecks">
-<OPTION>$acceptchecks</OPTION>
+<SELECT NAME="AgoraPay_disable_checks">
+<OPTION>$AgoraPay_disable_checks</OPTION>
 <OPTION VALUE="0">0</OPTION>
 <OPTION VALUE="1">1</OPTION>
 </SELECT>
@@ -283,12 +301,12 @@
 
 <TR>
 <TD>
-Are you setup to accept EFT through AgoraPay?
+Disable PayPal at AgoraPay checkout for this store?
 Select '0' for no, '1' for yes.
 </TD>
 <TD>
-<SELECT NAME="accepteft">
-<OPTION>$accepteft</OPTION>
+<SELECT NAME="AgoraPay_disable_paypal">
+<OPTION>$AgoraPay_disable_paypal</OPTION>
 <OPTION VALUE="0">0</OPTION>
 <OPTION VALUE="1">1</OPTION>
 </SELECT>
@@ -471,6 +489,12 @@
 		<td><font size=2 face =arial>Link Color:<br>
 <INPUT NAME="AgoraPay_linkcolor" TYPE="TEXT" SIZE=10 VALUE="$AgoraPay_linkcolor">
 </font></td>
+		<td><font size=2 face =arial>aLink Color:<br>
+<INPUT NAME="AgoraPay_alinkcolor" TYPE="TEXT" SIZE=10 VALUE="$AgoraPay_alinkcolor">
+</font></td>
+		<td><font size=2 face =arial>vLink Color:<br>
+<INPUT NAME="AgoraPay_vlinkcolor" TYPE="TEXT" SIZE=10 VALUE="$AgoraPay_vlinkcolor">
+</font></td>
 </table>
 <br>
 <font size=2 face =arial><br>
@@ -487,8 +511,8 @@
 
 <TR>
 <TD COLSPAN=2><font size=2 face =arial><br>
-Enter a text message to be shwon on the payment information page at AgoraPay.
-This mesage will be shown in the text box immediately above the submit button. Use a &lt;br> for line breaks/spacing.  You can also leave this blank if you prefer.<br>
+Enter a text message to be shown on the payment information page at AgoraPay.
+This mesage will be shown in the text box immediately above the submit button. You can also leave this blank if you prefer.<br>
 <TEXTAREA NAME="AgoraPay_merch_message" 
 cols="68" rows=8 
 wrap=off>$AgoraPay_merch_message</TEXTAREA><br>
diff -aruN 5.0.000.src/library/AgoraPay-order_lib.pl 5.2.000.src/library/AgoraPay-order_lib.pl
--- 5.0.000.src/library/AgoraPay-order_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/AgoraPay-order_lib.pl	2008-01-14 21:14:11.000000000 -0600
@@ -2,7 +2,7 @@
 #                    Order Form Definition Variables                  #
 #######################################################################
 
-$versions{'AgoraPay-order_lib.pl'} = "5.0.000";
+$versions{'AgoraPay-order_lib.pl'} = "5.2.000";
 $sc_use_secure_header_at_checkout = 'yes';
 $sc_use_secure_footer_for_order_form = 'yes';
 
@@ -73,6 +73,9 @@
     push(@sc_order_form_required_fields,"Ecom_tos");
  }
 
+# use this codehook to change the above arrays for required fields and such
+&codehook("AgoraPay_fields_bottom");
+
 }
 
 ###############################################################################
@@ -192,6 +195,8 @@
 <INPUT type="hidden" name="bgcolor" value="$AgoraPay_bodyback">
 <INPUT type="hidden" name="fontcolor" value="$AgoraPay_fontcolor">
 <INPUT type="hidden" name="link" value="$AgoraPay_linkcolor">
+<INPUT type="hidden" name="alink" value="$AgoraPay_alinkcolor">
+<INPUT type="hidden" name="vlink" value="$AgoraPay_vlinkcolor">
 ~;
 }
 
@@ -247,11 +252,9 @@
 <INPUT TYPE=HIDDEN NAME=\"acceptchecks\" VALUE=\"$acceptchecks\">
 <INPUT TYPE=HIDDEN NAME=\"accepteft\" VALUE=\"$accepteft\">
 <INPUT TYPE=HIDDEN NAME=\"altaddr\" VALUE=\"$altaddr\">
-<input type=hidden name="visaimage" value="$acceptvisa">
-<input type=hidden name="mcimage" value="$acceptmastercard">
-<input type=hidden name="discimage" value="$acceptdiscover">
-<INPUT type="hidden" name="ameximage" value="$acceptamex">
-<INPUT type="hidden" name="dinerimage" value="$acceptdiners">
+<INPUT TYPE=HIDDEN NAME=\"disable_cards\" VALUE=\"$AgoraPay_disable_cards\">
+<INPUT TYPE=HIDDEN NAME=\"disable_paypal\" VALUE=\"$AgoraPay_disable_paypal\">
+<INPUT TYPE=HIDDEN NAME=\"disable_checks\" VALUE=\"$AgoraPay_disable_checks\">
 
 <INPUT TYPE=HIDDEN NAME=\"lookup\" VALUE=\"first_name\">
 <INPUT TYPE=HIDDEN NAME=\"lookup\" VALUE=\"last_name\">
@@ -372,6 +375,7 @@
 # parse the signed response, not what was on the command line ... 
 # code borrowed from cgi-lib.pl
 
+if ($form_data{'signature'}) {
 foreach $i (0 .. $#itrans) {
    # Convert plus to space
    $itrans[$i] =~ s/\+/ /g;
@@ -387,6 +391,10 @@
    $itrans{$key} .= "\0" if (defined($itrans{$key})); #\0 = multiple separator
    $itrans{$key} .= $val;
  }
+} elsif ($AgoraPay_disable_paypal ne "1" && $form_data{'signature'} eq '') {
+  foreach $key (sort(keys(%form_data))) {
+   $itrans{$key} = "$form_data{$key}";
+ }
 
 if ($sc_pgp_or_gpg =~ /GPG/i) { # verify with GPG
   $command =  "$sc_pgp_or_gpg_path ";
@@ -565,6 +573,13 @@
   &add_text_of_both("SUBTOTAL",$temp);
   $orderLoggingHash{'subTotal'} = &format_price($sc_verify_subtotal);
 
+if (($sc_buySafe_is_enabled =~ /yes/) && ($sc_verify_buySafe > 0)) {
+my $temp = &format_price($sc_verify_buySafe);
+$text_of_cart .= "$sc_buySafe_bond_fee_mini_display_text       $temp\n";
+$text_of_confirm_email .= "$sc_verify_buySafe_display_text       $temp\n";
+$orderLoggingHash{'buySafe'} = "$temp";
+}
+
 if ($sc_verify_discount) {
   $temp = &format_price($sc_verify_discount);
   &add_text_of_both("DISCOUNT",$tempt);
@@ -675,7 +690,7 @@
 $text_of_cart .= "STATE:         $itrans{'sstate'}\n";
 $orderLoggingHash{'shipToState'} = "$itrans{'sstate'}";
 } else {
-$text_of_cart .= "CITY:          $eform_Ecom_ShipTo_Postal_StateProv\n";
+$text_of_cart .= "STATE:          $eform_Ecom_ShipTo_Postal_StateProv\n";
 $orderLoggingHash{'shipToState'} = "$eform_Ecom_ShipTo_Postal_StateProv";
 }
 
@@ -695,9 +710,7 @@
 $orderLoggingHash{'shipToCountry'} = "$vform_Ecom_ShipTo_Postal_CountryCode";
 }
 
-if ($sc_use_SBW =~ /yes/i) {
-  $text_of_cart .= "SHIP VIA:      $itrans{'Ecom_ShipTo_Method'}\n";
- }
+$text_of_cart .= "SHIP VIA:      $itrans{'Ecom_ShipTo_Method'}\n";
 
 # NEW CODEHOOK
 &codehook("process-order-pre-ship-instructions");
@@ -735,8 +748,14 @@
 
 $sc_agorapay_order_desc .= " - " . $itrans{'p5'};
 
+# added by Mister Ed Feb 7, 2007
+my $temp_admin_email = "$itrans{'email'}";
+if ($sc_use_customer_email_over_admin =~ /yes/i) {
+   $temp_admin_email = "$eform_Ecom_BillTo_Online_Email";
+}
+
 if ($sc_send_order_to_email =~ /yes/i) {
-  &send_mail($sc_admin_email, $sc_order_email, $sc_agorapay_order_desc, $text_of_cart);
+  &send_mail($temp_admin_email, $sc_order_email, $sc_agorapay_order_desc, $text_of_cart);
  }
 
 &log_order($text_of_cart,$itrans{'p5'},$itrans{'p4'});
@@ -774,6 +793,7 @@
 
 # This empties the cart after the order is successful
 &empty_cart;
+undef(%form_data);
 
 # and the footer is printed
 
diff -aruN 5.0.000.src/library/agora.setup.db 5.2.000.src/library/agora.setup.db
--- 5.0.000.src/library/agora.setup.db	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/agora.setup.db	2008-01-21 21:07:53.000000000 -0600
@@ -1,454 +1,453 @@
-$versions{'agora.setup.db 5 user'} = "5.0.000";
-# set this to "" to always calculate the tax
-$sc_sales_tax_form_variable = "Ecom_ShipTo_Postal_StateProv";
-$sc_userfields_available = "5";
-$sc_database_version = "5 User";
-
-# added by Mister Ed April 2006.
-# limits the chracters accepted from order forms.
-# silently truncates at the max size
-$sc_max_char_length = 2400;
-
-$sc_browser_header = "Content-type: text/html\n\n";
-$sc_qty_box_on_cart_display = "yes";
-$sc_default_qty_to_display = 1; # becomes %%qty%% in html below
-$sc_default_qty_box_html = 
-'<input type=text name="%%itemID%%" size="3" maxlength="4" value="%%qty%%">';
-
-$sc_product_display_header = qq~<div align=center><table class="ac_product_table">~;
-
-# add javascript or other items for header tags here
-$sc_image_string_template = '<img src="%%URLofImages%%/%%image%%" alt="%%image%%">';
-$sc_special_page_meta_tags = qq~  <!-- agora.cgi shopping cart $versions{'agora.cgi'} -->
-  <!-- sc_special_page_meta_tags in agora.setup.db -->
-~;
-$sc_browser_meta_tags = qq~  <meta http-equiv="Expires" content="Wed, 4 October 2005 00:00:00 GMT">
-  <meta http-equiv="Cache-Control" content="no-cache">
-  <meta http-equiv="Pragma" content="no-cache">
-  <!-- sc_browser_meta_tags in agora.setup.db -->
-~;
-$sc_robot_meta_tags = qq~  <!-- sc_robot_meta_tags in agora.setup.db -->
-~;
-
-# Setup the directory definitions first
-$sc_admin_dir = "./admin_files";
-$sc_data_file_dir = "./data_files";
-$sc_html_dir = "./html";
-$sc_lib_dir = "./library";
-$sc_logs_dir = "./log_files";
-$sc_templates_dir = "$sc_html_dir/html-templates"; # removed / at end 4.0c
-$sc_user_carts_directory_path = "./shopping_carts";
-
-$sc_cgi_lib_path = "$sc_lib_dir/cgi-lib.pl";
-$sc_mail_lib_path = "$sc_lib_dir/mail-lib.pl";
-$sc_ship_lib_path = "$sc_lib_dir/shipping_lib.pl";
-
-$sc_html_setup_file_path = "$sc_lib_dir/agora_html_lib.pl";
-$sc_process_order_lib_path = "$sc_lib_dir/$sc_gateway_name-order_lib.pl";
-$sc_cookie_lib = "$sc_lib_dir/cookie-lib.pl";
-
-if ($sc_database_lib eq "") {
-  $sc_database_lib="agora_db_lib.pl";
- }
-$sc_db_lib_path = "$sc_lib_dir/$sc_database_lib";
-$sc_order_lib_path = "$sc_lib_dir/agora_order_lib.pl";
-$sc_pgp_lib_path = "$sc_lib_dir/pgp-lib.pl";
-
-$sc_data_file_path = "$sc_data_file_dir/data.file";
-
-$sc_options_directory_path = "$sc_html_dir/options";
-$sc_generic_directory_path = "$sc_html_dir/files";
-$sc_html_product_directory_path = "$sc_html_dir/pages";
-$sc_form_dir_path = "$sc_html_dir/forms";
-$sc_html_order_form_path = "$sc_form_dir_path/$sc_gateway_name-orderform.html";
-$sc_store_front_path = "$sc_html_dir/index.html";
-
-$sc_counter_file_path = "$sc_admin_dir/counter.file";
-$sc_cart_user_lib_path = "$sc_admin_dir/cart_user_lib.pl";
-
-$sc_error_log_path = "$sc_logs_dir/error.log";
-$sc_access_log_path = "$sc_logs_dir/access.log";
-$sc_order_log_directory_path = "$sc_logs_dir/orders";
-
-$error_page = "$sc_html_dir/error.html";
-$sc_grep = "grep";
-$sc_main_script_url = "agora.cgi";
-$sc_secpicserver_url = "agora.cgi";
-
-if ($sc_stepone_order_script_url eq "") { #set default value
-  $sc_stepone_order_script_url = $sc_store_url;
- }
-$sc_debug_mode = "no";
-$sc_debug_track_cartid = 'no';
-$sc_cookie_days = 30; # browser cookie lifetime, not cart lifetime.  set to -1 if you wish cookies to expire when browser is closed.
-$sc_allow_location_redirect = "yes"; # helpful for cookies
-$sc_test_for_store_cart_change_repeats = 1; # test for reloaded pages
-
-# As of 3.1 taken out of manager, should be left on unless
-# a good reason for disabling is found (like security concerns 
-# on your particular server.)  Agorascript is now used in much
-# of the store!
-$sc_use_agorascript = "yes";
-
-# if this var is "" then it won't convert the underlines
-$sc_convert_product_token_underlines = " "; #convert to what char
-
-# if this var is "" then it won't process multiple instances of the
-# same product id number on a single web page.
-$sc_web_pid_sep_char = "~~"; 
-
-# special manager control variables
-$mc_allow_multiple_options = 'yes'; 
-
-#######################################################################
-#                Database Definition Variables                        #
-#######################################################################
-
-$sc_db_flatfile_caching_ok = "yes"; 
-$VF_DEF{"PRODUCT"} = "db";
-
-# If you need more fields, put them before 'options' field,
-# options must be last!
-
-$db[ 0]="product_id";
-$db[ 1]="product";
-$db[ 2]="price";
-$db[ 3]="name";
-$db[ 4]="image_url";
-$db[ 5]="description";
-$db[ 6]="shipping";
-$db[ 7]="user1";
-$db[ 8]="user2";
-$db[ 9]="user3";
-$db[10]="user4";
-$db[11]="user5";
-$db[12]="options";
-
-{ my $inx=-1; 
-  my $txt;
-  foreach $txt (@db) {
-    $inx++;
-    $db{$txt}=$inx;
-   }
-}
-
-@sc_db_display_fields = ("Product");
-
-@sc_db_index_for_display = ($db{"image_url"},
-                            $db{"name"},
-                            $db{"description"},
-                            $db{"options"},
-                            $db{"price"},
-                            $db{"shipping"},
-                            $db{"user1"},
-                            $db{"user2"},
-                            $db{"user3"},
-                            $db{"user4"},
-                            $db{"user5"});
-
-@sc_db_index_for_defining_item_id =
-($db{"product_id"},
- $db{"product"},
- $db{"price"},
- $db{"name"},
- $db{"image_url"},
- $db{"shipping"});
-
-$sc_db_index_of_product_id = $db{"product_id"};
-$sc_db_index_of_product    = $db{"product"};
-
-# These two can be changed if need be, they are used to get the db price
-# for verification when adding to the cart.
-# could use a virtual field
-$sc_db_price_field_name    = "price";
-$sc_db_index_of_price      = $db{$sc_db_price_field_name};
-
-@sc_db_query_criteria = ("product_id|0|=|string",
-                         "p_id|0|=|string",
-                         "product|1|=|string", 
-                         "user1|$db{'user1'}|=|string",
-                         "user2|$db{'user2'}|=|string",
-                         "user3|$db{'user3'}|=|string",
-                         "user4|$db{'user4'}|=|string",
-                         "user5|$db{'user5'}|=|string",
-                         "keywords|0,1,3,5|=|string",
-                         "lopr|2|<=|number",
-                         "hipr|2|>=|number",
-                         "query_price_low_range|2|<=|number",
-                         "query_price_high_range|2|>=|number");  
-
-#######################################################################
-#                    Cart Definition Variables                        #
-#######################################################################
-# The cart associative array is defined via the following steps:
-#                
-# 1. The 0th field is ALWAYS the quantity of the purchased item
-#
-# 2. The subsequent fields are the same fields defined
-#    in the @sc_db_index_for_defining_item_id variable.
-#    This is done because whatever is defined in this array,
-#    becomes the part of the product defined in the user's cart.
-#
-#       
-# 3. The field before the next to last field is ALWAYS the   
-#    "options" that have been selected by the user.  If you are    
-#     not using options, this field still needs to be here. It will
-#     just be used as an empty place marker.
-#       
-# 4. The next to last field is ALWAYS the price
-#    after options have been calculated in with the normal price.
-#       
-# 5. The last field is ALWAYS a computer generated
-#    unique identifier to distinguish cart line items from
-#    each other.
-
-
-$sc_opt_sep_marker = '{';
-$VF_DEF{"CART"} = "cart";
-
-$cart[ 0]="quantity";
-$cart[ 1]="product_id";
-$cart[ 2]="product";
-$cart[ 3]="price";
-$cart[ 4]="name";
-$cart[ 5]="image";
-$cart[ 6]="shipping";
-$cart[ 7]="shipping_calc_flag";
-$cart[ 8]="options_ids";
-$cart[ 9]="user1";
-$cart[10]="user2";
-$cart[11]="user3";
-$cart[12]="user4";
-$cart[13]="user5";
-$cart[14]="user6";
-$cart[15]="options";
-$cart[16]="price_after_options";
-$cart[17]="unique_cart_line_id";
-#
-{ my $inx=-1; 
-  my $txt;
-  foreach $txt (@cart) {
-    $inx++;
-    $cart{$txt}=$inx;
-   }
-}
-
-# old-style vitual fields ...
-# Virtual Cart Fields are all the negated value of position in data.file
-$cart{"db_description"}      = -5;
-$cart{"db_price"}            = -2;
-$cart{"db_shipping"}         = -6;
-$cart{"db_user1"}            = -7;
-$cart{"db_user2"}            = -8;
-$cart{"db_user3"}            = -9;
-$cart{"db_user4"}            = -10;
-$cart{"db_user5"}            = -11;
-
-$cart{"web_options"}    = '* $ans=&cart_web_options(&vf_eval("options"));';
-$cart{"email_options"}  = '* $ans=&cart_email_options(&vf_eval("options"));';
-
-$sc_opt_web_strip_part_number = "yes";
-$sc_opt_email_leading_spaces = 15;
-
-$sc_cart_index_of_price = $cart{"price"};
-$sc_cart_index_of_image = $cart{"image"};
-$sc_cart_index_of_price_after_options = $cart{"price_after_options"};
-
-# this will show the index of another column of our choice
-# to measure -- such as weight or volume if we are selling
-# something where the weight or volume affects the shipping
-# or discount logic.
-
-$sc_cart_index_of_measured_value = $cart{"shipping"};
-$sc_cart_index_of_item_id = $cart{"product_id"};
-$sc_cart_index_of_quantity = $cart{"quantity"};
-
-# The following will generate hidden fields with
-# the contents of the cart inside of them.
-$sc_order_with_hidden_fields = "yes";
-
-# increasing numerical value (1,2,3) if its 0,
-# then it never gets calculated at this stage
-
-$sc_max_final_values_loops = 3; # hard coded to do a min of 3 anyway!
-
-if ($sc_calculate_shipping_loop eq "" ||  
-    $sc_calculate_shipping_loop < 0   ||  
-    $sc_calculate_shipping_loop > 3   ) { 
-  $sc_calculate_shipping_loop = 3;  # set the loop value to default
- }
-
-if ($sc_use_SBW =~ /yes/i) { # need ZIP before we can determine
- $sc_calculate_shipping_at_display_form = 0;
-} else { #we can display, value is actual ship price
- $sc_calculate_shipping_at_display_form = $sc_calculate_shipping_loop; #3
-}
-
-$sc_calculate_shipping_at_process_form = $sc_calculate_shipping_loop; #3
-
-$sc_calculate_sales_tax_at_display_form = 3;
-$sc_calculate_sales_tax_at_process_form = 3;
-
-$sc_calculate_extra_tax1_at_display_form = 3;
-$sc_calculate_extra_tax1_at_process_form = 3;
-
-$sc_calculate_extra_tax2_at_display_form = 3;
-$sc_calculate_extra_tax2_at_process_form = 3;
-
-$sc_calculate_extra_tax3_at_display_form = 3;
-$sc_calculate_extra_tax3_at_process_form = 3;
-
-# This may be used in Custom Shipping Logic, can be reset there
-# to anything else if needs be
-@sc_order_form_shipping_related_fields = ('Ecom_ShipTo_Method');
-
-
-# Discount logic is the same as shipping logic except
-# that whatever value is calculated for the discount will
-# be subtracted rather than added to the grand total.
-
-@sc_order_form_discount_related_fields = ('Ecom_Discount');
-
-### Not used in agora ... use the Discount manger instead in
-### manager.cgi!  
-#@sc_discount_logic = ();
-### end of unused stuff
-
-if ($sc_calculate_discount_loop eq "" ||  
-    $sc_calculate_discount_loop < 0   ||  
-    $sc_calculate_discount_loop > 3   ) { 
-  $sc_calculate_discount_loop = 3;  # set the loop value to default
- }
-
-$sc_calculate_discount_at_display_form = $sc_calculate_discount_loop;
-$sc_calculate_discount_at_process_form = $sc_calculate_discount_loop;
- 
-$sc_pgp_temp_file_path = "./shopping_carts";
-
-#######################################################################
-#                     Store Option Variables                          #
-#######################################################################
-$sc_repeat_fake_it = "yes"; # attempt to answer well on reload of "cart change"
-
-# For Static HTML pages, if telling them item added ok used to sneak in msg,
-# use the %%item_ordered_msg%% token instead! Can enable if needed though:
-$sc_allow_sneak_in_message = "no"; 
-
-# this is for the %%item_ordered_msg%%
-$sc_item_ordered_msg_token = "<FONT FACE=ARIAL SIZE=2 COLOR=BLUE>Thank 
-you, your selection has been added to your order.</FONT>";
-
-$sc_shall_i_log_errors = "yes"; 
-$sc_shall_i_email_if_error = "no";
-$sc_shall_i_let_client_know_item_added = "yes";
-#######################################################################
-#                    HTML Search Variables                            #  
-#######################################################################
-@sc_unwanted_files = ('*.cgi');
-#######################################################################
-#                  Error Message Variables                            #
-#######################################################################
-$sc_page_load_security_warning = 
-    "I am sorry, but you may only use this program to view HTML pages.";
-
-$sc_randomizer_error_message = "
-There must be something wrong with your local
-rand function because I cannot get a unique, random number for
-your shopping cart. Please check the call to rand in the Assign a
-Shopping Cart routine.
-";
-
-#######################################################################
-#                  Miscellaneous Variables                            #
-#######################################################################
-$sc_processing_order="no"; # init this
-@acceptable_file_extensions_to_display = (".html", ".htm");
-@sc_sales_tax_form_values = ("$sc_sales_tax_state");
-$sc_no_frames_button = qq!
-<INPUT TYPE = "submit" NAME = "return_to_frontpage_button" 
- VALUE = "Return to Frontpage">
-!;
-$sc_product_display_title = "Product Listing";
-
-$sc_product_display_footer_helper = '<tr><td colspan="3"><hr/></td></tr>';
-$sc_product_display_footer = qq!</table></div>!;
-
-#######################################################################
-#                     Various Message Variables                       #
-#######################################################################
-#
-# format is $messages{'mod_num'}='the message';
-#
-
-#used if not "faking it" on a page reload, displays this msg & cart contents
-$messages{'chkref_01'} =  
-  "<center><table width=500><tr><td>The " .
-  "cart system has detected a possible page-reload  " .
-  "attempt on a page that may have previously changed the " .
-  "cart contents. &nbsp;The current cart contents are displayed below." .
-  "&nbsp; </td></tr></table></center>"; 
-
-# used in most if not all gateways
-#see also messages ordcnf_07,08,09
-$messages{'ordcnf_01'} = 
-  "Thank you for shopping with us. Your order has been \n" .
-  "received and will be shipped as soon as possible.&nbsp; Please \n" .
-  "visit us again soon!";
-
-#example of where used is below "Thank You" for an order
-$messages{'ordcnf_02'} = qq~
-  <br /><br /><a href="$sc_store_url">Return to the Store Front</a>
-~;
-
-#Happens if they "submit" the order a second time accidently
-$messages{'ordcnf_03'} = qq~
-  We do not seem to have an order verification file for this
-  shopping cart! Is it possible your order was already
-  processed?  If you are having trouble completing your
-  order, please contact us at <a href="mailto:$sc_admin_email">
-  $sc_admin_email</a>. <br /><br />Thank you for shopping with us!
-~;
-
-$messages{'ordcnf_04'} = qq~
-  Please verify the following information. 
-  When you are confident that it is correct, click the
-  'Submit Order For Processing' button below.
-~;
-  
-$messages{'ordcnf_05'} = qq~
-  There was a problem processing this order.
-~;
-
-$messages{'ordcnf_06'} = 
-  "Please verify the above information.&nbsp;\n" . 
-  "When you are confident that it is correct, click the \n" .
-  "'Secure Orderform' button to enter your payment information.\n";
-
-#see also message ordcnf_01
-$messages{'ordcnf_07'} = 
-  "Thank you for your order. We appreciate your business and will " .
-  "do everything we can to meet your expectations. Please visit us " .
-  "again soon!\n\n";
-
-# used in confirm emails and also thank you page titles, every gateway
-$messages{'ordcnf_08'} = "Thank you for your order";
-  
-# Used in Offline for the confirmation table after order is processed
-$messages{'ordcnf_09'} = qq~
-  Thank you for shopping with us. Your order has been 
-  received and will be shipped as soon as possible.
-  You will receive an email confirmation shortly.<br />
-  Please print this confirmation page for your records.
-~;
-
-$messages{'ordcnf_10'} =  '<b>Order Confirmation</b><br /><br />';
-eval('$messages{"ordcnf_10"} =  $messages{"ordcnf_10"} . &get_date; ');
-
-
-$messages{'ordprc_01'} = qq~I'm sorry, but there seems to 
-be a problem with your order.&nbsp Please
-check the order form, verify your information, and 
-try submitting the order again.~;
-
-#########################################################################
-1; # We are a library
+$versions{'agora.setup.db 5 user'} = "5.2.000";
+# set this to "" to always calculate the tax
+$sc_sales_tax_form_variable = "Ecom_ShipTo_Postal_StateProv";
+$sc_userfields_available = "5";
+$sc_database_version = "5 User";
+
+# added by Mister Ed April 2006.
+# limits the chracters accepted from order forms.
+# silently truncates at the max size
+$sc_max_char_length = 2400;
+
+$sc_browser_header = "Content-type: text/html\n\n";
+$sc_qty_box_on_cart_display = "yes";
+$sc_default_qty_to_display = 1; # becomes %%qty%% in html below
+$sc_default_qty_box_html = 
+'<input type=text name="%%itemID%%" size="3" maxlength="4" value="%%qty%%">';
+
+$sc_product_display_header = qq~<div align=center><table class="ac_product_table">~;
+
+# add javascript or other items for header tags here
+$sc_image_string_template = '<img src="%%URLofImages%%/%%image%%" alt="%%image%%">';
+$sc_special_page_meta_tags = qq~  <!-- agora.cgi shopping cart $versions{'agora.cgi'} -->
+  <!-- sc_special_page_meta_tags in agora.setup.db -->
+~;
+$sc_browser_meta_tags = qq~  <meta http-equiv="Expires" content="Wed, 4 October 2005 00:00:00 GMT">
+  <meta http-equiv="Cache-Control" content="no-cache">
+  <meta http-equiv="Pragma" content="no-cache">
+  <!-- sc_browser_meta_tags in agora.setup.db -->
+~;
+$sc_robot_meta_tags = qq~  <!-- sc_robot_meta_tags in agora.setup.db -->
+~;
+
+# Setup the directory definitions first
+$sc_admin_dir = "./admin_files";
+$sc_data_file_dir = "./data_files";
+$sc_html_dir = "./html";
+$sc_lib_dir = "./library";
+$sc_logs_dir = "./log_files";
+$sc_templates_dir = "$sc_html_dir/html-templates"; # removed / at end 4.0c
+$sc_user_carts_directory_path = "./shopping_carts";
+
+$sc_cgi_lib_path = "$sc_lib_dir/cgi-lib.pl";
+$sc_mail_lib_path = "$sc_lib_dir/mail-lib.pl";
+$sc_ship_lib_path = "$sc_lib_dir/shipping_lib.pl";
+
+$sc_html_setup_file_path = "$sc_lib_dir/agora_html_lib.pl";
+$sc_process_order_lib_path = "$sc_lib_dir/$sc_gateway_name-order_lib.pl";
+$sc_cookie_lib = "$sc_lib_dir/cookie-lib.pl";
+
+if ($sc_database_lib eq "") {
+  $sc_database_lib="agora_db_lib.pl";
+ }
+$sc_db_lib_path = "$sc_lib_dir/$sc_database_lib";
+$sc_order_lib_path = "$sc_lib_dir/agora_order_lib.pl";
+$sc_pgp_lib_path = "$sc_lib_dir/pgp-lib.pl";
+
+$sc_data_file_path = "$sc_data_file_dir/data.file";
+
+$sc_options_directory_path = "$sc_html_dir/options";
+$sc_generic_directory_path = "$sc_html_dir/files";
+$sc_html_product_directory_path = "$sc_html_dir/pages";
+$sc_form_dir_path = "$sc_html_dir/forms";
+$sc_html_order_form_path = "$sc_form_dir_path/$sc_gateway_name-orderform.html";
+$sc_store_front_path = "$sc_html_dir/index.html";
+
+$sc_counter_file_path = "$sc_admin_dir/counter.file";
+$sc_cart_user_lib_path = "$sc_admin_dir/cart_user_lib.pl";
+
+$sc_error_log_path = "$sc_logs_dir/error.log";
+$sc_access_log_path = "$sc_logs_dir/access.log";
+$sc_order_log_directory_path = "$sc_logs_dir/orders";
+
+$error_page = "$sc_html_dir/error.html";
+$sc_grep = "grep";
+$sc_main_script_url = "agora.cgi";
+$sc_secpicserver_url = "agora.cgi";
+
+if ($sc_stepone_order_script_url eq "") { #set default value
+  $sc_stepone_order_script_url = $sc_store_url;
+ }
+$sc_debug_mode = "no";
+$sc_debug_track_cartid = 'no';
+$sc_cookie_days = 30; # browser cookie lifetime, not cart lifetime.  set to -1 if you wish cookies to expire when browser is closed.
+$sc_allow_location_redirect = "yes"; # helpful for cookies
+$sc_test_for_store_cart_change_repeats = 1; # test for reloaded pages
+
+# As of 3.1 taken out of manager, should be left on unless
+# a good reason for disabling is found (like security concerns 
+# on your particular server.)  Agorascript is now used in much
+# of the store!
+$sc_use_agorascript = "yes";
+
+# if this var is "" then it won't convert the underlines
+$sc_convert_product_token_underlines = " "; #convert to what char
+
+# if this var is "" then it won't process multiple instances of the
+# same product id number on a single web page.
+$sc_web_pid_sep_char = "~~"; 
+
+# special manager control variables
+$mc_allow_multiple_options = 'yes'; 
+
+#######################################################################
+#                Database Definition Variables                        #
+#######################################################################
+
+$sc_db_flatfile_caching_ok = "yes"; 
+$VF_DEF{"PRODUCT"} = "db";
+
+# If you need more fields, put them before 'options' field,
+# options must be last!
+
+$db[ 0]="product_id";
+$db[ 1]="product";
+$db[ 2]="price";
+$db[ 3]="name";
+$db[ 4]="image_url";
+$db[ 5]="description";
+$db[ 6]="shipping";
+$db[ 7]="user1";
+$db[ 8]="user2";
+$db[ 9]="user3";
+$db[10]="user4";
+$db[11]="user5";
+$db[12]="options";
+
+{ my $inx=-1; 
+  my $txt;
+  foreach $txt (@db) {
+    $inx++;
+    $db{$txt}=$inx;
+   }
+}
+
+@sc_db_display_fields = ("Product");
+
+@sc_db_index_for_display = ($db{"image_url"},
+                            $db{"name"},
+                            $db{"description"},
+                            $db{"options"},
+                            $db{"price"},
+                            $db{"shipping"},
+                            $db{"user1"},
+                            $db{"user2"},
+                            $db{"user3"},
+                            $db{"user4"},
+                            $db{"user5"});
+
+@sc_db_index_for_defining_item_id =
+($db{"product_id"},
+ $db{"product"},
+ $db{"price"},
+ $db{"name"},
+ $db{"image_url"},
+ $db{"shipping"});
+
+$sc_db_index_of_product_id = $db{"product_id"};
+$sc_db_index_of_product    = $db{"product"};
+
+# These two can be changed if need be, they are used to get the db price
+# for verification when adding to the cart.
+# could use a virtual field
+$sc_db_price_field_name    = "price";
+$sc_db_index_of_price      = $db{$sc_db_price_field_name};
+
+@sc_db_query_criteria = ("product_id|0|=|string",
+                         "p_id|0|=|string",
+                         "product|1|=|string", 
+                         "user1|$db{'user1'}|=|string",
+                         "user2|$db{'user2'}|=|string",
+                         "user3|$db{'user3'}|=|string",
+                         "user4|$db{'user4'}|=|string",
+                         "user5|$db{'user5'}|=|string",
+                         "keywords|0,1,3,5|=|string",
+                         "lopr|2|<=|number",
+                         "hipr|2|>=|number",
+                         "query_price_low_range|2|<=|number",
+                         "query_price_high_range|2|>=|number");  
+
+#######################################################################
+#                    Cart Definition Variables                        #
+#######################################################################
+# The cart associative array is defined via the following steps:
+#                
+# 1. The 0th field is ALWAYS the quantity of the purchased item
+#
+# 2. The subsequent fields are the same fields defined
+#    in the @sc_db_index_for_defining_item_id variable.
+#    This is done because whatever is defined in this array,
+#    becomes the part of the product defined in the user's cart.
+#
+#       
+# 3. The field before the next to last field is ALWAYS the   
+#    "options" that have been selected by the user.  If you are    
+#     not using options, this field still needs to be here. It will
+#     just be used as an empty place marker.
+#       
+# 4. The next to last field is ALWAYS the price
+#    after options have been calculated in with the normal price.
+#       
+# 5. The last field is ALWAYS a computer generated
+#    unique identifier to distinguish cart line items from
+#    each other.
+
+
+$sc_opt_sep_marker = '{';
+$VF_DEF{"CART"} = "cart";
+
+$cart[ 0]="quantity";
+$cart[ 1]="product_id";
+$cart[ 2]="product";
+$cart[ 3]="price";
+$cart[ 4]="name";
+$cart[ 5]="image";
+$cart[ 6]="shipping";
+$cart[ 7]="shipping_calc_flag";
+$cart[ 8]="options_ids";
+$cart[ 9]="user1";
+$cart[10]="user2";
+$cart[11]="user3";
+$cart[12]="user4";
+$cart[13]="user5";
+$cart[14]="user6";
+$cart[15]="options";
+$cart[16]="price_after_options";
+$cart[17]="unique_cart_line_id";
+#
+{ my $inx=-1; 
+  my $txt;
+  foreach $txt (@cart) {
+    $inx++;
+    $cart{$txt}=$inx;
+   }
+}
+
+# old-style vitual fields ...
+# Virtual Cart Fields are all the negated value of position in data.file
+$cart{"db_description"}      = -5;
+$cart{"db_price"}            = -2;
+$cart{"db_shipping"}         = -6;
+$cart{"db_user1"}            = -7;
+$cart{"db_user2"}            = -8;
+$cart{"db_user3"}            = -9;
+$cart{"db_user4"}            = -10;
+$cart{"db_user5"}            = -11;
+
+$cart{"email_options"}  = '* $ans=&cart_email_options(&vf_eval("options"));';
+
+$sc_opt_web_strip_part_number = "yes";
+$sc_opt_email_leading_spaces = 15;
+
+$sc_cart_index_of_price = $cart{"price"};
+$sc_cart_index_of_image = $cart{"image"};
+$sc_cart_index_of_price_after_options = $cart{"price_after_options"};
+
+# this will show the index of another column of our choice
+# to measure -- such as weight or volume if we are selling
+# something where the weight or volume affects the shipping
+# or discount logic.
+
+$sc_cart_index_of_measured_value = $cart{"shipping"};
+$sc_cart_index_of_item_id = $cart{"product_id"};
+$sc_cart_index_of_quantity = $cart{"quantity"};
+
+# The following will generate hidden fields with
+# the contents of the cart inside of them.
+$sc_order_with_hidden_fields = "yes";
+
+# increasing numerical value (1,2,3) if its 0,
+# then it never gets calculated at this stage
+
+$sc_max_final_values_loops = 3; # hard coded to do a min of 3 anyway!
+
+if ($sc_calculate_shipping_loop eq "" ||  
+    $sc_calculate_shipping_loop < 0   ||  
+    $sc_calculate_shipping_loop > 3   ) { 
+  $sc_calculate_shipping_loop = 3;  # set the loop value to default
+ }
+
+if ($sc_use_SBW =~ /yes/i) { # need ZIP before we can determine
+ $sc_calculate_shipping_at_display_form = 0;
+} else { #we can display, value is actual ship price
+ $sc_calculate_shipping_at_display_form = $sc_calculate_shipping_loop; #3
+}
+
+$sc_calculate_shipping_at_process_form = $sc_calculate_shipping_loop; #3
+
+$sc_calculate_sales_tax_at_display_form = 3;
+$sc_calculate_sales_tax_at_process_form = 3;
+
+$sc_calculate_extra_tax1_at_display_form = 3;
+$sc_calculate_extra_tax1_at_process_form = 3;
+
+$sc_calculate_extra_tax2_at_display_form = 3;
+$sc_calculate_extra_tax2_at_process_form = 3;
+
+$sc_calculate_extra_tax3_at_display_form = 3;
+$sc_calculate_extra_tax3_at_process_form = 3;
+
+# This may be used in Custom Shipping Logic, can be reset there
+# to anything else if needs be
+@sc_order_form_shipping_related_fields = ('Ecom_ShipTo_Method');
+
+
+# Discount logic is the same as shipping logic except
+# that whatever value is calculated for the discount will
+# be subtracted rather than added to the grand total.
+
+@sc_order_form_discount_related_fields = ('Ecom_Discount');
+
+### Not used in agora ... use the Discount manger instead in
+### manager.cgi!  
+#@sc_discount_logic = ();
+### end of unused stuff
+
+if ($sc_calculate_discount_loop eq "" ||  
+    $sc_calculate_discount_loop < 0   ||  
+    $sc_calculate_discount_loop > 3   ) { 
+  $sc_calculate_discount_loop = 3;  # set the loop value to default
+ }
+
+$sc_calculate_discount_at_display_form = $sc_calculate_discount_loop;
+$sc_calculate_discount_at_process_form = $sc_calculate_discount_loop;
+ 
+$sc_pgp_temp_file_path = "./shopping_carts";
+
+#######################################################################
+#                     Store Option Variables                          #
+#######################################################################
+$sc_repeat_fake_it = "yes"; # attempt to answer well on reload of "cart change"
+
+# For Static HTML pages, if telling them item added ok used to sneak in msg,
+# use the %%item_ordered_msg%% token instead! Can enable if needed though:
+$sc_allow_sneak_in_message = "no"; 
+
+# this is for the %%item_ordered_msg%%
+$sc_item_ordered_msg_token = "<FONT FACE=ARIAL SIZE=2 COLOR=BLUE>Thank 
+you, your selection has been added to your order.</FONT>";
+
+$sc_shall_i_log_errors = "yes"; 
+$sc_shall_i_email_if_error = "no";
+$sc_shall_i_let_client_know_item_added = "yes";
+#######################################################################
+#                    HTML Search Variables                            #  
+#######################################################################
+@sc_unwanted_files = ('*.cgi');
+#######################################################################
+#                  Error Message Variables                            #
+#######################################################################
+$sc_page_load_security_warning = 
+    "I am sorry, but you may only use this program to view HTML pages.";
+
+$sc_randomizer_error_message = "
+There must be something wrong with your local
+rand function because I cannot get a unique, random number for
+your shopping cart. Please check the call to rand in the Assign a
+Shopping Cart routine.
+";
+
+#######################################################################
+#                  Miscellaneous Variables                            #
+#######################################################################
+$sc_processing_order="no"; # init this
+@acceptable_file_extensions_to_display = (".html", ".htm");
+@sc_sales_tax_form_values = ("$sc_sales_tax_state");
+$sc_no_frames_button = qq!
+<INPUT TYPE = "submit" NAME = "return_to_frontpage_button" 
+ VALUE = "Return to Frontpage">
+!;
+$sc_product_display_title = "Product Listing";
+
+$sc_product_display_footer_helper = '<tr><td colspan="3"><hr/></td></tr>';
+$sc_product_display_footer = qq!</table></div>!;
+
+#######################################################################
+#                     Various Message Variables                       #
+#######################################################################
+#
+# format is $messages{'mod_num'}='the message';
+#
+
+#used if not "faking it" on a page reload, displays this msg & cart contents
+$messages{'chkref_01'} =  
+  "<center><table width=500><tr><td>The " .
+  "cart system has detected a possible page-reload  " .
+  "attempt on a page that may have previously changed the " .
+  "cart contents. &nbsp;The current cart contents are displayed below." .
+  "&nbsp; </td></tr></table></center>"; 
+
+# used in most if not all gateways
+#see also messages ordcnf_07,08,09
+$messages{'ordcnf_01'} = 
+  "Thank you for shopping with us. Your order has been \n" .
+  "received and will be shipped as soon as possible.&nbsp; Please \n" .
+  "visit us again soon!";
+
+#example of where used is below "Thank You" for an order
+$messages{'ordcnf_02'} = qq~
+  <br /><br /><a href="$sc_store_url">Return to the Store Front</a>
+~;
+
+#Happens if they "submit" the order a second time accidently
+$messages{'ordcnf_03'} = qq~
+  We do not seem to have an order verification file for this
+  shopping cart! Is it possible your order was already
+  processed?  If you are having trouble completing your
+  order, please contact us at <a href="mailto:$sc_admin_email">
+  $sc_admin_email</a>. <br /><br />Thank you for shopping with us!
+~;
+
+$messages{'ordcnf_04'} = qq~
+  Please verify the following information. 
+  When you are confident that it is correct, click the
+  'Submit Order For Processing' button below.
+~;
+  
+$messages{'ordcnf_05'} = qq~
+  There was a problem processing this order.
+~;
+
+$messages{'ordcnf_06'} = 
+  "Please verify the above information.&nbsp;\n" . 
+  "When you are confident that it is correct, click the \n" .
+  "'Secure Orderform' button to enter your payment information.\n";
+
+#see also message ordcnf_01
+$messages{'ordcnf_07'} = 
+  "Thank you for your order. We appreciate your business and will " .
+  "do everything we can to meet your expectations. Please visit us " .
+  "again soon!\n\n";
+
+# used in confirm emails and also thank you page titles, every gateway
+$messages{'ordcnf_08'} = "Thank you for your order";
+  
+# Used in Offline for the confirmation table after order is processed
+$messages{'ordcnf_09'} = qq~
+  Thank you for shopping with us. Your order has been 
+  received and will be shipped as soon as possible.
+  You will receive an email confirmation shortly.<br />
+  Please print this confirmation page for your records.
+~;
+
+$messages{'ordcnf_10'} =  '<b>Order Confirmation</b><br /><br />';
+eval('$messages{"ordcnf_10"} =  $messages{"ordcnf_10"} . &get_date; ');
+
+
+$messages{'ordprc_01'} = qq~I'm sorry, but there seems to 
+be a problem with your order.&nbsp Please
+check the order form, verify your information, and 
+try submitting the order again.~;
+
+#########################################################################
+1; # We are a library
diff -aruN 5.0.000.src/library/AuthorizeNet-mgr_lib.pl 5.2.000.src/library/AuthorizeNet-mgr_lib.pl
--- 5.0.000.src/library/AuthorizeNet-mgr_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/AuthorizeNet-mgr_lib.pl	2008-01-14 21:14:11.000000000 -0600
@@ -10,7 +10,7 @@
 # May 3, 2006 Adjustments and misc edits for final v5 version by Mister Ed at K-Factor Technologies, Inc.
 # May 5, 2006 final edits for final v5 version by Mister Ed at K-Factor Technologies, Inc.
 
-$versions{'AuthorizeNet-mgr_lib.pl'} = "5.0.000";
+$versions{'AuthorizeNet-mgr_lib.pl'} = "5.2.000";
 &add_codehook("gateway_admin_screen","AuthorizeNet_mgr_check");
 &add_codehook("gateway_admin_settings","AuthorizeNet_settings");
 $mc_gateways .= "|AuthorizeNet";
@@ -54,6 +54,7 @@
   print (GW  "\$sc_auth_order_desc = \"$sc_auth_order_desc\";\n");
   print (GW  "\$sc_display_checkout_tos = \"$in{'sc_display_checkout_tos'}\";\n");
   print (GW  "\$sc_tos_display_address = qq'$sc_tos_display_address';\n");
+  print (GW  "\$sc_authnet_sale_mode = '$in{'sc_authnet_sale_mode'}';\n");
  
   print (GW  "#\n1\;\n");
   close(GW);
@@ -194,7 +195,7 @@
 </table><TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BORDER=0>
 
 <TR>
-<TD COLSPAN=2>
+<TD COLSPAN=2><br>
 Secure URL to your Gateway's server
 </TD>
 </TR>
@@ -206,6 +207,16 @@
 </TD>
 </TR>
 
+<TD width=80%><br>
+Sales Mode: <small>(Authorize Only or Normal Sales. Normal Sales is the default)</small> </TD>
+<TD>
+<SELECT NAME="sc_authnet_sale_mode">
+<OPTION>$sc_authnet_sale_mode</OPTION>
+<OPTION>Normal</OPTION>
+<OPTION>Authorize Only</OPTION>
+</SELECT>
+</TD>
+
 <TR>
 <TD COLSPAN=2><HR></TD>
 </TR>
diff -aruN 5.0.000.src/library/AuthorizeNet-order_lib.pl 5.2.000.src/library/AuthorizeNet-order_lib.pl
--- 5.0.000.src/library/AuthorizeNet-order_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/AuthorizeNet-order_lib.pl	2008-01-14 21:14:12.000000000 -0600
@@ -2,7 +2,7 @@
 #                    Order Form Definition Variables                  #
 #######################################################################
 
-$versions{'AuthorizeNet-order_lib.pl'} = "5.0.000";
+$versions{'AuthorizeNet-order_lib.pl'} = "5.2.000";
 
 # Copyright 2000-2001 Steve Kneizys.
 # Copyright 2002 to Present K-Factor Technologies, Inc.  All Rights Reserved.
@@ -92,6 +92,10 @@
  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("AuthorizeNet_fields_bottom");
+
 }
 ###############################################################################
 sub AuthorizeNet_verification_table {
@@ -233,6 +237,12 @@
   $test_mode = qq~<input type="hidden" name="x_test_request" value="TRUE">~;
  }
 
+if ($sc_authnet_sale_mode =~ /authorize/i){
+  $authnet_sale_mode = qq~<input type="hidden" name="x_type" value="AUTH_ONLY">~;
+ } else {
+  $authnet_sale_mode = "";
+ }
+
 $tstamp = time;
 if ($sc_tstamp3 =~ /add/i){
   $tstamp = $tstamp + $sc_tstamp2;
@@ -285,6 +295,7 @@
 <input type="hidden" name="x_description" value="$x_description">
 <input type="hidden" name="x_cust_id" value="$customer_number">
 <input type="hidden" name="x_show_form" value="PAYMENT_FORM">
+$authnet_sale_mode
 
 <input type="hidden" name="x_receipt_link_method" value="POST">
 <input type="hidden" name="x_receipt_link_text" value="YOU MUST CLICK HERE TO FINALIZE YOUR ORDER!">
@@ -383,7 +394,7 @@
 
 #
 # Need to process this info someday ...
-&load_verify_file;
+# &load_verify_file;
 #
 # Now verify the order total and the shipping cost
 #if ((!($sc_verify_shipping == $form_data{'x_freight'})) ||
@@ -451,6 +462,8 @@
 
 # All went well at AuthorizeNet, proceed with processing
 
+&load_verify_file;
+
 # initialize hash variables in case they are empty later
 # added by jfindlay 2006 April 10
 
@@ -567,12 +580,18 @@
   &add_text_of_both("SUBTOTAL",$temp);
   $orderLoggingHash{'subTotal'} = "$sc_verify_subtotal";
 
+if (($sc_buySafe_is_enabled =~ /yes/) && ($sc_verify_buySafe > 0)) {
+my $temp = &format_price($sc_verify_buySafe);
+$text_of_cart .= "$sc_buySafe_bond_fee_mini_display_text       $temp\n";
+$text_of_confirm_email .= "$sc_verify_buySafe_display_text       $temp\n";
+$orderLoggingHash{'buySafe'} = "$temp";
+}
+
   if ($form_data{'x_freight'})
   {
   $text_of_cart .= "SHIPPING:      $form_data{'x_freight'}\n";
   $text_of_confirm_email .= "SHIPPING:      $form_data{'x_freight'}\n";
   $orderLoggingHash{'shippingTotal'} = &format_price($sc_verify_shipping);
-  $orderLoggingHash{'shipMethod'} = "$vform_Ecom_ShipTo_Method";
          if (($sc_use_SBW =~ /yes/i) || ($form_data{'x_Freight'} > .009)) {
            $text_of_confirm_email .=  "SHIP VIA:      $vform_Ecom_ShipTo_Method\n";
          }
@@ -762,23 +781,26 @@
 $text_of_admin_email .= &addto_shop_keep_email;
 $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";
+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";
 }
 
-if ($sc_send_order_to_email =~ /yes/i)
-{
-&send_mail($sc_admin_email, $sc_order_email, "$x_description - $form_data{'x_invoice_num'}", $text_of_cart);
+# added by Mister Ed Feb 7, 2007
+my $temp_admin_email = "$sc_admin_email";
+if ($sc_use_customer_email_over_admin =~ /yes/i) {
+   $temp_admin_email = "form_data{'x_email'}";
+}
+
+if ($sc_send_order_to_email =~ /yes/i) {
+   &send_mail($sc_admin_email, $sc_order_email, "$x_description - $form_data{'x_invoice_num'}", $text_of_cart);
 }
 
 &log_order($text_of_cart,$form_data{'x_invoice_num'},$form_data{'x_cust_id'});
 
-if (($cartData) && ($form_data{'x_email'} ne ""))
-{
-&send_mail($sc_admin_email, $form_data{'x_email'}, $messages{'ordcnf_08'},
+if (($cartData) && ($form_data{'x_email'} ne "")) {
+   &send_mail($sc_admin_email, $form_data{'x_email'}, $messages{'ordcnf_08'},
            "$text_of_confirm_email");
 }
   
@@ -811,6 +833,7 @@
 
 # This empties the cart after the order is successful
 &empty_cart;
+undef(%form_data);
 
 # and the footer is printed
 
diff -aruN 5.0.000.src/library/cgi-lib.pl 5.2.000.src/library/cgi-lib.pl
--- 5.0.000.src/library/cgi-lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/cgi-lib.pl	2007-12-19 23:22:14.000000000 -0600
@@ -21,7 +21,7 @@
 #     http://cgi-lib.stanford.edu/cgi-lib/
 
 $cgi_lib'version = sprintf("%d.%02d", q$Revision: 2.18 $ =~ /(\d+)\.(\d+)/);
-$versions{'cgi-lib'}= "5.0.000";
+$versions{'cgi-lib'}= "5.0.001";
 
 # Parameters affecting cgi-lib behavior
 # User-configurable parameters affecting file upload.
@@ -106,7 +106,7 @@
     } else {
       &CgiDie("cgi-lib.pl: Unknown request method: $meth\n");
     }
-
+    $sc_special_checkout_variable2 = "$in";
     @in = split(/[&;]/,$in); 
     push(@in, @ARGV) if $cmdflag; # add command-line parameters
 
diff -aruN 5.0.000.src/library/iTransact-mgr_lib.pl 5.2.000.src/library/iTransact-mgr_lib.pl
--- 5.0.000.src/library/iTransact-mgr_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/iTransact-mgr_lib.pl	2007-12-19 23:22:15.000000000 -0600
@@ -8,7 +8,7 @@
 # All Rights Reserved.
 # November 10, 2001 to Present
 
-$versions{'iTransact-mgr_lib.pl'} = "5.0.000";
+$versions{'iTransact-mgr_lib.pl'} = "5.0.001";
 &add_codehook("gateway_admin_screen","iTransact_mgr_check");
 &add_codehook("gateway_admin_settings","iTransact_settings");
 $mc_gateways .= "|iTransact";
@@ -43,20 +43,16 @@
          &my_escape($in{'iTransact_fontcolor'}) . "\";\n");
    print (GW "\$iTransact_linkcolor = \"" . 
          &my_escape($in{'iTransact_linkcolor'}) . "\";\n");
+   print (GW "\$iTransact_alinkcolor = \"" . 
+         &my_escape($in{'iTransact_alinkcolor'}) . "\";\n");
+   print (GW "\$iTransact_vlinkcolor = \"" . 
+         &my_escape($in{'iTransact_vlinkcolor'}) . "\";\n");
    print (GW "\$iTransact_enablebodytags = \"$in{'iTransact_enablebodytags'}\";\n");
    print (GW "\$iTransact_Logo_URL = \"$in{'iTransact_Logo_URL'}\";\n");
    print (GW "\$iTransact_backimage_URL = \"$in{'iTransact_backimage_URL'}\";\n");
-
-  
-   print (GW "\$acceptcards = \"$in{'acceptcards'}\";\n");
-if ($in{'acceptcards'} eq 1) {
-   print (GW "\$acceptvisa = \"$in{'acceptvisa'}\";\n");
-   print (GW "\$acceptmastercard = \"$in{'acceptmastercard'}\";\n");
-   print (GW "\$acceptdiscover = \"$in{'acceptdiscover'}\";\n");
-   print (GW "\$acceptamex = \"$in{'acceptamex'}\";\n");
-   print (GW "\$acceptdiners = \"$in{'acceptdiners'}\";\n");
-}
-
+   print (GW "\$iTransact_disable_cards = \"$in{'iTransact_disable_cards'}\";\n");
+   print (GW "\$iTransact_disable_checks = \"$in{'iTransact_disable_checks'}\";\n");
+   print (GW "\$iTransact_disable_paypal = \"$in{'iTransact_disable_paypal'}\";\n");
    print (GW "\$acceptchecks = \"$in{'acceptchecks'}\";\n");
    print (GW "\$accepteft = \"$in{'accepteft'}\";\n");
    print (GW "\$altaddr = \"$in{'altaddr'}\";\n");
@@ -216,7 +212,7 @@
 <TR>
 <TD>
 Are setup to accept credit cards through iTransact? 
-Select '0' for no, '1' for yes.  (applies to card types below as well)
+Select '0' for no, '1' for yes. 
 </TD>
 <TD>
 <SELECT NAME="acceptcards">
@@ -228,35 +224,57 @@
 </TR>
 
 <TR>
-<TD COLSPAN=2><table>
-	<tr>
-		<td><font size=2 face =arial>Accept Visa?<br><SELECT NAME="acceptvisa">
-<OPTION>$acceptvisa</OPTION>
-<OPTION VALUE="0">0</OPTION>
-<OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-		<td><font size=2 face =arial>Accept MasterCard?<br><SELECT NAME="acceptmastercard">
-<OPTION>$acceptmastercard</OPTION>
-<OPTION VALUE="0">0</OPTION>
-<OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-		<td><font size=2 face =arial>Accept AMEX?<br><SELECT NAME="acceptamex">
-<OPTION>$acceptamex</OPTION>
+<TD COLSPAN=2><HR></TD>
+</TR>
+
+<TR>
+<TD>
+Are you setup to accept checks through iTransact?
+Select '0' for no, '1' for yes
+</TD>
+<TD>
+<SELECT NAME="acceptchecks">
+<OPTION>$acceptchecks</OPTION>
 <OPTION VALUE="0">0</OPTION>
 <OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-		<td><font size=2 face =arial>Accept Discover?<br><SELECT NAME="acceptdiscover">
-<OPTION>$acceptdiscover</OPTION>
+</SELECT>
+</TD>
+</TR>
+
+<TR>
+<TD COLSPAN=2><HR></TD>
+</TR>
+
+<TR>
+<TD>
+Are you setup to accept EFT through iTransact?
+Select '0' for no, '1' for yes.
+</TD>
+<TD>
+<SELECT NAME="accepteft">
+<OPTION>$accepteft</OPTION>
 <OPTION VALUE="0">0</OPTION>
 <OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-		<td><font size=2 face =arial>Accept Diners?<br><SELECT NAME="acceptdiners">
-<OPTION>$acceptdiners</OPTION>
+</SELECT>
+</TD>
+</TR>
+
+<TR>
+<TD COLSPAN=2><HR></TD>
+</TR>
+
+<TR>
+<TD>
+Disable Credit Cards at iTransact checkout for this store? 
+Select '0' for no, '1' for yes.
+</TD>
+<TD>
+<SELECT NAME="iTransact_disable_cards">
+<OPTION>$iTransact_disable_cards</OPTION>
 <OPTION VALUE="0">0</OPTION>
 <OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-	</tr>
-</table></TD>
+</SELECT>
+</TD>
 </TR>
 
 <TR>
@@ -265,12 +283,12 @@
 
 <TR>
 <TD>
-Are you setup to accept checks through iTransact?
-Select '0' for no, '1' for yes
+Disable Checks at iTransact checkout for this store? 
+Select '0' for no, '1' for yes.
 </TD>
 <TD>
-<SELECT NAME="acceptchecks">
-<OPTION>$acceptchecks</OPTION>
+<SELECT NAME="iTransact_disable_checks">
+<OPTION>$iTransact_disable_checks</OPTION>
 <OPTION VALUE="0">0</OPTION>
 <OPTION VALUE="1">1</OPTION>
 </SELECT>
@@ -283,12 +301,12 @@
 
 <TR>
 <TD>
-Are you setup to accept EFT through iTransact?
+Disable PayPal at iTransact checkout for this store?
 Select '0' for no, '1' for yes.
 </TD>
 <TD>
-<SELECT NAME="accepteft">
-<OPTION>$accepteft</OPTION>
+<SELECT NAME="iTransact_disable_paypal">
+<OPTION>$iTransact_disable_paypal</OPTION>
 <OPTION VALUE="0">0</OPTION>
 <OPTION VALUE="1">1</OPTION>
 </SELECT>
@@ -471,6 +489,12 @@
 		<td><font size=2 face =arial>Link Color:<br>
 <INPUT NAME="iTransact_linkcolor" TYPE="TEXT" SIZE=10 VALUE="$iTransact_linkcolor">
 </font></td>
+		<td><font size=2 face =arial>aLink Color:<br>
+<INPUT NAME="iTransact_alinkcolor" TYPE="TEXT" SIZE=10 VALUE="$iTransact_alinkcolor">
+</font></td>
+		<td><font size=2 face =arial>vLink Color:<br>
+<INPUT NAME="iTransact_vlinkcolor" TYPE="TEXT" SIZE=10 VALUE="$iTransact_vlinkcolor">
+</font></td>
 </table>
 <br>
 <font size=2 face =arial><br>
@@ -487,8 +511,8 @@
 
 <TR>
 <TD COLSPAN=2><font size=2 face =arial><br>
-Enter a text message to be shwon on the payment information page at iTransact.
-This mesage will be shown in the text box immediately above the submit button. Use a &lt;br> for line breaks/spacing.  You can also leave this blank if you prefer.<br>
+Enter a text message to be shown on the payment information page at iTransact.
+This mesage will be shown in the text box immediately above the submit button. You can also leave this blank if you prefer.<br>
 <TEXTAREA NAME="iTransact_merch_message" 
 cols="68" rows=8 
 wrap=off>$iTransact_merch_message</TEXTAREA><br>
diff -aruN 5.0.000.src/library/iTransact-order_lib.pl 5.2.000.src/library/iTransact-order_lib.pl
--- 5.0.000.src/library/iTransact-order_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/iTransact-order_lib.pl	2008-01-14 21:14:12.000000000 -0600
@@ -2,7 +2,7 @@
 #                    Order Form Definition Variables                  #
 #######################################################################
 
-$versions{'iTransact-order_lib.pl'} = "5.0.000";
+$versions{'iTransact-order_lib.pl'} = "5.2.000";
 $sc_use_secure_header_at_checkout = 'yes';
 $sc_use_secure_footer_for_order_form = 'yes';
 
@@ -73,6 +73,9 @@
     push(@sc_order_form_required_fields,"Ecom_tos");
  }
 
+# use this codehook to change the above arrays for required fields and such
+&codehook("iTransact_fields_bottom");
+
 }
 
 ###############################################################################
@@ -192,6 +195,8 @@
 <INPUT type="hidden" name="bgcolor" value="$iTransact_bodyback">
 <INPUT type="hidden" name="fontcolor" value="$iTransact_fontcolor">
 <INPUT type="hidden" name="link" value="$iTransact_linkcolor">
+<INPUT type="hidden" name="alink" value="$iTransact_alinkcolor">
+<INPUT type="hidden" name="vlink" value="$iTransact_vlinkcolor">
 ~;
 }
 
@@ -247,11 +252,9 @@
 <INPUT TYPE=HIDDEN NAME=\"acceptchecks\" VALUE=\"$acceptchecks\">
 <INPUT TYPE=HIDDEN NAME=\"accepteft\" VALUE=\"$accepteft\">
 <INPUT TYPE=HIDDEN NAME=\"altaddr\" VALUE=\"$altaddr\">
-<input type=hidden name="visaimage" value="$acceptvisa">
-<input type=hidden name="mcimage" value="$acceptmastercard">
-<input type=hidden name="discimage" value="$acceptdiscover">
-<INPUT type="hidden" name="ameximage" value="$acceptamex">
-<INPUT type="hidden" name="dinerimage" value="$acceptdiners">
+<INPUT TYPE=HIDDEN NAME=\"disable_cards\" VALUE=\"$iTransact_disable_cards\">
+<INPUT TYPE=HIDDEN NAME=\"disable_paypal\" VALUE=\"$iTransact_disable_paypal\">
+<INPUT TYPE=HIDDEN NAME=\"disable_checks\" VALUE=\"$iTransact_disable_checks\">
 
 <INPUT TYPE=HIDDEN NAME=\"lookup\" VALUE=\"first_name\">
 <INPUT TYPE=HIDDEN NAME=\"lookup\" VALUE=\"last_name\">
@@ -376,6 +379,7 @@
 # parse the signed response, not what was on the command line ... 
 # code borrowed from cgi-lib.pl
 
+if ($form_data{'signature'}) {
 foreach $i (0 .. $#itrans) {
    # Convert plus to space
    $itrans[$i] =~ s/\+/ /g;
@@ -391,6 +395,10 @@
    $itrans{$key} .= "\0" if (defined($itrans{$key})); #\0 = multiple separator
    $itrans{$key} .= $val;
  }
+} elsif ($AgoraPay_disable_paypal ne "1" && $form_data{'signature'} eq '') {
+  foreach $key (sort(keys(%form_data))) {
+   $itrans{$key} = "$form_data{$key}";
+ }
 
 if ($sc_pgp_or_gpg =~ /GPG/i) { # verify with GPG
   $command =  "$sc_pgp_or_gpg_path ";
@@ -568,6 +576,13 @@
   &add_text_of_both("SUBTOTAL",$temp);
   $orderLoggingHash{'subTotal'} = &format_price($sc_verify_subtotal);
 
+if (($sc_buySafe_is_enabled =~ /yes/) && ($sc_verify_buySafe > 0)) {
+my $temp = &format_price($sc_verify_buySafe);
+$text_of_cart .= "$sc_buySafe_bond_fee_mini_display_text       $temp\n";
+$text_of_confirm_email .= "$sc_verify_buySafe_display_text       $temp\n";
+$orderLoggingHash{'buySafe'} = "$temp";
+}
+
 if ($sc_verify_discount) {
   $temp = &format_price($sc_verify_discount);
   &add_text_of_both("DISCOUNT",$tempt);
@@ -678,7 +693,7 @@
 $text_of_cart .= "STATE:         $itrans{'sstate'}\n";
 $orderLoggingHash{'shipToState'} = "$itrans{'sstate'}";
 } else {
-$text_of_cart .= "CITY:          $eform_Ecom_ShipTo_Postal_StateProv\n";
+$text_of_cart .= "STATE:          $eform_Ecom_ShipTo_Postal_StateProv\n";
 $orderLoggingHash{'shipToState'} = "$eform_Ecom_ShipTo_Postal_StateProv";
 }
 
@@ -698,9 +713,7 @@
 $orderLoggingHash{'shipToCountry'} = "$vform_Ecom_ShipTo_Postal_CountryCode";
 }
 
-if ($sc_use_SBW =~ /yes/i) {
-  $text_of_cart .= "SHIP VIA:      $itrans{'Ecom_ShipTo_Method'}\n";
- }
+$text_of_cart .= "SHIP VIA:      $itrans{'Ecom_ShipTo_Method'}\n";
 
 # NEW CODEHOOK
 &codehook("process-order-pre-ship-instructions");
@@ -738,8 +751,14 @@
 
 $sc_itransact_order_desc .= " - " . $itrans{'p5'};
 
+# added by Mister Ed Feb 7, 2007
+my $temp_admin_email = "$itrans{'email'}";
+if ($sc_use_customer_email_over_admin =~ /yes/i) {
+   $temp_admin_email = "$eform_Ecom_BillTo_Online_Email";
+}
+
 if ($sc_send_order_to_email =~ /yes/i) {
-  &send_mail($sc_admin_email, $sc_order_email, $sc_itransact_order_desc, $text_of_cart);
+  &send_mail($temp_admin_email, $sc_order_email, $sc_itransact_order_desc, $text_of_cart);
  }
 
 &log_order($text_of_cart,$itrans{'p5'},$itrans{'p4'});
@@ -777,6 +796,7 @@
 
 # This empties the cart after the order is successful
 &empty_cart;
+undef(%form_data);
 
 # and the footer is printed
 
diff -aruN 5.0.000.src/library/LinkpointConnect-order_lib.pl 5.2.000.src/library/LinkpointConnect-order_lib.pl
--- 5.0.000.src/library/LinkpointConnect-order_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/LinkpointConnect-order_lib.pl	2007-12-19 23:22:16.000000000 -0600
@@ -1,7 +1,7 @@
 ##############################################################################
 #                       Order Form Definition Variables                      #
 ##############################################################################
-$versions{'LinkpointConnect-order_lib.pl'} = "5.0.000";
+$versions{'LinkpointConnect-order_lib.pl'} = "5.0.002";
 $sc_use_secure_header_at_checkout = 'yes';
 $sc_use_secure_footer_for_order_form = 'yes';
 $sc_LinkpointConnect_form_prep = 0;
@@ -87,6 +87,9 @@
     push(@sc_order_form_required_fields,"Ecom_tos");
  }
 
+# use this codehook to change the above arrays for required fields and such
+&codehook("LinkpointConnect_fields_bottom");
+
 }
 
 ###############################################################################
@@ -404,6 +407,13 @@
 &add_text_of_both("SUBTOTAL",$sc_verify_subtotal);
 $sc_verify_subtotal3 = $sc_verify_subtotal;
 
+if (($sc_buySafe_is_enabled =~ /yes/) && ($sc_verify_buySafe > 0)) {
+my $temp = &format_price($sc_verify_buySafe);
+$text_of_cart .= "$sc_buySafe_bond_fee_mini_display_text       $temp\n";
+$text_of_confirm_email .= "$sc_verify_buySafe_display_text       $temp\n";
+$orderLoggingHash{'buySafe'} = "$temp";
+}
+
 if ($sc_verify_discount) {
   $temp = &format_price($sc_verify_discount);
   &add_text_of_both("DISCOUNT",$temp);
@@ -562,9 +572,7 @@
 # NEW CODEHOOK
 &codehook("process-order-pre-ship-instructions");
 
-if ($sc_use_SBW =~ /yes/i) {
-  &add_text_of_cart("SHIP VIA",$vform_Ecom_ShipTo_Method);
- }
+$text_of_cart .= "SHIP VIA:      $vform_Ecom_ShipTo_Method\n";
 
 if ($sc_verify_discount) {
   &add_text_of_both("DISCOUNT",$sc_verify_discount);
@@ -603,8 +611,14 @@
 $text_of_cart = "\n" . $text_of_cart . "\n";
 }
 
+# added by Mister Ed 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) {
-  &send_mail($sc_order_email, $sc_order_email, "AgoraCart - LinkpointConnect Order - $lp_inv",$text_of_cart);
+  &send_mail($temp_admin_email, $sc_order_email, "AgoraCart - LinkpointConnect Order - $lp_inv",$text_of_cart);
  }
 
 # NEW CODEHOOK
@@ -647,6 +661,7 @@
 
 # This empties the cart after the order is successful
 &empty_cart;
+undef(%form_data);
 
 # and the footer is printed
 
diff -aruN 5.0.000.src/library/NiftyPay-mgr_lib.pl 5.2.000.src/library/NiftyPay-mgr_lib.pl
--- 5.0.000.src/library/NiftyPay-mgr_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/NiftyPay-mgr_lib.pl	2007-12-19 23:22:17.000000000 -0600
@@ -7,7 +7,7 @@
 # Copyright May 7, 2005 to Present K-Factor Technologies, Inc.  & AgoraScript
 # All Rights Reserved.
 
-$versions{'NiftyPay-mgr_lib.pl'} = "5.0.000";
+$versions{'NiftyPay-mgr_lib.pl'} = "5.0.001";
 &add_codehook("gateway_admin_screen","NiftyPay_mgr_check");
 &add_codehook("gateway_admin_settings","NiftyPay_settings");
 $mc_gateways .= "|NiftyPay";
@@ -42,20 +42,16 @@
          &my_escape($in{'NiftyPay_fontcolor'}) . "\";\n");
    print (GW "\$NiftyPay_linkcolor = \"" . 
          &my_escape($in{'NiftyPay_linkcolor'}) . "\";\n");
+   print (GW "\$NiftyPay_vlinkcolor = \"" . 
+         &my_escape($in{'NiftyPay_vlinkcolor'}) . "\";\n");
+   print (GW "\$NiftyPay_alinkcolor = \"" . 
+         &my_escape($in{'NiftyPay_alinkcolor'}) . "\";\n");
    print (GW "\$NiftyPay_enablebodytags = \"$in{'NiftyPay_enablebodytags'}\";\n");
    print (GW "\$NiftyPay_Logo_URL = \"$in{'NiftyPay_Logo_URL'}\";\n");
    print (GW "\$NiftyPay_backimage_URL = \"$in{'NiftyPay_backimage_URL'}\";\n");
-
-  
-   print (GW "\$acceptcards = \"$in{'acceptcards'}\";\n");
-if ($in{'acceptcards'} eq 1) {
-   print (GW "\$acceptvisa = \"$in{'acceptvisa'}\";\n");
-   print (GW "\$acceptmastercard = \"$in{'acceptmastercard'}\";\n");
-   print (GW "\$acceptdiscover = \"$in{'acceptdiscover'}\";\n");
-   print (GW "\$acceptamex = \"$in{'acceptamex'}\";\n");
-   print (GW "\$acceptdiners = \"$in{'acceptdiners'}\";\n");
-}
-
+   print (GW "\$NiftyPay_disable_cards = \"$in{'NiftyPay_disable_cards'}\";\n");
+   print (GW "\$NiftyPay_disable_checks = \"$in{'NiftyPay_disable_checks'}\";\n");
+   print (GW "\$NiftyPay_disable_paypal = \"$in{'NiftyPay_disable_paypal'}\";\n");
    print (GW "\$acceptchecks = \"$in{'acceptchecks'}\";\n");
    print (GW "\$accepteft = \"$in{'accepteft'}\";\n");
    print (GW "\$altaddr = \"$in{'altaddr'}\";\n");
@@ -215,7 +211,7 @@
 <TR>
 <TD>
 Are setup to accept credit cards through NiftyPay? 
-Select '0' for no, '1' for yes.  (applies to card types below as well)
+Select '0' for no, '1' for yes.
 </TD>
 <TD>
 <SELECT NAME="acceptcards">
@@ -227,38 +223,6 @@
 </TR>
 
 <TR>
-<TD COLSPAN=2><table>
-	<tr>
-		<td><font size=2 face =arial>Accept Visa?<br><SELECT NAME="acceptvisa">
-<OPTION>$acceptvisa</OPTION>
-<OPTION VALUE="0">0</OPTION>
-<OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-		<td><font size=2 face =arial>Accept MasterCard?<br><SELECT NAME="acceptmastercard">
-<OPTION>$acceptmastercard</OPTION>
-<OPTION VALUE="0">0</OPTION>
-<OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-		<td><font size=2 face =arial>Accept AMEX?<br><SELECT NAME="acceptamex">
-<OPTION>$acceptamex</OPTION>
-<OPTION VALUE="0">0</OPTION>
-<OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-		<td><font size=2 face =arial>Accept Discover?<br><SELECT NAME="acceptdiscover">
-<OPTION>$acceptdiscover</OPTION>
-<OPTION VALUE="0">0</OPTION>
-<OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-		<td><font size=2 face =arial>Accept Diners?<br><SELECT NAME="acceptdiners">
-<OPTION>$acceptdiners</OPTION>
-<OPTION VALUE="0">0</OPTION>
-<OPTION VALUE="1">1</OPTION>
-</SELECT></font></td>
-	</tr>
-</table></TD>
-</TR>
-
-<TR>
 <TD COLSPAN=2><HR></TD>
 </TR>
 
@@ -470,6 +434,12 @@
 		<td><font size=2 face =arial>Link Color:<br>
 <INPUT NAME="NiftyPay_linkcolor" TYPE="TEXT" SIZE=10 VALUE="$NiftyPay_linkcolor">
 </font></td>
+		<td><font size=2 face =arial>aLink Color:<br>
+<INPUT NAME="NiftyPay_alinkcolor" TYPE="TEXT" SIZE=10 VALUE="$NiftyPay_alinkcolor">
+</font></td>
+		<td><font size=2 face =arial>vLink Color:<br>
+<INPUT NAME="NiftyPay_vlinkcolor" TYPE="TEXT" SIZE=10 VALUE="$NiftyPay_vlinkcolor">
+</font></td>
 </table>
 <br>
 <font size=2 face =arial><br>
@@ -486,8 +456,8 @@
 
 <TR>
 <TD COLSPAN=2><font size=2 face =arial><br>
-Enter a text message to be shwon on the payment information page at NiftyPay.
-This mesage will be shown in the text box immediately above the submit button. Use a &lt;br> for line breaks/spacing.  You can also leave this blank if you prefer.<br>
+Enter a text message to be shown on the payment information page at NiftyPay.
+This mesage will be shown in the text box immediately above the submit button. You can also leave this blank if you prefer.<br>
 <TEXTAREA NAME="NiftyPay_merch_message" 
 cols="68" rows=8 
 wrap=off>$NiftyPay_merch_message</TEXTAREA><br>
diff -aruN 5.0.000.src/library/NiftyPay-order_lib.pl 5.2.000.src/library/NiftyPay-order_lib.pl
--- 5.0.000.src/library/NiftyPay-order_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/NiftyPay-order_lib.pl	2008-01-14 21:14:12.000000000 -0600
@@ -2,7 +2,7 @@
 #                    Order Form Definition Variables                  #
 #######################################################################
 
-$versions{'NiftyPay-order_lib.pl'} = "5.0.000";
+$versions{'NiftyPay-order_lib.pl'} = "5.2.000";
 $sc_use_secure_header_at_checkout = 'yes';
 $sc_use_secure_footer_for_order_form = 'yes';
 
@@ -73,6 +73,9 @@
     push(@sc_order_form_required_fields,"Ecom_tos");
  }
 
+# use this codehook to change the above arrays for required fields and such
+&codehook("NiftyPay_fields_bottom");
+
 }
 
 ###############################################################################
@@ -192,6 +195,8 @@
 <INPUT type="hidden" name="bgcolor" value="$NiftyPay_bodyback">
 <INPUT type="hidden" name="fontcolor" value="$NiftyPay_fontcolor">
 <INPUT type="hidden" name="link" value="$NiftyPay_linkcolor">
+<INPUT type="hidden" name="alink" value="$NiftyPay_alinkcolor">
+<INPUT type="hidden" name="vlink" value="$NiftyPay_vlinkcolor">
 ~;
 }
 
@@ -247,11 +252,9 @@
 <INPUT TYPE=HIDDEN NAME=\"acceptchecks\" VALUE=\"$acceptchecks\">
 <INPUT TYPE=HIDDEN NAME=\"accepteft\" VALUE=\"$accepteft\">
 <INPUT TYPE=HIDDEN NAME=\"altaddr\" VALUE=\"$altaddr\">
-<input type=hidden name="visaimage" value="$acceptvisa">
-<input type=hidden name="mcimage" value="$acceptmastercard">
-<input type=hidden name="discimage" value="$acceptdiscover">
-<INPUT type="hidden" name="ameximage" value="$acceptamex">
-<INPUT type="hidden" name="dinerimage" value="$acceptdiners">
+<INPUT TYPE=HIDDEN NAME=\"disable_cards\" VALUE=\"$NiftyPay_disable_cards\">
+<INPUT TYPE=HIDDEN NAME=\"disable_paypal\" VALUE=\"$NiftyPay_disable_paypal\">
+<INPUT TYPE=HIDDEN NAME=\"disable_checks\" VALUE=\"$NiftyPay_disable_checks\">
 
 <INPUT TYPE=HIDDEN NAME=\"lookup\" VALUE=\"first_name\">
 <INPUT TYPE=HIDDEN NAME=\"lookup\" VALUE=\"last_name\">
@@ -376,6 +379,7 @@
 # parse the signed response, not what was on the command line ... 
 # code borrowed from cgi-lib.pl
 
+if ($form_data{'signature'}) {
 foreach $i (0 .. $#itrans) {
    # Convert plus to space
    $itrans[$i] =~ s/\+/ /g;
@@ -391,6 +395,10 @@
    $itrans{$key} .= "\0" if (defined($itrans{$key})); #\0 = multiple separator
    $itrans{$key} .= $val;
  }
+} elsif ($AgoraPay_disable_paypal ne "1" && $form_data{'signature'} eq '') {
+  foreach $key (sort(keys(%form_data))) {
+   $itrans{$key} = "$form_data{$key}";
+ }
 
 if ($sc_pgp_or_gpg =~ /GPG/i) { # verify with GPG
   $command =  "$sc_pgp_or_gpg_path ";
@@ -568,6 +576,13 @@
   &add_text_of_both("SUBTOTAL",$temp);
   $orderLoggingHash{'subTotal'} = &format_price($sc_verify_subtotal);
 
+if (($sc_buySafe_is_enabled =~ /yes/) && ($sc_verify_buySafe > 0)) {
+my $temp = &format_price($sc_verify_buySafe);
+$text_of_cart .= "$sc_buySafe_bond_fee_mini_display_text       $temp\n";
+$text_of_confirm_email .= "$sc_verify_buySafe_display_text       $temp\n";
+$orderLoggingHash{'buySafe'} = "$temp";
+}
+
 if ($sc_verify_discount) {
   $temp = &format_price($sc_verify_discount);
   &add_text_of_both("DISCOUNT",$temp);
@@ -678,7 +693,7 @@
 $text_of_cart .= "STATE:         $itrans{'sstate'}\n";
 $orderLoggingHash{'shipToState'} = "$itrans{'sstate'}";
 } else {
-$text_of_cart .= "CITY:          $eform_Ecom_ShipTo_Postal_StateProv\n";
+$text_of_cart .= "STATE:          $eform_Ecom_ShipTo_Postal_StateProv\n";
 $orderLoggingHash{'shipToState'} = "$eform_Ecom_ShipTo_Postal_StateProv";
 }
 
@@ -698,9 +713,7 @@
 $orderLoggingHash{'shipToCountry'} = "$vform_Ecom_ShipTo_Postal_CountryCode";
 }
 
-if ($sc_use_SBW =~ /yes/i) {
-  $text_of_cart .= "SHIP VIA:      $itrans{'Ecom_ShipTo_Method'}\n";
- }
+$text_of_cart .= "SHIP VIA:      $itrans{'Ecom_ShipTo_Method'}\n";
 
 # NEW CODEHOOK
 &codehook("process-order-pre-ship-instructions");
@@ -738,8 +751,14 @@
 
 $sc_niftypay_order_desc .= " - " . $itrans{'p5'};
 
+# added by Mister Ed fFeb 7, 2007
+my $temp_admin_email = "$itrans{'email'}";
+if ($sc_use_customer_email_over_admin =~ /yes/i) {
+   $temp_admin_email = "$eform_Ecom_BillTo_Online_Email";
+}
+
 if ($sc_send_order_to_email =~ /yes/i) {
-  &send_mail($sc_admin_email, $sc_order_email, $sc_niftypay_order_desc, $text_of_cart);
+  &send_mail($temp_admin_email, $sc_order_email, $sc_niftypay_order_desc, $text_of_cart);
  }
 
 &log_order($text_of_cart,$itrans{'p5'},$itrans{'p4'});
@@ -777,6 +796,7 @@
 
 # This empties the cart after the order is successful
 &empty_cart;
+undef(%form_data);
 
 # and the footer is printed
 
diff -aruN 5.0.000.src/library/Offline-order_lib.pl 5.2.000.src/library/Offline-order_lib.pl
--- 5.0.000.src/library/Offline-order_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/Offline-order_lib.pl	2007-12-19 23:22:18.000000000 -0600
@@ -2,7 +2,7 @@
 #                    Order Form Definition Variables                  #
 #######################################################################
 
-$versions{'Offline-order_lib.pl'} = "5.0.000";
+$versions{'Offline-order_lib.pl'} = "5.0.002";
 
 $order_lib_cc_validate = "yes";
 $sc_use_secure_header_at_checkout = 'yes';
@@ -244,6 +244,9 @@
     push(@sc_order_form_required_fields,"Ecom_tos");
  }
 
+# use this codehook to change the above arrays for required fields and such
+&codehook("Offline_fields_bottom");
+
 }
 ###############################################################################
 sub print_Offline_SubmitPage {
@@ -830,6 +833,13 @@
 $sc_verify_subtotal_temp3 = $temp;
 $orderLoggingHash{'subTotal'} = &format_price($sc_verify_subtotal);
 
+if (($sc_buySafe_is_enabled =~ /yes/) && ($sc_verify_buySafe > 0)) {
+my $temp = &format_price($sc_verify_buySafe);
+$text_of_cart .= "$sc_buySafe_bond_fee_mini_display_text       $temp\n";
+$text_of_confirm_email .= "$sc_verify_buySafe_display_text       $temp\n";
+$orderLoggingHash{'buySafe'} = "$temp";
+}
+
 if ($form_data{'SHIPPING'})
 {
 $temp = &display_price($form_data{'SHIPPING'});
@@ -839,6 +849,7 @@
 }
 
 $orderLoggingHash{'shipMethod'} = "$vform_Ecom_ShipTo_Method";
+$text_of_admin_email = "SHIP VIA:      $vform_Ecom_ShipTo_Method";
 
 if (($sc_use_SBW =~ /yes/i) || ($form_data{'x_Freight'} > .009)) {
  $text_of_confirm_email .= "SHIP VIA:      $vform_Ecom_ShipTo_Method\n";
@@ -1046,10 +1057,16 @@
 $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'}";
+}
+
 # send email to admin or order email addy listed in main settings of manager
 if ($sc_send_order_to_email =~ /yes/i)
 {
-&send_mail($sc_admin_email, $sc_order_email, "AgoraCart - Online Order - $form_data{'INVOICE'}",$text_of_admin_email);
+&send_mail($temp_admin_email, $sc_order_email, "AgoraCart - Online Order - $form_data{'INVOICE'}",$text_of_admin_email);
 }
 
 # NEW CODEHOOK
@@ -1106,6 +1123,7 @@
 
 # This empties the cart after the order is successful
 &empty_cart;
+undef(%form_data);
 
 # and the footer is printed
 &SecureStoreFooter;
diff -aruN 5.0.000.src/library/PayPalIPN-mgr_lib.pl 5.2.000.src/library/PayPalIPN-mgr_lib.pl
--- 5.0.000.src/library/PayPalIPN-mgr_lib.pl	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/PayPalIPN-mgr_lib.pl	2007-11-12 19:37:09.000000000 -0600
@@ -0,0 +1,480 @@
+#
+# 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 -aruN 5.0.000.src/library/PayPalIPN-order_lib.pl 5.2.000.src/library/PayPalIPN-order_lib.pl
--- 5.0.000.src/library/PayPalIPN-order_lib.pl	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/library/PayPalIPN-order_lib.pl	2007-11-12 19:37:09.000000000 -0600
@@ -0,0 +1,1430 @@
+#
+# 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 -aruN 5.0.000.src/library/PayPal-mgr_lib.pl 5.2.000.src/library/PayPal-mgr_lib.pl
--- 5.0.000.src/library/PayPal-mgr_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/PayPal-mgr_lib.pl	2007-12-19 23:22:18.000000000 -0600
@@ -34,7 +34,7 @@
 # such works and/or derivatves.
 #
 ##############################################################################
-$versions{'PayPal-mgr_lib.pl'} = "5.0.000";
+$versions{'PayPal-mgr_lib.pl'} = "5.0.001";
 &add_codehook("gateway_admin_screen","PayPal_mgr_check");
 &add_codehook("gateway_admin_settings","PayPal_settings");
 $mc_gateways .= "|PayPal";
@@ -243,7 +243,7 @@
 <SELECT NAME="sc_currency_id">
 <OPTION>$sc_currency_id</OPTION>
 <OPTION>USD</OPTION>
-<OPTION>AUS</OPTION>
+<OPTION>AUD</OPTION>
 <OPTION>CAD</OPTION>
 <OPTION>GBP</OPTION>
 <OPTION>EUR</OPTION>
diff -aruN 5.0.000.src/library/PayPal-order_lib.pl 5.2.000.src/library/PayPal-order_lib.pl
--- 5.0.000.src/library/PayPal-order_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/PayPal-order_lib.pl	2007-12-19 23:22:18.000000000 -0600
@@ -37,7 +37,7 @@
 #                    Order Form Definition Variables                  #
 #######################################################################
 
-$versions{'PayPal-order_lib.pl'} = "5.0.000";
+$versions{'PayPal-order_lib.pl'} = "5.0.005";
 
 #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
@@ -71,6 +71,8 @@
            "&item_number=" . &my_paypal_order_number .
            "&amount=" . &format_price($authPrice) .
            "&currency_code=$sc_currency_id" .
+           "&no_shipping=1" .
+           "&bn=AgoraCart" .
            "&address_override=$sc_paypal_address_override" .
            "&first_name=$vform_Ecom_ShipTo_Postal_Name_First" .
            "&last_name=$vform_Ecom_ShipTo_Postal_Name_Last" .
@@ -150,6 +152,8 @@
   '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', 'First Name',
+  'Ecom_ShipTo_Postal_Name_Last', 'Last Name',
   'Ecom_ShipTo_Postal_Street_Line1', 'Shipping Address Street',
   'Ecom_ShipTo_Postal_City', 'Shipping Address City',
   'Ecom_ShipTo_Postal_StateProv', 'Shipping Address State',
@@ -176,6 +180,9 @@
     push(@sc_order_form_required_fields,"Ecom_tos");
  }
 
+# use this codehook to change the above arrays for required fields and such
+&codehook("PayPal_fields_bottom");
+
 }
 
 ###############################################################################
@@ -393,6 +400,8 @@
 
 &SecureStoreFooter;
 
+undef(%form_data);
+
 print qq!
 </BODY>
 </HTML>
@@ -540,6 +549,13 @@
 $sc_verify_subtotal_temp3 = $temp;
 $orderLoggingHash{'subTotal'} = "$temp";
 
+if (($sc_buySafe_is_enabled =~ /yes/) && ($sc_verify_buySafe > 0)) {
+my $temp = &format_price($sc_verify_buySafe);
+$text_of_cart .= "$sc_buySafe_bond_fee_mini_display_text       $temp\n";
+$text_of_confirm_email .= "$sc_verify_buySafe_display_text       $temp\n";
+$orderLoggingHash{'buySafe'} = "$temp";
+}
+
 if ($sc_verify_shipping > 0) {
     $temp = &display_price($sc_verify_shipping);
     &add_text_of_both('SHIPPING',$temp);
@@ -611,7 +627,7 @@
 
 $orderLoggingHash{'shipMethod'} = "$vform_Ecom_ShipTo_Method";
 if (($sc_use_SBW =~ /yes/i) || ($form_data{'x_Freight'} > .009)) {
-  &add_text_of_conf("SHIP VIA",$vform_Ecom_ShipTo_Method);
+  &add_text_of_both("SHIP VIA",$vform_Ecom_ShipTo_Method);
 }
 
 if ($ship_instructions ne "") {
@@ -648,10 +664,16 @@
 # This empties the cart after the order is "successful"
 &empty_cart;
 
+# added by Mister Ed Feb 7, 2007
+my $temp_admin_email = "$sc_admin_email";
+if ($sc_use_customer_email_over_admin =~ /yes/i) {
+   $temp_admin_email = "$vform_Ecom_BillTo_Online_Email";
+}
+
 if (($sc_send_order_to_email =~ /yes/i) && 
     ($sc_verify_inv_no ne "")){
   $my_order_name = &my_paypal_order_name . &my_paypal_order_number;
-  &send_mail($sc_order_email, $sc_order_email, $my_order_name, $text_of_cart);
+  &send_mail($temp_admin_email, $sc_order_email, $my_order_name, $text_of_cart);
 }
 
 $zemail = $vform_Ecom_BillTo_Online_Email;
diff -aruN 5.0.000.src/library/PlugnPay-order_lib.pl 5.2.000.src/library/PlugnPay-order_lib.pl
--- 5.0.000.src/library/PlugnPay-order_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/PlugnPay-order_lib.pl	2007-12-19 23:22:19.000000000 -0600
@@ -10,7 +10,7 @@
 # Misc updates and fixes by Mister Ed from AgoraScript / K-Factor Technologies, Inc., May 3, 2006
 # Major fixes by Mister Ed from AgoraScript / K-Factor Technologies, Inc., May 5, 2006
 
-$versions{'PlugnPay-order_lib.pl'} = "5.0.000";
+$versions{'PlugnPay-order_lib.pl'} = "5.0.002";
 
 $sc_order_response_vars{"PlugnPay"}="FinalStatus";
 $sc_use_secure_header_at_checkout = 'yes';
@@ -95,6 +95,8 @@
     push(@sc_order_form_required_fields,"Ecom_tos");
  }
 
+# use this codehook to change the above arrays for required fields and such
+&codehook("PlugnPay_fields_bottom");
 
 }
 ###############################################################################
@@ -730,6 +732,13 @@
 $orderLoggingHash{'subTotal'} = "$temp_number";
 $orderLoggingHash{'shipMethod'} = "$sc_verify_shipto_method";
 
+if (($sc_buySafe_is_enabled =~ /yes/) && ($sc_verify_buySafe > 0)) {
+my $temp = &format_price($sc_verify_buySafe);
+$text_of_cart .= "$sc_buySafe_bond_fee_mini_display_text       $temp\n";
+$text_of_confirm_email .= "$sc_verify_buySafe_display_text       $temp\n";
+$orderLoggingHash{'buySafe'} = "$temp";
+}
+
 if ($form_data{'shipping'}) {
   $text_of_cart .= "SHIPPING:      $form_data{'shipping'}\n";
   $text_of_confirm_email .= "SHIPPING:      $form_data{'shipping'}\n";
@@ -908,6 +917,12 @@
 #  $text_of_cart = "\n" . $text_of_cart . "\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) {
   &send_mail($sc_admin_email, $sc_order_email, "$sc_plugnpay_order_desc - $eform_cart_id", $text_of_cart);
 }
@@ -948,6 +963,7 @@
 
 # This empties the cart after the order is successful
 &empty_cart;
+undef(%form_data);
 
 # and the footer is printed
 
diff -aruN 5.0.000.src/library/shipping_lib.pl 5.2.000.src/library/shipping_lib.pl
--- 5.0.000.src/library/shipping_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/shipping_lib.pl	2007-12-19 23:22:20.000000000 -0600
@@ -24,24 +24,29 @@
 # Modified 08/17/2000 UPS Interface w LWP fixed
 # Modified 05/06/2001 UPS Interface fixed, uses 'old' code again 
 # Modified 05/11/2001 Includes 'value of items' in 'shipping thing' string
+#
 # Modifications by Mister Ed at K-Factor Technologies, Inc / AgoraCart.com
-# Modified 03/07/2003 Fixed parcel machine codes - USPS.
-# Modified 10/24/2003 Fixed multiple boxes for USPS.  Streamlined minor redundancy.
+#
+# Modified 03/07/2003 by Mister Ed  Fixed parcel machine codes - USPS.
+# Modified 10/24/2003 by Mister Ed  Fixed multiple boxes for USPS.  Streamlined minor redundancy.
 # 	UPS: Also added fuel tax charges of 2%.  error checking to make sure international
 # 	shipping methods and Canadian are correct for method and country for UPS.
-# Modified 01/26/2005 Added UPS XML and international shipping with origins as an add-on for members only.
+# Modified 01/26/2005 by Mister Ed  Added UPS XML and international shipping with origins as an add-on for members only.
 #	above inspired by donated code from Leamsi Fontanez at http://www.bizmanweb.com but significantly revised
 #	DHL shipping foundations added for future expansion into this shipping method
 #	separated DHL, FedEx, and UPS XML shipping methods into separate libraries.
 #	Original UPS simple shipping cost quotes remain and used if UPS XML not enabled.
-# Modified 02/15/2005 Finished above changes and phased out lynx socket options
-# Modified 05/19/2005 Finish Core UPS XML enhancements to work with multiple boxes
+# Modified 02/15/2005 by Mister Ed  Finished above changes and phased out lynx socket options
+# Modified 05/19/2005 by Mister Ed  Finish Core UPS XML enhancements to work with multiple boxes
 #	and multiple origins. ground work for dimensional aspects included, but needs cart contents overhaul first.
-# Modified 08/16/2005  Added custom logic option to run before or after SBW real-time routines
+# Modified 08/16/2005  by Mister Ed  Added custom logic option to run before or after SBW real-time routines
 #   also added $SBW_shipping_price variable incase real time needs to be deducted in the custom logic after
 #   running real-time SBW
+# 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.
 
-$versions{'shipping_lib.pl'} = "5.0.000";
+$versions{'shipping_lib.pl'} = "5.0.004";
 if (($sc_use_SBW =~ /yes/i) || ($sc_need_sockets =~ /yes/i)) { 
  if ($sc_use_socket eq "") { 
    $sc_use_socket = "http-lib";   
@@ -92,7 +97,9 @@
  my($weight_data,$names_data, $Origin_ZIP,$max_per_box) = @_;
  my($alt_origin, $instructions, $special_instructions, $items_in_box, $weight_of_box,
        $new_wt_data, $inx1, $inx2, $zip_list, $origin_product_list, $junk, $items_this_round, $value_of_box) = "";
+ my($packageType,$separatePackage,$length,$width,$height,$girth,$alt_stateprov) = '';
  my($continue)="yes";
+ my($ownbox,$single_item_box_list)="";
  $instructions="";
  $special_instructions="";
  &codehook("shippinglib-put-in-boxes-top");
@@ -106,53 +113,74 @@
  $weight_of_box = 0;
  $value_of_box = 0;
  $new_wt_data = "";
+
    my @ship_list = split(/\|/,$weight_data);
    @name_list = split(/\|/,$names_data);
+
     for ($inx1=0; $inx1 <= $#ship_list; $inx1++) {
-      ($item_qty,$item_wt,$item_val,$alt_origin,$junk) = split(/\*/,$ship_list[$inx1],5);
+      ($item_qty,$item_wt,$item_val,$alt_origin,$alt_stateprov,$ownbox,$junk) = split(/\*/,$ship_list[$inx1],6);
       $ztitle = $name_list[$inx1];
       $items_this_round = 0;
       for ($inx2=$item_qty; $inx2 > 0; $inx2--) {
-        if ($items_in_box == 0) {
-           $items_in_box = 1;
-           $weight_of_box = $item_wt;
-           $value_of_box = $item_val;
-           $items_this_round++;
-          } else { 
-            if (($weight_of_box + $item_wt) < $max_per_box) { 
-              $items_in_box++;
-              $weight_of_box = $weight_of_box + $item_wt;
-              $value_of_box = $value_of_box + $item_val;
-              $items_this_round++;
-             } else { 
-              if ($items_this_round > 0) {
-                  $instructions .="  $items_this_round $ztitle [$item_wt]\n";
-                }
-              $instructions .= " Total Weight: $weight_of_box\n\n";
-              if ($new_wt_data ne "") {
-              	$new_wt_data .= '|';
-              }
-              $new_wt_data .= "1*${weight_of_box}*${value_of_box}*$alt_origin";
-              $instructions .= "Next Box:\n";
-              $items_in_box = 1;
-              $weight_of_box = $item_wt;
-              $value_of_box = $item_val;
-              $items_this_round = 1;
-             }
-          }
-       }
+        ($packageType,$separatePackage,$length,$width,$height,$girth) = '';
+		($packageType,$separatePackage,$length,$width,$height,$girth) = split(/\,/,$ownbox);
+	if($separatePackage =~ /yes/){
+		$single_item_box_list = "1*$item_wt*$item_val*$alt_origin*$alt_stateprov*$length*$width*$height*$girth*$packageType";
+                $items_in_box = 1;
+                $weight_of_box = $item_wt;
+                $value_of_box = $item_val;
+                $items_this_round++;
+	} else {
+              if ($items_in_box == 0) {
+                $items_in_box = 1;
+                $weight_of_box = $item_wt;
+                $value_of_box = $item_val;
+                $items_this_round++;
+	          } else { # add to or close/start box
+	             if (($weight_of_box + $item_wt) < $max_per_box) { #add
+	              $items_in_box++;
+	              $weight_of_box = $weight_of_box + $item_wt;
+	              $value_of_box = $value_of_box + $item_val;
+	              $items_this_round++;
+	             } else { # close, then start a new box
+	                if ($items_this_round > 0) {
+	                  $instructions .="  $items_this_round $ztitle [$item_wt]\n";
+	                }
+	                $instructions .= " Total Weight: $weight_of_box\n\n";
+	                if ($new_wt_data ne "") {
+	              	  $new_wt_data .= '|';
+	                 }
+	                $new_wt_data .= "1*${weight_of_box}*${value_of_box}*$alt_origin*$alt_stateprov*****";
+	                $instructions .= "Next Box:\n";
+	                $items_in_box = 1;
+	                $weight_of_box = $item_wt;
+	                $value_of_box = $item_val;
+	               $items_this_round = 1;
+	             } 
+	          } 
+	       } 
+    	} 
+
         if ($items_this_round > 0) {
             $instructions .="  $items_this_round $ztitle [$item_wt]\n";
-          }
+        }
      }
     $instructions .= " Total Weight: $weight_of_box\n\n";
     if ($new_wt_data ne "") {
     	$new_wt_data .= '|';
     }
-    $new_wt_data .= "1*${weight_of_box}*${value_of_box}*$alt_origin";
+
+    if ($single_item_box_list ne "") {
+    	$new_wt_data .= "$single_item_box_list";
+        $single_item_box_list = '';
+    } else {
+    	$new_wt_data .= "1*${weight_of_box}*${value_of_box}*$alt_origin*$alt_stateprov*****";
+    }
+    
  if ($max_per_box == 0) {
    $instructions = "Put one item in each box.";
   }
+
  $final_instructions =  $special_instructions . $instructions;
  &codehook("shippinglib-put-in-boxes-bot");
  return ($new_wt_data,$final_instructions);
@@ -290,19 +318,23 @@
 sub calc_usps {
 my ($method, $origin, $dest, $destcountry, $shipping_total, $weight_data) = @_;
 my ($product_temp_name,$err_printed,$err,$temp_zip_thingy) = "";
-my ($product, $alt_origin, $alt_origin_temp, $weight, $ship_cost, $junk, $thezone, $errmsg, $foundit,
+my ($product, $alt_origin, $alt_stateprov, $alt_origin_temp, $weight, $ship_cost, $junk, $thezone, $errmsg, $foundit,
 	$item_info, $origin_passby, $new_weight_data, $item_wt, $item_qty, $splitanswer, $item_cost, @ship_list);
 my ($pounds,$ounces,$usps_prot,$usps_site,$usps_cgi,$answer);
 my ($error,$orig_ans);
-my ($country, $length, $width, $height, $oversized, $cod);
+my ($country, $oversized, $cod);
 my (%zip_list);
+
 $ship_cost = 0; # handling charge added in define_shipping_logic
+
 ($usps_prot,$junk,$usps_site,$usps_cgi) = split(/\//,$sc_USPS_host_URL,4);
 $usps_prot .= '//';
 $usps_cgi = '/' . $usps_cgi;
-if (($destcountry =~ /kingdom/i) && ($destcountry =~ /united/i)) { 
+
+if (($destcountry =~ /kingdom/i) && ($destcountry =~ /united/i)) { # convert UK to England for USPS only
 	$destcountry = "England";
 }
+
 ($junk,$stuff) = split(/\(/,$method,2);
 ($stuff,$junk) = split(/\)/,$stuff,2);
 if ($stuff ne "") { #assume we have a valid product code
@@ -310,25 +342,29 @@
     $product_temp_name = $stuff;
    	$foundit = "yes";
 }
+my $productindicator = "$product";
+if (($product =~ /Express Mail/i) && ($product !~ /Express Mail International/i)) {$productindicator = "EXPRESS";}
+if (($product =~ /First Class/i) && ($product !~ /First Class International/i)) {$productindicator = "FIRST CLASS";}
+if ($product =~ /Parcel Post/i) {$productindicator = "PARCEL";}
+if (($product =~ /Priority Mail/i) && ($product !~ /Priority Mail International/i)) {$productindicator = "PRIORITY";}
+
 if (($destcountry ne "") && ($destcountry !~ /united states/i) && ($destcountry !~ /puerto rico/i)) {
-	if (($product !~ /Global Express/i) && ($product !~ /Airmail/i) && ($product !~ /economy/i)) {
+	if (($product !~ /International/i)) {
        	$err_printed = "yes";
        	$order_error_do_not_finish = "yes";
        	print "USPS shipping error: wrong shipping type for your destination country!<br>",
-           	"Please use your browser's back button and select ",
-           	"<br>USPS Global Express options, Airmail Parcel Post, or <br>",
-           	"Economy surface Parcel Post.<br><br>$err<br>\n";
+           	"Please use your browser's back button  or any checkout link/button and select ",
+           	"<br>USPS Priority or Express Mail International options.<br><br>$err<br>\n";
 		$ship_cost = 0;
 		return $ship_cost;
 	}
 }
+
 $dest =~ /(\w+)/;
 $dest = $1;
-$product =~ /(\w+)/;
-$product = $1;
+
 $sc_verify_boxes_max_wt = $sc_USPS_max_wt;
-@ship_list = split(/\|/,$weight_data);
-# new stuff for alt origination. use even without alt origination. Added by Mister Ed
+my @ship_list = split(/\|/,$weight_data);
 	foreach $ship_list (@ship_list) {
       ($item_qty,$item_wt,$item_val,$alt_origin,$junk) = split(/\*/,$ship_list,5);
 		if ($alt_origin ne "") {
@@ -349,54 +385,130 @@
 			}
 		}
 	}
+
 foreach $origin_product_list (sort (keys %zip_list)) {
 	my $packageID = "0";
+
 	$weight_data = $zip_list{$origin_product_list};
+
 	if (($destcountry eq "") || ($destcountry =~ /united states/i) || ($destcountry =~ /puerto/i)) {
-    	$workString = "API=RateV2&XML=<RateV2Request "; #>
-    	$workString .= "USERID=\"$sc_USPS_userid\" ";
-    	$workString .= "PASSWORD=\"$sc_USPS_password\">";
+    	$workString = "API=RateV3&XML=<RateV3Request "; #>
+    	$workString .= "USERID=\"$sc_USPS_userid\">";
 	} else {
-    	$workString = "API=IntlRate&XML=<IntlRateRequest ";
-    	$workString .= "USERID=\"$sc_USPS_userid\" ";
-    	$workString .= "PASSWORD=\"$sc_USPS_password\">";
-	} # >
+    	$workString = "API=IntlRate&XML=<IntlRateRequest "; #>
+    	$workString .= "USERID=\"$sc_USPS_userid\">";
+	}
+
 	($new_weight_data,$ship_ins) = &ship_put_in_boxes($weight_data, $weight_data, $origin_product_list, $sc_USPS_max_wt);
+
 	$sc_shipping_thing .= $new_weight_data;
+
     @ship_list = split(/\|/,$new_weight_data);
+
     foreach $item_info (@ship_list) {
-    	($item_qty,$item_wt,$box_total_value,$alt_origin,$junk) = split(/\*/,$item_info,5);
-    	if ($item_wt <= 1) { # min
-      		$item_wt = 1;
-    	}
+        my ($length,$width,$height,$girth) = '';
+    	($item_qty,$item_wt,$box_total_value,$alt_origin,$alt_stateprov,$length,$width,$height,$girth,$myBoxType,$junk) = split(/\*/,$item_info,11);
+
+        # changed by Mister Ed Dec 17, 2006 to allow for First Class and ounces
+	    ($pounds,$ounces) = split(/\./, $item_wt);
+		$ounces = ("." . $ounces)*16;
+
+		#Taint mode stuff ...
+		$ounces = $ounces + 0.9999999999; # round her up!
+		$ounces =~ /(\w+)/;
+    	$ounces = $1;
+		$pounds = $pounds + 0.9999999999; # round her up!
+		$pounds =~ /(\w+)/;
+    	$pounds = $1;
+
+        if ($ounces eq 16) {
+          $pounds++;
+    	  $ounces = "0";
+        }
+
+	if (($product =~ /First Class/i) && ((($destcountry !~ /united states/i) && ($destcountry !~ /puerto rico/i))||(($pounds > 0)||($ounces > 13)))) {
+       	$err_printed = "yes";
+       	$order_error_do_not_finish = "yes";
+       	print "USPS shipping error: You cannot select First Class Mail for this shipment!<br>",
+           	"<br> Total weight for this shipment must be under 13oz, your shipment weight is: $pounds pounds and $ounces ounces.",
+           	"Please use your browser's back button or any checkout link/button and select ",
+           	"<br>a different shipping method<br><br>$err<br>\n";
+		$ship_cost = 0;
+		return $ship_cost;
+    }
+
 		if (($alt_origin ne "") && ($sc_alt_origin_enabled =~ /yes/i)) {
 			$origin_passby = $alt_origin;
 		} else {
 			$origin_passby = $sc_USPS_Origin_ZIP;
 		}
-		$weight = $item_wt + 0.9999999999; 
-		$weight =~ /(\w+)/;
-    	$weight = $1; 
+
     	$origin_passby =~ /(\w+)/; 
     	$origin_passby = $1;
-	    $pounds = $weight;
-	    $ounces = "0";
-		$container = ''; 
-		$containersize = 'Regular';
-		if (($service =~ /Priority/i) && ($pounds > 1) && ($sc_use_UPS_flatrate_box =~ /yes/i)) {
-				$container = 'Flat Rate Box'; 
-		}
-	if (($destcountry eq "") || ($destcountry =~ /united states/i) || ($destcountry =~ /puerto/i)) { 
+        my $package_dimensions_string = '';
+		my $container = "$myBoxType";
+        my $containersize = 'REGULAR';
+        my $USPS_machineable = "False";
+        if ($length eq '') { $length = $sc_USPS_avg_package_length;}
+        if ($width eq '') { $width = $sc_USPS_avg_package_width;}
+        if ($height eq '') { $height = $sc_USPS_avg_package_height;}
+        if ($girth eq '') { $girth = $sc_USPS_avg_package_girth;}
+
+        if (($USPS_PackageType !~ /flat rate/i) && (($myBoxType eq '')||($myBoxType !~ /flat rate/i))) {
+		$container = "$USPS_PackageType";
+        if ($product =~ /Express/i) { $container = '';}
+        if (($product =~ /parcel/i) && ($pounds < 35) && ($length < 34) && ($width < 17) && ($height < 17) && ($container ne 'NONRECTANGULAR')) {
+            $USPS_machineable = "True";
+         }
+         my $temp_large = ($length + (2*$height) + (2*$width));
+         if (($girth ne '') && ($myBoxType eq "NONRECTANGULAR")) {$temp_large = $girth;}
+	     if ((($product =~ /Express Mail/i) && ($temp_large > 108))||(($product =~ /Express Mail International/i) && ($temp_large > 79) && ($product !~ /flat rate/i))) {
+       	    $err_printed = "yes";
+       	    $order_error_do_not_finish = "yes";
+       	    print qq|USPS shipping error: You cannot select Express Mail for this shipment!<br>
+            	The package is too large for this shipping method.
+            	Please use your browser's back button or any checkout link/button and select 
+            	<br>a different shipping method<br><br>$err<br>\n|;
+		    $ship_cost = 0;
+		    return $ship_cost;
+          }
+	     if ((($product =~ /Priority Mail/i) && ($temp_large > 108))||(($product =~ /Priority Mail International/i) && ($temp_large > 79) && ($product !~ /flat rate/i))) {
+       	    $err_printed = "yes";
+       	    $order_error_do_not_finish = "yes";
+       	    print qq|USPS shipping error: You cannot select Priority Mail for this shipment!<br>
+            	 The package is too large for this shipping method.
+            	Please use your browser's back button or any checkout link/button and select 
+            	<br>a different shipping method<br><br>$err<br>\n|;
+		    $ship_cost = 0;
+		    return $ship_cost;
+          }
+            if (($temp_large > 84) && ($temp_large < 108.001)) {
+                $containersize = 'LARGE';
+                if (($pounds + $ounces) < 15) {$pounds = "15", $ounces = '';}
+                if ($product =~ /Priority/i) {
+                   $package_dimensions_string = qq|
+<Width>$width</Width>
+<Length>$length</Length>
+<Height>$height</Height>
+|;
+                }
+             } elsif (($temp_large > 108) && ($temp_large < 130.001)) {
+                $containersize = 'OVERSIZE';
+             } elsif ($product =~ /priority/i) { $container = '';}
+
+        } 
+	if (($destcountry eq "") || ($destcountry =~ /united states/i) || ($destcountry =~ /puerto/i)) { # USA and PR
 		$workString .= "<Package ID=\"$packageID\">";
-	    $workString .= "<Service>$product</Service>";
+	    $workString .= "<Service>$productindicator</Service>";
 	    $workString .= "<ZipOrigination>$origin_passby</ZipOrigination>";
 	    $workString .= "<ZipDestination>$dest</ZipDestination>";
 	    $workString .= "<Pounds>$pounds</Pounds>";
 	    $workString .= "<Ounces>$ounces</Ounces>";
 		$workString .= "<Container>$container</Container>";
 	    $workString .= "<Size>$containersize</Size>";
-	    $workString .= '<Machinable>False</Machinable></Package>';
-	} else {
+        $workString .= "$package_dimensions_string";
+	    $workString .= "<Machinable>$USPS_machineable</Machinable></Package>";
+	} else { 
 		$workString .= "<Package ID=\"$packageID\">";
 	    $workString .= "<Pounds>$pounds</Pounds>";
 	    $workString .= "<Ounces>$ounces</Ounces>";
@@ -405,18 +517,20 @@
     	$workString .= "</Package>";
 	}
 		$packageID++;
-	} 
-	if (($destcountry eq "") || ($destcountry =~ /united states/i) || ($destcountry =~ /puerto/i)) {
-		$workString .= "</RateV2Request>";
-	} else { 
-		$workString .= "</IntlRateRequest>";
 	}
-	# added by Mister Ed to fix machineable type for parcel codes
-		if ($product =~ /Parcel/ig) {
-		   $workString =~ s/False/True/;
+
+	if (($destcountry eq "") || ($destcountry =~ /united states/i) || ($destcountry =~ /puerto/i)) { 
+		$workString .= "</RateV3Request>";
+	} else { # international string
+		$workString .= "</IntlRateRequest>";
 	}
-  	$doworkString = "$usps_prot$usps_site$usps_cgi\?${workString}";
+	$doworkString = "$usps_prot$usps_site$usps_cgi\?${workString}";
+    # debug
+    # print "<br>$doworkString <br>";
+
 	if ($sc_use_socket =~ /lwp/i) { # use LWP library POST
+	# By calling this way, no error generated if library is missing
+	# when the library is first loaded up or at runtime of this routine
 	$answer = eval("use LWP::UserAgent;");
 		if ($@ eq "" ) {
     		$answer = LWP_post($doworkString);
@@ -424,51 +538,58 @@
 	    	print "<br><left>$@</left><br>\n";
 	    	$answer = "";
 	  	}
-	}
-	if ($sc_use_socket =~ /http-lib/i) { 
+	} elsif ($sc_use_socket =~ /http-lib/i) { # use http-lib.pl library GET
 		$answer = &HTTPGet($usps_cgi,$usps_site,80,$workString);
 	}
+
 	&codehook("USPS_XML_data_dump");
+	# For now used old method to get rate from XML
    	$orig_ans = $answer;
-	if (($destcountry eq "") || ($destcountry =~ /united states/i) || ($destcountry =~ /puerto/i)) { 
+	if (($destcountry eq "") || ($destcountry =~ /united states/i) || ($destcountry =~ /puerto/i)) { # USA and PR
 		while ($answer =~ /<Rate>/ig) {
    			($junk,$answer) = split(/<Rate>/i,$answer,2);
    			($splitanswer,$answer) = split(/<\/Rate>/i,$answer,2);
 			$item_cost += $splitanswer;
 		}
-	} else { 
+	} else { # international string
 			while ($answer =~ /<Service/ig) {
    				($splitanswer,$answer) = split(/<\/Service>/i,$answer,2);
-				if ($splitanswer =~ /$product_temp_name/i) {
+                # debug
+                # print " SPLITANSWER = $splitanswer <br><br>";
+                # print "Looked For:  = $product <br><br><br><br>";
+				if (($splitanswer =~ /$product/i) && ($splitanswer !~ /flat rate/i) && ($splitanswer !~ /Non\-Document/i)) {
+   					($junk,$splitanswer) = split(/<Postage>/i,$splitanswer,2);
+   					($splitanswer,$junk) = split(/<\/Postage>/i,$splitanswer,2);
+                    # debug
+                    # print "COST FOUND: $splitanswer <br><br><br><br>";
+					$item_cost += $splitanswer;
+				} elsif (($splitanswer =~ /$product/i) && ($product =~ /flat rate/i) && ($splitanswer =~ /flat rate/i) && ($splitanswer !~ /envelope/i)) {
    					($junk,$splitanswer) = split(/<Postage>/i,$splitanswer,2);
    					($splitanswer,$junk) = split(/<\/Postage>/i,$splitanswer,2);
+                    # debug
+                    # print "FLAT RATE COST FOUND: $splitanswer <br><br><br><br>";
 					$item_cost += $splitanswer;
-				}
+                }
 			}
 		}
    	if ($answer eq "") {
    		$error=$orig_ans;
    	}
-	if ($item_cost == 0 && $err_printed eq "" && $destcountry =~ /australia/i) {
-       	$err_printed = "yes";
-       	$order_error_do_not_finish = "yes";
-       	print "USPS module error: shipping cost not determined!<br>",
-           	"Please use your browser's back button and correct ",
-           	"<br>You may need to chose a different USPS shipping method for your destination<br>",
-           	"Weight limit for Global Priority Mail is 4 lbs; Airmail is 44 lbs.<br><br>$err<br>\n";
-	}
+
 	if ($item_cost == 0 && $err_printed eq "") {
        	$err_printed = "yes";
        	$order_error_do_not_finish = "yes";
        	print "USPS module error: shipping cost not determined!<br>",
-           	"Please use your browser's back button and correct ",
+           	"Please use your browser's back button or any checkout link/button and correct ",
            	"<br>any fields as required and try again.  Also, make sure your postal code is correct.<br>",
            	"You may also need to chose a different USPS shipping method for your destination<br><br>$err<br>\n";
 	}
 	$ship_cost += $item_cost;
 	$item_cost = 0;
-} 
+} # end of each origination
+
 	&codehook("UPS_USPS_cost_return");
+
 	return $ship_cost;
 }
 ############################################################################
@@ -631,7 +752,7 @@
 			# do nothing
 		}
   }
- return ($shipping_price);
+ return &format_price($shipping_price);
 }
 ############################################################################
 sub LWP_post {
diff -aruN 5.0.000.src/library/USAepay-order_lib.pl 5.2.000.src/library/USAepay-order_lib.pl
--- 5.0.000.src/library/USAepay-order_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/USAepay-order_lib.pl	2007-12-19 23:22:20.000000000 -0600
@@ -2,7 +2,7 @@
 #                    Order Form Definition Variables                  #
 #######################################################################
 
-$versions{'USAepay-order_lib.pl'} = "5.0.000";
+$versions{'USAepay-order_lib.pl'} = "5.0.004";
 $sc_use_secure_header_at_checkout = 'yes';
 $sc_use_secure_footer_for_order_form = 'yes';
 
@@ -138,6 +138,9 @@
     push(@sc_order_form_required_fields,"Ecom_tos");
  }
 
+# use this codehook to change the above arrays for required fields and such
+&codehook("USAepay_fields_bottom");
+
 }
 
 ###############################################################################
@@ -251,7 +254,7 @@
   $form_data{'Ecom_Payment_Card_ExpDate_Year'} = "09";
  }
 
-my $fullname = "$form_data{'Ecom_BillTo_Postal_Name_Last'}" . " $form_data{'Ecom_BillTo_Postal_Name_Last'}";
+my $fullname = "$form_data{'Ecom_BillTo_Postal_Name_First'}" . " $form_data{'Ecom_BillTo_Postal_Name_Last'}";
 my $expiredate = "$form_data{'Ecom_Payment_Card_ExpDate_Month'}" . " $form_data{'Ecom_Payment_Card_ExpDate_Year'}";
 
 print <<ENDOFTEXT;
@@ -522,6 +525,7 @@
 <body>
 !;
 
+
 &SecureStoreHeader;
 
 $text_of_cart .= "Order Date:    $orderDate\n";
@@ -551,7 +555,7 @@
 close(CART);
 
 # initialize hash variables in case they are empty later
-# added by jfindlay 2006 February
+# added by Mister Ed 2006
 
 $orderLoggingHash{'firstName'} = "";
 $orderLoggingHash{'lastName'} = "";
@@ -575,7 +579,6 @@
 $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";
@@ -606,6 +609,41 @@
 $orderLoggingHash{'xcomments'} = "";
 $orderLoggingHash{'termsOfService'} = "$vform_Ecom_tos";
 
+# new logging items added August 4, 2007 by Mister Ed
+$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) {
@@ -648,6 +686,13 @@
   &add_text_of_both("SUBTOTAL",$temp);
   $orderLoggingHash{'subTotal'} = &format_price($sc_verify_subtotal);
 
+if (($sc_buySafe_is_enabled =~ /yes/) && ($sc_verify_buySafe > 0)) {
+my $temp = &format_price($sc_verify_buySafe);
+$text_of_cart .= "$sc_buySafe_bond_fee_mini_display_text       $temp\n";
+$text_of_confirm_email .= "$sc_verify_buySafe_display_text       $temp\n";
+$orderLoggingHash{'buySafe'} = "$temp";
+}
+
 if ($sc_verify_discount) {
   $temp = &format_price($sc_verify_discount);
   &add_text_of_both("DISCOUNT",$temp);
@@ -742,9 +787,7 @@
 $text_of_cart .= "COUNTRY:       $vform_Ecom_ShipTo_Postal_CountryCode\n";
 $orderLoggingHash{'shipToCountry'} = "$vform_Ecom_ShipTo_Postal_CountryCode";
 
-if ($sc_use_SBW =~ /yes/i) {
-  $text_of_cart .= "SHIP VIA:      $eform_eform_Ecom_ShipTo_Method\n";
- }
+$text_of_cart .= "SHIP VIA:      $eform_eform_Ecom_ShipTo_Method\n";
 
 # NEW CODEHOOK
 &codehook("process-order-pre-ship-instructions");
@@ -776,8 +819,14 @@
 
 $sc_USAepay_order_desc .= " - " . $sc_verify_inv_no;
 
+# added by Mister Ed Feb 7, 2007
+my $temp_admin_email = "$sc_admin_email";
+if ($sc_use_customer_email_over_admin =~ /yes/i) {
+   $temp_admin_email = "$eform_Ecom_BillTo_Online_Email";
+}
+
 if ($sc_send_order_to_email =~ /yes/i) {
-  &send_mail($sc_admin_email, $sc_order_email, $sc_USAepay_order_desc, $text_of_cart);
+  &send_mail($temp_admin_email, $sc_order_email, $sc_USAepay_order_desc, $text_of_cart);
  }
 
 &log_order($text_of_cart,$sc_verify_inv_no,$form_data{'cart_id'});
@@ -815,6 +864,7 @@
 
 # This empties the cart after the order is successful
 &empty_cart;
+undef(%form_data);
 
 # and the footer is printed
 
diff -aruN 5.0.000.src/library/YourPayConnect-order_lib.pl 5.2.000.src/library/YourPayConnect-order_lib.pl
--- 5.0.000.src/library/YourPayConnect-order_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/library/YourPayConnect-order_lib.pl	2007-12-19 23:22:21.000000000 -0600
@@ -1,7 +1,7 @@
 ##############################################################################
 #                       Order Form Definition Variables                      #
 ##############################################################################
-$versions{'YourPayConnect-order_lib.pl'} = "5.0.000";
+$versions{'YourPayConnect-order_lib.pl'} = "5.0.002";
 $sc_use_secure_header_at_checkout = 'yes';
 $sc_use_secure_footer_for_order_form = 'yes';
 $sc_YourPayConnect_form_prep = 0;
@@ -88,6 +88,9 @@
     push(@sc_order_form_required_fields,"Ecom_tos");
  }
 
+# use this codehook to change the above arrays for required fields and such
+&codehook("YourPayConnect_fields_bottom");
+
 }
 
 ###############################################################################
@@ -405,6 +408,13 @@
 &add_text_of_both("SUBTOTAL",$sc_verify_subtotal);
 $sc_verify_subtotal3 = $sc_verify_subtotal;
 
+if (($sc_buySafe_is_enabled =~ /yes/) && ($sc_verify_buySafe > 0)) {
+my $temp = &format_price($sc_verify_buySafe);
+$text_of_cart .= "$sc_buySafe_bond_fee_mini_display_text       $temp\n";
+$text_of_confirm_email .= "$sc_verify_buySafe_display_text       $temp\n";
+$orderLoggingHash{'buySafe'} = "$temp";
+}
+
 if ($sc_verify_discount) {
   $temp = &format_price($sc_verify_discount);
   &add_text_of_both("DISCOUNT",$temp);
@@ -557,9 +567,7 @@
 # NEW CODEHOOK
 &codehook("process-order-pre-ship-instructions");
 
-if ($sc_use_SBW =~ /yes/i) {
-  &add_text_of_cart("SHIP VIA",$vform_Ecom_ShipTo_Method);
- }
+&add_text_of_cart("SHIP VIA",$vform_Ecom_ShipTo_Method);
 
 if ($sc_verify_discount) {
   &add_text_of_both("DISCOUNT",$sc_verify_discount);
@@ -609,8 +617,14 @@
 $text_of_cart = "\n" . $text_of_cart . "\n";
 }
 
+# added by Mister Ed 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) {
-  &send_mail($sc_order_email, $sc_order_email, "AgoraCart - YourPayConnect Order - $yp_inv",$text_of_cart);
+  &send_mail($temp_admin_email, $sc_order_email, "AgoraCart - YourPayConnect Order - $yp_inv",$text_of_cart);
  }
 
 # NEW CODEHOOK
@@ -653,6 +667,7 @@
 
 # This empties the cart after the order is successful
 &empty_cart;
+undef(%form_data);
 
 # and the footer is printed
 
diff -aruN 5.0.000.src/picserve.cgi 5.2.000.src/picserve.cgi
--- 5.0.000.src/picserve.cgi	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/picserve.cgi	2006-08-17 00:38:01.000000000 -0500
@@ -1,6 +1,13 @@
 #!/usr/bin/perl -T
-$versions{'picserve.cgi'} = "5.0.000";
+#
+# helper program that speeds up pic serving
+# includes contents of cgi-lib.pl for increased speed
+# be sure to set the paths correctly in the next few lines
+
+$versions{'picserve.cgi'} = "5.1.000";
+
 &ReadParse(*form_data);
+
 if ($form_data{'picserve'} ne "") {
   &serve_picture($form_data{'picserve'},"./html/images");
   exit;
@@ -10,16 +17,21 @@
   exit;
  }
 exit;
+# normally no need to edit anything below!
 ########################################################################
 sub serve_picture
 {
+
  local ($qstr,$sc_path_of_images_directory) = @_;
  local ($test, $test2, $my_path_to_image);
+
  $qstr =~ /([\w\-\=\+\/\.\:]+)/;
  $qstr = "$1";
+
  $my_path_to_image = $sc_path_of_images_directory . $qstr ;
  $test = substr($my_path_to_image,0,6);
  $test2 = substr($my_path_to_image,(length($my_path_to_image)-3),3);
+
  if ($test2=~ /jpg/i || $test2 =~ /gif/i || $test2 =~ /png/i) {
   # file is ok to display
   if ($test2=~ /jpg/i) {# .jpg is jpeg file
@@ -27,12 +39,15 @@
    }
   if ($test=~ /http:\//i || $test =~ /https:/i) {
    # need to GET the info .. no implemented here in agora
-   } else { 
+#    use LWP::Simple;
+#    print "Content-type: image/$test2\n\n";
+#    print get($my_path_to_image);
+   } else { # is a filename we can load up directly
     print "Content-type: image/$test2\n\n";
-    if (!(-f $my_path_to_image)) {
+    if (!(-f $my_path_to_image)) {# try adding another slash!
       $my_path_to_image = $sc_path_of_images_directory ."/" . $qstr ;
      }
-    { 
+    { # stuff in braces loads image all at once
      open (MYPIC,$my_path_to_image);
      binmode(MYPIC);
      local $/=undef;
@@ -46,7 +61,7 @@
 #
 #*********************************************************************
 # MODIFIED FOR AGORA.CGI -- an open source, FREE shopping cart 
-# http://www.agoracart.com  4/30/2000 SPK
+# http://www.agoracgi.com  4/30/2000 SPK
 # Fixes a problem with MSIE 5.01
 #*********************************************************************
 
@@ -64,44 +79,85 @@
 
 # For more information, see:
 #     http://cgi-lib.stanford.edu/cgi-lib/
+
 $cgi_lib'version = sprintf("%d.%02d", q$Revision: 2.18 $ =~ /(\d+)\.(\d+)/);
 $versions{'cgi-lib'}= "$cgi_lib'version with Agora MSIE Patch";
-$cgi_lib'maxdata    = 131072;
-$cgi_lib'writefiles =      0;
-$cgi_lib'filepre    = "cgi-lib";
-$cgi_lib'bufsize  =  8192; 
-$cgi_lib'maxbound =   100; 
-$cgi_lib'headerout =    0;
-#####################################################################
+
+# Parameters affecting cgi-lib behavior
+# User-configurable parameters affecting file upload.
+$cgi_lib'maxdata    = 131072;    # maximum bytes to accept via POST - 2^17
+$cgi_lib'writefiles =      0;    # directory to which to write files, or
+                                 # 0 if files should not be written
+$cgi_lib'filepre    = "cgi-lib"; # Prefix of file names, in directory above
+
+# Do not change the following parameters unless you have special reasons
+$cgi_lib'bufsize  =  8192;    # default buffer size when reading multipart
+$cgi_lib'maxbound =   100;    # maximum boundary length to be encounterd
+$cgi_lib'headerout =    0;    # indicates whether the header has been printed
+
+
+# ReadParse
+# Reads in GET or POST data, converts it to unescaped text, and puts
+# key/value pairs in %in, using "\0" to separate multiple selections
+
+# Returns >0 if there was input, 0 if there was no input 
+# undef indicates some failure.
+
+# Now that cgi scripts can be put in the normal file space, it is useful
+# to combine both the form and the script in one place.  If no parameters
+# are given (i.e., ReadParse returns FALSE), then a form could be output.
+
+# If a reference to a hash is given, then the data will be stored in that
+# hash, but the data from $in and @in will become inaccessable.
+# If a variable-glob (e.g., *cgi_input) is the first parameter to ReadParse,
+# information is stored there, rather than in $in, @in, and %in.
+# Second, third, and fourth parameters fill associative arrays analagous to
+# %in with data relevant to file uploads. 
+
+# If no method is given, the script will process both command-line arguments
+# of the form: name=value and any text that is in $ENV{'QUERY_STRING'}
+# This is intended to aid debugging and may be changed in future releases
+
 sub ReadParse {
+  # Disable warnings as this code deliberately uses local and environment
+  # variables which are preset to undef (i.e., not explicitly initialized)
   local ($perlwarn);
   $perlwarn = $^W;
   $^W = 0;
-  local (*in) = shift if @_; 
-  local (*incfn,
-         *inct,
-         *insfn) = @_;
+
+  local (*in) = shift if @_;    # CGI input
+  local (*incfn,                # Client's filename (may not be provided)
+         *inct,                 # Client's content-type (may not be provided)
+         *insfn) = @_;          # Server's filename (for spooled files)
 
 # SPK added $first_type and $junk below:
-  local ($len, $type, $first_type, $meth, $errflag, $cmdflag, $got, $name, $junk);     
-  binmode(STDIN);
-  binmode(STDOUT);
+  local ($len, $type, $first_type, $meth, $errflag, $cmdflag, $got, $name, $junk);
+        
+  binmode(STDIN);   # we need these for DOS-based systems
+  binmode(STDOUT);  # and they shouldn't hurt anything else 
   binmode(STDERR);
+        
+  # Get several useful env variables
   $type = $ENV{'CONTENT_TYPE'};
   $len  = $ENV{'CONTENT_LENGTH'};
   $meth = $ENV{'REQUEST_METHOD'};
+  
   if ($len > $cgi_lib'maxdata) { #'
       &CgiDie("cgi-lib.pl: Request to receive too much data: $len bytes\n");
   }
+
 # SPK look at only the first if there is a comma-delimited CONTENT-TYPE list
   ($first_type,$junk) = split(/\,/,$type,2);
+
   if (!defined $meth || $meth eq '' || $meth eq 'GET' ||
       $meth eq 'HEAD' ||
       $first_type eq 'application/x-www-form-urlencoded') {
     local ($key, $val, $i);
+        
+    # Read in text
     if (!defined $meth || $meth eq '') {
       $in = $ENV{'QUERY_STRING'};
-      $cmdflag = 1;
+      $cmdflag = 1;  # also use command-line options
     } elsif($meth eq 'GET' || $meth eq 'HEAD') {
       $in = $ENV{'QUERY_STRING'};
     } elsif ($meth eq 'POST') {
@@ -110,55 +166,95 @@
     } else {
       &CgiDie("cgi-lib.pl: Unknown request method: $meth\n");
     }
+
     @in = split(/[&;]/,$in); 
-    push(@in, @ARGV) if $cmdflag;
+    push(@in, @ARGV) if $cmdflag; # add command-line parameters
+
     foreach $i (0 .. $#in) {
+      # Convert plus to space
       $in[$i] =~ s/\+/ /g;
-      ($key, $val) = split(/=/,$in[$i],2);
+
+      # Split into key and value.  
+      ($key, $val) = split(/=/,$in[$i],2); # splits on the first =.
+
+      # Convert %XX from hex numbers to alphanumeric
       $key =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge;
       $val =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge;
-      $in{$key} .= "\0" if (defined($in{$key}));
+
+      # Associate key and value
+      $in{$key} .= "\0" if (defined($in{$key})); # \0 is the multiple separator
       $in{$key} .= $val;
     }
+
   } elsif ($ENV{'CONTENT_TYPE'} =~ m#^multipart/form-data#) {
+    # for efficiency, compile multipart code only if needed
 $errflag = !(eval <<'END_MULTIPART');
+
     local ($buf, $boundary, $head, @heads, $cd, $ct, $fname, $ctype, $blen);
     local ($bpos, $lpos, $left, $amt, $fn, $ser);
     local ($bufsize, $maxbound, $writefiles) = 
       ($cgi_lib'bufsize, $cgi_lib'maxbound, $cgi_lib'writefiles);
+
+
+    # The following lines exist solely to eliminate spurious warning messages
     $buf = ''; 
-    ($boundary) = $type =~ /boundary="([^"]+)"/; #";
+
+    ($boundary) = $type =~ /boundary="([^"]+)"/; #";   # find boundary
     ($boundary) = $type =~ /boundary=(\S+)/ unless $boundary;
     &CgiDie ("Boundary not provided: probably a bug in your server") 
       unless $boundary;
     $boundary =  "--" . $boundary;
     $blen = length ($boundary);
+
     if ($ENV{'REQUEST_METHOD'} ne 'POST') {
       &CgiDie("Invalid request method for  multipart/form-data: $meth\n");
     }
+
     if ($writefiles) {
       local($me);
       stat ($writefiles);
       $writefiles = "/tmp" unless  -d _ && -w _;
+      # ($me) = $0 =~ m#([^/]*)$#;
       $writefiles .= "/$cgi_lib'filepre"; 
     }
 
-   $left = $len;
-   PART: 
+    # read in the data and split into parts:
+    # put headers in @in and data in %in
+    # General algorithm:
+    #   There are two dividers: the border and the '\r\n\r\n' between
+    # header and body.  Iterate between searching for these
+    #   Retain a buffer of size(bufsize+maxbound); the latter part is
+    # to ensure that dividers don't get lost by wrapping between two bufs
+    #   Look for a divider in the current batch.  If not found, then
+    # save all of bufsize, move the maxbound extra buffer to the front of
+    # the buffer, and read in a new bufsize bytes.  If a divider is found,
+    # save everything up to the divider.  Then empty the buffer of everything
+    # up to the end of the divider.  Refill buffer to bufsize+maxbound
+    #   Note slightly odd organization.  Code before BODY: really goes with
+    # code following HEAD:, but is put first to 'pre-fill' buffers.  BODY:
+    # is placed before HEAD: because we first need to discard any 'preface,'
+    # which would be analagous to a body without a preceeding head.
+
+    $left = $len;
+   PART: # find each part of the multi-part while reading data
     while (1) {
       die $@ if $errflag;
+
       $amt = ($left > $bufsize+$maxbound-length($buf) 
               ?  $bufsize+$maxbound-length($buf): $left);
       $errflag = (($got = read(STDIN, $buf, $amt, length($buf))) != $amt);
       die "Short Read: wanted $amt, got $got\n" if $errflag;
       $left -= $amt;
+
       $in{$name} .= "\0" if defined $in{$name}; 
       $in{$name} .= $fn if $fn;
+
       $name=~/([-\w]+)/;  # This allows $insfn{$name} to be untainted
       if (defined $1) {
         $insfn{$1} .= "\0" if defined $insfn{$1}; 
         $insfn{$1} .= $fn if $fn;
       }
+ 
      BODY: 
       while (($bpos = index($buf, $boundary)) == -1) {
         if ($left == 0 && $buf eq '') {
@@ -169,19 +265,19 @@
                   "of multipart. Format of CGI input is wrong.\n");
         }
         die $@ if $errflag;
-        if ($name) { 
+        if ($name) {  # if no $name, then it's the prologue -- discard
           if ($fn) { print FILE substr($buf, 0, $bufsize); }
           else     { $in{$name} .= substr($buf, 0, $bufsize); }
         }
         $buf = substr($buf, $bufsize);
-        $amt = ($left > $bufsize ? $bufsize : $left);
+        $amt = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);
         $errflag = (($got = read(STDIN, $buf, $amt, length($buf))) != $amt);
         die "Short Read: wanted $amt, got $got\n" if $errflag;
         $left -= $amt;
       }
-      if (defined $name) { 
+      if (defined $name) {  # if no $name, then it's the prologue -- discard
         if ($fn) { print FILE substr($buf, 0, $bpos-2); }
-        else     { $in {$name} .= substr($buf, 0, $bpos-2); } 
+        else     { $in {$name} .= substr($buf, 0, $bpos-2); } # kill last \r\n
       }
       close (FILE);
       last PART if substr($buf, $bpos + $blen, 2) eq "--";
@@ -191,6 +287,8 @@
       $errflag = (($got = read(STDIN, $buf, $amt, length($buf))) != $amt);
       die "Short Read: wanted $amt, got $got\n" if $errflag;
       $left -= $amt;
+
+
       undef $head;  undef $fn;
      HEAD:
       while (($lpos = index($buf, "\r\n\r\n")) == -1) { 
@@ -215,15 +313,15 @@
       ($cd) = grep (/^\s*Content-Disposition:/i, @heads);
       ($ct) = grep (/^\s*Content-Type:/i, @heads);
 
-      ($name) = $cd =~ /\bname="([^"]+)"/i; 
+      ($name) = $cd =~ /\bname="([^"]+)"/i; #"; 
       ($name) = $cd =~ /\bname=([^\s:;]+)/i unless defined $name;  
 
-      ($fname) = $cd =~ /\bfilename="([^"]*)"/i;
+      ($fname) = $cd =~ /\bfilename="([^"]*)"/i; #"; # filename can be null-str
       ($fname) = $cd =~ /\bfilename=([^\s:;]+)/i unless defined $fname;
       $incfn{$name} .= (defined $in{$name} ? "\0" : "") . 
         (defined $fname ? $fname : "");
 
-      ($ctype) = $ct =~ /^\s*Content-type:\s*"([^"]+)"/i;
+      ($ctype) = $ct =~ /^\s*Content-type:\s*"([^"]+)"/i;  #";
       ($ctype) = $ct =~ /^\s*Content-Type:\s*([^\s:;]+)/i unless defined $ctype;
       $inct{$name} .= (defined $in{$name} ? "\0" : "") . $ctype;
 
@@ -237,6 +335,7 @@
       undef $fname;
       undef $ctype;
     }
+
 1;
 END_MULTIPART
     if ($errflag) {
@@ -252,22 +351,34 @@
   } else {
     &CgiDie("cgi-lib.pl: Unknown Content-type: $ENV{'CONTENT_TYPE'}\n");
   }
+
+  # no-ops to avoid warnings
   $insfn = $insfn;
   $incfn = $incfn;
   $inct  = $inct;
+
   $^W = $perlwarn;
+
   return ($errflag ? undef :  scalar(@in)); 
 }
 
-##################################################################
+
+# PrintHeader
+# Returns the magic line which tells WWW that we're an HTML document
+
 sub PrintHeader {
   return "Content-type: text/html\n\n";
 }
 
 
+# HtmlTop
+# Returns the <head> of a document and the beginning of the body
+# with the title and a body <h1> header as specified by the parameter
+
 sub HtmlTop
 {
   local ($title) = @_;
+
   return <<END_OF_TEXT;
 <html>
 <head>
@@ -278,12 +389,19 @@
 END_OF_TEXT
 }
 
+
+# HtmlBot
+# Returns the </body>, </html> codes for the bottom of every HTML page
+
 sub HtmlBot
 {
   return "</body>\n</html>\n";
 }
 
 
+# SplitParam
+# Splits a multi-valued parameter into a list of the constituent parameters
+
 sub SplitParam
 {
   local ($param) = @_;
@@ -292,16 +410,24 @@
 }
 
 
+# MethGet
+# Return true if this cgi call was using the GET request, false otherwise
+
 sub MethGet {
   return (defined $ENV{'REQUEST_METHOD'} && $ENV{'REQUEST_METHOD'} eq "GET");
 }
 
 
+# MethPost
+# Return true if this cgi call was using the POST request, false otherwise
+
 sub MethPost {
   return (defined $ENV{'REQUEST_METHOD'} && $ENV{'REQUEST_METHOD'} eq "POST");
 }
 
 
+# MyBaseUrl
+# Returns the base URL to the script (i.e., no extra path or query string)
 sub MyBaseUrl {
   local ($ret, $perlwarn);
   $perlwarn = $^W; $^W = 0;
@@ -313,6 +439,8 @@
 }
 
 
+# MyFullUrl
+# Returns the full URL to the script (i.e., with extra path or query string)
 sub MyFullUrl {
   local ($ret, $perlwarn);
   $perlwarn = $^W; $^W = 0;
@@ -325,11 +453,22 @@
 }
 
 
+# MyURL
+# Returns the base URL to the script (i.e., no extra path or query string)
+# This is obsolete and will be removed in later versions
 sub MyURL  {
   return &MyBaseUrl;
 }
 
 
+# CgiError
+# Prints out an error message which which containes appropriate headers,
+# markup, etcetera.
+# Parameters:
+#  If no parameters, gives a generic error message
+#  Otherwise, the first parameter will be the title and the rest will 
+#  be given as different paragraphs of the body
+
 sub CgiError {
   local (@msg) = @_;
   local ($i,$name);
@@ -352,6 +491,9 @@
 }
 
 
+# CgiDie
+# Identical to CgiError, but also quits with the passed error message.
+
 sub CgiDie {
   local (@msg) = @_;
   &CgiError (@msg);
@@ -359,6 +501,13 @@
 }
 
 
+# PrintVariables
+# Nicely formats variables.  Three calling options:
+# A non-null associative array - prints the items in that array
+# A type-glob - prints the items in the associated assoc array
+# nothing - defaults to use %in
+# Typical use: &PrintVariables()
+
 sub PrintVariables {
   local (*in) = @_ if @_ == 1;
   local (%in) = @_ if @_ > 1;
@@ -376,14 +525,18 @@
   return $output;
 }
 
+# PrintEnv
+# Nicely formats all environment variables and returns HTML string
 sub PrintEnv {
   &PrintVariables(*ENV);
 }
 
+
+# The following lines exist only to avoid warning messages
 $cgi_lib'writefiles =  $cgi_lib'writefiles;
 $cgi_lib'bufsize    =  $cgi_lib'bufsize ;
 $cgi_lib'maxbound   =  $cgi_lib'maxbound;
 $cgi_lib'version    =  $cgi_lib'version;
 $cgi_lib'filepre    =  $cgi_lib'filepre;
 
-1;
+1; #return true 
diff -aruN 5.0.000.src/protected/basic_options_editor-ext_lib.pl 5.2.000.src/protected/basic_options_editor-ext_lib.pl
--- 5.0.000.src/protected/basic_options_editor-ext_lib.pl	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/basic_options_editor-ext_lib.pl	2008-01-14 23:34:55.000000000 -0600
@@ -0,0 +1,835 @@
+# file ./store/protected/basic_options_editor-ext_lib.pl
+#########################################################################
+#
+# Copyright (c) 2002-2004 K-Factor Technologies, Inc.
+# http://www.k-factor.net/  and  http://www.AgoraCart.com/
+# All Rights Reserved.
+#
+# This is NOT FREE SOFTWARE!  This library is a cost item,
+# part of an ecommerce payment gateway solution.  To use it
+# you must license it from http://www.AgoraCartPro.com/
+#
+# Pro Members (of AgoraCart) my use this file in one store.
+# additional licenses must be purchused at:
+# http://www.AgoraCartPro.com/
+#
+# This software is the confidential and proprietary information of
+# K-Factor Technologies, Inc.  You shall
+# not disclose such Confidential Information and shall use it only in
+# accordance with the terms of the license agreement you entered into
+# with K-Factor Technologies, Inc.
+#
+# K-Factor Technologies, Inc. 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. 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 away or distribute it an any way without
+# written permission.
+#
+##########################################################################
+$versions{'basic_options_editor-ext_lib.pl'} = "4.99.001";
+
+
+{
+ local ($modname) = 'basic_options_editor';
+ &register_extension($modname,"Basic Option File Manager",$versions{$modname});
+ &add_merchtools_settings_choice("Basic Option Files"," Basic Option Files ",
+  "change_basic_options_screen");
+ &register_menu('EditOptionsFile',"display_basic_options_screen",
+  $modname,"Select Option File");
+ &register_menu('BasicOptionsSettings',"write_basic_options_settings",
+  $modname,"Write Basic Option Files Settings");
+ &register_menu('change_basic_options_screen',"display_options_screen",
+  $modname,"Display Basic Option File Settings");
+# &add_item_to_manager_menu("Basic Option Files","change_basic_options_screen=yes","");
+}
+#######################################################################################
+sub write_basic_options_settings {
+local($myset)="";
+local($optfile)="";
+$optfile2 ="";
+local($optfile3)="";
+
+&ReadParse;
+
+      $optfile = "$in{'optionfilename'}.html";
+      $optfile =~ /([\w\-\=\+\/]+)\.(\w+)/;
+      $optfile = "$1.$2";
+      $optfile =~ s/^\/+//;
+      $optfile2 = (split (/\./, $optfile))[0];
+if ($optfile2 eq "") {$optfile2 = "$optfile";}
+      $optfile3 = "html";
+      $optfile = "$optfile2.$optfile3";
+$sc_optfile2edit = "$optfile2";
+
+      open (NEW, ">$sc_options_directory_path/$optfile");
+      $counter = 1;
+
+
+      print NEW  "<table border=\"0\"><tr><td><p align=\"right\"><font size=\"2\" face=\"Arial\">\n";
+      if ($in{'OptionA1'} ne "")
+      {
+         print NEW "<b>$in{'OptionA'}<\/b><SELECT NAME = \"option|$counter|\%\%PRODUCT_ID\%\%\">\n";
+         if ($in{'OptionA1d'}){$OptionA1d = " \(\+ \$$in{'OptionA1d'}\)";}
+         print NEW "<OPTION VALUE = \"$in{'OptionA1'}|$in{'OptionA1d'}\">$in{'OptionA1'}$OptionA1d\n";
+         if ($in{'OptionA2'} ne "")
+         {
+            if ($in{'OptionA2d'}){$OptionA2d = " \(\+ \$$in{'OptionA2d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionA2'}|$in{'OptionA2d'}\">$in{'OptionA2'}$OptionA2d\n";
+         }
+         if ($in{'OptionA3'} ne "")
+         {
+            if ($in{'OptionA3d'}){$OptionA3d = " \(\+ \$$in{'OptionA3d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionA3'}|$in{'OptionA3d'}\">$in{'OptionA3'}$OptionA3d\n";
+         }
+         if ($in{'OptionA4'} ne "")
+         {
+            if ($in{'OptionA4d'}){$OptionA4d = " \(\+ \$$in{'OptionA4d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionA4'}|$in{'OptionA4d'}\">$in{'OptionA4'}$OptionA4d\n";
+         }
+         if ($in{'OptionA5'} ne "")
+         {
+            if ($in{'OptionA5d'}){$OptionA5d = " \(\+ \$$in{'OptionA5d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionA5'}|$in{'OptionA5d'}\">$in{'OptionA5'}$OptionA5d\n";
+         }
+         if ($in{'OptionA6'} ne "")
+         {
+            if ($in{'OptionA6d'}){$OptionA6d = " \(\+ \$$in{'OptionA6d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionA6'}|$in{'OptionA6d'}\">$in{'OptionA6'}$OptionA6d\n";
+         }
+         if ($in{'OptionA7'} ne "")
+         {
+            if ($in{'OptionA7d'}){$OptionA7d = " \(\+ \$$in{'OptionA7d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionA7'}|$in{'OptionA7d'}\">$in{'OptionA7'}$OptionA7d\n";
+         }
+         if ($in{'OptionA8'} ne "")
+         {
+            if ($in{'OptionA8d'}){$OptionA8d = " \(\+ \$$in{'OptionA8d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionA8'}|$in{'OptionA8d'}\">$in{'OptionA8'}$OptionA8d\n";
+         }
+         if ($in{'OptionA9'} ne "")
+         {
+            if ($in{'OptionA9d'}){$OptionA9d = " \(\+ \$$in{'OptionA9d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionA9'}|$in{'OptionA9d'}\">$in{'OptionA9'}$OptionA9d\n";
+         }
+      if ($in{'OptionA10'} ne "")
+      {
+         if ($in{'OptionA10d'}){$OptionA10d = " \(\+ \$$in{'OptionA10d'}\)";}
+         print NEW "<OPTION VALUE = \"$in{'OptionA10'}|$in{'OptionA10d'}\">$in{'OptionA10'}$OptionA10d\n";
+         }
+      if ($in{'OptionA11'} ne "")
+      {
+         if ($in{'OptionA11d'}){$OptionA12d = " \(\+ \$$in{'OptionA11d'}\)";}
+         print NEW "<OPTION VALUE = \"$in{'OptionA11'}|$in{'OptionA11d'}\">$in{'OptionA11'}$OptionA11d\n";
+         }
+      if ($in{'OptionA12'} ne "")
+      {
+         if ($in{'OptionA12d'}){$OptionA12d = " \(\+ \$$in{'OptionA12d'}\)";}
+         print NEW "<OPTION VALUE = \"$in{'OptionA12'}|$in{'OptionA12d'}\">$in{'OptionA12'}$OptionA12d\n";
+         }
+      if ($in{'OptionA13'} ne "")
+      {
+         if ($in{'OptionA13d'}){$OptionA13d = " \(\+ \$$in{'OptionA13d'}\)";}
+         print NEW "<OPTION VALUE = \"$in{'OptionA13'}|$in{'OptionA13d'}\">$in{'OptionA13'}$OptionA13d\n";
+         }
+      if ($in{'OptionA14'} ne "")
+      {
+         if ($in{'OptionA14d'}){$OptionA14d = " \(\+ \$$in{'OptionA14d'}\)";}
+         print NEW "<OPTION VALUE = \"$in{'OptionA14'}|$in{'OptionA14d'}\">$in{'OptionA14'}$OptionA14d\n";
+         }
+      if ($in{'OptionA15'} ne "")
+      {
+         if ($in{'OptionA15d'}){$OptionA15d = " \(\+ \$$in{'OptionA1d'}\)";}
+         print NEW "<OPTION VALUE = \"$in{'OptionA15'}|$in{'OptionA15d'}\">$in{'OptionA15'}$OptionA15d\n";
+         }
+         $counter++;
+         print NEW "<\/SELECT><br><br>\n";
+      }
+      if ($in{'OptionB1'} ne "")
+      {
+         print NEW "<b>$in{'OptionB'}<\/b><SELECT NAME = \"option|$counter|\%\%PRODUCT_ID\%\%\">\n";
+         if ($in{'OptionB1d'}){$OptionB1d = " \(\+ \$$in{'OptionB1d'}\)";}
+         print NEW "<OPTION VALUE = \"$in{'OptionB1'}|$in{'OptionB1d'}\">$in{'OptionB1'}$OptionB1d\n";
+         if ($in{'OptionB2'} ne "")
+         {
+            if ($in{'OptionB2d'}){$OptionB2d = " \(\+ \$$in{'OptionB2d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB2'}|$in{'OptionB2d'}\">$in{'OptionB2'}$OptionB2d\n";
+         }
+         if ($in{'OptionB3'} ne "")
+         {
+            if ($in{'OptionB3d'}){$OptionB3d = " \(\+ \$$in{'OptionB3d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB3'}|$in{'OptionB3d'}\">$in{'OptionB3'}$OptionB3d\n";
+         }
+         if ($in{'OptionB4'} ne "")
+         {
+            if ($in{'OptionB4d'}){$OptionB4d = " \(\+ \$$in{'OptionB4d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB4'}|$in{'OptionB4d'}\">$in{'OptionB4'}$OptionB4d\n";
+         }
+         if ($in{'OptionB5'} ne "")
+         {
+            if ($in{'OptionB5d'}){$OptionB5d = " \(\+ \$$in{'OptionB5d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB5'}|$in{'OptionB5d'}\">$in{'OptionB5'}$OptionB5d\n";
+         }
+         if ($in{'OptionB6'} ne "")
+         {
+            if ($in{'OptionB6d'}){$OptionB6d = " \(\+ \$$in{'OptionB6d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB6'}|$in{'OptionB6d'}\">$in{'OptionB6'}$OptionB6d\n";
+         }
+         if ($in{'OptionB7'} ne "")
+         {
+            if ($in{'OptionB7d'}){$OptionB7d = " \(\+ \$$in{'OptionB7d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB7'}|$in{'OptionB7d'}\">$in{'OptionB7'}$OptionB7d\n";
+         }
+         if ($in{'OptionB8'} ne "")
+         {
+            if ($in{'OptionB8d'}){$OptionB8d = " \(\+ \$$in{'OptionB8d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB8'}|$in{'OptionB8d'}\">$in{'OptionB8'}$OptionB8d\n";
+         }
+         if ($in{'OptionB9'} ne "")
+         {
+            if ($in{'OptionB9d'}){$OptionB9d = " \(\+ \$$in{'OptionB9d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB9'}|$in{'OptionB9d'}\">$in{'OptionB9'}$OptionB9d\n";
+         }
+         if ($in{'OptionB10'} ne "")
+         {
+            if ($in{'OptionB10d'}){$OptionB10d = " \(\+ \$$in{'OptionB10d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB10'}|$in{'OptionB10d'}\">$in{'OptionB10'}$OptionB10d\n";
+         }
+         if ($in{'OptionB11'} ne "")
+         {
+            if ($in{'OptionB11d'}){$OptionB11d = " \(\+ \$$in{'OptionB11d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB11'}|$in{'OptionB11d'}\">$in{'OptionB11'}$OptionB11d\n";
+         }
+         if ($in{'OptionB12'} ne "")
+         {
+            if ($in{'OptionB12d'}){$OptionB12d = " \(\+ \$$in{'OptionB12d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB12'}|$in{'OptionB12d'}\">$in{'OptionB12'}$OptionB12d\n";
+         }
+         if ($in{'OptionB13'} ne "")
+         {
+            if ($in{'OptionB13d'}){$OptionB1d = " \(\+ \$$in{'OptionB13d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB13'}|$in{'OptionB13d'}\">$in{'OptionB13'}$OptionB13d\n";
+         }
+         if ($in{'OptionB14'} ne "")
+         {
+            if ($in{'OptionB14d'}){$OptionB14d = " \(\+ \$$in{'OptionB14d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB14'}|$in{'OptionB14d'}\">$in{'OptionB14'}$OptionB14d\n";
+         }
+         if ($in{'OptionB15'} ne "")
+         {
+            if ($in{'OptionB15d'}){$OptionB15d = " \(\+ \$$in{'OptionB15d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionB15'}|$in{'OptionB15d'}\">$in{'OptionB15'}$OptionB15d\n";
+         }
+         $counter++;
+         print NEW "<\/SELECT><br><br>\n";
+      }
+      if ($in{'OptionC1'} ne "")
+      {
+         print NEW "<b>$in{'OptionC'}<\/b><SELECT NAME = \"option|$counter|\%\%PRODUCT_ID\%\%\">\n";
+         if ($in{'OptionC1d'}){$OptionC1d = " \(\+ \$$in{'OptionC1d'}\)";}
+         print NEW "<OPTION VALUE = \"$in{'OptionC1'}|$in{'OptionC1d'}\">$in{'OptionC1'}$OptionC1d\n";
+         if ($in{'OptionC2'} ne "")
+         {
+            if ($in{'OptionC2d'}){$OptionC2d = " \(\+ \$$in{'OptionC2d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC2'}|$in{'OptionC2d'}\">$in{'OptionC2'}$OptionC2d\n";
+         }
+         if ($in{'OptionC3'} ne "")
+         {
+            if ($in{'OptionC3d'}){$OptionC3d = " \(\+ \$$in{'OptionC3d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC3'}|$in{'OptionC3d'}\">$in{'OptionC3'}$OptionC3d\n";
+         }
+         if ($in{'OptionC4'} ne "")
+         {
+            if ($in{'OptionC4d'}){$OptionC4d = " \(\+ \$$in{'OptionC4d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC4'}|$in{'OptionC4d'}\">$in{'OptionC4'}$OptionC4d\n";
+         }
+         if ($in{'OptionC5'} ne "")
+         {
+            if ($in{'OptionC5d'}){$OptionC5d = " \(\+ \$$in{'OptionC5d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC5'}|$in{'OptionC5d'}\">$in{'OptionC5'}$OptionC5d\n";
+         }
+         if ($in{'OptionC6'} ne "")
+         {
+            if ($in{'OptionC6d'}){$OptionC6d = " \(\+ \$$in{'OptionC6d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC6'}|$in{'OptionC6d'}\">$in{'OptionC6'}$OptionC6d\n";
+         }
+         if ($in{'OptionC7'} ne "")
+         {
+            if ($in{'OptionC7d'}){$OptionC7d = " \(\+ \$$in{'OptionC7d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC7'}|$in{'OptionC7d'}\">$in{'OptionC7'}$OptionC7d\n";
+         }
+         if ($in{'OptionC8'} ne "")
+         {
+            if ($in{'OptionC8d'}){$OptionC8d = " \(\+ \$$in{'OptionC8d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC8'}|$in{'OptionC8d'}\">$in{'OptionC8'}$OptionC8d\n";
+         }
+         if ($in{'OptionC9'} ne "")
+         {
+            if ($in{'OptionC9d'}){$OptionC9d = " \(\+ \$$in{'OptionC9d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC9'}|$in{'OptionC9d'}\">$in{'OptionC9'}$OptionC9d\n";
+         }
+         if ($in{'OptionC10'} ne "")
+         {
+            if ($in{'OptionC10d'}){$OptionC10d = " \(\+ \$$in{'OptionC10d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC10'}|$in{'OptionC10d'}\">$in{'OptionC10'}$OptionC10d\n";
+         }
+         if ($in{'OptionC11'} ne "")
+         {
+            if ($in{'OptionC11d'}){$OptionC11d = " \(\+ \$$in{'OptionC11d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC11'}|$in{'OptionC11d'}\">$in{'OptionC11'}$OptionC11d\n";
+         }
+         if ($in{'OptionC12'} ne "")
+         {
+            if ($in{'OptionC12d'}){$OptionC12d = " \(\+ \$$in{'OptionC12d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC12'}|$in{'OptionC12d'}\">$in{'OptionC12'}$OptionC12d\n";
+         }
+         if ($in{'OptionC13'} ne "")
+         {
+            if ($in{'OptionC13d'}){$OptionC13d = " \(\+ \$$in{'OptionC13d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC13'}|$in{'OptionC13d'}\">$in{'OptionC13'}$OptionC13d\n";
+         }
+         if ($in{'OptionC14'} ne "")
+         {
+            if ($in{'OptionC14d'}){$OptionC14d = " \(\+ \$$in{'OptionC14d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC14'}|$in{'OptionC14d'}\">$in{'OptionC14'}$OptionC14d\n";
+         }
+         if ($in{'OptionC15'} ne "")
+         {
+            if ($in{'OptionC15d'}){$OptionC1d = " \(\+ \$$in{'OptionC15d'}\)";}
+            print NEW "<OPTION VALUE = \"$in{'OptionC15'}|$in{'OptionC15d'}\">$in{'OptionC15'}$OptionC15d\n";
+         }
+         $counter++;
+         print NEW "<\/SELECT><br><br>\n";
+      }
+   print NEW  "<\/font><\/td><\/tr><\/table>\n";
+   close (NEWFILE);
+$myset .= "$optfile|";
+$myset .= "$in{'OptionA'}|";
+$myset .= "$in{'OptionA1'}|";
+$myset .= "$in{'OptionA1d'}|";
+$myset .= "$in{'OptionA2'}|";
+$myset .= "$in{'OptionA2d'}|";
+$myset .= "$in{'OptionA3'}|";
+$myset .= "$in{'OptionA3d'}|";
+$myset .= "$in{'OptionA4'}|";
+$myset .= "$in{'OptionA4d'}|";
+$myset .= "$in{'OptionA5'}|";
+$myset .= "$in{'OptionA5d'}|";
+$myset .= "$in{'OptionA6'}|";
+$myset .= "$in{'OptionA6d'}|";
+$myset .= "$in{'OptionA7'}|";
+$myset .= "$in{'OptionA7d'}|";
+$myset .= "$in{'OptionA8'}|";
+$myset .= "$in{'OptionA8d'}|";
+$myset .= "$in{'OptionA9'}|";
+$myset .= "$in{'OptionA9d'}|";
+$myset .= "$in{'OptionA10'}|";
+$myset .= "$in{'OptionA10d'}|";
+$myset .= "$in{'OptionA11'}|";
+$myset .= "$in{'OptionA11d'}|";
+$myset .= "$in{'OptionA12'}|";
+$myset .= "$in{'OptionA12d'}|";
+$myset .= "$in{'OptionA13'}|";
+$myset .= "$in{'OptionA13d'}|";
+$myset .= "$in{'OptionA14'}|";
+$myset .= "$in{'OptionA14d'}|";
+$myset .= "$in{'OptionA15'}|";
+$myset .= "$in{'OptionA15d'}|";
+$myset .= "$in{'OptionB'}|";
+$myset .= "$in{'OptionB1'}|";
+$myset .= "$in{'OptionB1d'}|";
+$myset .= "$in{'OptionB2'}|";
+$myset .= "$in{'OptionB2d'}|";
+$myset .= "$in{'OptionB3'}|";
+$myset .= "$in{'OptionB3d'}|";
+$myset .= "$in{'OptionB4'}|";
+$myset .= "$in{'OptionB4d'}|";
+$myset .= "$in{'OptionB5'}|";
+$myset .= "$in{'OptionB5d'}|";
+$myset .= "$in{'OptionB6'}|";
+$myset .= "$in{'OptionB6d'}|";
+$myset .= "$in{'OptionB7'}|";
+$myset .= "$in{'OptionB7d'}|";
+$myset .= "$in{'OptionB8'}|";
+$myset .= "$in{'OptionB8d'}|";
+$myset .= "$in{'OptionB9'}|";
+$myset .= "$in{'OptionB9d'}|";
+$myset .= "$in{'OptionB10'}|";
+$myset .= "$in{'OptionB10d'}|";
+$myset .= "$in{'OptionB11'}|";
+$myset .= "$in{'OptionB11d'}|";
+$myset .= "$in{'OptionB12'}|";
+$myset .= "$in{'OptionB12d'}|";
+$myset .= "$in{'OptionB13'}|";
+$myset .= "$in{'OptionB13d'}|";
+$myset .= "$in{'OptionB14'}|";
+$myset .= "$in{'OptionB14d'}|";
+$myset .= "$in{'OptionB15'}|";
+$myset .= "$in{'OptionB15d'}|";
+$myset .= "$in{'OptionC'}|";
+$myset .= "$in{'OptionC1'}|";
+$myset .= "$in{'OptionC1d'}|";
+$myset .= "$in{'OptionC2'}|";
+$myset .= "$in{'OptionC2d'}|";
+$myset .= "$in{'OptionC3'}|";
+$myset .= "$in{'OptionC3d'}|";
+$myset .= "$in{'OptionC4'}|";
+$myset .= "$in{'OptionC4d'}|";
+$myset .= "$in{'OptionC5'}|";
+$myset .= "$in{'OptionC5d'}|";
+$myset .= "$in{'OptionC6'}|";
+$myset .= "$in{'OptionC6d'}|";
+$myset .= "$in{'OptionC7'}|";
+$myset .= "$in{'OptionC7d'}|";
+$myset .= "$in{'OptionC8'}|";
+$myset .= "$in{'OptionC8d'}|";
+$myset .= "$in{'OptionC9'}|";
+$myset .= "$in{'OptionC9d'}|";
+$myset .= "$in{'OptionC10'}|";
+$myset .= "$in{'OptionC10d'}|";
+$myset .= "$in{'OptionC11'}|";
+$myset .= "$in{'OptionC11d'}|";
+$myset .= "$in{'OptionC12'}|";
+$myset .= "$in{'OptionC12d'}|";
+$myset .= "$in{'OptionC13'}|";
+$myset .= "$in{'OptionC13d'}|";
+$myset .= "$in{'OptionC14'}|";
+$myset .= "$in{'OptionC14d'}|";
+$myset .= "$in{'OptionC15'}|";
+$myset .= "$in{'OptionC15d'}|";
+&update_option_file_settings('$optfile2',$myset);
+  &display_basic_options_screen;
+ }
+################################################################################
+sub display_basic_options_screen
+{
+local($filename)="$mgrdir/";
+print &$manager_page_header("Basic Options","","","","");
+
+
+if ($in{'sc_optfile2edit'} ne "") {
+$sc_optfile2edit = "$in{'sc_optfile2edit'}";}
+if ($sc_optfile2edit ne "") {
+$optext4="pl";
+$optfilename4="$mgrdir/options/$sc_optfile2edit.$optext4";
+  open (DATA, "$optfilename4");
+  @indata = <DATA>;
+  close (DATA);
+foreach $entries (@indata){
+    ($optfilename,$OptionA,$OptionA1,$OptionA1d,$OptionA2,$OptionA2d,$OptionA3,$OptionA3d,$OptionA4,$OptionA4d,$OptionA5,$OptionA5d,$OptionA6,$OptionA6d,$OptionA7,$OptionA7d,$OptionA8,$OptionA8d,$OptionA9,$OptionA9d,$OptionA10,$OptionA10d,$OptionA11,$OptionA11d,$OptionA12,$OptionA12d,$OptionA13,$OptionA13d,$OptionA14,$OptionA14d,$OptionA15,$OptionA15d,$OptionB,$OptionB1,$OptionB1d,$OptionB2,$OptionB2d,$OptionB3,$OptionB3d,$OptionB4,$OptionB4d,$OptionB5,$OptionB5d,$OptionB6,$OptionB6d,$OptionB7,$OptionB7d,$OptionB8,$OptionB8d,$OptionB9,$OptionB9d,$OptionB10,$OptionB10d,$OptionB11,$OptionB11d,$OptionB12,$OptionB12d,$OptionB13,$OptionB13d,$OptionB14,$OptionB14d,$OptionB15,$OptionB15d,$OptionC,$OptionC1,$OptionC1d,$OptionC2,$OptionC2d,$OptionC3,$OptionC3d,$OptionC4,$OptionC4d,$OptionC5,$OptionC5d,$OptionC6,$OptionC6d,$OptionC7,$OptionC7d,$OptionC8,$OptionC8d,$OptionC9,$OptionC9d,$OptionC10,$OptionC10d,$OptionC11,$OptionC11d,$OptionC12,$OptionC12d,$OptionC13,$OptionC13d,$OptionC14,$OptionC14d,$OptionC15,$OptionC15d) = split(/\|/, $entries);}
+}
+
+print <<ENDOFTEXT;
+<CENTER>
+<HR>
+</CENTER>
+
+<FORM ACTION="manager.cgi" METHOD="POST">
+<CENTER>
+<TABLE>
+<TR>
+<TD>
+<FONT FACE=ARIAL>Welcome to the <b>AgoraCart</b> Basic Option File Creator/Manager.  This area allows you to create the actual option files you use for your products.  You can create an option file that will contain up to 3 drop-down option boxes with up to 15 options per box.<br><br>An .HTML file will be created in the html/options subdirectory as well as a data file in the store manager's options directory so that you may be able to update a file you created with this manager at a later date.<br><br>
+<b>Tips:</b><br>
+<ul>
+<li> in Option Name, for formatting, add a : and a space afterwards.
+<li> In the pricing for each individual option, if there is no price or price increase, leave blank.
+<li> Once the option file has been created, go to the product in the database and select the option file you created from the dropdown list and save.  Repeat for every product that needs this option file.</ul>
+</TD>
+</TR>
+</TABLE>
+</CENTER>
+
+ENDOFTEXT
+
+if($in{'system_edit_success'} ne "")
+{
+print <<ENDOFTEXT;
+<CENTER><br>
+<TABLE>
+<TR>
+<TD>
+<FONT FACE=ARIAL SIZE=2 COLOR=RED>Option File has been 
+successfully updated. </FONT>
+</TD>
+</TR>
+</TABLE>
+</CENTER>
+ENDOFTEXT
+}
+
+print qq~
+<br>
+<FORM ACTION="manager.cgi" METHOD="POST">
+   <div align="center">
+   <table border="0" cellspacing="0">
+   <center>
+   <tr>
+   <td>
+   <p align="right"><b><font face="Arial" size="2">File Name:</font></b></td>
+   <td colspan="4"><b><font face="Arial" size="2"><input type="text" name="optionfilename" size="26" value="$optfilename">
+   </font>
+   </b><font color="#FF0000" size="2" face="Arial">- filename.html</font></td>
+   </tr>
+   <tr>
+   <td colspan="6"><b><font face="Arial" size="2">&nbsp;</font></b></td>
+   </tr>
+   </center>
+   <tr>
+   <td colspan="6" bgcolor="#0000ff" align=center><font face="Arial" size="2" color=white><b>Top/First Option Box - Option 1</b></font></td>
+</tr>
+   <tr>
+   <td colspan="6" align=center>
+   <p><font face="Arial" size="2"><b>Option Name:</b></font>&nbsp;&nbsp;
+ <b><font face="Arial" size="2"><input type="text" name="OptionA" size="26" value="$OptionA"></font></b>
+   </td>
+</tr>
+   <tr>
+   <td bgcolor="#E0E5FF" align=center>
+   <b>
+   <font face="Arial" size="2">Enter Option Name and Price</font></b></td>
+   <td bgcolor="#E0E5FF" align=center></td>
+   <td bgcolor="#E0E5FF" align=center>
+   <b>
+   <font face="Arial" size="2">Enter Option Name and Price</font></b></td>
+   <td bgcolor="#E0E5FF" align=center></td>
+   <td bgcolor="#E0E5FF" align=center>
+   <b>
+   <font face="Arial" size="2">Enter Option Name and Price</font></b></td>
+   </tr>
+   <tr>
+   <td>
+   <b>
+   <font face="Arial" size="2">1.<input type="text" name="OptionA1" size="17" value="$OptionA1">\$<input type="text" name="OptionA1d" size="7" value="$OptionA1d"></font></b></td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">2.<input type="text" name="OptionA2" size="17" value="$OptionA2">\$<input type="text" name="OptionA2d" size="7" value="$OptionA2d"></font></b></td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">3.<input type="text" name="OptionA3" size="17" value="$OptionA3">\$<input type="text" name="OptionA3d" size="7" value="$OptionA3d"></font></b></td>
+   </tr>
+   <tr>
+   <td>
+   <b>
+   <font face="Arial" size="2">4.<input type="text" name="OptionA4" size="17" value="$OptionA4">\$<input type="text" name="OptionA4d" size="7"  value="$OptionA4d"></font></b></td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">5.<input type="text" name="OptionA5" size="17" value="$OptionA5">\$<input type="text" name="OptionA5d" size="7" value="$OptionA5d"></font></b></td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">6.<input type="text" name="OptionA6" size="17" value="$OptionA6">\$<input type="text" name="OptionA6d" size="7" value="$OptionA6d"></font></b>
+   </td>
+   </tr>
+   <tr>
+   <td>
+   <b><font face="Arial" size="2">7.<input type="text" name="OptionA7" size="17" value="$OptionA7">\$<input type="text" name="OptionA7d" size="7" value="$OptionA7d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">8.<input type="text" name="OptionA8" size="17" value="$OptionA8">\$<input type="text" name="OptionA8d" size="7" value="$OptionA8d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">9.<input type="text" name="OptionA9" size="17" value="$OptionA9">\$<input type="text" name="OptionA9d" size="7" value="$OptionA9d"></font></b>
+   </td>
+   </tr>
+   <tr>
+   <td>
+   <b><font face="Arial" size="2">10.<input type="text" name="OptionA10" size="17" value="$OptionA10">\$<input type="text" name="OptionA10d" size="7" value="$OptionA10d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">11.<input type="text" name="OptionA11" size="17" value="$OptionA11">\$<input type="text" name="OptionA11d" size="7" value="$OptionA11d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">12.<input type="text" name="OptionA12" size="17" value="$OptionA12">\$<input type="text" name="OptionA12d" size="7" value="$OptionA12d"></font></b>
+   </td>
+   </tr>
+   <tr>
+   <td>
+   <b><font face="Arial" size="2">13.<input type="text" name="OptionA13" size="17" value="$OptionA13">\$<input type="text" name="OptionA13d" size="7" value="$OptionA13d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">14.<input type="text" name="OptionA14" size="17" value="$OptionA14">\$<input type="text" name="OptionA14d" size="7" value="$OptionA14d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">15.<input type="text" name="OptionA15" size="17" value="$OptionA15">\$<input type="text" name="OptionA15d" size="7" value="$OptionA15d"></font></b>
+   </td>
+   </tr>
+  <tr>
+   <td colspan="6"><b><font face="Arial" size="2">&nbsp;</font></b></td>
+   </tr>
+   </center>
+   <tr>
+   <td colspan="6" bgcolor="#0000ff" align=center><font face="Arial" size="2" color=white><b>Middle/Second Option Box - Option 2</b></font></td>
+</tr>
+   <tr>
+   <td colspan="6" align=center>
+   <p><font face="Arial" size="2"><b>Option Name:</b></font>&nbsp;&nbsp;
+ <b><font face="Arial" size="2"><input type="text" name="OptionB" size="26" value="$OptionB"></font></b>
+   </td>
+</tr>
+   <tr>
+   <td bgcolor="#E0E5FF" align=center>
+   <b>
+   <font face="Arial" size="2">Enter Option Name and Price</font></b></td>
+   <td bgcolor="#E0E5FF" align=center></td>
+   <td bgcolor="#E0E5FF" align=center>
+   <b>
+   <font face="Arial" size="2">Enter Option Name and Price</font></b></td>
+   <td bgcolor="#E0E5FF" align=center></td>
+   <td bgcolor="#E0E5FF" align=center>
+   <b>
+   <font face="Arial" size="2">Enter Option Name and Price</font></b></td>
+   </tr>
+   <tr>
+   <td>
+   <b>
+   <font face="Arial" size="2">1.<input type="text" name="OptionB1" size="17" value="$OptionB1">\$<input type="text" name="OptionB1d" size="7" value="$OptionB1d"></font></b></td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">2.<input type="text" name="OptionB2" size="17" value="$OptionB2">\$<input type="text" name="OptionB2d" size="7" value="$OptionB2d"></font></b></td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">3.<input type="text" name="OptionB3" size="17" value="$OptionB3">\$<input type="text" name="OptionB3d" size="7" value="$OptionB3d"></font></b></td>
+   </tr>
+   <tr>
+   <td>
+   <b>
+   <font face="Arial" size="2">4.<input type="text" name="OptionB4" size="17" value="$OptionB4">\$<input type="text" name="OptionB4d" size="7" value="$OptionB4d"></font></b></td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">5.<input type="text" name="OptionB5" size="17" value="$OptionB5">\$<input type="text" name="OptionB5d" size="7" value="$OptionB5d"></font></b></td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">6.<input type="text" name="OptionB6" size="17" value="$OptionB6">\$<input type="text" name="OptionB6d" size="7" value="$OptionB6d"></font></b>
+   </td>
+   </tr>
+   <tr>
+   <td>
+   <b><font face="Arial" size="2">7.<input type="text" name="OptionB7" size="17" value="$OptionB7">\$<input type="text" name="OptionB7d" size="7" value="$OptionB7d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">8.<input type="text" name="OptionB8" size="17" value="$OptionB8">\$<input type="text" name="OptionB8d" size="7" value="$OptionB8d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">9.<input type="text" name="OptionB9" size="17" value="$OptionB9">\$<input type="text" name="OptionB9d" size="7" value="$OptionB9d"></font></b>
+   </td>
+   </tr>
+  <tr>
+   <td>
+   <b><font face="Arial" size="2">10.<input type="text" name="OptionB10" size="17" value="$OptionB10">\$<input type="text" name="OptionB10d" size="7" value="$OptionB10d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">11.<input type="text" name="OptionB11" size="17" value="$OptionB11">\$<input type="text" name="OptionB11d" size="7" value="$OptionB11d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">12.<input type="text" name="OptionB12" size="17" value="$OptionB12">\$<input type="text" name="OptionB12d" size="7" value="$OptionB12d"></font></b>
+   </td>
+   </tr>
+  <tr>
+   <td>
+   <b><font face="Arial" size="2">13.<input type="text" name="OptionB13" size="17" value="$OptionB13">\$<input type="text" name="OptionB13d" size="7" value="$OptionB13d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">14.<input type="text" name="OptionB14" size="17" value="$OptionB14">\$<input type="text" name="OptionB14d" size="7" value="$OptionB14d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">15.<input type="text" name="OptionB15" size="17" value="$OptionB15">\$<input type="text" name="OptionB15d" size="7" value="$OptionB15d"></font></b>
+   </td>
+   </tr>
+
+   <tr>
+   <td colspan="6"><b><font face="Arial" size="2">&nbsp;</font></b></td>
+   </tr>
+   </center>
+   <tr>
+   <td colspan="6" bgcolor="#0000ff" align=center><font face="Arial" size="2" color=white><b>Bottom/Third Option Box - Option 3</b></font></td>
+</tr>
+   <tr>
+   <td colspan="6" align=center>
+   <p><font face="Arial" size="2"><b>Option Name:</b></font>&nbsp;&nbsp;
+ <b><font face="Arial" size="2"><input type="text" name="OptionC" size="26" value="$OptionC"></font></b>
+   </td>
+</tr>
+   <tr>
+   <td bgcolor="#E0E5FF" align=center>
+   <b>
+   <font face="Arial" size="2">Enter Option Name and Price</font></b></td>
+   <td bgcolor="#E0E5FF" align=center></td>
+   <td bgcolor="#E0E5FF" align=center>
+   <b>
+   <font face="Arial" size="2">Enter Option Name and Price</font></b></td>
+   <td bgcolor="#E0E5FF" align=center></td>
+   <td bgcolor="#E0E5FF" align=center>
+   <b>
+   <font face="Arial" size="2">Enter Option Name and Price</font></b></td>
+   </tr>
+  <tr>
+   <td>
+   <b>
+   <font face="Arial" size="2">1.<input type="text" name="OptionC1" size="17" value="$OptionC1">\$<input type="text" name="OptionC1d" size="7" value="$OptionC1d"></font></b></td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">2.<input type="text" name="OptionC2" size="17" value="$OptionC2">\$<input type="text" name="OptionC2d" size="7" value="$OptionC2d"></font></b></td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">3.<input type="text" name="OptionC3" size="17" value="$OptionC3">\$<input type="text" name="OptionC3d" size="7" value="$OptionC3d"></font></b></td>
+   </tr>
+   <tr>
+   <td>
+   <b>
+   <font face="Arial" size="2">4.<input type="text" name="OptionC4" size="17" value="$OptionC4">\$<input type="text" name="OptionC4d" size="7" value="$OptionC4d"></font></b></td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">5.<input type="text" name="OptionC5" size="17" value="$OptionC5">\$<input type="text" name="OptionC5d" size="7" value="$OptionC5d"></font></b></td>
+   <td></td>
+   <td>
+   <b>
+   <font face="Arial" size="2">6.<input type="text" name="OptionC6" size="17" value="$OptionC6">\$<input type="text" name="OptionC6d" size="7" value="$OptionC6d"></font></b>
+   </td>
+   </tr>
+   <tr>
+   <td>
+   <b><font face="Arial" size="2">7.<input type="text" name="OptionC7" size="17" value="$OptionC7">\$<input type="text" name="OptionC7d" size="7" value="$OptionC7d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">8.<input type="text" name="OptionC8" size="17" value="$OptionC8">\$<input type="text" name="OptionC8d" size="7" value="$OptionC8d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">9.<input type="text" name="OptionC9" size="17" value="$OptionC9">\$<input type="text" name="OptionC9d" size="7" value="$OptionC9d"></font></b>
+   </td>
+   </tr>
+ <tr>
+   <td>
+   <b><font face="Arial" size="2">10.<input type="text" name="OptionC10" size="17" value="$OptionC10">\$<input type="text" name="OptionC10d" size="7" value="$OptionC10d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">11.<input type="text" name="OptionC11" size="17" value="$OptionC11">\$<input type="text" name="OptionC11d" size="7" value="$OptionC11d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">12.<input type="text" name="OptionC12" size="17" value="$OptionC12">\$<input type="text" name="OptionC12d" size="7" value="$OptionC12d"></font></b>
+   </td>
+   </tr>
+ <tr>
+   <td>
+   <b><font face="Arial" size="2">13.<input type="text" name="OptionC13" size="17" value="$OptionC13">\$<input type="text" name="OptionC13d" size="7" value="$OptionC13d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">14.<input type="text" name="OptionC14" size="17" value="$OptionC14">\$<input type="text" name="OptionC14d" size="7" value="$OptionC14d"></font></b>
+   </td>
+   <td></td>
+   <td>
+   <b><font face="Arial" size="2">15.<input type="text" name="OptionC15" size="17" value="$OptionC15">\$<input type="text" name="OptionC15d" size="7" value="$OptionC15d"></font></b>
+   </td>
+   </tr>
+   </table>
+
+   </div>
+   <p align="center">&nbsp;</p>
+   <p align="center"><font face="Arial"><INPUT TYPE="HIDDEN" NAME="system_edit_success" value="yes">
+<INPUT NAME="BasicOptionsSettings" TYPE="SUBMIT" value="Submit">
+&nbsp;&nbsp;
+<INPUT TYPE="RESET" value="Reset"></font></p>
+   </form>
+~;
+
+print &$manager_page_footer;
+}
+#######################################################################################
+sub display_options_screen
+{
+&ReadParse;
+print &$manager_page_header("Basic Options","","","","");
+$sc_optfile2edit = '';
+$optlist = '';
+$optlist = "<OPTION VALUE=''>Create New Option File</OPTION>\n";
+
+   opendir(OPTDIR,"$mgrdir/options")||die("Cannot open Directory!");
+   @optnames2 = readdir(OPTDIR);
+   for $optnames2(@optnames2)
+   {
+      $optname2 = (split (/\./, $optnames2))[0];
+      $opt_extension2 = (split (/\./, $optnames2))[1];
+       if ($opt_extension2 eq "pl")      {
+  $optlist .= "<OPTION VALUE='$optname2'>$optname2</OPTION>\n";}
+   }
+   close (OPTDIR);
+
+print qq~
+<FORM ACTION="manager.cgi" METHOD="POST">
+   <div align="center">
+   <table border="0" cellspacing="0" width=500>
+   <tr>
+   <td>
+<b><font face="Arial" size="2">Select file you wish to edit:<br>
+<SELECT NAME='sc_optfile2edit'>$optlist</SELECT>
+   </font>
+   </b>
+  <br><br>
+   </td>
+   </tr>
+   </table>
+<br>
+   <p align="center"><font face="Arial">
+<INPUT NAME="EditOptionsFile" TYPE="SUBMIT" value="Submit"></font></p>
+   </div> </form>
+
+~;
+
+print &$manager_page_footer;
+}
+#######################################################################################
+sub update_option_file_settings {
+  local($item,$stuff) = @_;
+  $option_file_settings{$item} = $stuff;
+local($opt_settings) = "$mgrdir/options/$optfile2.pl";
+  local($item,$zitem);
+
+  &get_file_lock("$opt_settings.lockfile");
+  open(OPTFILE,">$opt_settings") || &my_die("Can't Open $opt_settings");
+  foreach $zitem (sort(keys %option_file_settings)) {
+    $item = $zitem;
+     print (OPTFILE $option_file_settings{$zitem});
+   }
+  close(OPTFILE);
+  &release_file_lock("$opt_settings.lockfile");
+ }
+#######################################################################################
+1; # Library
diff -aruN 5.0.000.src/protected/buySAFE-ext_lib.pl 5.2.000.src/protected/buySAFE-ext_lib.pl
--- 5.0.000.src/protected/buySAFE-ext_lib.pl	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/buySAFE-ext_lib.pl	2008-01-23 17:46:37.000000000 -0600
@@ -0,0 +1,362 @@
+# file ./store/protected/buySAFE-ext_lib.pl
+#########################################################################
+#
+# Copyright (c) 2002 to Date K-Factor Technologies, Inc.
+# http://www.k-factor.net/  and  http://www.AgoraCart.com/
+# All Rights Reserved.
+#
+# Use with permission only with AgoraCart, AgoraCartPro, AgoraSQL, AgoraCartSQL, 
+# or AgoraSuite
+#
+# 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 shall
+# not disclose such Confidential Information and shall use it only in
+# conjunction with the AgoraCart (aka agora.cgi) shopping cart.
+#
+# Requires AgoraCart version 5.0.0 or above.  Just place this file in the protected directory.
+#
+# 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 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.
+#
+# Hosting Companies and other software integrators are encouraged to integrate additional
+# features and add-ons in their AgoraCart offerings, but must receive written permission from from
+# K-Factor Technologies, Inc. in order to distribute this add-on to AgoraCart (aka Agora.cgi).
+#
+##########################################################################
+$versions{'buySAFE-ext_lib.pl'} = "5.2.001";
+
+{
+ local ($modname) = 'buySAFE';
+ &register_extension($modname,"buySAFE Manager",$versions{$modname});
+ &add_settings_choice("buySAFE Manager"," buySAFE Manager ",
+	"change_buySAFE_screen");
+ &register_menu('buySAFESettings',"write_buySAFE_settings",
+	$modname,"Write Best Sellers Settings");
+ &register_menu('change_buySAFE_screen',"display_buySAFE_screen",
+	$modname,"Display buySAFE Settings");
+ &add_merchtools_settings_choice("buySAFE","buySAFE Bonding",
+  "change_buySAFE_screen");
+   &register_menu('buysafecanceltrigger',"select_cancel_buysafe_bond_screen",
+  $modname,"buysafecanceltrigger")
+   &register_menu('CancelBuySafeBond',"cancel_individual_buysafe_bond",
+  $modname,"Cancel an Individual buySAFE Bond");
+}
+#######################################################################################
+sub write_buySAFE_settings {
+ my ($myset)="";
+
+$sc_buySafe_is_enabled = "$in{'sc_buySafe_is_enabled'}";
+$myset .= "\$sc_buySafe_is_enabled = qq|$in{'sc_buySafe_is_enabled'}|;\n";
+$myset .= "\$sc_buysafe_VERSION = '600';\n";
+$myset .= "\$sc_buysafe_USERNAME = qq|agora|;\n";
+$myset .= "\$sc_buysafe_PASSWORD = qq|7F2FBE0D-4245-48BC-9F6B-7B4BEFC48B6C|;\n";
+$myset .= "\$sc_buysafe_STORE_TOKEN = qq|$in{'sc_buysafe_STORE_TOKEN'}|;\n";
+$myset .= "\$sc_buysafe_SEAL_DATA = qq|$in{'sc_buysafe_SEAL_DATA'}|;\n";
+$myset .= "\$sc_buysafe_URL = qq|https://api.buysafe.com/buysafews/CheckoutAPI.dll|;\n";
+# buysafe sandbox
+#$myset .= "\$sc_buysafe_URL = qq|https://sbws.buysafe.com/BuysafeWS/CheckoutAPI.dll|;\n";
+
+my $temp = &str_encode($in{'sc_buysafe_SEAL_DATA'});
+
+$sc_buysafe_merchant_seal_complete_button_string = qq|
+<span id="BuySafeSealSpan"><script type="text/javascript">WriteBuySafeSeal('BuySafeSealSpan', 'Small', "HASH=$temp");</script></span>
+|;
+$myset .= "\$sc_buysafe_merchant_seal_complete_button_string = q|$sc_buysafe_merchant_seal_complete_button_string|;\n";
+
+# $sc_buysafe_SERVER = "api.buysafe.com";
+
+&update_store_settings('BUYSAFE',$myset);
+&display_buySAFE_screen;
+ }
+################################################################################
+sub display_buySAFE_screen
+{
+print &$manager_page_header("buySAFE Settings","","","","");
+
+if ($sc_buySafe_is_enabled eq "") {
+    $sc_buySafe_is_enabled = "no";
+}
+
+print <<ENDOFTEXT;
+<form action="manager.cgi" method="POST">
+<center>
+<hr width="580" />
+<table width="580">
+<tr>
+<td width="580"><font face="arial,helvetica" size=2>
+Welcome to the <b>AgoraCart</b> BuySAFE Manager.<br /><br />
+
+<b>AgoraCart and buySAFE</b> - the leading trust and safety company for e-commerce transactions - recently joined forces to enable AgoraCart merchants to display the buySAFE trust solution on their websites!<br /><br />
+
+<b>Turn More Shoppers into Buyers with buySAFE</b><br />
+buySAFE provides the Internets only explicit third-party endorsement of a merchants reliability and trustworthiness backed by a willingness to back the transaction with a bond guarantee. buySAFE Merchants benefit from the increase in shopper thrust this through greater conversion of shoppers to buyers, which means more revenue  and profits.<br /><br />
+
+<b>With buySAFE, you can expect:</b>
+<ul><li>Increased website conversion rates  6.7% average increase</li>
+<li>More repeat buyers  4.3% more likely to buy again and again</li>
+<li>Greater profits  more carts started and fewer carts abandoned add up to more profits for you! </li></ul><br /><br />
+
+<b>Best of all, buySAFE is FREE for AgoraCart merchants</b>  there are no hidden fees, no risk, and no long-term commitments!<br /><br />
+
+<b>Learn More about buySAFE!</b> Visit <a href="http://www.AgoraCart.com/buySAFE.html" target="_blank">www.AgoraCart.com/buySAFE.html</a><br /><br />
+
+<b>How does buySAFE work?</b><br />
+Approved buySAFE merchants display the buySAFE Seal on their websitesthe only seal that explicitly certifies that an online merchant is reliable and trustworthy. The buySAFE bond guarantee at checkout, provides shoppers with the option to fully guarantee their online purchase with a buySAFE bond. Together, this powerful combination makes shoppers feel safer and more confident and, therefore, more likely to buy from you. <br /><br />
+<b>
+Get Started Now!</b><br />
+Here are the simple steps to enable buySAFE in your AgoraCart store:<br />
+<blockquote><b>1.</b> visit <a href="http://www.agoracart.com/buySAFE.html" target="_blank">www.AgoraCart.com/buySAFE.html</a> to learn more about the program and apply for buySAFE.<br />
+<b>2.</b> from buySAFE.com, click apply now and complete the short application to become a buysafe merchant.<br />
+<b>3.</b> login to your buySAFE merchant dashboard, and complete the store setup process.<br />
+<b>4.</b> under test store, click no under is the button present? and you will see your seal authentication and store authentication data.<br />
+<b>5.</b> copy and paste the seal and store authentication data into the matching fields on this page (below) and click submit.<br />
+<b>6.</b> last, choose a prominent location for the buySAFE seal in your store using the field at the bottom of this page (we recommend above the fold!)</blockquote><br />
+
+Once you complete these steps, youll be set up to start turning more shoppers into buyers with buySAFE! <a href="http://www.AgoraCart.com/buySAFE.html" target="_blank">Clicking Here - special for AgoraCart users</a>.<br /></font></td>
+</tr>
+</table>
+<hr width="580" />
+</center>
+
+ENDOFTEXT
+
+if($in{'system_edit_success'} ne "")
+{
+print <<ENDOFTEXT;
+<center>
+<table width="580">
+<tr>
+<td align="center">
+<font FACE=ARIAL SIZE=2 COLOR=RED>Your buySAFE Account settings been successfully updated. <br /><br /></font>
+</td>
+</tr>
+<tr>
+<td colspan="2"><hr width="580" /></td>
+</tr>
+</table>
+</center>
+ENDOFTEXT
+}
+
+print <<ENDOFTEXT;
+<font face="arial" size=2>
+<form method="POST" action="manager.cgi">
+<center>
+<table border="0" cellpadding="1" cellspacing="0" width="580">
+<tr>
+<td><font size="2" face="Arial, Helvetica, sans-serif"><b>Enable buySAFE?</b>. Select "yes" to allow your customers to insure their order from you with a surety bond from buySAFE.</font></td>
+<td><font size="2" face="Arial, Helvetica, sans-serif">
+<select name="sc_buySafe_is_enabled">
+<option>$sc_buySafe_is_enabled</option>
+<option>yes</option> 
+<option>no</option> 
+</select>
+</font></td>
+</td>
+</tr>
+<tr>
+<td colspan="2"><hr /></td>
+</tr>
+
+<tr>
+<td><font size="2" face="Arial, Helvetica, sans-serif"><b>buySAFE Store Token</b>. Enter the 35-45 character store token provided to you by buySAFE when you sign up for your buySAFE account.</font></td>
+<td><font size="2" face="Arial, Helvetica, sans-serif">
+<input name="sc_buysafe_STORE_TOKEN" type="text" size=45 maxlength="50" value="$sc_buysafe_STORE_TOKEN">
+</font></td>
+</td>
+</tr>
+<tr>
+<td colspan="2"><hr /></td>
+</tr>
+
+<tr>
+<td><font size="2" face="Arial, Helvetica, sans-serif"><b>buySAFE Merchant Seal</b>. Enter the Seal Hash provided to you by buySAFE when you sign up for your buySAFE account.</font></td>
+<td><font size="2" face="Arial, Helvetica, sans-serif">
+<input name="sc_buysafe_SEAL_DATA" type="text" size=45 maxlength="150" value="$sc_buysafe_SEAL_DATA">
+</font></td>
+</td>
+</tr>
+<tr>
+<td colspan="2"><hr /></td>
+</tr>
+
+<TR>
+<TD COLSPAN=2>
+<CENTER>
+<INPUT TYPE="HIDDEN" NAME="system_edit_success" VALUE="yes">
+<INPUT NAME="buySAFESettings" TYPE="SUBMIT" VALUE="Submit">
+&nbsp;&nbsp;
+<INPUT TYPE="RESET" VALUE="Reset">
+</CENTER>
+</TD>
+</TR>
+
+<tr>
+<td colspan="2"><hr /></td>
+</tr>
+
+</table>
+
+</center>
+</form>
+
+<br/>
+<center>
+For your convenience, here is the <b>buySAFE Merchant Seal</b> pre-built to place within header/footer and/or other pages within your site.<br/><br/>NOTE: If no code appears, please hit the submit button when ready and the code will be compiled from Merchant Seal Hash listed above.<br/>Advanced users may also use the variable called: <b>\$sc_buysafe_merchant_seal_complete_button_string</b> instead, within cart pages.<br/><br/><b>Cut and paste</b> the code below for use in your website and shopping cart pages:<br/>
+<form>
+<textarea 
+name="Ecom_XCOMMENT_Special_Notes" 
+cols="55" rows="9" 
+wrap="soft">$sc_buysafe_merchant_seal_complete_button_string</textarea>
+</form>
+</center>
+
+ENDOFTEXT
+
+print &$manager_page_footer;
+}
+#######################################################################################
+sub select_cancel_buysafe_bond_screen {
+
+$in{'customerNumber'} =~ /([\w\=\+\.]+)/;
+my $inv_number = "$1";
+
+print &$manager_page_header("Cancel buySAFE Bond on order: $inv_number","","","","");
+
+print <<ENDOFTEXT;
+<form method="POST" action="manager.cgi"><br />
+<center>
+<hr width="580" /><br />
+<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></TD>
+</TR>
+</table><br /><br />
+<font face=arial size=2 color=red><b>NOTE:</b><br>Once you cancel the surety bond on this order,<br>the cancelled bond cannot be resubmitted.</font><br /><br />
+<INPUT TYPE="hidden" NAME="customerNumber" VALUE="$inv_number">
+<INPUT NAME="CancelBuySafeBond" TYPE="SUBMIT" VALUE="Cancel buySAFE Bond for Order# $inv_number ">
+<br /><br /><br /><br />
+</center>
+ENDOFTEXT
+
+print &$manager_page_footer;
+}
+#######################################################################################
+sub buysafe_sendcancelRequest($$) {
+
+
+$sc_buysafe_SOAP_Header = qq{<SOAP-ENV:Header>
+  <MerchantServiceProviderCredentials xmlns="http://ws.buysafe.com">
+    <UserName>$sc_buysafe_USERNAME</UserName>
+    <Password>$sc_buysafe_PASSWORD</Password>
+  </MerchantServiceProviderCredentials>
+  <BuySafeUserCredentials xmlns="http://ws.buysafe.com">
+    <AuthenticationTokens>
+      <string>$sc_buysafe_STORE_TOKEN</string>
+    </AuthenticationTokens>
+  </BuySafeUserCredentials>
+  <BuySafeWSHeader xmlns="http://ws.buysafe.com">
+    <Version>$sc_buysafe_VERSION</Version>
+  </BuySafeWSHeader>
+</SOAP-ENV:Header>};
+
+
+  use LWP::UserAgent;
+  my $SOAP_Method = shift || die "Missing required parameter 1, buySafe Request Type";
+  my $SOAP_Body   = shift || die "Missing required parameter 2, SOAP body data";
+  my $ua = LWP::UserAgent->new;
+  my $req = HTTP::Request->new(POST => $sc_buysafe_URL);
+  $req->content_type('text/xml');
+  $req->header(SOAPAction => "http://ws.buysafe.com/$SOAP_Method");
+  $req->content(qq{<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+$sc_buysafe_SOAP_Header
+<SOAP-ENV:Body>
+$SOAP_Body
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+});
+
+  # debug
+   print "<br><br>Request:<br>" . $req->as_string;
+   print "<br><br>Sending POST to [$sc_buysafe_URL]<br>";
+
+  my $res = $ua->request($req);
+
+  # debug
+   print "<br><br>Response:<br>" . $res->as_string;
+
+  return($res->content);
+}
+###############################################################################
+sub cancel_individual_buysafe_bond {
+
+# &ReadParse;
+ $in{'customerNumber'} =~ /([\w\=\+\.]+)/;
+ my $inv_number = "$1";
+ my $inv_thingy = $sc_domain_name_for_cookie . "-" . $inv_number;
+
+print &$manager_page_header("Cancelled buySAFE Bond on order: $inv_number","","","","");
+
+ my $BodyofCancelBond .= qq{    <SetShoppingCartCancelOrder xmlns="http://ws.buysafe.com">
+ <ShoppingCartCancelOrderRQ>
+ <ShoppingCartId>$inv_thingy</ShoppingCartId>
+ </ShoppingCartCancelOrderRQ>
+ </SetShoppingCartCancelOrder>
+}; # end of  $BodyofCancelBond
+
+            #send her off to buySafe
+            my $responseCancelBond = &buysafe_sendcancelRequest('SetShoppingCartCancelOrder', $BodyofCancelBond);
+
+           # parse results
+            use XML::Simple;
+            my $xml             = XMLin($responseCancelBond);
+            my $isSuccessful    = $xml->{'soap:Header'}->{TransactionStatus}->{isSuccessful};
+            my $CancelRS_id     = $xml->{'soap:Header'}->{TransactionStatus}->{TransactionId};
+
+if($CancelRS_id eq $inv_thingy) {
+print <<ENDOFTEXT;
+<center>
+<table width="580">
+<tr>
+<td align="center">
+<font face="arial" size="2" color="red">The buySAFE surety bond on Order# $inv_number has been successfully cancelled <br /><br /></font>
+</td>
+</tr>
+<tr>
+<td colspan="2"><hr width="580" /></td>
+</tr>
+</table>
+</center>
+ENDOFTEXT
+}
+
+print <<ENDOFTEXT;
+<center>
+<br /><br /><br />
+<a href="manager.cgi?order_log=yes"><font face="arial" size="+1">Back to New Orders Screen</font></a>
+<br /><br /><br />
+</center>
+ENDOFTEXT
+
+print &$manager_page_footer;
+}
+#######################################################################################
+1; # Library
diff -aruN 5.0.000.src/protected/cart_display-ext_lib.pl 5.2.000.src/protected/cart_display-ext_lib.pl
--- 5.0.000.src/protected/cart_display-ext_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/cart_display-ext_lib.pl	2007-12-19 23:21:17.000000000 -0600
@@ -1,11 +1,11 @@
 # file ./store/protected/cart_display-ext_lib.pl
 
-$versions{'cart_display-ext_lib.pl'} = "5.0.000";
+$versions{'cart_display-ext_lib.pl'} = "5.2.000";
 
 {
  local ($modname) = 'cart_display';
  &register_extension($modname,"Cart Display Settings",$versions{$modname});
- &add_settings_choice("Cart Display","Cart Contents - Displays/Emails",
+ &add_merchtools_settings_choice("Cart Display","Cart Contents - Displays/Emails",
   "change_cart_screen");
  &register_menu('ConfigCART',"write_cart_display_settings",
   $modname,"Write Cart Display Settings");
diff -aruN 5.0.000.src/protected/custom/index.html 5.2.000.src/protected/custom/index.html
--- 5.0.000.src/protected/custom/index.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/custom/index.html	2006-08-02 22:23:08.000000000 -0500
@@ -0,0 +1 @@
+Restricted Area
\ No newline at end of file
diff -aruN 5.0.000.src/protected/database-ext_lib.pl 5.2.000.src/protected/database-ext_lib.pl
--- 5.0.000.src/protected/database-ext_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/database-ext_lib.pl	2007-12-19 23:21:17.000000000 -0600
@@ -21,7 +21,7 @@
 # on process time for web tasks can be overcome -- it autmatically
 # reloads itself for the next group of records.  -- July 19, 2001
 
-$versions{'database-ext_lib.pl'} = "5.0.000";
+$versions{'database-ext_lib.pl'} = "5.0.001";
 
 {
  local ($modname) = 'database';
@@ -65,7 +65,7 @@
 
 }
 $mc_db_convert_per_pass = 500; # max records to convert per pass
-$mc_db_convert_seconds  = 10; # max time to plug away per pass
+$mc_db_convert_seconds  = 15; # max time to plug away per pass
 
 # mainly for delayed initializations when file locking routines are required
 &codehook("manager_database_lib_init");
@@ -241,7 +241,6 @@
    }
   print NEWFILE "$line\n";  
 }
-
 close (NEWFILE);
 $conv_result .="The $db_name database converted to $conv_type format " . 
   "in file: $datafile_conv\n";
@@ -337,9 +336,10 @@
          }
         &codehook("mgr_custom_conversion_logic_4");
        $st[$#db] .= ''; 
+       $myline = join('|',@st);
         &codehook("mgr_custom_conversion_logic_5");
        }
-&put_db_raw_line($db_name,$st[0],$myline,"no");
+     &put_db_raw_line($db_name,$st[0],$myline,"no");
      } else { 
       if ($in{'db_pos'} > 0) { 
         seek(OFILE,0,2);
@@ -444,7 +444,7 @@
  }
 
 $my_db_name_list = 
-  "Name of database to import/export:\n" .
+  "Type of database to import/export:\n" .
   "<SELECT NAME='db_name'>\n" .
   $my_db_name_list .
   "</SELECT>\n";
diff -aruN 5.0.000.src/protected/DOCS/discountdirections.html 5.2.000.src/protected/DOCS/discountdirections.html
--- 5.0.000.src/protected/DOCS/discountdirections.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/DOCS/discountdirections.html	2006-06-08 17:21:47.000000000 -0500
@@ -0,0 +1,50 @@
+<HTML>
+<HEAD>
+<TITLE>Notes on Adding a new Discount Code(s)</TITLE>
+</HEAD>
+<body onLoad="setTimeout('window.close()',55000)">
+<font face="Arial,Helvetica" size=2>
+<CENTER>
+<table border=1 CELLPADDING=1 CELLSPACING=0 WIDTH=580>
+<tr>
+<td colspan=2 align=center><b>Notes on Adding a new Discount Code</b></td>
+</tr>
+<tr>
+<td width=100><b>Discount Code:</b></td>
+<td width=480>The Discount Code can be any alpha numeric string. Is NOT case sensitive.</td>
+</tr>
+<tr>
+<td><b>Subtotal Range:</b></td>
+<td>The discount will be applied only if the subtotal falls
+	in the range entered.<br><small>Examples (10.99-25.99, 10-, -100) The first applies the discount
+	if it is between 10.99 and 25.99. The second applies it if the subtotal greater than 10 and the
+	third applies it if the subtotal is less than 100.</small></td>
+</tr>
+<tr>
+<td><b>Quantity Range:</b></td>
+<td>The discount will be applied only if the quantity ordered falls
+	in the range entered.<br><small>Examples (10-25, 10-, -100)</small></td>
+</tr>
+<tr>
+<td><b>Measured Value Range:</b></td>
+<td>The discount will be applied only if the weight or the items ordered falls
+	in the range entered.<br><small>Examples (10-25, 10-, -100)</small></td>
+</tr>
+<tr>
+<td><b>Discount:</b></td>
+<td>The Discount can be any amount in percentages or hard dollar amounts.<br>
+	<small>Examples (5%, 15.00, 20)</small></td>
+</tr>
+<tr>
+<td><b>Discount Date:</b></td>
+<td>Enter the dates the discount is valid using the date form MM/DD/YYYY.<br>
+<small>Examples (05/17/2003-05/17/2006, -01/01/2007, 12/31/2003-)</small></td>
+</tr>
+<tr>
+<td><b>Comments:</b></td>
+<td>Enter comments to remind you of the discount or promtion. Use only alpha numeric characters.</td>
+</tr>
+</table>
+</center>
+</BODY>
+</HTML>
\ No newline at end of file
diff -aruN 5.0.000.src/protected/DOCS/NETSCAPE_MSIE.txt 5.2.000.src/protected/DOCS/NETSCAPE_MSIE.txt
--- 5.0.000.src/protected/DOCS/NETSCAPE_MSIE.txt	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/DOCS/NETSCAPE_MSIE.txt	1969-12-31 18:00:00.000000000 -0600
@@ -1,31 +0,0 @@
-Why does it look fine on one browser and not another???
--------------------------------------------------------
-
-Sometimes there are real differences between browsers, one may look fine,
-the other "off" just a little.  This happens sometimes, and you will need
-to tweek the HTML a bit for different possible browsers.
-
-Sometimes, though, NETSCAPE may simply present a blank page.  It really
-isn't blank, it is just that there were so many HTML errors it gave up
-trying to display anything.  If that happens, then take a look at the page
-source in the browser.  Often, you can obviously see that the headers or
-footers do not have their complete HTML being displayed.  A table or form
-is not clodes out, etc.  Often it is a direct result of not including the
-entire code in the .inc file.
-
-This is one reason the <h3>--cut here--<\/h3> tokens have been
-implemented.  instead of cutting up your HTML files after editing them
-with an HTML editor, you may place that token just above and below what
-you believe to be the start and end of the code you desire agora.cgi to
-use.  There is an example of how to do this in the DOC/options_files.txt
-document.  Currently, for header, footer, productPage.inc and options
-files have this is implemented.  
-
-If you observe your code behaving strangely dpending on the browser, you
-may just need to adjust the locations of the <h3>--cut here--<\/h3>
-tokens.  Make sure you close out all tables and forms, HTML needs
-beginning and ending tags!  If there is a <TABLE> tag, there must also be
-a </TABLE> tag to close it out. 
-
-Good Luck!
-
diff -aruN 5.0.000.src/protected/featured_product-ext_lib.pl 5.2.000.src/protected/featured_product-ext_lib.pl
--- 5.0.000.src/protected/featured_product-ext_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/featured_product-ext_lib.pl	2007-12-19 23:21:18.000000000 -0600
@@ -38,15 +38,15 @@
 # K-Factor Technologies, Inc. in order to distribute this add-on to AgoraCart (aka Agora.cgi).
 #
 ##########################################################################
-$versions{'featured_product-ext_lib.pl'} = "5.0.000";
+$versions{'featured_product-ext_lib.pl'} = "5.2.000";
 
 $mc_featuredProductPath="$mgrdir/misc/featuredproduct.pl";
 
 {
  local ($modname) = 'featured_product';
  &register_extension($modname,"Featured Product Manager",$versions{$modname});
- &add_settings_choice("Featured Product Manager"," Featured Product Manager ",
-	"change_featuredproduct_screen");
+# &add_settings_choice("Featured Product Manager"," Featured Product Manager ",
+#	"change_featuredproduct_screen");
  &register_menu('FeaturedProductSettings',"write_featuredproduct_settings",
 	$modname,"Write Featured Product Settings");
  &register_menu('change_featuredproduct_screen',"display_featuredproduct_screen",
@@ -61,9 +61,9 @@
 
 if (($in{'OptionA1'} ne "") && ($in{'OptionA1t'} ne "") && ($in{'OptionA1n'} ne "") && 
 	  ($in{'OptionA1p'} ne "") && ($in{'OptionA1d'} ne "")) {
-$sc_featuredProduct = qq~<div align=center><a class=$style href="$sc_store_url?cart_id=%%cart_id%%&amp;p_id=$in{'OptionA1'}&amp;xm=on">
-                         <img class="template_image_no_border" src="%%URLofImages%%/$in{'OptionA1t'}" alt="featured product" /></a><br /><br />\n~;
-$sc_featuredProduct .= qq~<a class=$style href="$sc_store_url?cart_id=%%cart_id%%&amp;p_id=$in{'OptionA1'}&amp;xm=on"><b>$in{'OptionA1n'}</b></a><br />\n~;
+$sc_featuredProduct = qq|<div align=center><a class=$style href="$sc_store_url?cart_id=%%cart_id%%&amp;p_id=$in{'OptionA1'}&amp;xm=on">
+                         <img class="template_image_no_border" src="%%URLofImages%%/$in{'OptionA1t'}" alt="featured product" /></a><br /><br />\n|;
+$sc_featuredProduct .= qq|<a class=$style href="$sc_store_url?cart_id=%%cart_id%%&amp;p_id=$in{'OptionA1'}&amp;xm=on"><b>$in{'OptionA1n'}</b></a><br />\n|;
 $p1 = $in{'OptionA1p'};
 $p2 = &format_pricemgr($p1);
 $sc_featuredProduct .= qq~$in{'OptionA1d'}<br />\n~;
@@ -71,14 +71,14 @@
 
 my $temp_SSL = $sc_ssl_location_url2;
 $temp_SSL =~ s/agora\.cgi//i;
-$sc_featuredProduct_secure = qq~<div align=center><a class=$style href="$sc_store_url?cart_id=%%cart_id%%&amp;p_id=$in{'OptionA1'}&amp;xm=on">
-     <img class="template_image_no_border" src="$temp_SSL%%URLofImages%%/$in{'OptionA1t'}" alt="featured product" /></a><br /><br />\n~;
-$sc_featuredProduct_secure .= qq~<a class=$style href="$sc_store_url?cart_id=%%cart_id%%&amp;p_id=$in{'OptionA1'}&amp;xm=on"><b>$in{'OptionA1n'}</b></a><br />\n~;
-$sc_featuredProduct_secure .= qq~$in{'OptionA1d'}<br />\n~;
-$sc_featuredProduct_secure .= qq~<font class=ac_product_price>%%sc_money_symbol%% $p2</font></div>\n~;
+$sc_featuredProduct_secure = qq|<div align=center><a class=$style href="$sc_store_url?cart_id=%%cart_id%%&amp;p_id=$in{'OptionA1'}&amp;xm=on">
+     <img class="template_image_no_border" src="$temp_SSL%%URLofImages%%/$in{'OptionA1t'}" alt="featured product" /></a><br /><br />\n|;
+$sc_featuredProduct_secure .= qq|<a class=$style href="$sc_store_url?cart_id=%%cart_id%%&amp;p_id=$in{'OptionA1'}&amp;xm=on"><b>$in{'OptionA1n'}</b></a><br />\n|;
+$sc_featuredProduct_secure .= qq|$in{'OptionA1d'}<br />\n|;
+$sc_featuredProduct_secure .= qq|<font class=ac_product_price>%%sc_money_symbol%% $p2</font></div>\n|;
 }
 
-$myset .= "\$sc_featuredProduct = qq~$sc_featuredProduct~;\n";
+$myset .= "\$sc_featuredProduct = qq|$sc_featuredProduct|;\n";
 $myset .= "\$sc_featuredProduct_secure = qq|$sc_featuredProduct_secure|;\n";
 $myset .= "\$sc_displayFeaturedProducts = \"$in{'sc_displayFeaturedProducts'}\";\n";
 $sc_displayFeaturedProducts = $in{'sc_displayFeaturedProducts'};
diff -aruN 5.0.000.src/protected/files/8mdXTYsr.login 5.2.000.src/protected/files/8mdXTYsr.login
--- 5.0.000.src/protected/files/8mdXTYsr.login	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/files/8mdXTYsr.login	1969-12-31 18:00:00.000000000 -0600
@@ -1,7 +0,0 @@
-$ok_ip="63.98.126.82"; 1;
-$mc_manager_name = 'mister.ed';
-$username = 'mister.ed';
-eval("&multi_mgr_set_privs('mister.ed');");
-#
-#MANAGER:mister.ed
-1; # Library
diff -aruN 5.0.000.src/protected/htacess 5.2.000.src/protected/htacess
--- 5.0.000.src/protected/htacess	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/htacess	1969-12-31 18:00:00.000000000 -0600
@@ -1,9 +0,0 @@
-
-AuthType Basic
-
-AuthName "Agora Cart Admin"
-
-AuthUserFile "/home/agoracgi/.htpasswds/storepro5/protected/passwd"
-
-
-require valid-user
diff -aruN 5.0.000.src/protected/images/buysafe1.gif 5.2.000.src/protected/images/buysafe1.gif
--- 5.0.000.src/protected/images/buysafe1.gif	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/images/buysafe1.gif	2007-03-16 00:24:23.000000000 -0500
@@ -0,0 +1,5 @@
+GIF89az "   
+ͯϻßѐ$$)*//po44`~_}p{9oz9Pq`p>_p?PfD@dOeD?c?ZI@[I1X}0W|/V|0PN/POIr Jr ESET=h<g;Y:Y 0^   ! > ,    z "  wȤrl2pJZTGExLFdڴzm}|~<-c-zU6|DN	X;(!!3V~FT(S9^>`>C(BG>	s)&."$H`6C6G--H 	-J圴BBC0V1pH+C>Br(7Dd& /4+)Lq
+E=['OFPɘo=1$rWf@k^Vq`J;NŋWvJH?&#$0Ř0#0eǇ)}㫨ЫY=\B,^^	*]ʴ-B(bKbŧ}qm &L9.E!2L! U2Q<~ciڳ`aBGB zstFH0ʃ4T܅ǈqo`;,0S
RLH\0	YOL-X;<'_4(f
q(N^BԀOwq?Cpą$/C;mb7/0!XCdgT)(&X B`A 88Ւ@
+A\ed86XIgCGO{B'R/rō>EG:ċlQA$W(D}9A[r)kQ9䕄p,'K
+v(\ʧ"&'- @Q1abAk"$*8RTtH\4KRQhvZ?'dC` hD 1cL@Ѓl;1 RЫ;a9D-ܓeaйԿ$\2<K=}2Sq/)Ķ$=T'8T_&0؛CT@ڎ,#`ng7хέ<%\x)9,θ&| 9P>w9A  ;
\ No newline at end of file
diff -aruN 5.0.000.src/protected/images/buysafe2.gif 5.2.000.src/protected/images/buysafe2.gif
--- 5.0.000.src/protected/images/buysafe2.gif	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/images/buysafe2.gif	2007-03-16 00:24:23.000000000 -0500
@@ -0,0 +1,11 @@
+GIF89a ? $ 3Q.E)'Wj0˫DuqhDP}0'=۷=tEZfx-.7^3 2%_br7145                                                                                 !  $ ,     ?  @pH,Ȥrl:ШtJZجvzxL.zn|N~vJ $ ""Ĩ|ӽͦ{Բ ۴}#
+
юyt 0\E un	QDчQT 0b F$B
+Fay_D
+,\DB._i*d* D2X`GH*`/	(HQ
80Wtm4YI8T"i89 cp*/b)e%4F0 /fG:Un!X:a
+V&Q"ڦ&dє a9D7z.2o>2lXyI"Bp
8h  Gkx\&3t V+yg!w<	GDp h
@84|
.C@!jmm l5ˇF)ihn<7	|% =戉x\% 
(ছPCYnz@I (hAC?f#t1- 	RJ
+DV"$ЩP=Q(
@GD 
(p/DudgJA|1 u^J+ԫnKx@JEԁkr( kD&P{Ddz[BYԂ]$븰~.K	l D
+
z +)H{
',""=k0n	`Z$PTRp0B=,LU(Ĵ'oFUR QDY.r0 #ym|зjP 8lp7<,Y=Xٔ@O {a+Ouҽ"~. | ljB
( ȯ`uDbTf"PClxp" <L4
+64"P_c07¯/b>	,/ֳz#CJ:NAa18o [a!bC5BkpMLcb·	 x*8`QQ uB,ËSQ
+Ą"XL(#+A.v17
+ 2J ̼SBk"IW*yWV"	1Tl!H@Pr(,@x;2HDK(
	y m28GtaDcFUPހL9Be t613L.d
7kRS	7KA<{+L2;_ÄkB9910
 WП+#H 5Nys- Yr4%ӅYZc"1!
 Xk]@F1Ѽ0dVQ GF<nC=vOVXFXTDV":1.iFˢpW
.bSl}N%n
+Ϣ$Pͩx
+"X@nbU %|  (5) @Hlbo(6cn3]KA@ T@ҊVl >`""u7@nT#pjyl)0֎hlAora:*2y120jz0bsb@x vn%WQCK.|KT ;
\ No newline at end of file
diff -aruN 5.0.000.src/protected/images/index.html 5.2.000.src/protected/images/index.html
--- 5.0.000.src/protected/images/index.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/images/index.html	2006-08-02 22:23:15.000000000 -0500
@@ -0,0 +1 @@
+Restricted Area
\ No newline at end of file
diff -aruN 5.0.000.src/protected/images/niftylogo1.png 5.2.000.src/protected/images/niftylogo1.png
--- 5.0.000.src/protected/images/niftylogo1.png	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/images/niftylogo1.png	2006-08-11 11:01:27.000000000 -0500
@@ -1,117 +1,107 @@
 PNG
 
-   
IHDR      <   0   sBIT|d   	pHYs  
+   
IHDR      -   oWÁ   sBIT|d   	pHYs  
   
-B4   tEXtCreation Time 07/22/060   %tEXtSoftware Macromedia Fireworks MX 2004v  
prVWx[]$U>5=kjޞݹ}0MݪuRAD%%\@!Q$(1h$1`Za|Ac"Jaszfv f
}oݟ9?߹瞪ի%^g[no[*zu{NWpvt znP-]:^Q:n`tEnENQ` %!*}C_w{}g㡅iα?}<'\gwԯpYg/~P|s~ډO>1ŗG?t7|!>ԟm_r>9;']M?8؍[<q޻d&=>ǉqkd	MFAsfWVÙbjK}15N88ozi;P~5n@At5}W&,>Gڳf+GEWUrшFFʼ(r2ՈZtp	yl8	5ҷՃ+k2V1*Ofpmcckל0H-9v;m5r(O0Av[C 6[,ܭ $ahߐY&4X%&1rmn/QF$XY,7d̵yX2IK%a~0BXS*xE	82@IgMf(
]ם3D4Z=8G
qNeT6X&^jG<9k%YpTӊ'p9'\OV׋(m.3dOQLrIkR7ѝ3)̐vK,iz[RE!]Z½,CbX{V
->z6Yϣq6=T0SP%icj9U
-]Hݱ_~[~
-lQx^T
-Ԥ0 lFM4r]p,:2"GOK[Hd%D~{RDY˙| `XOs5F$f6*#W [ח
knYCq0Mg-oab6ͭ܇p>S2q' C,tCse_1{hP0*9%pZ9|wYz\cr`%vPܝI-˕ I b4fDG\i7A2	{g,Hs(*ߑaˋE,^+W?45/REp\Vxe(X1>p8f8s]pc7oO<&!oA, v;&B^$PhwgNM]#*ERŁÂQP3K}ipf PĶy)syN
-3S.Q6+?-ِO<N<B;KŘCs9w@Nl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77Fy0@ߋL?󞕹Khi@=RJ)RJ)RJ]M;;j;  SmkBT                                                                     xi`Qqqqq!	COMlS$I$I$I$I$I$IqO9˵wOo]ss,Խu˲<^0tc}av=7_{V9z}ٿ^s_y~?}ez۶@wE՟k$I$I$I                                         @?
+0lzsA_x7췣*U}R%+C_	ڟ~I\Q~ky#_jo~DyU^`5pko?:ˮCw>?Kv:A}E:_n+{u=rq͓̳]>>d}+|L01`0leg:׺񶊝`W,3O?]\9P~[kOWiGc~)-<w.3q}'vuw$Vnv(r52S;Wk_Kϔ8B/hEՠ'9w?K;x:x<|@cϽVyc@ۖSw8Bq]=2lBe6V}eR(	VeZT4ade2ޒ+nYBTqSߔ<[&=f[|szP)G}{Zׅ3n7jpWwftEw[ǽ;`l?`0`0`{~i`oLy>uoi\qK|} 7Svu9G쯿c¾#>,jow{ՆݲL=mW2u_8دjo?kD߱mw>#}E:OۡO;<sy}ڛk}~|M'8CTo+[WUQr'\'tTYwz.D=W|~q=_ yMǏktbS=2|ұyN_}Oe摽ۏtLS6q`Cjf3#ܰ?z1H]\"W]O;2'@@~tG:{u7m1Q]PWV2Sz]ϥzs3]vxwҞ:ڗ>y`$jw  mkBT                                                                     xOYq´4L.4ri&13
+BWtR*rR@{W8gKyN[}~ЏEa?ʽA??;<p9·'tIhU2,}ڥz[FV;`(<p9.>J1Km+:[qܯϸ-	MT\#hh#r&|x=\p=ŰKa,|1IM:uig
*WvG#6MowR	fCUe4Rjޥٝr>׹-JX_%Ld-rH՘Ts[F+U3[FհՓթ:e/WrL1gnh cXFS~ͷ!]?˨ߡFZe+5Tt"N?e4zLevSLĖ9w:5Fc5GFjA~Os^Zg-cF6FP-cz_Twk9-Zgށ 
+{Is2=-7M4/^}עi-5z¿gU8HϏg@RO~oǧo69=أ:hCHwӌg-6s&e48_D3;.?>?=Z<p9ÄtK}{=                                                              ʣ+  ymkBT 6                                                                    x횉m0]HI!)$FR?6c<lHٱdtC"+RJ)RJkJ߃L_SUn7ss~uU-Uyy9c/Juz?i>>>~ sm+vuՑνYu8uN?WP>1JsWiV_uKEϸ/r_gKW]ױEYcl,[TYHT}xL#}A GV7^}>iҞ-i;}LJX&TP3T#ߨgJl e'=?͘ona|7>?ǐU%;/mN/IfQփz{<d6dn;Qm{{5$iѦxg<$"^%=RJ)Ste/֔ a};k_y?9Ԛlz}m#GKk!k(9G1z,Q&liV濊#_<3Ξm$^9g
{9&w&:˙uf֚R:ֽL+mWW^z%I2loZf?k4W-#	?V/c^!!{u̵ʴUٷAGe>G}?v✽3X~j{zTAO^ʰ>?sy|G)P</11~2ў׆R/7 Ӿsmsr"(2cϹ;~u-)}<U1g:apb5{3(k!m'mʞ2.~[)}GκbXELpaԃ77Fy0@ߋL?󞕹Khi@=RJ)RJ)RJ]M;;j;  SmkBT                                                                     xi`Qqqqq!	COMlS$I$I$I$I$I$IqO9˵wOo]ss,Խu˲<^0tc}av=7_{V9z}ٿ^s_y~?}ez۶@wE՟k$I$I$I                                         @?
 R*f  *mkBT                                                                    x}+(H,"H$"#X$,QԈZs>U{	..T}6 ڳ-F`p]k ߅~b
 
 О$wݓٱ|sCo A+q3lOx@(0a+?	T,_7s\Ϙ^Bl1)C+k(FyN"8dPC_9>O0&l4Im+nwGrŰ<Qq		+H}eq~~[).5c6,muO9p\<//?N:Mp) Ĝ-2p'uKq`_/64<~ 77SNBQ맨uM{5%.BNɊk:	kNm9*uU|2%;]Faג)RE%HWc0Mg>)/tihf	ѸX>E)<,6s45zb?J\<OM%O#(76:=	ӋYAH
Ls6MXBcX&ǘJte.	3.je(?<?-1$pO= x	]<Jt¡Vg`|I,<丕}FQj]o%[Pa6XY<?Yoh F067ၭ6JFG[wv)7?,@w
@@ -147,93 +137,77 @@
 ]>4gb
 s	2WRsKg6
's8qzTT[R[w )I95xWj
#!nN+zPڔ	KgTE,?{^RDݥ=Ru^zîc&D'i74SJߔ&HUG[crͦ<׿~4}څh;lpAZ%XZ;tQ?yk1+Ƴu6[Dc4Ɯ*dB#!}e>samhG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B(;4cZ(!CCQ׋IE]S%͎7nR8ģP:@`Rm{	$i`0ИF+OWI+62
"T<]Q.u0o/=cPZsi2Cm)呲Ե"LД%jX8MYf(z-N;MY'cakgkƦh0G:pl&HaXE.2$%uBl!-C	AUqMH?n1l0k䣃Kک0Xs&h*}Q
+׌Q#N%F)#h$1;IE	BlbP|<\3I(cR@|P3)2L=0-vAI>:'LR-6)7K6A[
̛KZ# @!	tkj9G
+I_Ǆݼc|A#	C1f
+$uB04RǀN׉H(>B
$2aF!\H2>BH1i>R+4~;}Z+0%_0.,?tT 0N.xa> 4=zm	¹эvhfIZ"ÕRQΣ´?<5cS1    IENDB`
\ No newline at end of file
diff -aruN 5.0.000.src/protected/index.html 5.2.000.src/protected/index.html
--- 5.0.000.src/protected/index.html	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/index.html	2008-01-28 14:34:39.000000000 -0600
@@ -1 +1,8 @@
-Restricted Area
\ No newline at end of file
+<html>
+<head>
+<meta http-equiv="refresh" content="1;url=manager.cgi">
+</head>
+<body onload="window.location = 'manager.cgi';">
+If you do not get redirected to the manager interface, please click <a href='manager.cgi'>here</a>.
+</body>
+</html>
diff -aruN 5.0.000.src/protected/main_settings-ext_lib.pl 5.2.000.src/protected/main_settings-ext_lib.pl
--- 5.0.000.src/protected/main_settings-ext_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/main_settings-ext_lib.pl	2008-01-21 22:58:39.000000000 -0600
@@ -1,7 +1,19 @@
 # file ./store/protected/main_settings-ext_lib.pl
 
-$versions{'main_settings-ext_lib.pl'} = "5.0.000";
+$versions{'main_settings-ext_lib.pl'} = "5.2.001";
+#######################################################################################
+# Misc Variables
+      use File::Copy;
 $sc_mgrmiscmainfile = "$mgrdir/misc/mgr_miscmain.pl";
+$templates_file_dir = "html/html-templates/templates";
+$sm_templatelinks = '';
+$sm_old_templateName = '';
+$sc_buttonSetURLthingy = "./html/images/buttonsets";
+  $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">~;
+#######################################################################################
 
 {
  local ($modname) = 'main_settings';
@@ -64,33 +76,33 @@
 print &$manager_page_header("Select Payment Gateway to Edit","","","","");
 
 print <<ENDOFTEXT;
-<CENTER>
-<HR>
-</CENTER>
+<center>
+<hr />
+</center>
 
 <FORM METHOD="POST" ACTION="manager.cgi">
-<CENTER>
+<center>
 <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BORDER=0>
-<TR>
-<TD colspan=2>
-<FONT FACE=ARIAL>Welcome to the <b>AgoraCart</b> Payment Processing Gateway Editor. Here you
-will select the gateway you wish to make changes to (to set the primary gateway, use the main settings manager).</TD>
-</TR>
+<tr>
+<td colspan=2>
+<FONT FACE=ARIAL>Welcome to the <b>AgoraCart</b> Payment Processing Gateway Settings Manager. Here you
+will select the gateway you wish to change the settings (to set the primary gateway, use the main settings manager).</td>
+</tr>
 
 
-<TR>
-<TD colspan=2><font face=arial size=2><br><br><br>
-<b>Please select your the Payment Gateway you wish to edit:</b>
-<br>
-<SELECT NAME=gateway>
+<tr>
+<td colspan=2><font face=arial size=2><br /><br /><br />
+<b>Please select the Payment Gateway settings you wish to change:</b>
+<br />
+<select name=gateway>
 $mylist_of_gateway_options
-</SELECT> <INPUT NAME="SelectGatewayScreen" TYPE="SUBMIT" VALUE="Submit">
+</select> <input name="SelectGatewayScreen" TYPE="SUBMIT" value="Submit">
 </font>
-</TD>
-</TR>
+</td>
+</tr>
 
 
-</table></center><br><br><br></form>
+</table></center><br /><br /><br /></form>
 ENDOFTEXT
 print &$manager_page_footer;
 }
@@ -108,14 +120,25 @@
  }
 eval("require './admin_files/$sc_gateway_name-user_lib.pl'");
 if ($@ ne "") {
-  $msg= "<br><FONT COLOR=RED>GATEWAY USER LIB NOT FOUND!</FONT><br>\n";
+  $msg= "<br /><FONT COLOR=RED>GATEWAY USER LIB NOT FOUND!</FONT><br />\n";
  }
 
  
 &codehook("gateway_admin_screen");
 
 }
-#############################################################################################
+#######################################################################################
+sub set_css_file_path{
+  # Set the path to the style sheet
+  $i=1;
+  $mc_css_file_path = "";
+  while($i<=$sc_levels_to_root)
+  {
+    $mc_css_file_path .= "../";
+    $i++;
+  }
+}
+#######################################################################################
 sub action_input_main_settings{
 
 local($admin_email, $order_email, $cookieDomain, $cookiePath);
@@ -126,6 +149,21 @@
 local($myset2)="";
 local($myset3)="";
 
+my $buysafe_header_string = qq|
+<script src="https://sb.buysafe.com/private/rollover/rollover.js" type="text/javascript" language="javascript" charset="utf-8"></script>
+<script type="text/javascript">
+function buySAFEOnClick(WantsBond)
+{
+  document.cartForm.buySAFE.value = WantsBond;
+  document.cartForm.submit();
+}
+</script>
+|;
+
+if ($sc_buySafe_is_enabled !~ /yes/i) {
+   $buysafe_header_string = ""; 
+}
+
 &ReadParse;
 
 $cookieDomain = $in{'sc_store_url'};
@@ -187,7 +225,7 @@
 $myset .= "\$sc_temp_affiliate_call = \"$sc_temp_affiliate_call2\";\n";
 if ($in{'sc_temp_affiliate_call'} ne "") {
 $temp_affiliate_image_call = "<IMG SRC=\"" . $in{'sc_http_affiliate_call'}."://$sc_temp_affiliate_call\" border=0>";
-$myset .= "\$sc_affiliate_image_call = qq~$temp_affiliate_image_call~;\n";
+$myset .= "\$sc_affiliate_image_call = qq|$temp_affiliate_image_call|;\n";
 }
 $myset .= "\$sc_send_order_to_email = \"$in{'email_orders_yes_no'}\";\n";
 $myset .= "\$sc_second_send_order_to_email = \"$in{'second_email_orders_yes_no'}\";\n";
@@ -196,9 +234,13 @@
 $myset .= "\$sc_order_email = \"$order_email\";\n";
 $myset .= "\$sc_first_order_email = \"$first_order_email\";\n";
 $myset .= "\$sc_second_order_email = \"$order_email5\";\n";
+$myset .= "\$sc_use_customer_email_over_admin = \"$in{'sc_use_customer_email_over_admin'}\";\n";
 $myset .= "\$sc_use_dynamic_email_subjects = \"$in{'sc_use_dynamic_email_subjects'}\";\n";
 
 $myset .= "\$sc_store_url = \"$in{'sc_store_url'}\";\n";
+if ($in{'sc_ssl_location_url2'} eq '') {
+   $in{'sc_ssl_location_url2'} = "$in{'sc_store_url'}";
+} 
 $myset .= "\$sc_ssl_location_url2 = \"$in{'sc_ssl_location_url2'}\";\n";
 $myset .= "\$sc_stepone_order_script_url = \"$in{'sc_ssl_location_url2'}\";\n";
 $myset .= "\$sc_admin_email = \"$admin_email\";\n";
@@ -228,13 +270,98 @@
 $myset .= "\$sc_debug_mode = \"no\";\n";
 $mc_images_dir = "$in{'mc_images_dir'}";
 $myset2 .= "\$mc_images_dir = \"$in{'mc_images_dir'}\";\n";
+$myset2 .= "\$mc_chmod_uploaded_images = \"$in{'mc_chmod_uploaded_images'}\";\n";
+
+$sc_template_css_at_root = "$in{'sc_template_css_at_root'}";
+$myset2 .= "\$sc_template_css_at_root = \"$sc_template_css_at_root\";\n";
+
+#setting the path to the css file
+$sm_levels_to_root = $sc_levels_to_root;
+$sc_levels_to_root = "$in{'sc_levels_to_root'}";
+$myset2 .= "\$sc_levels_to_root = \"$in{'sc_levels_to_root'}\";\n";
+&set_css_file_path;
+
+$myset2 .= "\$mc_css_file_path = \"$mc_css_file_path\";\n";
+
+$sm_old_templateName = $sc_headerTemplateName;
+$sc_headerTemplateName = $in{'sc_headerTemplateName'};
+my $tempURLthingyForTemplates = "$templates_file_dir/$sc_headerTemplateName/$templatestylename";
+my $tempURLthingyForTemplates2 =  "$templates_file_dir/$sc_headerTemplateName/$templatestylename";
+
+my ($sc_headerTemplateRoot,$junk) = split (/\//, $sc_headerTemplateName);
+$myset .= "\$sc_headerTemplateName = \"$in{'sc_headerTemplateName'}\";\n";
+$myset .= "\$sc_headerTemplateRoot = \"$sc_headerTemplateRoot\";\n";
+
+$sc_buttonSetName = $in{'sc_buttonSetName'};
+$sc_buttonSetURL = "$URL_of_images_directory/buttonsets/$sc_buttonSetName";
+$myset .= "\$sc_buttonSetName = \"$in{'sc_buttonSetName'}\";\n";
+$myset .= "\$sc_buttonSetURL = \"$sc_buttonSetURL\";\n";
+$myset .= "\$sc_displayDynamicCategories = \"$in{'sc_displayDynamicCategories'}\";\n";
+$myset .= "\$sc_headerStoreTitle = \"$in{'sc_headerStoreTitle'}\";\n";
+$myset .= "\$sc_headerStoreTagLine = \"$in{'sc_headerStoreTagLine'}\";\n";
+$sc_store_header_file = "$sc_templates_dir/templates/$sc_headerTemplateRoot/store_header.html";
+$sc_store_footer_file = "$sc_templates_dir/templates/$sc_headerTemplateRoot/store_footer.html";
+$sc_secure_store_header_file = "$sc_templates_dir/templates/$sc_headerTemplateRoot/secure_store_header.html";
+$sc_secure_store_footer_file = "$sc_templates_dir/templates/$sc_headerTemplateRoot/secure_store_footer.html";
+
+$myset .= "\$sc_store_header_file = \"$sc_store_header_file\";\n";
+$myset .= "\$sc_store_footer_file = \"$sc_store_footer_file\";\n";
+$myset .= "\$sc_secure_store_header_file = \"$sc_secure_store_header_file\";\n";
+$myset .= "\$sc_secure_store_footer_file = \"$sc_secure_store_footer_file\";\n";
+
+if (($sc_headerTemplateName ne $sm_old_templateName) || ($sm_levels_to_root ne $sc_levels_to_root)) {
+
+  # copy original CSS file for template change to location needed, if at alternate location
+  # added by Mister Ed for 5.0.1 version fixes.
+  if ($sc_template_css_at_root =~ /yes/i) {
+      $tempURLthingyForTemplates2 = "$mc_css_file_path$templatestylename";
+      copy($tempURLthingyForTemplates, $tempURLthingyForTemplates2);
+  }
+  my $temp_styles_url = "$mc_css_file_path$stylename";
+  if (!(-e $temp_styles_url)  && (-e $stylename)) {
+      copy($stylename, "$temp_styles_url");
+  }
+}
+
+  # need to place all of that into the $sc_standard_head_info variable in the correct format
+   $myset .= "\$sc_standard_head_info = qq|<link rel=\"stylesheet\" type=\"text/css\" href=\"$mc_css_file_path$stylename\" media=\"screen\">\n";
+  $myset .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$tempURLthingyForTemplates2\" media=\"screen\">\n";
+  $myset .= "$mc_meta_tags_css\n";
+  $myset .= qq~$in{'mc_additional_head_info'}\n $buysafe_header_string\n|;\n~;
+
+if ($sc_ssl_location_url2 ne ''){
+  my $temp_SSL = $sc_ssl_location_url2;
+  $temp_SSL =~ s/agora\.cgi//i;
+  my $temp_SSL_CSS = $tempURLthingyForTemplates2;
+  $temp_SSL_CSS =~ s/\.\.\///g;
+  $myset .= "\$sc_secure_standard_head_info = qq|<link rel=\"stylesheet\" type=\"text/css\" href=\"$temp_SSL$stylename\" media=\"screen\">\n";
+  $myset .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$temp_SSL$temp_SSL_CSS\" media=\"screen\">\n";
+  $myset .= "$mc_meta_tags_css\n";
+  $myset .= qq~$in{'mc_additional_head_info'}\n $buysafe_header_string\n|;\n~;
+  $in{'mc_additional_head_info'} = &my_escape($in{'mc_additional_head_info'});
+  $myset2 .= "\$mc_additional_head_info = qq|$in{'mc_additional_head_info'}|;\n";
+} else {
+  $myset .= "\$sc_secure_standard_head_info = qq|<link rel=\"stylesheet\" type=\"text/css\" href=\"$mc_css_file_path$stylename\" media=\"screen\">\n";
+  $myset .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$tempURLthingyForTemplates2\" media=\"screen\">\n";
+  $myset .= "$mc_meta_tags_css\n";
+  $myset .= qq~$in{'mc_additional_head_info'}\n $buysafe_header_string \n|;\n~;
+  $in{'mc_additional_head_info'} = &my_escape($in{'mc_additional_head_info'});
+  $myset2 .= "\$mc_additional_head_info = qq|$in{'mc_additional_head_info'}|;\n";
+}
+
+
+  #DOCTYPE
+  $myset .= "\$sc_doctype =  qq|$mc_doctype|;\n";
+
 &codehook("other_program_settings");
 if ($other_program_settings ne "") {
   $myset .= "$other_program_settings\n";
  }
 
 $myset2 .= "\$mgr_shall_i_log_accesses = \"$in{'sc_shall_i_log_accesses'}\";\n";
+$myset2 .= "1;";
 $myset3 .= "\$sc_shall_i_log_accesses = \"$in{'sc_shall_i_log_accesses'}\";\n";
+$myset3 .= "1;";
 
 &update_store_settings('MAIN',$myset); # main settings
 &save_userlog_settings($myset3); # userlog settings
@@ -246,35 +373,68 @@
 
 print &$manager_page_header("Main Store Settings","","","","");
 
+&require_supporting_libraries(__FILE__,__LINE__,
+  "$mgrdir/misc/mgr_miscmain.pl");
+
+    opendir (TEMPLATES, "$templates_file_dir"); 
+    @myfiles = readdir(TEMPLATES); 
+    closedir (TEMPLATES);
+    foreach $zfile (@myfiles){
+        if (!($zfile =~ /\./)) {
+           opendir (INTEMPLATES, "$templates_file_dir/$zfile"); 
+           @myfiles2 = readdir(INTEMPLATES); 
+           closedir (INTEMPLATES);
+           foreach $zzfile (@myfiles2){
+             if (!($zzfile =~ /\./)) {
+                $sm_templatelinks .= qq~<option value="$zfile/$zzfile">$zzfile</option>\n~;
+             }
+           }
+           @myfiles2 = ""; 
+        }
+    }
+
+
+    if ($sc_self_serve_images =~ /no/i) {
+         $sc_buttonSetURLthingy = "$URL_of_images_directory/buttonsets";
+    }
+    opendir (BUTTONSETS, "$sc_buttonSetURLthingy"); 
+    @myfiles = readdir(BUTTONSETS); 
+    closedir (BUTTONSETS);
+    foreach $zfile (@myfiles){
+        if (!($zfile =~ /\./)) {
+                $sm_buttonsetlinks .= qq~<option value="$zfile">$zfile</option>\n~;
+        }
+    }
+
 print <<ENDOFTEXT;
-<CENTER>
-<HR>
-</CENTER>
-
-<CENTER>
-<TABLE>
-<TR>
-<TD>
+<center>
+<hr />
+</center>
+
+<center>
+<table>
+<tr>
+<td>
 <FONT FACE=ARIAL>Welcome to the <b>AgoraCart</b> System Manager. Here you
-will set the main data settings/variables specific to your store.</TD>
-</TR>
-</TABLE>
-</CENTER>
+will set the main data settings/variables specific to your store.</td>
+</tr>
+</table>
+</center>
 
 ENDOFTEXT
 
 if($in{'system_edit_success'} ne "")
 {
 print <<ENDOFTEXT;
-<CENTER>
-<TABLE>
-<TR>
-<TD><br>
+<center>
+<table>
+<tr>
+<td><br />
 <FONT FACE=ARIAL SIZE=2 COLOR=RED>System settings have been successfully updated.  Check/Edit your Primary Gateway Settings <a href=manager.cgi?show_gateway_settings_screen=$sc_gateway_name>here</a></FONT>
-</TD>
-</TR>
-</TABLE>
-</CENTER>
+</td>
+</tr>
+</table>
+</center>
 ENDOFTEXT
 }
 
@@ -286,17 +446,17 @@
 #     use LWP::Simple;
     } else {
      $Lib_message="<FONT COLOR=RED><b>WARNING:</b> LWP library was " .
-                  "not found!  Choose one of the other options.</FONT><BR>";
+                  "not found!  Choose one of the other options.</FONT><br />";
     }
 #   $test_result = eval('require "./library/http-lib.pl"');
    if (!($http_lib_ok =~ /yes/i)) {
      $Lib_message .= "<FONT COLOR=RED>Couldn't load http-lib. " .   
-                  "Choose one of the other options.</FONT><BR>";
+                  "Choose one of the other options.</FONT><br />";
     } 
    $test_result = eval('&get_lynx_path("0")');
    if ($test_result eq "") {
      $Lib_message .= "<FONT COLOR=RED>Lynx was not found. " .     
-                  "Choose one of the other options.</FONT><BR>";
+                  "Choose one of the other options.</FONT><br />";
     } 
 
 #if ($sc_path_of_images_directory ne "") {
@@ -351,87 +511,87 @@
 
 <FONT FACE=ARIAL SIZE=2>
 <FORM METHOD="POST" ACTION="manager.cgi">
-<CENTER>
+<center>
 <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BORDER=0>
 
-<TR>
-<TD><br></TD>
-</TR>
-<TR>
-<TD COLSPAN=4 bgcolor=#99CC99><center><font face="Arial, Helvetica, sans-serif" size=+2><b>Payment Gateway Section</b></font></center></TD>
-</TR>
-<TR>
-<TD><br></TD>
-</TR>
+<tr>
+<td><br /></td>
+</tr>
+<tr>
+<td colspan=4 bgcolor=#99CC99><center><font face="Arial, Helvetica, sans-serif" size=+2><b>Payment Gateway Section</b></font></center></td>
+</tr>
+<tr>
+<td><br /></td>
+</tr>
 
-<TR>
-<TD colspan=2>
+<tr>
+<td colspan=2>
 <b>Please select your Primary Payment Gateway:</b>
-<br>
+<br />
 <small><a href="http://www.agoracart.com/agorawiki/index.php?title=What_is_a_Payment_Gateway" target="_blank">What is a Payment Gateway</a>?  &nbsp;&nbsp; <a href="http://www.agoracart.com/agorawiki/index.php?title=Payment_Gateway_Basics_%26_x-comments">Payment Gateway Basics</a></small>
-<TD colspan=2>
-<SELECT NAME=gateway_name>
+<td colspan=2>
+<select name=gateway_name>
 $mylist_of_gateway_options
-</SELECT>
-</TD>
-</TR>
+</select>
+</td>
+</tr>
 
-<TR>
-<td colspan=2><br><b>Allow Multiple Gateways? </b> <small>This will automatically use the <b>combo-orderform.html</b> file so that customer can choose their preferred payment type, so you will need to edit that file for your payment types (can be 2 or more gateways).  For security reasons, it is a good idea
+<tr>
+<td colspan=2><br /><b>Allow Multiple Gateways? </b> <small>This will automatically use the <b>combo-orderform.html</b> file so that customer can choose their preferred payment type, so you will need to edit that file for your payment types (can be 2 or more gateways).  For security reasons, it is a good idea
 to delete any order forms from the "html/forms" sub-directory of your store for
 gateways you are not planning to use. </small></td>
-<TD colspan=2><SELECT NAME=sc_allow_ofn_choice>
-<OPTION SELECTED>$sc_allow_ofn_choice</OPTION>
-<OPTION>$sc_other_ofn</OPTION> 
-</SELECT></TD>
-</TR>
-
-<TR>
-<td colspan=2><br><b>Replace Order Form Tags?</b>  <small>This handles the submit button when displaying the order form.  Select yes to run a normal store operation.  Select "no" if having problems with multiple gateways going to the wrong gateway or back to the cart .  Default is yes.  Leave this as "yes" unless it corrects multiple gateway forms submission problems.</small></td>
-<TD colspan=2><SELECT NAME=sc_replace_orderform_form_tags>
-<OPTION SELECTED>$sc_replace_orderform_form_tags</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT></TD>
-</TR>
-
-<TR>
-<TD><br></TD>
-</TR>
-<TR>
-<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Database Section</b></font></TD>
-</TR>
-<TR>
-<TD><br></TD>
-</TR>
+<td colspan=2><select name=sc_allow_ofn_choice>
+<option selected>$sc_allow_ofn_choice</option>
+<option>$sc_other_ofn</option> 
+</select></td>
+</tr>
+
+<tr>
+<td colspan=2><br /><b>Replace Order Form Tags?</b>  <small>This handles the submit button when displaying the order form.  Select yes to run a normal store operation.  Select "no" if having problems with multiple gateways going to the wrong gateway or back to the cart .  Default is yes.  Leave this as "yes" unless it corrects multiple gateway forms submission problems.</small></td>
+<td colspan=2><select name=sc_replace_orderform_form_tags>
+<option selected>$sc_replace_orderform_form_tags</option>
+<option>yes</option>
+<option>no</option>
+</select></td>
+</tr>
 
-<TR>
-<TD colspan=4>
+<tr>
+<td><br /></td>
+</tr>
+<tr>
+<td colspan=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Database Section</b></font></td>
+</tr>
+<tr>
+<td><br /></td>
+</tr>
+
+<tr>
+<td colspan=4>
 <b>Select your Database library and set the product database key pad length:</b>
-<br>
-Library: <SELECT NAME=database_lib>
+<br />
+Library: <select name=database_lib>
 $mylist_of_database_libs
-</SELECT>
+</select>
 &nbsp;&nbsp;&nbsp;&nbsp;
-Key Pad Length: <INPUT NAME="sc_prod_db_pad_length" TYPE="TEXT" SIZE=1 
-MAXLENGTH="2" VALUE="$sc_prod_db_pad_length">
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
-
-<TR>
-<TD colspan=4>
-<b>Do you wish to use Product Sub Categories? </b> <SELECT NAME=sc_use_database_subcats>
-<OPTION>$sc_use_database_subcats</OPTION>
-<OPTION>No</OPTION> 
-<OPTION>Yes</OPTION> 
-</SELECT><br><br>
+Key Pad Length: <input name="sc_prod_db_pad_length" TYPE="TEXT" SIZE=1 
+MAXLENGTH="2" value="$sc_prod_db_pad_length">
+</td>
+</tr>
+
+<tr>
+<td colspan=4><hr /></td>
+</tr>
+
+<tr>
+<td colspan=4>
+<b>Do you wish to use Product Sub Categories? </b> <select name=sc_use_database_subcats>
+<option>$sc_use_database_subcats</option>
+<option>No</option> 
+<option>Yes</option> 
+</select><br /><br />
 
 <b>Select Product UserField you wish to Enter Sub Category Names in: </b><small>NOTE: when entering a product into multiple sub categories, separate sub catergory names with double colons (::) in the edit/add product manager screens. If you have subcat names of "Books" and "Used Books", they would be entered as: "Books::Used Books" in the UserField of choice.  Spaces allowed in the sub-category names. Only a single level of sub- categories available at this time (will be expanded later)</small> &nbsp;
-<SELECT NAME=sc_subcat_index_field>
+<select name=sc_subcat_index_field>
 <option>$sc_subcat_index_field
 <option value="">None
 <option>user2
@@ -440,447 +600,576 @@
 <option>user5
 $user10_thingy
 $user20_thingy
-</SELECT>
+</select>
+
+<br /><br />
+<b>Do you wish to use Count total products in Categories and Sub Categories? </b> <small>This will display the item counts in each category or sub category next to the title/name of the category, if using standard layouts and/or standard AgoraScript category display code.  NOTE: if you get multiples in product counts equal in proportion to the number of category lists on a page, remove the extra category lists in the headers, footers and page layouts or turn this feature off. <select name=sc_count_database_cats>
+<option>$sc_count_database_cats</option>
+<option>No</option> 
+<option>Yes</option> 
+</select><br /><br />
+</td>
+</tr>
 
-<br><br>
-<b>Do you wish to use Count total products in Categories and Sub Categories? </b> <small>This will display the item counts in each category or sub category next to the title/name of the category, if using standard layouts and/or standard AgoraScript category display code.  NOTE: if you get multiples in product counts equal in proportion to the number of category lists on a page, remove the extra category lists in the headers, footers and page layouts or turn this feature off. <SELECT NAME=sc_count_database_cats>
-<OPTION>$sc_count_database_cats</OPTION>
-<OPTION>No</OPTION> 
-<OPTION>Yes</OPTION> 
-</SELECT><br><br>
-</TD>
-</TR>
-
-<TR>
-<TD><br></TD>
-</TR>
-<TR>
-<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Ordering/Checkout Controls Section</b></font></TD>
-</TR>
-<TR>
-<TD><br></TD>
-</TR>
+<tr>
+<td><br /></td>
+</tr>
+<tr>
+<td colspan=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Ordering/Checkout Controls Section</b></font></td>
+</tr>
+<tr>
+<td><br /></td>
+</tr>
 
-<TR>
+<tr>
 <td colspan=2><b>Minimum order:</b>  <small>If you wish to set a minimum order amount that customers must reach to complete an order, enter it here.  Otherwise, enter 0.  Do not add currency symbols as they will be stripped out in most cases.  indicate currency in the next box.</small></td>
-<TD colspan=2><INPUT NAME="sc_minimum_order_amount" TYPE="TEXT" SIZE=10 
-MAXLENGTH="10" VALUE="$sc_minimum_order_amount"></TD>
-</TR>
-<tr>
-<td colspan=2><br><b>MInimum order Currency Type:</b>  <small>Enter the currency type for the minimum order.  Spell it out.  Example: Euro, Dollars, Pounds, US Dollars, etc.</small></td>
-<TD colspan=2><INPUT NAME="sc_minimum_order_text" TYPE="TEXT" SIZE=15 
-MAXLENGTH="20" VALUE="$sc_minimum_order_text"></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
-
-<TR>
-<TD colspan=4>
-<b>Do you wish to display the prices of options? </b> <small>This allows you to turn off the display of prices for each option ordered on each product in the view cart contents screen as well as on the cart contents displayed at checkout.  Default is ON, even if nothing is selected in this setting.</small> <SELECT NAME=sc_turn_off_option_price_display>
-<OPTION>$sc_turn_off_option_price_display</OPTION>
-<OPTION>on</OPTION> 
-<OPTION>off</OPTION> 
-</SELECT>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
-
-<TR>
-<TD colspan=4>
-<b>Do you wish to prevent Zero total orders? </b> <small>YES will prevent zero orders.  NO will allow you to take zero orders.</small> <SELECT NAME=sc_prevent_zero_total_orders>
-<OPTION>$sc_prevent_zero_total_orders</OPTION>
-<OPTION>No</OPTION> 
-<OPTION>Yes</OPTION> 
-</SELECT>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
-
-<TR>
-<TD colspan=4>
-<b>Do you need shorter Cart ID numbers? </b> <small>NO is default, and ensures harder to guess order ID credentials (for increased security).  If your payment gateway requires shorter number for the "order ID" passed to them, then set this to YES.</small> <SELECT NAME=sc_need_short_cart_id>
-<OPTION>$sc_need_short_cart_id</OPTION>
-<OPTION>No</OPTION> 
-<OPTION>Yes</OPTION> 
-</SELECT>
-</TD>
-</TR>
-
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
-
-<TR>
-<TD colspan=4>
-<b>Allow International/Extended Latin Characters? </b> <small>YES will allow international latin based characters, useful when selling to countries such as those in Europe.  NO will only allow ASCII or normal English characters.  Default is NO for additional security purposes.  Additional characters allowed would be:<br>                                                                .</small> <br><SELECT NAME=sc_use_international_latin_characters>
-<OPTION>$sc_use_international_latin_characters</OPTION>
-<OPTION>No</OPTION> 
-<OPTION>Yes</OPTION> 
-</SELECT>
-</TD>
-</TR>
-
-<TR>
-<TD><br></TD>
-</TR>
-<TR>
-<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Image Serving Section</b></font></TD>
-</TR>
-<TR>
-<TD><br></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4>
-<b>Please enter URL of your Store's images directory</b>.<br><small>For example:<br>
+<td colspan=2><input name="sc_minimum_order_amount" TYPE="TEXT" SIZE=10 
+MAXLENGTH="10" value="$sc_minimum_order_amount"></td>
+</tr>
+<tr>
+<td colspan=2><br /><b>Minimum order Currency Type:</b>  <small>Enter the currency type for the minimum order.  Spell it out.  Example: Euro, Dollars, Pounds, US Dollars, etc.</small></td>
+<td colspan=2><input name="sc_minimum_order_text" TYPE="TEXT" SIZE=15 
+MAXLENGTH="20" value="$sc_minimum_order_text"></td>
+</tr>
+
+<tr>
+<td colspan=4><hr /></td>
+</tr>
+
+<tr>
+<td colspan=4>
+<b>Do you wish to display the prices of options? </b> <small>This allows you to turn off the display of prices for each option ordered on each product in the view cart contents screen as well as on the cart contents displayed at checkout.  Default is ON, even if nothing is selected in this setting.</small> <select name=sc_turn_off_option_price_display>
+<option>$sc_turn_off_option_price_display</option>
+<option>on</option> 
+<option>off</option> 
+</select>
+</td>
+</tr>
+
+<tr>
+<td colspan=4><hr /></td>
+</tr>
+
+<tr>
+<td colspan=4>
+<b>Do you wish to prevent Zero total orders? </b> <small>YES will prevent zero orders.  NO will allow you to take zero orders.</small> <select name=sc_prevent_zero_total_orders>
+<option>$sc_prevent_zero_total_orders</option>
+<option>No</option> 
+<option>Yes</option> 
+</select>
+</td>
+</tr>
+
+<tr>
+<td colspan=4><hr /></td>
+</tr>
+
+<tr>
+<td colspan=4>
+<b>Do you need shorter Cart ID numbers? </b> <small>NO is default, and ensures harder to guess order ID credentials (for increased security).  If your payment gateway requires shorter number for the "order ID" passed to them, then set this to YES.</small> <select name=sc_need_short_cart_id>
+<option>$sc_need_short_cart_id</option>
+<option>No</option> 
+<option>Yes</option> 
+</select>
+</td>
+</tr>
+
+
+<tr>
+<td colspan=4><hr /></td>
+</tr>
+
+<tr>
+<td colspan=4>
+<b>Allow International/Extended Latin Characters? </b> <small>YES will allow international latin based characters, useful when selling to countries such as those in Europe.  NO will only allow ASCII or normal English characters.  Default is NO for additional security purposes.  Additional characters allowed would be:<br />                                                                .</small> <br /><select name=sc_use_international_latin_characters>
+<option>$sc_use_international_latin_characters</option>
+<option>No</option> 
+<option>Yes</option> 
+</select>
+</td>
+</tr>
+
+<tr>
+<td><br /></td>
+</tr>
+<tr>
+<td colspan=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Image Serving Section</b></font></td>
+</tr>
+<tr>
+<td><br /></td>
+</tr>
+
+<tr>
+<td colspan=4>
+<b>Please enter URL of your Store's images directory</b>.<br /><small>For example:<br />
 <b>http://$ENV{'SERVER_NAME'}/store/html/images</b></small>  DO NOT include the trailing slash!!! <b>/</b>
-</TD>
-</TR>
+</td>
+</tr>
 
-<TR>
-<TD COLSPAN=4>
-<INPUT NAME="URL_of_images_directory" TYPE="TEXT" SIZE=60 
-VALUE="$sc_path_of_images_directory"><br><br><small>
+<tr>
+<td colspan=4>
+<input name="URL_of_images_directory" TYPE="TEXT" SIZE=60 
+VALUE="$sc_path_of_images_directory"><br /><br /><small>
 Hint: if you desire to use the \%\%URLofImages\%\% token in both
 secure https and insecure http pages, then setup things so that
 both use the same directory tree to access the images.  In this case, instead
-of using the full URL (http://www.domain-name.com/store/html/images) just use the directory/file part, such as:<br>
-<b>/store/html/images</b>(aka absolute path from your root web directory) or <b>html/images</b> (aka relative path from the agora.cgi file)<br><br>
+of using the full URL (http://www.domain-name.com/store/html/images) just use the directory/file part, such as:<br />
+<b>/store/html/images</b>(aka absolute path from your root web directory) or <b>html/images</b> (aka relative path from the agora.cgi file)<br /><br />
 For faster image serving, enter the relative disk path from the location of the agora.cgi  file
 (or the absolute path to the image) for your store's images directory (without the trailing slash) 
-and set the next option to "yes" for self-serve of the images. If your images are stored outside your store directory, such as an graphics directory in your "root" directory for your website:<br><b>www.domain-name.com/graphics</b><br>and your store was located in your cgi-bin like so:<br><b>www.domain-name.com/cgi-bin/store</b><br>then you would need to go up two levels in your directory tree and then back down one.  Each level upwards is indicated by a set of: ../ , so the image location for serving your images would look like this:<br>
-<b>../../graphics</b> with no trailing slash.</small><br><br><br>
-<b>Do you want to self-serve the images?</b> &nbsp; <SELECT NAME=sc_self_serve_images>
-<OPTION>$sc_self_serve_images</OPTION>
-<OPTION>No</OPTION> 
-<OPTION>Yes</OPTION> 
-</SELECT> <br><small> Say NO unless you have some good reason to use this images serving feature.&nbsp; One reason
+and set the next option to "yes" for self-serve of the images. If your images are stored outside your store directory, such as an graphics directory in your "root" directory for your website:<br /><b>www.domain-name.com/graphics</b><br />and your store was located in your cgi-bin like so:<br /><b>www.domain-name.com/cgi-bin/store</b><br />then you would need to go up two levels in your directory tree and then back down one.  Each level upwards is indicated by a set of: ../ , so the image location for serving your images would look like this:<br />
+<b>../../graphics</b> with no trailing slash.</small><br /><br /><br />
+<b>Do you want to self-serve the images?</b> &nbsp; <select name=sc_self_serve_images>
+<option>$sc_self_serve_images</option>
+<option>No</option> 
+<option>Yes</option> 
+</select> <br /><small> Say NO unless you have some good reason to use this images serving feature.&nbsp; One reason
 would be that your server will not serve images from your cgi-bin directory (or where the store is currently installed at) and for some reason you do not desire to move them outside of the store directory areas.  <b>Speed Enhancement:</b> Your store will run faster with this set to no.</small>
-</TD>
-</TR>
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
-<TR>
-<TD COLSPAN=2><font face="Arial, Helvetica, sans-serif" size=2>
+</td>
+</tr>
+<tr>
+<td colspan=4><hr /></td>
+</tr>
+<tr>
+<td colspan=2><font face="Arial, Helvetica, sans-serif" size=2>
 Because the store can have a disk or http directory path for images, and manager needs disk path, we set this variable here to point to be the disk path to the images directory. 
-</font></TD><TD  COLSPAN=2>
-&nbsp;<INPUT NAME="mc_images_dir" TYPE="TEXT" SIZE=12 
-MAXLENGTH="30" VALUE="$mc_images_dir"><br><br>
-</TD>
-</TR>
-
-<TR>
-<TD><br></TD>
-</TR>
-<TR>
-<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Store URL Section</b></font></TD>
-</TR>
-<TR>
-<TD><br></TD>
-</TR>
+</font></td><td  colspan=2>
+&nbsp;<input name="mc_images_dir" TYPE="TEXT" SIZE=12 
+MAXLENGTH="30" value="$mc_images_dir"><br /><br />
+</td>
+</tr>
+
+<tr>
+<td><br /></td>
+</tr>
+<tr>
+<td colspan=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Store URL Section</b></font></td>
+</tr>
+<tr>
+<td><br /></td>
+</tr>
 
-<TR>
-<TD COLSPAN=4>
+<tr>
+<td colspan=4>
 <b>Please enter the full URL of your store here.</b>  <small>Note: according to 
 browser cookie implementation rules, you must have at least two dots in 
 the name of the host for cookies to work properly for domains such as 
-.com, .org, .net, etc.<BR>
-(ex: <b>http://$ENV{'SERVER_NAME'}/store/agora.cgi</b>)</small>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><br>
-<b>Store URL</b>: <INPUT NAME="sc_store_url" TYPE="TEXT" SIZE=60 
-MAXLENGTH="128" VALUE="$sc_store_url">
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><br>
-<b>SSL URL</b>: <INPUT NAME="sc_ssl_location_url2" TYPE="TEXT" SIZE=60 
-MAXLENGTH="128" VALUE="$sc_ssl_location_url2"><br><small>Leave blank if not using SSL<br>. Shared SSL hosting, enter the SSL URL in form of: https://www.SSL-server-URL-here.com/~accountname/directory-of-store/agora.cgi.  (Make sure this URL matches what your hosting provider issued to you.)   If SSL runs under your domain name (you bought an SSL certificate), then enter the SSL URL in the form of:  https://www.yourDomanNameHere.com/directory-of-store/agora.cgi</small>
-</TD>
-</TR>
-
-<TR>
-<TD><br></TD>
-</TR>
-<TR>
-<TD COLSPAN=4 bgcolor=#99CC99><center><font face="Arial, Helvetica, sans-serif" size=+2><b>Order Logging / Confirmation Emails Section</b></font></center></TD>
-</TR>
-<TR>
-<TD><br></TD>
-</TR>
-
-<TR>
-<TD colspan=2><b>Do you wish to have orders e-mailed to you?</b><br><small>NOTE: some hosting services may require that the email addresses your scripts use to be on the same domain and/or server for security and anti-spamming purposes.  Basically, this means that your store and confirmation emails might need to be on the same server and/or hosting account.  If this is the case, setup a forwarding address on your hosting account / domain name to forward order confirmations to the external email address you wish to use and then enter that "forwarder" email address here.</small></TD>
-<TD colspan=2><SELECT NAME="email_orders_yes_no">
-<OPTION>$sc_send_order_to_email</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT></TD></TR>
+.com, .org, .net, etc.<br />
+(ex: <b>http://www.$ENV{'SERVER_NAME'}/store5/agora.cgi</b>)</small>
+</td>
+</tr>
+
+<tr>
+<td colspan=4><br />
+<b>Store URL</b>: <input name="sc_store_url" TYPE="TEXT" SIZE=60 
+MAXLENGTH="128" value="$sc_store_url">
+</td>
+</tr>
+
+<tr>
+<td colspan=4><br />
+<b>SSL URL</b>: <input name="sc_ssl_location_url2" TYPE="TEXT" SIZE=60 
+MAXLENGTH="128" value="$sc_ssl_location_url2"><br /><small>If not using SSL, leave blank and the normal store URL will be used.<br />Shared SSL hosting, enter the SSL URL in form of: https://www.SSL-server-URL-here.com/~accountname/directory-of-store/agora.cgi.  (Make sure this URL matches what your hosting provider issued to you.)   If SSL runs under your domain name (you bought an SSL certificate), then enter the SSL URL in the form of:  https://www.yourDomanNameHere.com/directory-of-store/agora.cgi</small>
+</td>
+</tr>
+
+<tr>
+<td><br /></td>
+</tr>
+<tr>
+<td colspan=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Store CSS File Location Settings</b></font></td>
+</tr>
+<tr>
+<td><br /></td>
+</tr>
+
+
+<tr>
+<td colspan="2"><br/><b>Number of levels between agora.cgi and the CSS file.</b><br/><font face="Arial, Helvetica, sans-serif" size=2>
+By default the CSS file ($stylename) is installed in the <em>store</em> dir along 
+with the agora.cgi file. If you've moved the CSS file from this location please 
+specify the number of levels to access it. Also if the <em>store</em> dir is 
+inside of the cgi-bin you may have to move the CSS file to the root dir. To do so 
+simply adjust the levels to the CSS file below to take you outside of the cgi-bin.<br/></font>
+<small>Examples:<br/>
+location of agora.cgi -> http://www.domain.com/cgi-bin/store/<br/>
+location of css file ---> http://www.domain.com/<br/>
+Number of levels would be <b>2</b>.</small><br/><br/>
+<b>Number of Levels to CSS file:</b>
+<select name="sc_levels_to_root">
+<option>$sc_levels_to_root</option>
+<option>0</option>
+<option>1</option>
+<option>2</option>
+<option>3</option>
+<option>4</option>
+<option>5</option>
+<option>6</option>
+</select>
+<br /><br />
+<b>Do you need to make a copy of the template CSS file in same location as the main CSS file?</b>
+<select name="sc_template_css_at_root">
+<option>$sc_template_css_at_root</option>
+<option>no</option>
+<option>yes</option>
+</select>
+</td>
+</tr>
+
+<tr>
+<td colspan=2><hr /></td>
+</tr>
+
+<tr>
+<td colspan="2"><b>Additional items to be included inside of the &lt;head&gt; section</b><br/><font face="Arial, Helvetica, sans-serif" size=2>
+This would be where you include any <b>javascript</b> or <b>meta tags</b> you wish to show up on
+all pages thoughout the entire site. You can also enter additional style sheets, just 
+make sure there are no confliting entries between the two.</font>
+<small>DO NOT enter the full web path, instead enter it in the form ../../. 
+If you include the hostname and try running in secure mode you might have issues 
+with getting the padlock to show up.</small><br/>
+Example: <b>&lt;script type="text/javascript" language="javascript" 
+src="../../scripts/functions.js"&gt;&lt;/script&gt;</b><br/>
+<TEXTAREA name="mc_additional_head_info" 
+cols="68" rows="5">$mc_additional_head_info</TEXTAREA></td>
+</tr>
+
+<tr>
+<td><br /></td>
+</tr>
+<tr>
+<td colspan=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Store Header/Footer/Buttons Section</b></font></td>
+</tr>
+<tr>
+<td><br /></td>
+</tr>
+<tr>
+<td colspan="2"><font face="Arial, Helvetica, sans-serif" size=2>
+This area allows you to chose a header and footer template that will be used by default in the design/look of your store (basically the default design applied store wide unless customized pages are found).  Using your own headers/footers is fairly easy, but not recommended for those without HTML editing experience. For faster setup, use a template already available<br /><br /> <i>NOTE: You can use your own templates if you wish, but this will require you to create your own headers and footers and upload them to the store's html/html-templates/templates/Custom sub directory and then put the .css file for your custom look in the html/html-templates/templates/Custom/CustomOne sub directory of your store (one more level down).   The Custom/CustomOne sub-directory names can be anything you like, such as CompanyName/SpringSaleTemplate, CompanyName/XmasTemplate, etc.  If you wish to use custom header and/or footer files by category name, you will need to create those files separately and place them in the html/html-templates sub directory of your store (using the formats of header-CATEGORY-NAME-HERE.inc and/or footer-CATEGORY-NAME-HERE.inc, which is auto-detected automatically if enabled in the <a href="manager.cgi?change_store_layout_screen=yes">Layout & Design Settings - Misc</a> Manager).  Make sure to upload all HTML and CSS files in ASCII mode.</i></font>
+</td>
+</tr>
+<tr>
+<td>
+<b>Select a Template: </b>
+</td><td>
+<br />
+<select name=sc_headerTemplateName>
+<option selected>$sc_headerTemplateName</option>
+$sm_templatelinks
+</select>
+<br /><br />
+</td>
+</tr>
+<tr>
+<td colspan=2><hr /></td>
+</tr>
+<tr>
+<td>
+<b>Select a Button Set: </b></font>
+</td><td>
+<br />
+<select name=sc_buttonSetName>
+<option selected>$sc_buttonSetName</option>
+$sm_buttonsetlinks
+</select>
+<br /><br />
+</td>
+</tr>
+<tr>
+<td colspan=2><hr /></td>
+</tr>
+<tr>
+<td>
+<b>Display Categories</b> (and sub categories if enabed)<b>?</b> 
+</td><td>
+<br />
+<select name=sc_displayDynamicCategories>
+<option selected>$sc_displayDynamicCategories</option>
+<option>yes</option>
+<option>no</option>
+</select>
+
+<br /><br />
+</td>
+</tr>
+<tr>
+<td colspan=2><hr /></td>
+</tr>
+<tr>
+<td colspan="2">
+<b>Store Name and Tag Line:</b><br />
+<small>This is the store name/title diplayed to your customers in the heading of the template. Do not use special metacharacters (\$,%,&,\@ etc). 45 characters max.    The shorter the better to ensure the store template does not get distorted due to the long text line. Leave blank if you do not want this line to show.</small>:
+<br />
+<input type=TEXT SIZE=45 maxlength=45 name="sc_headerStoreTitle" value="$sc_headerStoreTitle">
+<br /><br />
+</td>
+</tr>
+<tr>
+<td colspan=2><hr /></td>
+</tr>
+<tr>
+<td colspan=2>
+<b>Tag Line:</b><br />
+<small>This is located just beneath the Store title listed above. Do not use special metacharacters (\$,%,&,\@ etc).  60 characters max.  The shorter the better to ensure the store template does not get distorted due to the long text line. Leave blank if you do not want this line to show.</small>:
+<br />
+<input type=TEXT SIZE=45 maxlength=60 name="sc_headerStoreTagLine" value="$sc_headerStoreTagLine">
+<br /><br />
+</td>
+</tr>
+
+
+
+<tr>
+<td><br /></td>
+</tr>
+
+<tr>
+<td colspan=4 bgcolor=#99CC99><center><font face="Arial, Helvetica, sans-serif" size=+2><b>Order Logging / Confirmation Emails Section</b></font></center></td>
+</tr>
+<tr>
+<td><br /></td>
+</tr>
+
+<tr>
+<td colspan=2><b>Do you wish to have orders e-mailed to you?</b><br /><small>NOTE: some hosting services may require that the email addresses your scripts use to be on the same domain and/or server for security and anti-spamming purposes.  Basically, this means that your store and confirmation emails might need to be on the same server and/or hosting account.  If this is the case, setup a forwarding address on your hosting account / domain name to forward order confirmations to the external email address you wish to use and then enter that "forwarder" email address here.</small></td>
+<td colspan=2><select name="email_orders_yes_no">
+<option>$sc_send_order_to_email</option>
+<option>yes</option>
+<option>no</option>
+</select></td></tr>
 <tr><td colspan=4>Email Address to use: <INPUT 
 NAME="email_address_for_orders" TYPE="TEXT" 
 VALUE="$sc_first_order_email" SIZE="48">
-</TD>
-</TR>
-<TR>
-<TD COLSPAN=4><BR></TD>
-</TR>
-<TR>
-<TD colspan=2><b>Do you wish to have orders e-mailed to a second email address?</b><br><small>NOTE: see note above for primary confirmation email address.</small></TD>
-<TD colspan=2><SELECT NAME="second_email_orders_yes_no">
-<OPTION>$sc_second_send_order_to_email</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT></TD></TR>
+</td>
+</tr>
+<tr>
+<td colspan=4><br /></td>
+</tr>
+<tr>
+<td colspan=2><b>Do you wish to have orders e-mailed to a second email address?</b><br /><small>NOTE: see note above for primary confirmation email address.</small></td>
+<td colspan=2><select name="second_email_orders_yes_no">
+<option>$sc_second_send_order_to_email</option>
+<option>yes</option>
+<option>no</option>
+</select></td></tr>
 <tr><td colspan=4><b>Email Address to use:</b> <INPUT 
 NAME="second_email_address_for_orders" TYPE="TEXT" 
 VALUE="$sc_second_order_email" SIZE="48">
-</TD>
-</TR>
+</td>
+</tr>
+
+<tr>
+<td colspan=4><hr /></td>
+</tr>
+
+<tr>
+<td colspan=4>
+<b>Enter the e-mail address of your webmaster or administrator here</b><br /><small>NOTE: Must be on same server and/or hosting account as store resides (same domain name or a parked domain name). If one does not exist, create a forwarded admin email address for your store in your hosting account control panel.</small>
+</td>
 
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4>
-<b>Enter the e-mail address of your webmaster or administrator here</b><br><small>NOTE: Must be on same server and/or hosting account as store resides (same domain name or a parked domain name). If one does not exist, create a forwarded admin email address for your store in your hosting account control panel.</small>
-</TD>
-
-<TR>
-<TD COLSPAN="2">
-<INPUT NAME="admin_email" TYPE="TEXT" VALUE="$sc_admin_email" SIZE="55">
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2>
-<b>Do you wish to use dynamic email subjects?</b><br><small>Advanced Feature. Some add-ons require this to be set to YES.  Default is NO.  Test and check emails prior to going live with this feature to ensure it does what you expect.</small></td>
-<td colspan=2><SELECT NAME="sc_use_dynamic_email_subjects">
-<OPTION>$sc_use_dynamic_email_subjects</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT></td></tr>
-
-<TR>
-<TD><br></TD>
-</TR>
-<TR>
-<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Misc Main Settings Section</b></font></TD>
-</TR>
-<TR>
-<TD><br></TD>
-</TR>
-
-<TR>
-<TD colspan=2><b>How long do you wish to keep pevious cart contents (and server side cookies) for non-finalized orders?</b>. <small>This is the record of what was added to the cart, as well as other info such as the cart ID, in case a payment is delayed and/or the customer wishes to come back later and resume shopping.  These files are automagically deleted once the order is completed or the time set for expiration of these customer cart files is reached.  Default is is 1 day.  If using a payment gateway that reports back pending payments at a later date/time (such as authorizations only, ACH payments, eChecks, and/or PayPal IPN), set this to a suggested time of 5 days.  Fractional days acceptable as well, such as .25 (6 hours), .5 (12hours), 1.75 (1 day and 18 hours), etc.  Warning: do not exceed 7 days if your site is very busy.</small></TD>
-<TD colspan=2>
-<INPUT NAME="sc_number_days_keep_old_carts" TYPE="TEXT" 
-VALUE="$sc_number_days_keep_old_carts" SIZE="10" maxlength="10"></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
-
-<TR>
-<TD colspan=2><b>Do you wish to log unique accesses to your store?</b>. <small>Default is yes.  Setting to "no" will disable the menu item as well.  To see the results of this setting in the manager menus at the top of each page, reload a page after saving these settings. <b>Speed Enhancement:</b> Your store will run faster with this set to no.</small></TD>
-<TD colspan=2><SELECT NAME="sc_shall_i_log_accesses">
-<OPTION>$sc_shall_i_log_accesses</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
+<tr>
+<td colspan=2><br /><b>Do you wish to have admin emails shown as "From" the customer?</b><br /><small>Order confirmation emails to the admin(s) will show the admin email address in the from field of an email by default. This allows you to use the customer's email address instead of the admin's email address. Applies only to emails to the admin when an order confirmation is to be emailed. Also, if you have problems recievign the emails after chaging this, you might be restricted by your server and must use an admin email address that is linked to or based on your hosting account (domain names used on your hosting account). Default is no.</small></td>
+<td colspan=2><br /><select name="sc_use_customer_email_over_admin">
+<option>$sc_use_customer_email_over_admin</option>
+<option>no</option>
+<option>yes</option>
+</select></td></tr>
+
+<tr>
+<td colspan="2">
+<input name="admin_email" TYPE="TEXT" value="$sc_admin_email" SIZE="55">
+</td>
+</tr>
+
+<tr>
+<td colspan=4><hr /></td>
+</tr>
 
-<TR>
-<TD colspan=4>
+<tr>
+<td colspan=2>
+<b>Do you wish to use dynamic email subjects?</b><br /><small>Advanced Feature. Some add-ons require this to be set to YES.  Default is NO.  Test and check emails prior to going live with this feature to ensure it does what you expect.</small></td>
+<td colspan=2><select name="sc_use_dynamic_email_subjects">
+<option>$sc_use_dynamic_email_subjects</option>
+<option>yes</option>
+<option>no</option>
+</select></td></tr>
+
+<tr>
+<td><br /></td>
+</tr>
+<tr>
+<td colspan=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Misc Main Settings Section</b></font></td>
+</tr>
+<tr>
+<td><br /></td>
+</tr>
+
+<tr>
+<td colspan=2><b>How long do you wish to keep pevious cart contents (and server side cookies) for non-finalized orders?</b>. <small>This is the record of what was added to the cart, as well as other info such as the cart ID, in case a payment is delayed and/or the customer wishes to come back later and resume shopping.  These files are automagically deleted once the order is completed or the time set for expiration of these customer cart files is reached.  Default is is 1 day.  If using a payment gateway that reports back pending payments at a later date/time (such as authorizations only, ACH payments, eChecks, and/or PayPal IPN), set this to a suggested time of 5 days.  Fractional days acceptable as well, such as .25 (6 hours), .5 (12hours), 1.75 (1 day and 18 hours), etc.  Warning: do not exceed 7 days if your site is very busy.</small></td>
+<td colspan=2>
+<input name="sc_number_days_keep_old_carts" TYPE="TEXT" 
+VALUE="$sc_number_days_keep_old_carts" SIZE="10" maxlength="10"></td>
+</tr>
+
+<tr>
+<td colspan=4><hr /></td>
+</tr>
+
+<tr>
+<td colspan=2><b>Do you wish to log unique accesses to your store?</b>. <small>Default is yes.  Setting to "no" will disable the menu item as well.  To see the results of this setting in the manager menus at the top of each page, reload a page after saving these settings. <b>Speed Enhancement:</b> Your store will run faster with this set to no.</small></td>
+<td colspan=2><select name="sc_shall_i_log_accesses">
+<option>$sc_shall_i_log_accesses</option>
+<option>yes</option>
+<option>no</option>
+</select></td>
+</tr>
+
+<tr>
+<td colspan=4><hr /></td>
+</tr>
+
+<tr>
+<td colspan=4>
 if using an affiliate program, <b>Enter your image call info</b>:
-<br><small>in the form of: locationURLtoImage?ordertotal=AMOUNT&unique=UNIQUE&otherneededinfo .  edit as needed.  do not enter: &lt;IMG SRC="https:// or the "
-BORDER=0&gt; portions of the image call as those are added automatically. For the total, AMOUNT will be substituted by the cart with the subtotal before taxes and shipping.  If you need a different amount or total, such as from the profit tracker add-on, you will need to edit the order library file for your gateway(s) directly.  For the UNIQUE portion, the invoice number will be used by the cart automatically.  Also add whatever else is needed by your affiliate program for the image call.</small><br>
-<SELECT NAME=sc_http_affiliate_call>
+<br /><small>in the form of: locationURLtoImage?ordertotal=AMOUNT&unique=UNIQUE&otherneededinfo .  edit as needed.  do not enter: &lt;IMG SRC="https:// or the "
+BORDER=0&gt; portions of the image call as those are added automatically. For the total, AMOUNT will be substituted by the cart with the subtotal before taxes and shipping.  If you need a different amount or total, such as from the profit tracker add-on, you will need to edit the order library file for your gateway(s) directly.  For the UNIQUE portion, the invoice number will be used by the cart automatically.  Also add whatever else is needed by your affiliate program for the image call.</small><br />
+<select name=sc_http_affiliate_call>
 <option>$sc_http_affiliate_call</option>
 <option>http</option>
 <option>https</option>
-</SELECT>&nbsp;&nbsp;&nbsp;
-tag info: <INPUT NAME="sc_temp_affiliate_call" TYPE="TEXT" SIZE=45 
-MAXLENGTH="225" VALUE="$sc_temp_affiliate_call">
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
-
-<TR>
-<td colspan=2><br><b>Advanced Feature Only & Beta/Experimental</b>:<br><b>Running an SSI store?</b>  If using Server Side Includes to execute 
-the store, you will need meta cookies too! &nbsp; For normal operation 
-choose NO. If not sure, leave at NO or your customers will loose their cart contents <small>... and ... your store will blow up, your house will shake to pieces, you will wake up tomorrow bald as a hippo, and the little children in your neighborhood will cry without knowing why.</small></td>
-<TD colspan=2><SELECT NAME=running_an_SSI_store>
-<OPTION>$sc_running_an_SSI_store</OPTION>
-<OPTION>yes</OPTION> 
-<OPTION>no</OPTION> 
-</SELECT></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
-
-<TR>
-<td colspan=2><b>Use meta cookies instead of pre-content header style cookies?</b>  <small>Leave at "no" unless you know how to use this feature</small></td>
-<TD colspan=2><SELECT NAME=use_meta_cookies>
-<OPTION>$sc_use_meta_cookies</OPTION>
-<OPTION>yes</OPTION> 
-<OPTION>no</OPTION> 
-</SELECT></TD>
-</TR>
-
-
-<TR>
-<TD><br></TD>
-</TR>
-<TR>
-<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Security Section</b></font></TD>
-</TR>
-<TR>
-<TD><br></TD>
-</TR>
-
-<TR>
-<TD colspan=2><b>Do you wish to verify orders with the database info?</b>  <small>Say "no" 
-if running an HTML-based store without a database or adding to the cart from non-agora.cgi parsed pages. NOTE: links to cart and database still need to come from the same domain name as AgoraCart runs from</small></TD>
-<TD colspan=2><SELECT NAME="sc_order_check_db">
-<OPTION>$sc_order_check_db</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
+</select>&nbsp;&nbsp;&nbsp;
+tag info: <input name="sc_temp_affiliate_call" TYPE="TEXT" SIZE=45 
+MAXLENGTH="225" value="$sc_temp_affiliate_call">
+</td>
+</tr>
+
+<input type="HIDDEN" name="running_an_SSI_store" value="no">
+<input type="HIDDEN" name="use_meta_cookies" value="no">
+
+<tr>
+<td><br /></td>
+</tr>
+<tr>
+<td colspan=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Security Section</b></font></td>
+</tr>
+<tr>
+<td><br /></td>
+</tr>
+
+<tr>
+<td colspan=2><b>Do you wish to verify orders with the database info?</b>  <small>Say "no" 
+if running an HTML-based store without a database or adding to the cart from non-agora.cgi parsed pages. NOTE: links to cart and database still need to come from the same domain name as AgoraCart runs from</small></td>
+<td colspan=2><select name="sc_order_check_db">
+<option>$sc_order_check_db</option>
+<option>yes</option>
+<option>no</option>
+</select></td>
+</tr>
 
-<TR>
+<tr>
+<td colspan=4><hr /></td>
+</tr>
+
+<tr>
 <td colspan=2><b>Use Verified Option Values?</b>  <small>For security reasons it is a good idea to say YES here.  This will check options (pricing and names) on products ordered against the values found in the actual options file that is listed with the product in the database. If you use dynamic options (those files built via dynamically with multiple files), then set this to NO.  NOTE: this feature currently does not verify the more advanced variable options.</small></td>
-<TD colspan=2><SELECT NAME=sc_use_verified_opt_values>
-<OPTION SELECTED>$sc_use_verified_opt_values</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION> 
-</SELECT></TD>
-</TR>
-<TR>
-<TD COLSPAN=4><BR></TD>
-</TR>
-<TR>
+<td colspan=2><select name=sc_use_verified_opt_values>
+<option selected>$sc_use_verified_opt_values</option>
+<option>yes</option>
+<option>no</option> 
+</select></td>
+</tr>
+<tr>
+<td colspan=4><br /></td>
+</tr>
+<tr>
 <td colspan=2><b>Prevent Negative Priced Options?</b>  <small>For security reasons it is a good idea
 to say YES here. This will disallow negative priced options.  If having problems with variable option discounts, set to NO</small></td>
-<TD colspan=2><SELECT NAME=sc_negative_priced_options>
-<OPTION SELECTED>$sc_negative_priced_options</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION> 
-</SELECT></TD>
-</TR>
-<TR>
-<TD COLSPAN=4><BR></TD>
-</TR>
-<TR>
+<td colspan=2><select name=sc_negative_priced_options>
+<option selected>$sc_negative_priced_options</option>
+<option>yes</option>
+<option>no</option> 
+</select></td>
+</tr>
+<tr>
+<td colspan=4><br /></td>
+</tr>
+<tr>
 <td colspan=2><b>Turnoff Variable Options?</b>  <small>If you are not using Variable Options, then set to YES. This will increase the speed and security of your store if disabled (set to yes).  These are different than standard options listed above that are used by most users.   Variable options allow for discount or volume pricing, per an individual product, as well as other advanced option capabilites, but requires AgoraScript/Perl coding and manual edits/customization of the individual product option files.  Default is NO, which enables the use of variable options.</small></td>
-<TD colspan=2><SELECT NAME=sc_disable_variable_options>
-<OPTION SELECTED>$sc_disable_variable_options</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION> 
-</SELECT></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><BR></TD>
-</TR>
-<TR>
+<td colspan=2><select name=sc_disable_variable_options>
+<option selected>$sc_disable_variable_options</option>
+<option>yes</option>
+<option>no</option> 
+</select></td>
+</tr>
+
+<tr>
+<td colspan=4><br /></td>
+</tr>
+<tr>
 <td colspan=2><b>Allow more than one instance of an Option File loaded per product with %%Load_Option_file%% tokens?</b> (aka nested option loading) <small>This is an Advanced Feature. Default is NO.  If you have numerous option files that share common elements, setting this to YES will allow you to load the option file more than once per product using <b>%%Load_Option_file option-file-name.html%%</b> within the already called option files.  The error indicator will look like: <b>(reload of option graphicSelect.html attempted!)</b> where the option file would be expected to be displayed.  This error means that you are trying to load the option files inside of one another. If unsure how this works, leave at NO as it is not recommended unless absolutely necessary for more complex stores.</small></td>
-<TD colspan=2><SELECT NAME=sc_enable_multi_load_option_files>
-<OPTION SELECTED>$sc_enable_multi_load_option_files</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION> 
-</SELECT></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
+<td colspan=2><select name=sc_enable_multi_load_option_files>
+<option selected>$sc_enable_multi_load_option_files</option>
+<option>yes</option>
+<option>no</option> 
+</select></td>
+</tr>
+
+<tr>
+<td colspan=4><hr /></td>
+</tr>
 
-<TR>
+<tr>
 <td colspan=2><b>Use 0077 umask?</b>  <small>(NOTE: Most installs of the cart can skip this setting and leave it at NO.)  For security reasons it is a good idea
 to say yes here if the cgi scripts on your Unix host 
 run under your own id.  If you are having problems with files not deleting or being read (cart files, cart cookies, order files, etc), then set to NO.  If you setup your cart via a control panel (Cpanel) or it is based on a Linux operating system, then leave at the default of NO, as your system admin may have already set your file access  "rights" correctly.</small></td>
-<TD colspan=2><SELECT NAME=sc_set_0077_umask>
-<OPTION SELECTED>$sc_set_0077_umask</OPTION>
-<OPTION>$sc_other_0077</OPTION> 
-</SELECT></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
+<td colspan=2><select name=sc_set_0077_umask>
+<option selected>$sc_set_0077_umask</option>
+<option>$sc_other_0077</option> 
+</select></td>
+</tr>
+
+<tr>
+<td colspan=4><hr /></td>
+</tr>
 
-<TR>
+<tr>
 <td colspan=2><b>Scramble CC Info?</b> <small> This option scrambles the CC info that
 is stored on disk temporarily in the VERIFY files in Offline and other
 gateways that take CC info on your server.  Set to YES unless you have
 trouble with blank CC numbers in confirmation emails <b>and</b> you are
 sure that the VERIFY files are safe from prying eyes.</small></td>
-<TD colspan=2><SELECT NAME=scramble_cc_info>
-<OPTION>$sc_scramble_cc_info</OPTION>
-<OPTION>yes</OPTION> 
-<OPTION>no</OPTION> 
-</SELECT></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4><HR></TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4>
-<CENTER>
-<INPUT TYPE="HIDDEN" NAME="system_edit_success" VALUE="yes">
-<INPUT NAME="ChangeMainSettings" TYPE="SUBMIT" VALUE="Submit">
+<td colspan=2><select name=scramble_cc_info>
+<option>$sc_scramble_cc_info</option>
+<option>yes</option> 
+<option>no</option> 
+</select></td>
+</tr>
+
+<tr>
+<td colspan=4><hr /></td>
+</tr>
+
+<tr>
+<td colspan=4>
+<center>
+<input type="HIDDEN" name="system_edit_success" value="yes">
+<input name="ChangeMainSettings" TYPE="SUBMIT" value="Submit">
 &nbsp;&nbsp;
-<INPUT TYPE="RESET" VALUE="Reset">
-</CENTER>
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=4>
-<HR>
-</TD>
-</TR>
+<input type="RESET" value="Reset">
+</center>
+</td>
+</tr>
+
+<tr>
+<td colspan=4>
+<hr />
+</td>
+</tr>
 
-</TABLE>
+</table>
 
-</CENTER>
-</FORM>
+</center>
+</form>
 ENDOFTEXT
 print &$manager_page_footer;
 }
diff -aruN 5.0.000.src/protected/manager.cgi 5.2.000.src/protected/manager.cgi
--- 5.0.000.src/protected/manager.cgi	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/manager.cgi	2007-12-19 23:21:19.000000000 -0600
@@ -4,13 +4,16 @@
 #################################################################
 # do not edit below this line         #
 #################################################################
+
+BEGIN { use lib "./library/additions"; push(@INC,"./library/additions"); }
+
 $mgrdirname = "protected";
 $mgrdir = "./$mgrdirname";
 if ((-f "./wrap_mgr.o") && (!($ARGV[0] =~ /nowrap/i))) {
   print `./wrap_mgr.o`;
   &call_exit;
  }
-$versions{'manager.cgi'}="5.0.000";
+$versions{'manager.cgi'}="5.2.000";
 $manager_program_running = "yes";
 chdir(".."); 
 &setup_manager;
@@ -39,6 +42,30 @@
 &load_custom("$mgrdir",'-ext_lib.pl');
 &load_custom("$mgrdir",'-ext_editor_lib.pl');
 &load_custom("./library",'-mgr_lib.pl');
+my $result_ccbrf = "$mgrdir/custom/customizeable_category_builder_routines.pl";
+if (!(-e $result_ccbrf)) {
+$file = qq| # file ./store/protected/custom/customizeable_category_builder_routines.pl
+#######################################################################################
+#
+# Use this file to customize your category and sub category links that are displayed in the headers
+# or footers of the store when a customer visits your store.
+#
+# change only the values for the variables (they start with a \$) between the single quote marks (')
+# If you are not familiar with editing of programming variables, just use the defaults.
+# 
+#######################################################################################
+\$custom_sc_main_category_indent = '&bull;';
+\$custom_sc_sub_category_indent = '&nbsp;&nbsp; ';
+\$custom_sc_main_category_css_class = 'ac_left_links';
+\$custom_sc_sub_category_css_class = 'ac_left_links';
+\$custom_sc_main_category_end_html = '<br />';
+\$custom_sc_sub_category_end_html = '<br />';
+1;
+|;
+  open(UPDATEFILE,">$mgrdir/custom/customizeable_category_builder_routines.pl") || &my_die("Can't Open $mgrdir/custom/customizeable_category_builder_routines.pl");
+     print (UPDATEFILE $file);
+  close(UPDATEFILE);
+}
 &load_custom("$mgrdir/custom",'');
 &setup_login_check;
 if ($mc_file_upload_ok =~ /yes/) { 
@@ -56,8 +83,10 @@
   &call_exit;
  }
 print "Content-type: text/html\n\n";
-print qq~<meta http-equiv="P3P" content='CP="NOI CUR OUR NOR"'>\n~;  
+print qq~<meta http-equiv="P3P" content='CP="NOI CUR OUR NOR"'>\n~;
+
 &$menu_item_init;
+
 if ($in{'login'} ne "") 
  {
   &action_process_login;
@@ -102,6 +131,12 @@
    &call_exit;
   }
  }
+
+# clear out old carts
+# moved from agora.cgi to speed up cart by Mister Ed September 29, 2007
+&check_cart_expiry;
+&delete_old_carts;
+
 &welcome_screen;
 &call_exit;
 #*********************************************************************
@@ -129,7 +164,7 @@
  $menu_items{'order_log'} = "display_order_log";
  $menu_items{'change_settings_screen'} = "change_settings_screen";
 $menu_items{'order_management_settings_screen'} = "order_management_settings_screen";
-$menu_items{'merchandising_tools_settings_screen'} = "merchandising_tools_settings_screen";
+$menu_items{'content_management_settings_screen'} = "content_management_settings_screen";
  $menu_items{'tracking_screen'} = "tracking_screen";
  $menu_items{'htaccess_screen'} = "setup_htaccess_screen";
  $menu_items{'htaccessSettings'} = "action_htaccess_settings";
@@ -262,6 +297,9 @@
 if (($file_has_contents) && ($in_name{$zname} ne "")) {
   $fup_msg = `cp $in{$zname} $my_img_file 2>&1` . "<br>\b";
   $fup_msg .= `ls -al $my_img_file` . "<br>\n";
+  if ($mc_chmod_uploaded_images =~ /Yes/) {
+      `chmod 0644 $my_img_file`;
+  }
  } else { $fup_msg="no file name for image given $in_name{$zname}" .
  "### " . $in_server_name{$zname} . " ### $zname ###" .
  " $my_img_file <br>$in{$zname} con=$file_has_contents<br>\n";}
@@ -501,7 +539,150 @@
 $year += 1900;
 $month = "$months[$mon]";
 return ($mday,$month,$year);
-}   
+}
+######################################################################
+sub category_list_builder_for_store {
+# updated for AgoraCart 5.x by Mister Ed Jan 11, 2005
+# updated to fit CSS mods by Eric Welin Feb 02, 2005
+# moved from header files to manager function to speed
+# up store.  By Mister Ed September 29, 2007
+
+my($sku,$category,$subcategory,$sc_categories_with_subcats,$sc_categories_no_subcats,$sc_categories_bots_with_subcats,$sc_categories_bots_no_subcats) = '';
+my ($catnumber,$catnumber2,$myset,$category,$category2,$category3)= '';
+local(%db_ele,%subcatarray)= ();
+if (!($sc_db_lib_was_loaded =~ /yes/i)){ 
+  &require_supporting_libraries (__FILE__, __LINE__, "$sc_db_lib_path"); 
+}
+
+if ($sc_use_database_subcats =~ /yes/i) {
+  &get_prod_db_element($db{"product"},*db_ele);
+  foreach $sku (sort (keys %db_ele)) {
+    $catnumber = "";
+    $category = $db_ele{$sku};
+    %subcatarray = %{$db_ele{$category}};
+    $category2 = $category;
+    $category2=~s/ /_/g;
+    if ($sc_count_database_cats =~ /yes/i) {
+      $catnumber = "(" . $db_ele2{$category} . ")";
+    }
+
+    $sc_categories_with_subcats .= qq|\n$custom_sc_main_category_indent<a href="agora.cgi?cart_id=%%cart_id%%&amp;product=$category2&amp;xm=on" class="$custom_sc_main_category_css_class" title="$category">$category</a> $catnumber$custom_sc_main_category_end_html|;
+    $sc_categories_bots_with_subcats .= qq|\n$custom_sc_main_category_indent<a href="agora.cgi?product=$category2&amp;xm=on" class="$custom_sc_main_category_css_class" title="$category">$category</a> $catnumber$custom_sc_main_category_end_html|;
+    foreach $subcategoryarray (sort(keys %subcatarray)) {
+      $category3 = $subcategoryarray;
+      $category3=~s/ /_/g;
+      if ($sc_count_database_cats =~ /yes/i) {
+        $catnumber2 = "(" . $db_ele{$category}->{$subcategoryarray} . ")";
+      }
+     $sc_categories_with_subcats .= qq|\n$custom_sc_sub_category_indent<a href="agora.cgi?cart_id=%%cart_id%%&amp;product=$category2&amp;$sc_subcat_index_field=$category3&amp;xm=on" class="$custom_sc_sub_category_css_class" title="$category3">$category3</a> $catnumber2$custom_sc_sub_category_end_html|;
+     $sc_categories_bots_with_subcats .= qq|\n$custom_sc_sub_category_indent<a href="agora.cgi?product=$category2&amp;$sc_subcat_index_field=$category3&amp;xm=on" class="$custom_sc_sub_category_css_class" title="$category3">$category3</a> $catnumber2$custom_sc_sub_category_end_html|;
+    }
+  }
+  $myset .= "\$sc_categories_with_subcats = qq|$sc_categories_with_subcats|;\n";
+  $myset .= "\$sc_categories_bots_with_subcats = qq|$sc_categories_bots_with_subcats|;\n";
+
+}
+else { 
+  &get_prod_db_element($db{"product"},*db_ele);
+  foreach $sku (keys %db_ele) {
+    $category = $db_ele{$sku};
+    $category_list{$category}++;
+  }
+  foreach $category (sort(keys %category_list)) {
+    $category2 = $category;
+    $category2=~s/_/ /g;
+    $sc_categories_no_subcats .= qq|\n$custom_sc_main_category_indent <a href="agora.cgi?cart_id=%%cart_id%%&amp;product=$category&amp;xm=on" class="$custom_sc_main_category_css_class" title="$category2">$category2</a>$custom_sc_main_category_end_html|;
+    $sc_categories_bots_no_subcats .= qq|\n$custom_sc_main_category_indent <a href="agora.cgi?product=$category&amp;xm=on" class="$custom_sc_main_category_css_class" title="$category2">$category2</a>$custom_sc_main_category_end_html|;
+  }
+  $myset .= "\$sc_categories_no_subcats = qq|$sc_categories_no_subcats|;\n";
+  $myset .= "\$sc_categories_bots_no_subcats = qq|$sc_categories_bots_no_subcats|;\n";
+}
+
+&update_store_settings('CATEGORYLIST',$myset);
+
+}
+#######################################################################
+#                        Delete Old Carts.                            #
+#######################################################################
+
+    # delete_old_carts is a subroutine which is used to prune
+    # the carts directory, cleaning out all the old carts
+    # after some time interval defined in the setup file.  It
+    # takes no argumnetes and is called with the following
+    # syntax:
+    #
+    # &delete_old_carts;
+
+sub check_cart_expiry {
+  &check_cart_type_file_expiry("$sc_cart_path");
+  &check_cart_type_file_expiry("$sc_verify_order_path");
+  &check_cart_type_file_expiry("$sc_server_cookie_path");
+ }
+
+sub check_cart_type_file_expiry {
+local($cart_type_file_path) = @_;
+if (-M "$cart_type_file_path" > $sc_number_days_keep_old_carts)
+{
+if ($cart_type_file_path =~ /cart/i) {
+  &codehook("delete-cart");
+	if (($sc_db_index_for_inventory) && ($sc_inventory_subtract_at_add_to_cart =~ /yes/i)) {
+		open (CART, "$cart_type_file_path") || &errorcode(__FILE__, __LINE__, "$sc_cart_path", "$!", "ignore", "FILE OPEN ERROR", "0");
+		while (<CART>) {
+			my @row = split (/\|/, $_);
+		&add_inventory($row[1], $row[0]);
+	}
+close (CART);
+}
+ } else {
+  &codehook("delete-non-cart");
+ }
+unlink("$cart_type_file_path");
+}
+}
+
+sub delete_old_carts
+{
+
+    # The subroutine begins by grabbing a listing of all of
+    # the client created shoppping carts in the User_carts
+    # directory.
+    #
+    # It then opens the directory and reads the contents using
+    # grep to grab every file with the extension _cart. Then
+    # it closes the directory.  
+    #
+    # If the script has any trouble opening the directory,
+    # it will output an error message using the
+    # file_open_error subroutine discussed later.  To the
+    # subroutine, it will pass the name of the file which had
+    # trouble, as well as the current routine in the script
+    # having trouble , the filename and the current line
+    # number.
+
+opendir (USER_CARTS, "$sc_user_carts_directory_path") || &file_open_error("$sc_user_carts_directory_path", "Delete Old Carts", __FILE__, __LINE__);
+@carts = grep(/\.[0-9]/,readdir(USER_CARTS)); # must have . followed by digits
+closedir (USER_CARTS);
+      
+    # Now, for every cart in the directory, delete the cart if
+    # it is older than half a day.  The -M file test returns
+    # the number of days since the file was last modified.
+    # Since the result is in terms of days, if the value is
+    # greater than the value of $sc_number_days_keep_old_carts
+    # set in agora.setup.db, we'll delete the file.
+
+foreach $cart (@carts)
+{
+# code below deletes carts and other files in this directory that have expired
+$sc_cart_path = "$sc_user_carts_directory_path/$cart";
+$sc_cart_path =~ /([\w\-\=\+\/\.]+)/;
+$sc_cart_path = "$1";
+$sc_cart_path = "" if ($sc_cart_path eq ".");
+$sc_cart_path =~ s/^\/+//; # Get rid of any residual / prefix
+&check_cart_type_file_expiry("$sc_cart_path");
+}# end of foreach
+
+}# End of sub delete_old_carts
+
 #######################################################################
 sub call_exit {
   codehook("cleanup_before_exit");
diff -aruN 5.0.000.src/protected/Merchandising_Tools-ext_lib.pl 5.2.000.src/protected/Merchandising_Tools-ext_lib.pl
--- 5.0.000.src/protected/Merchandising_Tools-ext_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/Merchandising_Tools-ext_lib.pl	2007-12-19 23:21:19.000000000 -0600
@@ -1,4 +1,4 @@
-# file ./store/protected/Merchandising_Tools-ext_lib.pl
+# file ./store/protected/Merchandising_tools-ext_lib.pl
 #########################################################################
 #
 # Copyright (c) 2005 to Date K-Factor Technologies, Inc.
@@ -36,14 +36,14 @@
 # K-Factor Technologies, Inc. in order to distribute this add-on.
 #
 ##########################################################################
-$versions{'Merchandising_Tools-ext_lib.pl'} = "5.0.000";
+$versions{'Merchandising_Tools-ext_lib.pl'} = "5.2.000";
 
 {
  local ($modname) = 'merchant_tools_and_resources';
- &register_extension($modname,"Merchandising Tools",$versions{$modname});
+ &register_extension($modname,"CMS - Content Management System",$versions{$modname});
    &register_menu('display_MerchantTools_screen',"display_MerchantTools_screen",
  $modname,"Merchant Tools & Resources screen");
-   &add_item_to_manager_menu("Merchandising Tools","merchandising_tools_settings_screen=yes","merchandising_tools_settings_screen");
+   &add_item_to_manager_menu("CMS - Content Management","content_management_settings_screen=yes","content_management_settings_screen");
    &add_merchtools_settings_choice("Merchant Tools & Resources"," Merchant Tools & Resources ",
  "display_MerchantTools_screen");
 }
@@ -63,7 +63,7 @@
 <TABLE>
 <TR>
 <TD>
-<FONT FACE=ARIAL size=2>Welcome to the <b>AgoraCart</b> Merchant Resources Page for your store. This page lists additional tools and resources to help you promote your store.<br/><br/></font></TD>
+<FONT FACE=ARIAL size=2>Welcome to the <b>AgoraCart</b> Merchant Resources Page for your store. This page lists additional tools and resources to help you promote and use your store.<br/><br/></font></TD>
 </TR>
 </TABLE>
 </CENTER>
@@ -71,105 +71,123 @@
 <CENTER>
 <TABLE>
 <TR>
-<TD><br></TD>
+<TD><br /></TD>
 </TR>
 <TR>
-<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Site Metrics</b></font></TD>
+<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Online Directories</b></font></TD>
 </TR>
 <TR>
-<TD><br></TD>
+<TD><br /></TD>
 </TR>
 <TR>
 <TD colspan=4>
 <font size="2" face="Arial, Helvetica, sans-serif">
+<a href="http://www.iMegaMall.com" target="_new"><img src="images/Imega5d.gif" width="180" height="44" border="0" align=left> <b>iMegaMall</b></a><br />
+
+Increase your search engine rankings with real link in iMegaMall.com.  iMegaMall aggressively provides very small to mid-sized advertisers the opportunity to get their name in front of targeted shoppers and visitors without having giant internet companies buying up all the premium ad spots. <br /><br />
 
-<a href="http://www.WebStyleStats.com" target="_new"><img src="images/webstyle.jpg" width="120" height="55" border="0" align=left> <b>Web Style Stats & Site Metrics</b></a><br>
+iMegaMall provides businesses and information content providers with a quality presence to online consumers and offers a wide range of targeted advertising and directory listing options through its large mall-department-category infrastructure of 28 Main Departments, over 500 Shopping & Informational Categories.<br /><br />
+
+Sign up today for your free listing at: <a href="http://www.iMegaMall.com/info/listing.htm" target="_new">www.iMegaMall.com/info/listing.htm</a>
+<br />
+<br /><br />
 
-Use Web Style Stats to measure all your advertising and marketing campaigns.  Web Style Stats will help you identify exactly what is working to drive visitors to your site, which pages work best in tests, and which ones are bring your customers to your order pages. Using Web Style Stats you will be able to track campaigns, keywords, web pages, links and banners that are not effective and those that are, thereby saving time, money and hassle in finding those campaigns that work best for your site and store, while optimizing your web site's  and/or store's performance.<br><br>
 
-Web Style Stats is conducting a beta for alimited time.  During this time you can sign up for a free 7 day trial with the additional benefit of a low monthly rate of $2.99 per month for as long as your account remains valid.  Your account remains valid and still tracks your stats for up to 90 days from when your paid access has expired, which is nice and convenient for those that only need to track their performance every couple of months, at which point if you desire to login and view site performance, simply renew access for 30 days or longer.<br><br>
+<a href="http://www.AgoraCart.com/pages/Shopping/" target="_blank"><img src="images/agoracart.jpg" width="56" height="55" border="0" align=left> <b>AgoraCart Shops</b></a> <b>(real stores using AgoraCart)</b><br />
 
-Sign up today for your free trial and lock in your promotional price during this beta period at: <a href="http://www.WebStyleStats.com" target="_new">www.WebStyleStats.com</a>
-<br><br><br>
+List your Agoracart based store in the shopping section at AgoraCart.com. Listings are free as long as your site uses and/or promotes AgoraCart.<br />
+Sign up today for your free listing at: <a href="http://www.agoracart.com/cgibin/add.cgi" target="_new">www.AgoraCart.com/cgibin/add.cgi</a>
+<br />
 </font>
 
 </TD>
 </TR>
 <TR>
-<TD><br></TD>
+<TD><br /></TD>
 </TR>
 <TR>
-<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Online Directories</b></font></TD>
+<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Search Engines</b></font></TD>
 </TR>
 <TR>
-<TD><br></TD>
+<TD><br /></TD>
 </TR>
 <TR>
 <TD colspan=4>
 <font size="2" face="Arial, Helvetica, sans-serif">
-<a href="http://www.iMegaMall.com" target="_new"><img src="images/Imega5d.gif" width="180" height="44" border="0" align=left> <b>iMegaMall</b></a><br>
 
-Increase your search engine rankings with real link in iMegaMall.com.  iMegaMall aggressively provides very small to mid-sized advertisers the opportunity to get their name in front of targeted shoppers and visitors without having giant internet companies buying up all the premium ad spots. <br><br>
-
-iMegaMall provides businesses and information content providers with a quality presence to online consumers and offers a wide range of targeted advertising and directory listing options through its large mall-department-category infrastructure of 28 Main Departments, over 500 Shopping & Informational Categories.<br><br>
-
-Sign up today for your free listing at: <a href="http://www.iMegaMall.com/info/listing.htm" target="_new">www.iMegaMall.com/info/listing.htm</a>
-<br>
-<br><br>
-
-
-<a href="http://www.AgoraCart.com/pages/Shopping/" target="_blank"><img src="images/agoracart.jpg" width="56" height="55" border="0" align=left> <b>AgoraCart Shops</b></a><br>
-
-List your Agoracart based store in the shopping section at AgoraCart.com. Listings are free as long as your site uses and/or promotes AgoraCart.<br>
-Sign up today for your free listing at: <a href="http://www.agoracart.com/cgibin/add.cgi" target="_new">www.AgoraCart.com/cgibin/add.cgi</a>
-<br>
+<a href="http://www.SnooperClick.com" target="_blank"><img src="images/snooperclick.jpg" width="158" height="39" border="0" align=left> <b>SnooperClick.com</b></a><br />
+Snoop, Click and Go! with the fantastic SnooperClick Search Engine.  Advertise in SnooperClick for free with a \$2 trial balance, or earn extra money for every valid search you refer.  Or integrate SnooperClick's search results and enhance the content of your site by placing a little bit of code into your website's html pages and earn extra money at the same time.<br /><br />
+Sign up as a advertiser or affiliate at: <a href="http://www.SnooperClick.com" target="_blank">www.SnooperClick.com</a>
+<br />
 </font>
 
 </TD>
 </TR>
+
+
 <TR>
-<TD><br></TD>
+<TD><br /></TD>
 </TR>
 <TR>
-<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Search Engines</b></font></TD>
+<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Professional Freelance Exchange</b></font></TD>
 </TR>
 <TR>
-<TD><br></TD>
+<TD><br /></TD>
 </TR>
 <TR>
 <TD colspan=4>
 <font size="2" face="Arial, Helvetica, sans-serif">
 
-<a href="http://www.SnooperClick.com" target="_blank"><img src="images/snooperclick.jpg" width="158" height="39" border="0" align=left> <b>SnooperClick.com</b></a><br>
-Snoop, Click and Go! with the fantastic SnooperClick Search Engine.  Advertise in SnooperClick for free with a $2 trial balance, or earn extra money for every valid search you refer.  Or integrate SnooperClick's search results and enhance the content of your site by placing a little bit of code into your website's html pages and earn extra money at the same time.<br><br>
-Sign up as a advertiser or affiliate at: <a href="http://www.SnooperClick.com" target="_blank">www.SnooperClick.com</a>
-<br>
+<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 />
+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>
+<br />
 </font>
 
 </TD>
 </TR>
 
-
 <TR>
-<TD><br></TD>
+<TD><br /></TD>
 </TR>
 <TR>
-<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>Professional Freelance Exchange</b></font></TD>
+<TD COLSPAN=4 bgcolor=#99CC99 align=center><font face="Arial, Helvetica, sans-serif" size=+2><b>AgoraCart Project/Community Website Links</b></font></TD>
 </TR>
 <TR>
-<TD><br></TD>
+<TD><br /></TD>
 </TR>
 <TR>
 <TD colspan=4>
 <font size="2" face="Arial, Helvetica, sans-serif">
+This section covers various links to the AgoraCart community, manuals, news, and other resources avaiable at the official AgoraCart websites.
+<br />
 
-<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>
-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>
+            <br /><font size="+1"><b>Help & Support</b></font><br /><br />
+            <a href="http://www.AgoraCart.com/agorawiki/" target="_blank">User Manuals / Wiki</a> Official Manuals and guides. Users may submit, update or edit entires in a collaborative effort to improve the documentation for AgoraCart.<br /><br />
+            <a href="http://www.agoraguide.com/faq/" target="_blank">Free Support Forum</a> The official forums for the non-pro version of the cart.<br /><br />
+            <a href="http://members.AgoraCartPro.com/proforum/" target="_blank">Pro Version Users Forum</a> The official forums for the Pro Version of the cart.<br /><br />
+            <a href="http://www.agoracartpro.com/chat/" target="_blank">Pro Version Chat</a> Chat rooms for Pro Version Members to share information and tips in real time<br /><br /><br />
+            <a href="https://www2.hosted-projects.com/bugzilla/AgoraCart/" target="_blank">Bugzilla</a> Submit and track bugs for all versions of AgoraCart<br /><br />
+            <a href="http://www.AgoraCart.com/pages/Authorized_Solutions_Providers/" target="_blank">Certified AgoraCart Professionals</a> A list of solutions providers pre-screened and approved by AgoraCart.  However, work by anyone on this list is not guaranteed by AgoraCart <small>(aka: use at your own risk).</small><br /><br />
+            <a href="http://www.agoracart.com/proshop/agora.cgi?product=Tech_Support" target="_blank">TechSupport</a> A paid tech support option performed by the official AgoraCart personnel.<br /><br />
+
+            <br /><font size="+1"><b>\@ AgoraCart</b></font><br /><br />
+            <a href="http://www.AgoraCart.com/" target="_blank">AgoraCart.com</a> Main AgoraCart Site<br /><br />
+            <a href="http://www.AgoraCartPro.com/" target="_blank">AgoraCartPro.com</a> Main Pro Version Site<br /><br />
+            <a href="http://www.AgoraCart.com/ancient_greek_agora" target="_blank">The Ancient Greek Agora</a> The inspiration behind the AgoraCart name.<br /><br />
+            <a href="http://www.AgoraCart.com/blog" target="_blank">Blog: News &amp; Updates</a> News and Updates on AgoraCart. Also serves as Mister Ed's Blog, the primary ecommerce engineer behind the AgoraCart project.<br /><br />
+            <a href="http://www.AgoraCart.com/logos.htm" target="_blank">"Powered by" Logos</a> Logos to show off your pride in using the most flexible open source shopping cart solution on the web.<br /><br />
+            <a href="http://www.AgoraCart.com/contest.html" target="_blank">Cool Add-ons Contest</a> Contest for designers and programmers to show off their talents.<br /><br />
+            <a href="http://www.AgoraCart.com/foundersclub.htm" target="_blank">Founders Club</a> Official Sponsors and Partners of the AgoraCart project..<br /><br />
+            <a href="http://www.AgoraCart.com/dashboard.html" target="_blank">AgoraCart Community Dashboard</a> See the snap-shots and listings for what's happening with others in the AgoraNaut commmunity.<br /><br />
+
+            <a href="http://members.AgoraCartPro.com/downloads/" target="_blank">Pro Version Downloads</a> For Pro Version Members Only<br /><br />
+            <a href="http://www.AgoraCart.com/download/" target="_blank">More Downloads</a><br /><br />
+            <a href="http://www.AgoraCart.com/proshop/agora.cgi" target="_blank">The AgoraCart Store</a> Buy official AgoraCart add-ons and Pro Version Memberships.<br />
 
-Sign up as a webmaster, affiliate, or a freelancer at: <a href="http://www.AgoraXchange.com" target="_blank">www.AgoraXchange.com</a>
-<br>
 </font>
 
 </TD>
@@ -177,7 +195,7 @@
 
 </TABLE>
 </CENTER>
-<br><br>
+<br /><br />
 ENDOFTEXT
 
 print &$manager_page_footer;
@@ -201,7 +219,7 @@
 if($in{'system_edit_success'} ne "")
 {
 print <<ENDOFTEXT;
-<p align="center"><br><font color="#FF0000" face="Arial"><strong>$revmsg</strong></font></p><br>
+<p align="center"><br /><font color="#FF0000" face="Arial"><strong>$revmsg</strong></font></p><br />
 ENDOFTEXT
 }
 
@@ -227,10 +245,10 @@
       $singlename =~ s/\n//ig;
 
 ##for testing:
-# print "order number $singlename written <br>";
-# print "order is:<br>";
+# print "order number $singlename written <br />";
+# print "order is:<br />";
 # foreach $line(@single){
-# print "$line<br>";
+# print "$line<br />";
 # }
 # exit;
 ##end for testing
diff -aruN 5.0.000.src/protected/misc/bestsellers.pl 5.2.000.src/protected/misc/bestsellers.pl
--- 5.0.000.src/protected/misc/bestsellers.pl	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/misc/bestsellers.pl	2007-12-08 23:48:50.000000000 -0600
@@ -0,0 +1 @@
+ac_left_links|00001|test this link|00002|test this one too||||||||||||||||
\ No newline at end of file
diff -aruN 5.0.000.src/protected/misc/customizeable_category_builder_routines.pl 5.2.000.src/protected/misc/customizeable_category_builder_routines.pl
--- 5.0.000.src/protected/misc/customizeable_category_builder_routines.pl	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/misc/customizeable_category_builder_routines.pl	2007-12-08 23:48:50.000000000 -0600
@@ -0,0 +1,17 @@
+ # file ./store/protected/custom/customizeable_category_builder_routines.pl
+#######################################################################################
+#
+# Use this file to customize your category and sub category links that are displayed in the headers
+# or footers of the store when a customer visits your store.
+#
+# change only the values for the variables (they start with a $) between the single quote marks (')
+# If you are not familiar with editing of programming variables, just use the defaults.
+# 
+#######################################################################################
+$custom_sc_main_category_indent = '&bull;';
+$custom_sc_sub_category_indent = '&nbsp;&nbsp; ';
+$custom_sc_main_category_css_class = 'ac_left_links';
+$custom_sc_sub_category_css_class = 'ac_left_links';
+$custom_sc_main_category_end_html = '<br />';
+$custom_sc_sub_category_end_html = '<br />';
+1;
diff -aruN 5.0.000.src/protected/misc/index.html 5.2.000.src/protected/misc/index.html
--- 5.0.000.src/protected/misc/index.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/misc/index.html	2007-12-08 23:48:51.000000000 -0600
@@ -0,0 +1 @@
+Restricted Area
\ No newline at end of file
diff -aruN 5.0.000.src/protected/misc/mgr_css.pl 5.2.000.src/protected/misc/mgr_css.pl
--- 5.0.000.src/protected/misc/mgr_css.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/misc/mgr_css.pl	2007-12-08 23:48:51.000000000 -0600
@@ -1,4 +1,3 @@
-$mc_template_css_at_root = "no";
-$mc_levels_to_root = "0";
-$mc_additional_head_info = qq~~;
-$mc_css_row_count = "30";
+$mc_template_css_at_root = "";
+$mc_levels_to_root = "";
+$mc_css_row_count = "40";
diff -aruN 5.0.000.src/protected/misc/mgr_memberstatus.pl 5.2.000.src/protected/misc/mgr_memberstatus.pl
--- 5.0.000.src/protected/misc/mgr_memberstatus.pl	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/misc/mgr_memberstatus.pl	2007-12-08 23:48:51.000000000 -0600
@@ -0,0 +1,4 @@
+$mgr_basic_membership_status = "";
+$mgr_lifetime_membership_status = "";
+$mgr_booster_membership_status = "";
+1;
diff -aruN 5.0.000.src/protected/misc/mgr_miscmain.pl 5.2.000.src/protected/misc/mgr_miscmain.pl
--- 5.0.000.src/protected/misc/mgr_miscmain.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/misc/mgr_miscmain.pl	2007-12-08 23:48:51.000000000 -0600
@@ -1,2 +1,8 @@
 $mc_images_dir = "./html/images";
-$mgr_shall_i_log_accesses = "yes";
+$mc_chmod_uploaded_images = "No";
+$sc_template_css_at_root = "yes";
+$sc_levels_to_root = "0";
+$mc_css_file_path = "";
+$mc_additional_head_info = qq||;
+$mgr_shall_i_log_accesses = "no";
+1;
\ No newline at end of file
diff -aruN 5.0.000.src/protected/misc/mgr_pass.pl 5.2.000.src/protected/misc/mgr_pass.pl
--- 5.0.000.src/protected/misc/mgr_pass.pl	2006-10-31 09:45:48.000000000 -0600
+++ 5.2.000.src/protected/misc/mgr_pass.pl	2008-01-28 13:43:13.000000000 -0600
@@ -1,4 +1,7 @@
 $username = "[% username %]";
 $password = "[% password %]";
+$proUserName = "";
+$proPassWord = "";
 $mc_use_cookie_login = "yes";
 $a_unique_name = "thisisunique_g8eq.login";
+1;
diff -aruN 5.0.000.src/protected/misc/.mgr_pass.pl.swp 5.2.000.src/protected/misc/.mgr_pass.pl.swp
--- 5.0.000.src/protected/misc/.mgr_pass.pl.swp	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/misc/.mgr_pass.pl.swp	2008-01-28 13:56:24.000000000 -0600
@@ -0,0 +1 @@
+b0VIM 7.0      Q0G3  root                                    keith.dev.cpanel.net                    /usr/local/cpanel/cpaddons/cPanel/Ecommerce/AgoraCart/5.2.000.src/protected/misc/mgr_pass.pl                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
 3210    #"! U                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 tp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ad    Q                      T  Q  P                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           1; $a_unique_name = "thisisunique_g8eq.login"; $mc_use_cookie_login = "yes"; $proPassWord = ""; $proUserName = ""; $password = "[% password %]"; $username = "[% username %]"; 
\ No newline at end of file
diff -aruN 5.0.000.src/protected/misc/newproducts.pl 5.2.000.src/protected/misc/newproducts.pl
--- 5.0.000.src/protected/misc/newproducts.pl	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/misc/newproducts.pl	2007-12-08 23:48:52.000000000 -0600
@@ -0,0 +1 @@
+ac_left_links|00001|one||||||||||||||||||
\ No newline at end of file
diff -aruN 5.0.000.src/protected/misc/ship_admin.pl 5.2.000.src/protected/misc/ship_admin.pl
--- 5.0.000.src/protected/misc/ship_admin.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/misc/ship_admin.pl	2007-12-08 23:48:52.000000000 -0600
@@ -1,5 +1,16 @@
 $sc_alt_origin_db_counter2 = "";
 $sc_howmanycustomshippingmethods = "4";
+$sc_ups03 = "yes";
+$sc_ups12 = "yes";
+$sc_ups02 = "yes";
+$sc_ups59 = "yes";
+$sc_ups13 = "yes";
+$sc_ups01 = "yes";
+$sc_ups14 = "yes";
+$sc_ups11 = "yes";
+$sc_ups07 = "yes";
+$sc_ups08 = "yes";
+$sc_ups54 = "yes";
 $sc_uspsparcelpost = "yes";
 $sc_uspsprioritymail = "yes";
 $sc_uspsexpressmail = "yes";
diff -aruN 5.0.000.src/protected/misc/standardheadersettings.pl 5.2.000.src/protected/misc/standardheadersettings.pl
--- 5.0.000.src/protected/misc/standardheadersettings.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/misc/standardheadersettings.pl	2007-12-08 23:49:19.000000000 -0600
@@ -1 +1 @@
-Powered by AgoraCart - AgoraCart.com|#ffffff|+1|Thanks for Visiting our Store!|yellow|+1|#680098|#cccccc|steelgrey.jpg|arial,verdana|2|red|yes|Shopping Categories|yes|Look For Gifts under this Price|yes|Company Info|yes|#cccccc|steelgrey.jpg|arial,verdana|#000000|#0000ff|#cccccc|steelgrey.jpg
\ No newline at end of file
+1;
\ No newline at end of file
diff -aruN 5.0.000.src/protected/options/index.html 5.2.000.src/protected/options/index.html
--- 5.0.000.src/protected/options/index.html	1969-12-31 18:00:00.000000000 -0600
+++ 5.2.000.src/protected/options/index.html	2006-08-02 22:23:27.000000000 -0500
@@ -0,0 +1 @@
+Restricted Area
\ No newline at end of file
diff -aruN 5.0.000.src/protected/Order_Manager-ext_lib.pl 5.2.000.src/protected/Order_Manager-ext_lib.pl
--- 5.0.000.src/protected/Order_Manager-ext_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/Order_Manager-ext_lib.pl	2008-01-14 21:04:11.000000000 -0600
@@ -38,7 +38,7 @@
 # K-Factor Technologies, Inc. in order to distribute this add-on to AgoraCart (aka Agora.cgi).
 #
 ##########################################################################
-$versions{'Order_Manager-ext_lib.pl'} = "5.0.000";
+$versions{'Order_Manager-ext_lib.pl'} = "5.2.000";
 
 # fax number added March 11, 2006 and otehr little fixes on phone nembers by Mister Ed
 
@@ -360,7 +360,7 @@
     if (-e $filename) {
         open (ORDERLOGLOOK, "$filename");
         $stuff=<ORDERLOGLOOK>;
-        ($in{'year'},$in{'month'},$in{'day'},$in{'invoiceNumber'},$in{'customerNumber'},$in{'orderStatus'},$in{'shiptrackingID'},$in{'firstName'},$in{'lastName'},$in{'fullName'},$in{'companyName'},$in{'customerPhone'},$in{'faxNumber'},$in{'emailAddress'},$in{'orderFromAddress'},$in{'customerAddress2'},$in{'customerAddress3'},$in{'orderFromCity'},$in{'orderFromState'},$in{'orderFromPostal'},$in{'orderFromCountry'},$in{'shipToName'},$in{'shipToAddress'},$in{'shipToAddress2'},$in{'shipToAddress3'},$in{'shipToCity'},$in{'shipToState'},$in{'shipToPostal'},$in{'shipToCountry'},$in{'shiptoResidential'},$in{'insureShipment'},$in{'shipMethod'},$in{'shippingTotal'},$in{'salesTax'},$in{'tax1'},$in{'tax2'},$in{'tax3'},$in{'discounts'},$in{'netProfit'},$in{'subTotal'},$in{'orderTotal'},$in{'affiliateTotal'},$in{'affiliateID'},$in{'affiliateMisc'},$in{'user1'},$in{'user2'},$in{'user3'},$in{'user4'},$in{'user5'},$in{'adminMessages'},$in{'cartContents'},$in{'GatewayUsed'},$in{'shippingMessages'},$in{'xcomments'},$in{'termsOfService'}) = split(/\t/,$stuff);
+        ($in{'year'},$in{'month'},$in{'day'},$in{'invoiceNumber'},$in{'customerNumber'},$in{'orderStatus'},$in{'shiptrackingID'},$in{'firstName'},$in{'lastName'},$in{'fullName'},$in{'companyName'},$in{'customerPhone'},$in{'faxNumber'},$in{'emailAddress'},$in{'orderFromAddress'},$in{'customerAddress2'},$in{'customerAddress3'},$in{'orderFromCity'},$in{'orderFromState'},$in{'orderFromPostal'},$in{'orderFromCountry'},$in{'shipToName'},$in{'shipToAddress'},$in{'shipToAddress2'},$in{'shipToAddress3'},$in{'shipToCity'},$in{'shipToState'},$in{'shipToPostal'},$in{'shipToCountry'},$in{'shiptoResidential'},$in{'insureShipment'},$in{'shipMethod'},$in{'shippingTotal'},$in{'salesTax'},$in{'tax1'},$in{'tax2'},$in{'tax3'},$in{'discounts'},$in{'netProfit'},$in{'subTotal'},$in{'orderTotal'},$in{'affiliateTotal'},$in{'affiliateID'},$in{'affiliateMisc'},$in{'user1'},$in{'user2'},$in{'user3'},$in{'user4'},$in{'user5'},$in{'adminMessages'},$in{'cartContents'},$in{'GatewayUsed'},$in{'shippingMessages'},$in{'xcomments'},$in{'termsOfService'},$in{'discountCode'},$in{'user6'},$in{'user7'},$in{'user8'},$in{'user9'},$in{'user10'},$in{'buySafe'},$in{'order_payment_type_user1'},$in{'order_payment_type_user2'},$in{'GiftCard_number'},$in{'GiftCard_amount_used'},$in{'internal_company_notes1'},$in{'internal_company_notes2'},$in{'internal_company_notes2'},$in{'customer_order_notes1'},$in{'customer_order_notes2'},$in{'customer_order_notes3'},$in{'customer_order_notes4'},$in{'customer_order_notes5'},$in{'mailinglist_subscribe'},$in{'wishlist_subscribe'},$in{'insurance_cost'},$in{'trade_in_allowance'},$in{'rma_number'},$in{'customer_contact_notes1'},$in{'customer_contact_notes2'},$in{'account_number'},$in{'sales_rep'},$in{'sales_rep_notes1'},$in{'sales_rep_notes2'},$in{'how_did_you_find_us'},$in{'suggestion_box'},$in{'preferrred_shipping_date'},$in{'ship_order_items_as_available'}) = split(/\t/,$stuff);
         close (ORDERLOGLOOK);
         @cart_contents_rows = split(/::/,$in{'cartContents'},$in{'GatewayUsed'});
         foreach $cart_contents_rows(@cart_contents_rows) {
@@ -462,11 +462,46 @@
       $line =~ s/%%user3%%/$in{'user3'}/g;
       $line =~ s/%%user4%%/$in{'user4'}/g;
       $line =~ s/%%user5%%/$in{'user5'}/g;
+          my ($buysafetext,$buysafeamount) = split(/>/,$in{'buySafe'},2);
+          $line =~ s/%%buysafecost%%/$buysafeamount/g;
       $line =~ s/%%adminMessages%%/$in{'adminMessages'}/g;
       $line =~ s/%%cartContents%%/$cartContentsStringViewer/g;
       $line =~ s/%%shippingMessages%%/$in{'shippingMessages'}/g;
       $line =~ s/%%xcomments%%/$in{'xcomments'}/g;
       $line =~ s/%%termsOfService%%/$in{'termsOfService'}/g;
+      $line =~ s/%%discountCode%%/$in{'discountCode'}/g;
+      $line =~ s/%%user6%%/$in{'user6'}/g;
+      $line =~ s/%%user7%%/$in{'user7'}/g;
+      $line =~ s/%%user8%%/$in{'user8'}/g;
+      $line =~ s/%%user9%%/$in{'user9'}/g;
+      $line =~ s/%%user10%%/$in{'user10'}/g;
+      $line =~ s/%%order_payment_type_user1%%/$in{'order_payment_type_user1'}/g;
+      $line =~ s/%%order_payment_type_user2%%/$in{'order_payment_type_user2'}/g;
+      $line =~ s/%%GiftCard_number%%/$in{'GiftCard_number'}/g;
+      $line =~ s/%%GiftCard_amount_used%%/$in{'GiftCard_amount_used'}/g;
+      $line =~ s/%%internal_company_notes1%%/$in{'internal_company_notes1'}/g;
+      $line =~ s/%%internal_company_notes2%%/$in{'internal_company_notes2'}/g;
+      $line =~ s/%%internal_company_notes3%%/$in{'internal_company_notes3'}/g;
+      $line =~ s/%%customer_order_notes1%%/$in{'customer_order_notes1'}/g;
+      $line =~ s/%%customer_order_notes2%%/$in{'customer_order_notes2'}/g;
+      $line =~ s/%%customer_order_notes3%%/$in{'customer_order_notes3'}/g;
+      $line =~ s/%%customer_order_notes4%%/$in{'customer_order_notes4'}/g;
+      $line =~ s/%%customer_order_notes5%%/$in{'customer_order_notes5'}/g;
+      $line =~ s/%%mailinglist_subscribe%%/$in{'mailinglist_subscribe'}/g;
+      $line =~ s/%%wishlist_subscribe%%/$in{'wishlist_subscribe'}/g;
+      $line =~ s/%%insurance_cost%%/$in{'insurance_cost'}/g;
+      $line =~ s/%%trade_in_allowance%%/$in{'trade_in_allowance'}/g;
+      $line =~ s/%%rma_number%%/$in{'rma_number'}/g;
+      $line =~ s/%%customer_contact_notes1%%/$in{'customer_contact_notes1'}/g;
+      $line =~ s/%%customer_contact_notes2%%/$in{'customer_contact_notes2'}/g;
+      $line =~ s/%%account_number%%/$in{'account_number'}/g;
+      $line =~ s/%%sales_rep%%/$in{'sales_rep'}/g;
+      $line =~ s/%%sales_rep_notes1%%/$in{'sales_rep_notes1'}/g;
+      $line =~ s/%%sales_rep_notes2%%/$in{'sales_rep_notes2'}/g;
+      $line =~ s/%%how_did_you_find_us%%/$in{'how_did_you_find_us'}/g;
+      $line =~ s/%%suggestion_box%%/$in{'suggestion_box'}/g;
+      $line =~ s/%%preferrred_shipping_date%%/$in{'preferrred_shipping_date'}/g;
+      $line =~ s/%%ship_order_items_as_available%%/$in{'ship_order_items_as_available'}/g;
       $new_output .= $line;
    }
    close (TEMPLATE);
@@ -493,7 +528,7 @@
     if (-e $filename) {
         open (ORDERLOGLOOK, "$filename");
         $stuff=<ORDERLOGLOOK>;
-        ($in{'year'},$in{'month'},$in{'day'},$in{'invoiceNumber'},$in{'customerNumber'},$in{'orderStatus'},$in{'shiptrackingID'},$in{'firstName'},$in{'lastName'},$in{'fullName'},$in{'companyName'},$in{'customerPhone'},$in{'faxNumber'},$in{'emailAddress'},$in{'orderFromAddress'},$in{'customerAddress2'},$in{'customerAddress3'},$in{'orderFromCity'},$in{'orderFromState'},$in{'orderFromPostal'},$in{'orderFromCountry'},$in{'shipToName'},$in{'shipToAddress'},$in{'shipToAddress2'},$in{'shipToAddress3'},$in{'shipToCity'},$in{'shipToState'},$in{'shipToPostal'},$in{'shipToCountry'},$in{'shiptoResidential'},$in{'insureShipment'},$in{'shipMethod'},$in{'shippingTotal'},$in{'salesTax'},$in{'tax1'},$in{'tax2'},$in{'tax3'},$in{'discounts'},$in{'netProfit'},$in{'subTotal'},$in{'orderTotal'},$in{'affiliateTotal'},$in{'affiliateID'},$in{'affiliateMisc'},$in{'user1'},$in{'user2'},$in{'user3'},$in{'user4'},$in{'user5'},$in{'adminMessages'},$in{'cartContents'},$in{'GatewayUsed'},$in{'shippingMessages'},$in{'xcomments'},$in{'termsOfService'},$in{'discountCode'}) = split(/\t/,$stuff);
+        ($in{'year'},$in{'month'},$in{'day'},$in{'invoiceNumber'},$in{'customerNumber'},$in{'orderStatus'},$in{'shiptrackingID'},$in{'firstName'},$in{'lastName'},$in{'fullName'},$in{'companyName'},$in{'customerPhone'},$in{'faxNumber'},$in{'emailAddress'},$in{'orderFromAddress'},$in{'customerAddress2'},$in{'customerAddress3'},$in{'orderFromCity'},$in{'orderFromState'},$in{'orderFromPostal'},$in{'orderFromCountry'},$in{'shipToName'},$in{'shipToAddress'},$in{'shipToAddress2'},$in{'shipToAddress3'},$in{'shipToCity'},$in{'shipToState'},$in{'shipToPostal'},$in{'shipToCountry'},$in{'shiptoResidential'},$in{'insureShipment'},$in{'shipMethod'},$in{'shippingTotal'},$in{'salesTax'},$in{'tax1'},$in{'tax2'},$in{'tax3'},$in{'discounts'},$in{'netProfit'},$in{'subTotal'},$in{'orderTotal'},$in{'affiliateTotal'},$in{'affiliateID'},$in{'affiliateMisc'},$in{'user1'},$in{'user2'},$in{'user3'},$in{'user4'},$in{'user5'},$in{'adminMessages'},$in{'cartContents'},$in{'GatewayUsed'},$in{'shippingMessages'},$in{'xcomments'},$in{'termsOfService'},$in{'discountCode'},$in{'user6'},$in{'user7'},$in{'user8'},$in{'user9'},$in{'user10'},$in{'buySafe'},$in{'order_payment_type_user1'},$in{'order_payment_type_user2'},$in{'GiftCard_number'},$in{'GiftCard_amount_used'},$in{'internal_company_notes1'},$in{'internal_company_notes2'},$in{'internal_company_notes2'},$in{'customer_order_notes1'},$in{'customer_order_notes2'},$in{'customer_order_notes3'},$in{'customer_order_notes4'},$in{'customer_order_notes5'},$in{'mailinglist_subscribe'},$in{'wishlist_subscribe'},$in{'insurance_cost'},$in{'trade_in_allowance'},$in{'rma_number'},$in{'customer_contact_notes1'},$in{'customer_contact_notes2'},$in{'account_number'},$in{'sales_rep'},$in{'sales_rep_notes1'},$in{'sales_rep_notes2'},$in{'how_did_you_find_us'},$in{'suggestion_box'},$in{'preferrred_shipping_date'},$in{'ship_order_items_as_available'}) = split(/\t/,$stuff);
         close (ORDERLOGLOOK);
         @cart_contents_rows = split(/::/,$in{'cartContents'},$in{'GatewayUsed'});
         foreach $cart_contents_rows(@cart_contents_rows) {
@@ -610,6 +645,8 @@
       $line =~ s/%%user3%%/$in{'user3'}/g;
       $line =~ s/%%user4%%/$in{'user4'}/g;
       $line =~ s/%%user5%%/$in{'user5'}/g;
+          my ($buysafetext,$buysafeamount) = split(/>/,$in{'user5'},2);
+          $line =~ s/%%buysafecost%%/$buysafeamount/g;
       $line =~ s/%%adminMessages%%/$in{'adminMessages'}/g;
       $line =~ s/%%GatewayUsed%%/$in{'GatewayUsed'}/g;
       $line =~ s/%%shippingMessages%%/$in{'shippingMessages'}/g;
@@ -618,6 +655,39 @@
       $line =~ s/%%xcomments%%/$in{'xcomments'}/g;
       $line =~ s/%%termsOfService%%/$in{'termsOfService'}/g;
       $line =~ s/%%discountCode%%/$in{'discountCode'}/g;
+      $line =~ s/%%user6%%/$in{'user6'}/g;
+      $line =~ s/%%user7%%/$in{'user7'}/g;
+      $line =~ s/%%user8%%/$in{'user8'}/g;
+      $line =~ s/%%user9%%/$in{'user9'}/g;
+      $line =~ s/%%user10%%/$in{'user10'}/g;
+      $line =~ s/%%order_payment_type_user1%%/$in{'order_payment_type_user1'}/g;
+      $line =~ s/%%order_payment_type_user2%%/$in{'order_payment_type_user2'}/g;
+      $line =~ s/%%GiftCard_number%%/$in{'GiftCard_number'}/g;
+      $line =~ s/%%GiftCard_amount_used%%/$in{'GiftCard_amount_used'}/g;
+      $line =~ s/%%internal_company_notes1%%/$in{'internal_company_notes1'}/g;
+      $line =~ s/%%internal_company_notes2%%/$in{'internal_company_notes2'}/g;
+      $line =~ s/%%internal_company_notes3%%/$in{'internal_company_notes3'}/g;
+      $line =~ s/%%customer_order_notes1%%/$in{'customer_order_notes1'}/g;
+      $line =~ s/%%customer_order_notes2%%/$in{'customer_order_notes2'}/g;
+      $line =~ s/%%customer_order_notes3%%/$in{'customer_order_notes3'}/g;
+      $line =~ s/%%customer_order_notes4%%/$in{'customer_order_notes4'}/g;
+      $line =~ s/%%customer_order_notes5%%/$in{'customer_order_notes5'}/g;
+      $line =~ s/%%mailinglist_subscribe%%/$in{'mailinglist_subscribe'}/g;
+      $line =~ s/%%wishlist_subscribe%%/$in{'wishlist_subscribe'}/g;
+      $line =~ s/%%insurance_cost%%/$in{'insurance_cost'}/g;
+      $line =~ s/%%trade_in_allowance%%/$in{'trade_in_allowance'}/g;
+      $line =~ s/%%rma_number%%/$in{'rma_number'}/g;
+      $line =~ s/%%customer_contact_notes1%%/$in{'customer_contact_notes1'}/g;
+      $line =~ s/%%customer_contact_notes2%%/$in{'customer_contact_notes2'}/g;
+      $line =~ s/%%account_number%%/$in{'account_number'}/g;
+      $line =~ s/%%sales_rep%%/$in{'sales_rep'}/g;
+      $line =~ s/%%sales_rep_notes1%%/$in{'sales_rep_notes1'}/g;
+      $line =~ s/%%sales_rep_notes2%%/$in{'sales_rep_notes2'}/g;
+      $line =~ s/%%how_did_you_find_us%%/$in{'how_did_you_find_us'}/g;
+      $line =~ s/%%suggestion_box%%/$in{'suggestion_box'}/g;
+      $line =~ s/%%preferrred_shipping_date%%/$in{'preferrred_shipping_date'}/g;
+      $line =~ s/%%ship_order_items_as_available%%/$in{'ship_order_items_as_available'}/g;
+
       $new_output .= $line;
    }
    close (TEMPLATE);
@@ -659,8 +729,8 @@
    }
    $cartrow_counter_temp++;
 }
-     $cart_string = "$in{'year'}\t$in{'month'}\t$in{'day'}\t$in{'invoiceNumber'}\t$in{'customerNumber'}\t$in{'orderStatus'}\t$in{'shiptrackingID'}\t$in{'firstName'}\t$in{'lastName'}\t$in{'fullName'}\t$in{'companyName'}\t$in{'customerPhone'}\t$in{'faxNumber'}\t$in{'emailAddress'}\t$in{'orderFromAddress'}\t$in{'customerAddress2'}\t$in{'customerAddress3'}\t$in{'orderFromCity'}\t$in{'orderFromState'}\t$in{'orderFromPostal'}\t$in{'orderFromCountry'}\t$in{'shipToName'}\t$in{'shipToAddress'}\t$in{'shipToAddress2'}\t$in{'shipToAddress3'}\t$in{'shipToCity'}\t$in{'shipToState'}\t$in{'shipToPostal'}\t$in{'shipToCountry'}\t$in{'shiptoResidential'}\t$in{'insureShipment'}\t$in{'shipMethod'}\t$in{'shippingTotal'}\t$in{'salesTax'}\t$in{'tax1'}\t$in{'tax2'}\t$in{'tax3'}\t$in{'discounts'}\t$in{'netProfit'}\t$in{'subTotal'}\t$in{'orderTotal'}\t$in{'affiliateTotal'}\t$in{'affiliateID'}\t$in{'affiliateMisc'}\t$in{'user1'}\t$in{'user2'}\t$in{'user3'}\t$in{'user4'}\t$in{'user5'}\t$in{'adminMessages'}\t$cartlog_string_thingy\t$in{'GatewayUsed'}\t$in{'shippingMessages'}\t$in{'xcomments'}\t$in{'termsOfService'}\t$in{'discountCode'}";
-     $cart_string_short = "$in{'year'}\t$in{'month'}\t$in{'day'}\t$in{'invoiceNumber'}\t$in{'customerNumber'}\t$in{'orderStatus'}\t$in{'firstName'}\t$in{'lastName'}\t$in{'fullName'}\t$in{'companyName'}\t$in{'emailAddress'}\t$in{'orderFromState'}\t$in{'orderFromPostal'}\t$in{'orderFromCountry'}\t$in{'shipMethod'}\t$in{'shippingTotal'}\t$in{'salesTax'}\t$in{'tax1'}\t$in{'tax2'}\t$in{'tax3'}\t$in{'discounts'}\t$in{'netProfit'}\t$in{'subTotal'}\t$in{'orderTotal'}\t$in{'affiliateTotal'}\t$in{'affiliateID'}\t$in{'affiliateMisc'}\n";
+     $cart_string = "$in{'year'}\t$in{'month'}\t$in{'day'}\t$in{'invoiceNumber'}\t$in{'customerNumber'}\t$in{'orderStatus'}\t$in{'shiptrackingID'}\t$in{'firstName'}\t$in{'lastName'}\t$in{'fullName'}\t$in{'companyName'}\t$in{'customerPhone'}\t$in{'faxNumber'}\t$in{'emailAddress'}\t$in{'orderFromAddress'}\t$in{'customerAddress2'}\t$in{'customerAddress3'}\t$in{'orderFromCity'}\t$in{'orderFromState'}\t$in{'orderFromPostal'}\t$in{'orderFromCountry'}\t$in{'shipToName'}\t$in{'shipToAddress'}\t$in{'shipToAddress2'}\t$in{'shipToAddress3'}\t$in{'shipToCity'}\t$in{'shipToState'}\t$in{'shipToPostal'}\t$in{'shipToCountry'}\t$in{'shiptoResidential'}\t$in{'insureShipment'}\t$in{'shipMethod'}\t$in{'shippingTotal'}\t$in{'salesTax'}\t$in{'tax1'}\t$in{'tax2'}\t$in{'tax3'}\t$in{'discounts'}\t$in{'netProfit'}\t$in{'subTotal'}\t$in{'orderTotal'}\t$in{'affiliateTotal'}\t$in{'affiliateID'}\t$in{'affiliateMisc'}\t$in{'user1'}\t$in{'user2'}\t$in{'user3'}\t$in{'user4'}\t$in{'user5'}\t$in{'adminMessages'}\t$cartlog_string_thingy\t$in{'GatewayUsed'}\t$in{'shippingMessages'}\t$in{'xcomments'}\t$in{'termsOfService'}\t$in{'discountCode'}\t$in{'user6'}\t$in{'user7'}\t$in{'user8'}\t$in{'user9'}\t$in{'user10'}\t$in{'buySafe'}\t$in{'order_payment_type_user1'}\t$in{'order_payment_type_user2'}\t$in{'GiftCard_number'}\t$in{'GiftCard_amount_used'}\t$in{'internal_company_notes1'}\t$in{'internal_company_notes2'}\t$in{'internal_company_notes2'}\t$in{'customer_order_notes1'}\t$in{'customer_order_notes2'}\t$in{'customer_order_notes3'}\t$in{'customer_order_notes4'}\t$in{'customer_order_notes5'}\t$in{'mailinglist_subscribe'}\t$in{'wishlist_subscribe'}\t$in{'insurance_cost'}\t$in{'trade_in_allowance'}\t$in{'rma_number'}\t$in{'customer_contact_notes1'}\t$in{'customer_contact_notes2'}\t$in{'account_number'}\t$in{'sales_rep'}\t$in{'sales_rep_notes1'}\t$in{'sales_rep_notes2'}\t$in{'how_did_you_find_us'}\t$in{'suggestion_box'}\t$in{'preferrred_shipping_date'}\t$in{'ship_order_items_as_available'}";
+     $cart_string_short = "$in{'year'}\t$in{'month'}\t$in{'day'}\t$in{'invoiceNumber'}\t$in{'customerNumber'}\t$in{'orderStatus'}\t$in{'firstName'}\t$in{'lastName'}\t$in{'fullName'}\t$in{'companyName'}\t$in{'emailAddress'}\t$in{'orderFromState'}\t$in{'orderFromPostal'}\t$in{'orderFromCountry'}\t$in{'shipMethod'}\t$in{'shippingTotal'}\t$in{'salesTax'}\t$in{'tax1'}\t$in{'tax2'}\t$in{'tax3'}\t$in{'discounts'}\t$in{'netProfit'}\t$in{'subTotal'}\t$in{'orderTotal'}\t$in{'affiliateTotal'}\t$in{'affiliateID'}\t$in{'affiliateMisc'}\t$in{'GatewayUsed'}\t$in{'buySafe'}\n";
 
      open (ORDERLOG, ">$filename8");
      print ORDERLOG $cart_string;
@@ -738,7 +808,7 @@
     if (-e $filename) {
         open (ORDERLOGLOOK, "$filename");
         $stuff=<ORDERLOGLOOK>;
-        ($in{'year'},$in{'month'},$in{'day'},$in{'invoiceNumber'},$in{'customerNumber'},$in{'orderStatus'},$in{'shiptrackingID'},$in{'firstName'},$in{'lastName'},$in{'fullName'},$in{'companyName'},$in{'customerPhone'},$in{'emailAddress'},$in{'faxNumber'},$in{'orderFromAddress'},$in{'customerAddress2'},$in{'customerAddress3'},$in{'orderFromCity'},$in{'orderFromState'},$in{'orderFromPostal'},$in{'orderFromCountry'},$in{'shipToName'},$in{'shipToAddress'},$in{'shipToAddress2'},$in{'shipToAddress3'},$in{'shipToCity'},$in{'shipToState'},$in{'shipToPostal'},$in{'shipToCountry'},$in{'shiptoResidential'},$in{'insureShipment'},$in{'shipMethod'},$in{'shippingTotal'},$in{'salesTax'},$in{'tax1'},$in{'tax2'},$in{'tax3'},$in{'discounts'},$in{'netProfit'},$in{'subTotal'},$in{'orderTotal'},$in{'affiliateTotal'},$in{'affiliateID'},$in{'affiliateMisc'},$in{'user1'},$in{'user2'},$in{'user3'},$in{'user4'},$in{'user5'},$in{'adminMessages'},$in{'cartContents'},$in{'GatewayUsed'},$in{'shippingMessages'},$in{'xcomments'},$in{'termsOfService'},$in{'discountCode'}) = split(/\t/,$stuff);
+        ($in{'year'},$in{'month'},$in{'day'},$in{'invoiceNumber'},$in{'customerNumber'},$in{'orderStatus'},$in{'shiptrackingID'},$in{'firstName'},$in{'lastName'},$in{'fullName'},$in{'companyName'},$in{'customerPhone'},$in{'emailAddress'},$in{'faxNumber'},$in{'orderFromAddress'},$in{'customerAddress2'},$in{'customerAddress3'},$in{'orderFromCity'},$in{'orderFromState'},$in{'orderFromPostal'},$in{'orderFromCountry'},$in{'shipToName'},$in{'shipToAddress'},$in{'shipToAddress2'},$in{'shipToAddress3'},$in{'shipToCity'},$in{'shipToState'},$in{'shipToPostal'},$in{'shipToCountry'},$in{'shiptoResidential'},$in{'insureShipment'},$in{'shipMethod'},$in{'shippingTotal'},$in{'salesTax'},$in{'tax1'},$in{'tax2'},$in{'tax3'},$in{'discounts'},$in{'netProfit'},$in{'subTotal'},$in{'orderTotal'},$in{'affiliateTotal'},$in{'affiliateID'},$in{'affiliateMisc'},$in{'user1'},$in{'user2'},$in{'user3'},$in{'user4'},$in{'user5'},$in{'adminMessages'},$in{'cartContents'},$in{'GatewayUsed'},$in{'shippingMessages'},$in{'xcomments'},$in{'termsOfService'},$in{'discountCode'},$in{'user6'},$in{'user7'},$in{'user8'},$in{'user9'},$in{'user10'},$in{'buySafe'},$in{'order_payment_type_user1'},$in{'order_payment_type_user2'},$in{'GiftCard_number'},$in{'GiftCard_amount_used'},$in{'internal_company_notes1'},$in{'internal_company_notes2'},$in{'internal_company_notes2'},$in{'customer_order_notes1'},$in{'customer_order_notes2'},$in{'customer_order_notes3'},$in{'customer_order_notes4'},$in{'customer_order_notes5'},$in{'mailinglist_subscribe'},$in{'wishlist_subscribe'},$in{'insurance_cost'},$in{'trade_in_allowance'},$in{'rma_number'},$in{'customer_contact_notes1'},$in{'customer_contact_notes2'},$in{'account_number'},$in{'sales_rep'},$in{'sales_rep_notes1'},$in{'sales_rep_notes2'},$in{'how_did_you_find_us'},$in{'suggestion_box'},$in{'preferrred_shipping_date'},$in{'ship_order_items_as_available'}) = split(/\t/,$stuff);
         close (ORDERLOGLOOK);
         @cart_contents_rows = split(/::/,$in{'cartContents'},$in{'GatewayUsed'});
         foreach $cart_contents_rows(@cart_contents_rows) {
@@ -910,56 +980,90 @@
 <b>Invoice Number:</b> $in{'invoiceNumber'}<br>
 <b>Customer ID Number:</b> $in{'customerNumber'}<br><br>
 <table width=600 border=0>
-<tr><td align=right>Order Status: </td><td><INPUT NAME="orderStatus" TYPE="TEXT" SIZE=30 value="$in{'orderStatus'}"></td></tr>
-<tr><td align=right>Shipping/Tracking ID: </td><td><INPUT NAME="shiptrackingID" TYPE="TEXT" SIZE=30 value="$in{'shiptrackingID'}"></td></tr>
-<tr><td align=right>Agree to Sales/Terms of Service: </td><td><INPUT NAME="shiptrackingID" TYPE="TEXT" SIZE=30 value="$in{'termsOfService'}"></td></tr>
-<tr><td align=right>First Name: </td><td><INPUT NAME="firstName" TYPE="TEXT" SIZE=30 value="$in{'firstName'}"></td></tr>
-<tr><td align=right>Last Name: </td><td><INPUT NAME="lastName" TYPE="TEXT" SIZE=30 value="$in{'lastName'}"></td></tr>
-<tr><td align=right>Full Name: </td><td><INPUT NAME="fullName" TYPE="TEXT" SIZE=30 value="$in{'fullName'}"></td></tr>
-<tr><td align=right>Company Name: </td><td><INPUT NAME="companyName" TYPE="TEXT" SIZE=30 value="$in{'companyName'}"></td></tr>
-<tr><td align=right>Phone Number: </td><td><INPUT NAME="customerPhone" TYPE="TEXT" SIZE=30 value="$in{'customerPhone'}"></td></tr>
-<tr><td align=right>Fax Number: </td><td><INPUT NAME="faxNumber" TYPE="TEXT" SIZE=30 value="$in{'faxNumber'}"></td></tr>
-<tr><td align=right>email Address: </td><td><INPUT NAME="emailAddress" TYPE="TEXT" SIZE=30 value="$in{'emailAddress'}"></td></tr>
-<tr><td align=right>Billing Address: </td><td><INPUT NAME="orderFromAddress" TYPE="TEXT" SIZE=30 value="$in{'orderFromAddress'}"></td></tr>
-<tr><td align=right>Address line 2: </td><td><INPUT NAME="customerAddress2" TYPE="TEXT" SIZE=30 value="$in{'customerAddress2'}"></td></tr>
-<tr><td align=right>Address line 3: </td><td><INPUT NAME="customerAddress3" TYPE="TEXT" SIZE=30 value="$in{'customerAddress3'}"></td></tr>
-<tr><td align=right>Billing City: </td><td><INPUT NAME="orderFromCity" TYPE="TEXT" SIZE=30 value="$in{'orderFromCity'}"></td></tr>
-<tr><td align=right>Billing State/Province: </td><td><INPUT NAME="orderFromState" TYPE="TEXT" SIZE=30 value="$in{'orderFromState'}"></td></tr>
-<tr><td align=right>Billing Postal Code: </td><td><INPUT NAME="orderFromPostal" TYPE="TEXT" SIZE=30 value="$in{'orderFromPostal'}"></td></tr>
-<tr><td align=right>Billing Country: </td><td><INPUT NAME="orderFromCountry" TYPE="TEXT" SIZE=30 value="$in{'orderFromCountry'}"></td></tr>
-<tr><td align=right>Ship to Name: </td><td><INPUT NAME="shipToName" TYPE="TEXT" SIZE=30 value="$in{'shipToName'}"></td></tr>
-<tr><td align=right>Ship to Address: </td><td><INPUT NAME="shipToAddress" TYPE="TEXT" SIZE=30 value="$in{'shipToAddress'}"></td></tr>
-<tr><td align=right>Ship to Address line 2: </td><td><INPUT NAME="shipToAddress2" TYPE="TEXT" SIZE=30 value="$in{'shipToAddress2'}"></td></tr>
-<tr><td align=right>Ship to Address line 3: </td><td><INPUT NAME="shipToAddress3" TYPE="TEXT" SIZE=30 value="$in{'shipToAddress3'}"></td></tr>
-<tr><td align=right>Ship to City: </td><td><INPUT NAME="shipToCity" TYPE="TEXT" SIZE=30 value="$in{'shipToCity'}"></td></tr>
-<tr><td align=right>Ship to State: </td><td><INPUT NAME="shipToState" TYPE="TEXT" SIZE=30 value="$in{'shipToState'}"></td></tr>
-<tr><td align=right>Ship to Postal Code: </td><td><INPUT NAME="shipToPostal" TYPE="TEXT" SIZE=30 value="$in{'shipToPostal'}"></td></tr>
-<tr><td align=right>Ship to Country: </td><td><INPUT NAME="shipToCountry" TYPE="TEXT" SIZE=30 value="$in{'shipToCountry'}"></td></tr>
-<tr><td align=right>Ship to Residential Address: </td><td><INPUT NAME="shiptoResidential" TYPE="TEXT" SIZE=30 value="$in{'shiptoResidential'}"></td></tr>
-<tr><td align=right>Insure Shipment? </td><td><INPUT NAME="insureShipment" TYPE="TEXT" SIZE=30 value="$in{'insureShipment'}"></td></tr>
-<tr><td align=right>Shipping Method / Shipped by: </td><td><INPUT NAME="shipMethod" TYPE="TEXT" SIZE=40 value="$in{'shipMethod'}"></td></tr>
-<tr><td align=right>Shipping Total: </td><td><INPUT NAME="shippingTotal" TYPE="TEXT" SIZE=30 value="$in{'shippingTotal'}"></td></tr>
-<tr><td align=right>Sales Tax Collected: </td><td><INPUT NAME="salesTax" TYPE="TEXT" SIZE=30 value="$in{'salesTax'}"></td></tr>
-<tr><td align=right>Special Tax 1 Collected: </td><td><INPUT NAME="tax1" TYPE="TEXT" SIZE=30 value="$in{'tax1'}"></td></tr>
-<tr><td align=right>Special Tax 2 Collected: </td><td><INPUT NAME="tax2" TYPE="TEXT" SIZE=30 value="$in{'tax2'}"></td></tr>
-<tr><td align=right>Special Tax 3 Collected: </td><td><INPUT NAME="tax3" TYPE="TEXT" SIZE=30 value="$in{'tax3'}"></td></tr>
-<tr><td align=right>Discounts Given: </td><td><INPUT NAME="discounts" TYPE="TEXT" SIZE=30 value="$in{'discounts'}"></td></tr>
-<tr><td align=right>Discount Code: </td><td><INPUT NAME="discountCode" TYPE="TEXT" SIZE=30 value="$in{'discountCode'}"></td></tr>
-<tr><td align=right>Net Profits Generated: </td><td><INPUT NAME="netProfit" TYPE="TEXT" SIZE=30 value="$in{'netProfit'}"></td></tr>
-<tr><td align=right>Order Sub Total: </td><td><INPUT NAME="subTotal" TYPE="TEXT" SIZE=30 value="$in{'subTotal'}"></td></tr>
-<tr><td align=right>Order Grand Total: </td><td><INPUT NAME="orderTotal" TYPE="TEXT" SIZE=30 value="$in{'orderTotal'}"></td></tr>
-<tr><td align=right>Affiliate Commision: </td><td><INPUT NAME="affiliateTotal" TYPE="TEXT" SIZE=30 value="$in{'affiliateTotal'}"></td></tr>
-<tr><td align=right>Affiliate ID: </td><td><INPUT NAME="affiliateID" TYPE="TEXT" SIZE=30 value="$in{'affiliateID'}"></td></tr>
-<tr><td align=right>Affiliate Misc: </td><td><INPUT NAME="affiliateMisc" TYPE="TEXT" SIZE=30 value="$in{'affiliateMisc'}"></td></tr>
-<tr><td align=right>User 1: </td><td><INPUT NAME="user1" TYPE="TEXT" SIZE=30 value="$in{'user1'}"></td></tr>
-<tr><td align=right>User 2: </td><td><INPUT NAME="user2" TYPE="TEXT" SIZE=30 value="$in{'user2'}"></td></tr>
-<tr><td align=right>User 3: </td><td><INPUT NAME="user3" TYPE="TEXT" SIZE=30 value="$in{'user3'}"></td></tr>
-<tr><td align=right>User 4: </td><td><INPUT NAME="user4" TYPE="TEXT" SIZE=30 value="$in{'user4'}"></td></tr>
-<tr><td align=right>User 5: </td><td><INPUT NAME="user5" TYPE="TEXT" SIZE=30 value="$in{'user5'}"></td></tr>
-<tr><td align=right>Admin Notes / Messages: </td><td><textarea name="adminMessages" cols="30" rows="7">$in{'adminMessages'}</textarea></td></tr>
-<tr><td align=right>Gateway Used: </td><td><INPUT NAME="GatewayUsed" TYPE="TEXT" SIZE=30 value="$in{'GatewayUsed'}"></td></tr>
-<tr><td align=right>Shipping Messages: </td><td><textarea name="shippingMessages" cols="30" rows="7">$in{'shippingMessages'}</textarea></td></tr>
+<tr><td align=right>Order Status: </td><td><INPUT NAME="orderStatus" type="text" size=40 value="$in{'orderStatus'}"></td></tr>
+<tr><td align=right>Shipping/Tracking ID: </td><td><INPUT NAME="shiptrackingID" type="text" size=40 value="$in{'shiptrackingID'}"></td></tr>
+<tr><td align=right>Agree to Sales/Terms of Service: </td><td><INPUT NAME="termsOfService" type="text" size=40 value="$in{'termsOfService'}"></td></tr>
+<tr><td align=right>First Name: </td><td><INPUT NAME="firstName" type="text" size=40 value="$in{'firstName'}"></td></tr>
+<tr><td align=right>Last Name: </td><td><INPUT NAME="lastName" type="text" size=40 value="$in{'lastName'}"></td></tr>
+<tr><td align=right>Full Name: </td><td><INPUT NAME="fullName" type="text" size=40 value="$in{'fullName'}"></td></tr>
+<tr><td align=right>Company Name: </td><td><INPUT NAME="companyName" type="text" size=40 value="$in{'companyName'}"></td></tr>
+<tr><td align=right>Phone Number: </td><td><INPUT NAME="customerPhone" type="text" size=40 value="$in{'customerPhone'}"></td></tr>
+<tr><td align=right>Fax Number: </td><td><INPUT NAME="faxNumber" type="text" size=40 value="$in{'faxNumber'}"></td></tr>
+<tr><td align=right>email Address: </td><td><INPUT NAME="emailAddress" type="text" size=40 value="$in{'emailAddress'}"></td></tr>
+<tr><td align=right>Billing Address: </td><td><INPUT NAME="orderFromAddress" type="text" size=40 value="$in{'orderFromAddress'}"></td></tr>
+<tr><td align=right>Address line 2: </td><td><INPUT NAME="customerAddress2" type="text" size=40 value="$in{'customerAddress2'}"></td></tr>
+<tr><td align=right>Address line 3: </td><td><INPUT NAME="customerAddress3" type="text" size=40 value="$in{'customerAddress3'}"></td></tr>
+<tr><td align=right>Billing City: </td><td><INPUT NAME="orderFromCity" type="text" size=40 value="$in{'orderFromCity'}"></td></tr>
+<tr><td align=right>Billing State/Province: </td><td><INPUT NAME="orderFromState" type="text" size=40 value="$in{'orderFromState'}"></td></tr>
+<tr><td align=right>Billing Postal Code: </td><td><INPUT NAME="orderFromPostal" type="text" size=40 value="$in{'orderFromPostal'}"></td></tr>
+<tr><td align=right>Billing Country: </td><td><INPUT NAME="orderFromCountry" type="text" size=40 value="$in{'orderFromCountry'}"></td></tr>
+<tr><td align=right>Ship to Name: </td><td><INPUT NAME="shipToName" type="text" size=40 value="$in{'shipToName'}"></td></tr>
+<tr><td align=right>Ship to Address: </td><td><INPUT NAME="shipToAddress" type="text" size=40 value="$in{'shipToAddress'}"></td></tr>
+<tr><td align=right>Ship to Address line 2: </td><td><INPUT NAME="shipToAddress2" type="text" size=40 value="$in{'shipToAddress2'}"></td></tr>
+<tr><td align=right>Ship to Address line 3: </td><td><INPUT NAME="shipToAddress3" type="text" size=40 value="$in{'shipToAddress3'}"></td></tr>
+<tr><td align=right>Ship to City: </td><td><INPUT NAME="shipToCity" type="text" size=40 value="$in{'shipToCity'}"></td></tr>
+<tr><td align=right>Ship to State: </td><td><INPUT NAME="shipToState" type="text" size=40 value="$in{'shipToState'}"></td></tr>
+<tr><td align=right>Ship to Postal Code: </td><td><INPUT NAME="shipToPostal" type="text" size=40 value="$in{'shipToPostal'}"></td></tr>
+<tr><td align=right>Ship to Country: </td><td><INPUT NAME="shipToCountry" type="text" size=40 value="$in{'shipToCountry'}"></td></tr>
+<tr><td align=right>Ship to Residential Address: </td><td><INPUT NAME="shiptoResidential" type="text" size=40 value="$in{'shiptoResidential'}"></td></tr>
+<tr><td align=right>Insure Shipment? </td><td><INPUT NAME="insureShipment" type="text" size=40 value="$in{'insureShipment'}"></td></tr>
+<tr><td align=right>Shipping Method / Shipped by: </td><td><INPUT NAME="shipMethod" type="text" size=40 value="$in{'shipMethod'}"></td></tr>
+<tr><td align=right>Shipping Total: </td><td><INPUT NAME="shippingTotal" type="text" size=40 value="$in{'shippingTotal'}"></td></tr>
+<tr><td align=right>Sales Tax Collected: </td><td><INPUT NAME="salesTax" type="text" size=40 value="$in{'salesTax'}"></td></tr>
+<tr><td align=right>Special Tax 1 Collected: </td><td><INPUT NAME="tax1" type="text" size=40 value="$in{'tax1'}"></td></tr>
+<tr><td align=right>Special Tax 2 Collected: </td><td><INPUT NAME="tax2" type="text" size=40 value="$in{'tax2'}"></td></tr>
+<tr><td align=right>Special Tax 3 Collected: </td><td><INPUT NAME="tax3" type="text" size=40 value="$in{'tax3'}"></td></tr>
+<tr><td align=right>Discounts Given: </td><td><INPUT NAME="discounts" type="text" size=40 value="$in{'discounts'}"></td></tr>
+<tr><td align=right>Discount Code: </td><td><INPUT NAME="discountCode" type="text" size=40 value="$in{'discountCode'}"></td></tr>
+<tr><td align=right>buySAFE Fee: </td><td><INPUT NAME="buySafe" type="text" size=40 value="$in{'buySafe'}"></td></tr>
+<tr><td align=right>Net Profits Generated: </td><td><INPUT NAME="netProfit" type="text" size=40 value="$in{'netProfit'}"></td></tr>
+<tr><td align=right>Order Sub Total: </td><td><INPUT NAME="subTotal" type="text" size=40 value="$in{'subTotal'}"></td></tr>
+<tr><td align=right>Order Grand Total: </td><td><INPUT NAME="orderTotal" type="text" size=40 value="$in{'orderTotal'}"></td></tr>
+<tr><td align=right>Affiliate Commision: </td><td><INPUT NAME="affiliateTotal" type="text" size=40 value="$in{'affiliateTotal'}"></td></tr>
+<tr><td align=right>Affiliate ID: </td><td><INPUT NAME="affiliateID" type="text" size=40 value="$in{'affiliateID'}"></td></tr>
+<tr><td align=right>Affiliate Misc: </td><td><INPUT NAME="affiliateMisc" type="text" size=40 value="$in{'affiliateMisc'}"></td></tr>
+<tr><td align=right>User 1: </td><td><INPUT NAME="user1" type="text" size=40 value="$in{'user1'}"></td></tr>
+<tr><td align=right>User 2: </td><td><INPUT NAME="user2" type="text" size=40 value="$in{'user2'}"></td></tr>
+<tr><td align=right>User 3: </td><td><INPUT NAME="user3" type="text" size=40 value="$in{'user3'}"></td></tr>
+<tr><td align=right>User 4: </td><td><INPUT NAME="user4" type="text" size=40 value="$in{'user4'}"></td></tr>
+<tr><td align=right>User 5: </td><td><INPUT NAME="user5" type="text" size=40 value="$in{'user5'}"></td></tr>
+<tr><td align=right>Admin Notes / Messages: </td><td><textarea name="adminMessages" cols="40" rows="10">$in{'adminMessages'}</textarea></td></tr>
+<tr><td align=right>Gateway Used: </td><td><INPUT NAME="GatewayUsed" type="text" size=40 value="$in{'GatewayUsed'}"></td></tr>
+<tr><td align=right>Shipping Messages: </td><td><textarea name="shippingMessages" cols="40" rows="10">$in{'shippingMessages'}</textarea></td></tr>
 <tr><td align=right>XCOMMENTS: </td><td><textarea name="xcomments" cols="30" rows="5">$in{'xcomments'}</textarea></td></tr>
+<tr><td align=center colspan=2><br><b>NOTE:</b> the items below are not currently logged by the cart nor displayed on any invoices or packing slips, but you can use them for your order management needs right now.<br><br></td></tr>
+<tr><td align=right>user 6: </td><td><textarea name="user6" cols="40" rows="10">$in{'user6'}</textarea></td></tr>
+<tr><td align=right>user 7: </td><td><textarea name="user7" cols="40" rows="10">$in{'user7'}</textarea></td></tr>
+<tr><td align=right>user 8: </td><td><textarea name="user8" cols="40" rows="10">$in{'user8'}</textarea></td></tr>
+<tr><td align=right>user 9: </td><td><textarea name="user9" cols="40" rows="10">$in{'user9'}</textarea></td></tr>
+<tr><td align=right>user 10: </td><td><textarea name="user10" cols="40" rows="10">$in{'user10'}</textarea></td></tr>
+<tr><td align=right>Order Payment Type User 1: </td><td><INPUT NAME="order_payment_type_user1" type="text" size=40 value="$in{'order_payment_type_user1'}"></td></tr>
+<tr><td align=right>Order Payment Type User 2: </td><td><INPUT NAME="order_payment_type_user2" type="text" size=40 value="$in{'order_payment_type_user2'}"></td></tr>
+<tr><td align=right>GiftCard_number: </td><td><INPUT NAME="GiftCard_number" type="text" size=40 value="$in{'GiftCard_number'}"></td></tr>
+<tr><td align=right>GiftCard Amount Used: </td><td><INPUT NAME="GiftCard_amount_used" type="text" size=40 value="$in{'GiftCard_amount_used'}"></td></tr>
+<tr><td align=right>internal company notes 1: </td><td><textarea name="internal_company_notes1" cols="40" rows="10">$in{'internal_company_notes1'}</textarea></td></tr>
+<tr><td align=right>internal company notes 2: </td><td><textarea name="internal_company_notes2" cols="40" rows="10">$in{'internal_company_notes2'}</textarea></td></tr>
+<tr><td align=right>internal company notes 3: </td><td><textarea name="internal_company_notes3" cols="40" rows="10">$in{'internal_company_notes3'}</textarea></td></tr>
+<tr><td align=right>customer order notes 1: </td><td><textarea name="customer_order_notes1" cols="40" rows="10">$in{'customer_order_notes1'}</textarea></td></tr>
+<tr><td align=right>customer order notes 2: </td><td><textarea name="customer_order_notes2" cols="40" rows="10">$in{'customer_order_notes2'}</textarea></td></tr>
+<tr><td align=right>customer order notes 3: </td><td><textarea name="customer_order_notes3" cols="40" rows="10">$in{'customer_order_notes3'}</textarea></td></tr>
+<tr><td align=right>customer order notes 4: </td><td><textarea name="customer_order_notes4" cols="40" rows="10">$in{'customer_order_notes4'}</textarea></td></tr>
+<tr><td align=right>customer order notes 5: </td><td><textarea name="customer_order_notes5" cols="40" rows="10">$in{'customer_order_notes5'}</textarea></td></tr>
+<tr><td align=right>mailinglist subscribe: </td><td><INPUT NAME="mailinglist_subscribe" type="text" size=40 value="$in{'mailinglist_subscribe'}"></td></tr>
+<tr><td align=right>wishlist subscribe: </td><td><INPUT NAME="wishlist_subscribe" type="text" size=40 value="$in{'wishlist_subscribe'}"></td></tr>
+<tr><td align=right>insurance_cost: </td><td><INPUT NAME="insurance_cost" type="text" size=40 value="$in{'insurance_cost'}"></td></tr>
+<tr><td align=right>trade-in allowance: </td><td><INPUT NAME="trade_in_allowance" type="text" size=40 value="$in{'trade_in_allowance'}"></td></tr>
+<tr><td align=right>RMA number: </td><td><INPUT NAME="rma_number" type="text" size=40 value="$in{'rma_number'}"></td></tr>
+<tr><td align=right>customer contact notes 1: </td><td><textarea name="customer_contact_notes1" cols="40" rows="10">$in{'customer_contact_notes1'}</textarea></td></tr>
+<tr><td align=right>customer contact notes 2: </td><td><textarea name="customer_contact_notes2" cols="40" rows="10">$in{'customer_contact_notes2'}</textarea></td></tr>
+<tr><td align=right>Account Number: </td><td><INPUT NAME="account_number'" type="text" size=40 value="$in{'account_number'}"></td></tr>
+<tr><td align=right>sales_rep: </td><td><INPUT NAME="sales_rep" type="text" size=40 value="$in{'sales_rep'}"></td></tr>
+<tr><td align=right>sales rep notes 1: </td><td><textarea name="sales_rep_notes1" cols="40" rows="10">$in{'sales_rep_notes1'}</textarea></td></tr>
+<tr><td align=right>sales rep notes 2: </td><td><textarea name="sales_rep_notes1" cols="40" rows="10">$in{'sales_rep_notes2'}</textarea></td></tr>
+<tr><td align=right>how_did_you_ ind us: </td><td><INPUT NAME="how_did_you_find_us" type="text" size=40 value="$in{'how_did_you_find_us'}"></td></tr>
+<tr><td align=right>suggestion box: </td><td><textarea name="suggestion_box" cols="40" rows="10">$in{'suggestion_box'}</textarea></td></tr>
+<tr><td align=right>preferrred shipping date: </td><td><INPUT NAME="preferrred_shipping_date" type="text" size=40 value="$in{'preferrred_shipping_date'}"></td></tr>
+<tr><td align=right>ship order items separately as available: </td><td><INPUT NAME="ship_order_items_as_available" type="text" size=40 value="$in{'ship_order_items_as_available'}"></td></tr>
 ~;
 
  my ($quantity,$product,$pid,$category,$price,$shipping,$optionids,$productStatus,$downladables,$altorigin,$nontaxable,$cartuser5,$cartuser6,$formattedoptions,$priceafteroptions);
@@ -1017,7 +1121,7 @@
         }
 
 print qq~
-<tr><td colspan=2><INPUT TYPE="HIDDEN" NAME="cartContents" TYPE="TEXT" SIZE=30 value="$in{'cartContents'}">
+<tr><td colspan=2><INPUT TYPE="HIDDEN" NAME="cartContents" type="text" size=40 value="$in{'cartContents'}">
 <table>
 <TR>
 <TD COLSPAN=8 BGCOLOR="#99CC99" align=center width=100%><font face="Arial, Helvetica, sans-serif" size=+2><b>Individual items in this Order</b></font></TD>
@@ -1072,7 +1176,7 @@
     if (-e $filename) {
         open (ORDERLOGLOOK, "$filename");
         $stuff=<ORDERLOGLOOK>;
-        ($in{'year'},$in{'month'},$in{'day'},$in{'invoiceNumber'},$in{'customerNumber'},$in{'orderStatus'},$in{'shiptrackingID'},$in{'firstName'},$in{'lastName'},$in{'fullName'},$in{'companyName'},$in{'customerPhone'},$in{'faxNumber'},$in{'emailAddress'},$in{'orderFromAddress'},$in{'customerAddress2'},$in{'customerAddress3'},$in{'orderFromCity'},$in{'orderFromState'},$in{'orderFromPostal'},$in{'orderFromCountry'},$in{'shipToName'},$in{'shipToAddress'},$in{'shipToAddress2'},$in{'shipToAddress3'},$in{'shipToCity'},$in{'shipToState'},$in{'shipToPostal'},$in{'shipToCountry'},$in{'shiptoResidential'},$in{'insureShipment'},$in{'shipMethod'},$in{'shippingTotal'},$in{'salesTax'},$in{'tax1'},$in{'tax2'},$in{'tax3'},$in{'discounts'},$in{'netProfit'},$in{'subTotal'},$in{'orderTotal'},$in{'affiliateTotal'},$in{'affiliateID'},$in{'affiliateMisc'},$in{'user1'},$in{'user2'},$in{'user3'},$in{'user4'},$in{'user5'},$in{'adminMessages'},$in{'cartContents'},$in{'GatewayUsed'},$in{'shippingMessages'},$in{'xcomments'},$in{'termsOfService'},$in{'discountCode'}) = split(/\t/,$stuff);
+        ($in{'year'},$in{'month'},$in{'day'},$in{'invoiceNumber'},$in{'customerNumber'},$in{'orderStatus'},$in{'shiptrackingID'},$in{'firstName'},$in{'lastName'},$in{'fullName'},$in{'companyName'},$in{'customerPhone'},$in{'faxNumber'},$in{'emailAddress'},$in{'orderFromAddress'},$in{'customerAddress2'},$in{'customerAddress3'},$in{'orderFromCity'},$in{'orderFromState'},$in{'orderFromPostal'},$in{'orderFromCountry'},$in{'shipToName'},$in{'shipToAddress'},$in{'shipToAddress2'},$in{'shipToAddress3'},$in{'shipToCity'},$in{'shipToState'},$in{'shipToPostal'},$in{'shipToCountry'},$in{'shiptoResidential'},$in{'insureShipment'},$in{'shipMethod'},$in{'shippingTotal'},$in{'salesTax'},$in{'tax1'},$in{'tax2'},$in{'tax3'},$in{'discounts'},$in{'netProfit'},$in{'subTotal'},$in{'orderTotal'},$in{'affiliateTotal'},$in{'affiliateID'},$in{'affiliateMisc'},$in{'user1'},$in{'user2'},$in{'user3'},$in{'user4'},$in{'user5'},$in{'adminMessages'},$in{'cartContents'},$in{'GatewayUsed'},$in{'shippingMessages'},$in{'xcomments'},$in{'termsOfService'},$in{'discountCode'},$in{'user6'},$in{'user7'},$in{'user8'},$in{'user9'},$in{'user10'},$in{'buySafe'},$in{'order_payment_type_user1'},$in{'order_payment_type_user2'},$in{'GiftCard_number'},$in{'GiftCard_amount_used'},$in{'internal_company_notes1'},$in{'internal_company_notes2'},$in{'internal_company_notes2'},$in{'customer_order_notes1'},$in{'customer_order_notes2'},$in{'customer_order_notes3'},$in{'customer_order_notes4'},$in{'customer_order_notes5'},$in{'mailinglist_subscribe'},$in{'wishlist_subscribe'},$in{'insurance_cost'},$in{'trade_in_allowance'},$in{'rma_number'},$in{'customer_contact_notes1'},$in{'customer_contact_notes2'},$in{'account_number'},$in{'sales_rep'},$in{'sales_rep_notes1'},$in{'sales_rep_notes2'},$in{'how_did_you_find_us'},$in{'suggestion_box'},$in{'preferrred_shipping_date'},$in{'ship_order_items_as_available'}) = split(/\t/,$stuff);
         close (ORDERLOGLOOK);
         @cart_contents_rows = split(/::/,$in{'cartContents'},$in{'GatewayUsed'});
         foreach $cart_contents_rows(@cart_contents_rows) {
@@ -1242,56 +1346,90 @@
 <b>Invoice Number:</b> $in{'invoiceNumber'}<br>
 <b>Customer ID Number:</b> $in{'customerNumber'}<br><br>
 <table width=600 border=0>
-<tr><td align=right>Order Status: </td><td><INPUT NAME="orderStatus" TYPE="TEXT" SIZE=30 value="$in{'orderStatus'}"></td></tr>
-<tr><td align=right>Shipping/Tracking ID: </td><td><INPUT NAME="shiptrackingID" TYPE="TEXT" SIZE=30 value="$in{'shiptrackingID'}"></td></tr>
-<tr><td align=right>Agree to Sales/Terms of Service: </td><td><INPUT NAME="shiptrackingID" TYPE="TEXT" SIZE=30 value="$in{'termsOfService'}"></td></tr>
-<tr><td align=right>First Name: </td><td><INPUT NAME="firstName" TYPE="TEXT" SIZE=30 value="$in{'firstName'}"></td></tr>
-<tr><td align=right>Last Name: </td><td><INPUT NAME="lastName" TYPE="TEXT" SIZE=30 value="$in{'lastName'}"></td></tr>
-<tr><td align=right>Full Name: </td><td><INPUT NAME="fullName" TYPE="TEXT" SIZE=30 value="$in{'fullName'}"></td></tr>
-<tr><td align=right>Company Name: </td><td><INPUT NAME="companyName" TYPE="TEXT" SIZE=30 value="$in{'companyName'}"></td></tr>
-<tr><td align=right>Phone Number: </td><td><INPUT NAME="customerPhone" TYPE="TEXT" SIZE=30 value="$in{'customerPhone'}"></td></tr>
-<tr><td align=right>Fax Number: </td><td><INPUT NAME="faxNumber" TYPE="TEXT" SIZE=30 value="$in{'faxNumber'}"></td></tr>
-<tr><td align=right>email Address: </td><td><INPUT NAME="emailAddress" TYPE="TEXT" SIZE=30 value="$in{'emailAddress'}"></td></tr>
-<tr><td align=right>Billing Address: </td><td><INPUT NAME="orderFromAddress" TYPE="TEXT" SIZE=30 value="$in{'orderFromAddress'}"></td></tr>
-<tr><td align=right>Address line 2: </td><td><INPUT NAME="customerAddress2" TYPE="TEXT" SIZE=30 value="$in{'customerAddress2'}"></td></tr>
-<tr><td align=right>Address line 3: </td><td><INPUT NAME="customerAddress3" TYPE="TEXT" SIZE=30 value="$in{'customerAddress3'}"></td></tr>
-<tr><td align=right>Billing City: </td><td><INPUT NAME="orderFromCity" TYPE="TEXT" SIZE=30 value="$in{'orderFromCity'}"></td></tr>
-<tr><td align=right>Billing State/Province: </td><td><INPUT NAME="orderFromState" TYPE="TEXT" SIZE=30 value="$in{'orderFromState'}"></td></tr>
-<tr><td align=right>Billing Postal Code: </td><td><INPUT NAME="orderFromPostal" TYPE="TEXT" SIZE=30 value="$in{'orderFromPostal'}"></td></tr>
-<tr><td align=right>Billing Country: </td><td><INPUT NAME="orderFromCountry" TYPE="TEXT" SIZE=30 value="$in{'orderFromCountry'}"></td></tr>
-<tr><td align=right>Ship to Name: </td><td><INPUT NAME="shipToName" TYPE="TEXT" SIZE=30 value="$in{'shipToName'}"></td></tr>
-<tr><td align=right>Ship to Address: </td><td><INPUT NAME="shipToAddress" TYPE="TEXT" SIZE=30 value="$in{'shipToAddress'}"></td></tr>
-<tr><td align=right>Ship to Address line 2: </td><td><INPUT NAME="shipToAddress2" TYPE="TEXT" SIZE=30 value="$in{'shipToAddress2'}"></td></tr>
-<tr><td align=right>Ship to Address line 3: </td><td><INPUT NAME="shipToAddress3" TYPE="TEXT" SIZE=30 value="$in{'shipToAddress3'}"></td></tr>
-<tr><td align=right>Ship to City: </td><td><INPUT NAME="shipToCity" TYPE="TEXT" SIZE=30 value="$in{'shipToCity'}"></td></tr>
-<tr><td align=right>Ship to State: </td><td><INPUT NAME="shipToState" TYPE="TEXT" SIZE=30 value="$in{'shipToState'}"></td></tr>
-<tr><td align=right>Ship to Postal Code: </td><td><INPUT NAME="shipToPostal" TYPE="TEXT" SIZE=30 value="$in{'shipToPostal'}"></td></tr>
-<tr><td align=right>Ship to Country: </td><td><INPUT NAME="shipToCountry" TYPE="TEXT" SIZE=30 value="$in{'shipToCountry'}"></td></tr>
-<tr><td align=right>Ship to Residential Address: </td><td><INPUT NAME="shiptoResidential" TYPE="TEXT" SIZE=30 value="$in{'shiptoResidential'}"></td></tr>
-<tr><td align=right>Insure Shipment? </td><td><INPUT NAME="insureShipment" TYPE="TEXT" SIZE=30 value="$in{'insureShipment'}"></td></tr>
-<tr><td align=right>Shipping Method / Shipped by: </td><td><INPUT NAME="shipMethod" TYPE="TEXT" SIZE=40 value="$in{'shipMethod'}"></td></tr>
-<tr><td align=right>Shipping Total: </td><td><INPUT NAME="shippingTotal" TYPE="TEXT" SIZE=30 value="$in{'shippingTotal'}"></td></tr>
-<tr><td align=right>Sales Tax Collected: </td><td><INPUT NAME="salesTax" TYPE="TEXT" SIZE=30 value="$in{'salesTax'}"></td></tr>
-<tr><td align=right>Special Tax 1 Collected: </td><td><INPUT NAME="tax1" TYPE="TEXT" SIZE=30 value="$in{'tax1'}"></td></tr>
-<tr><td align=right>Special Tax 2 Collected: </td><td><INPUT NAME="tax2" TYPE="TEXT" SIZE=30 value="$in{'tax2'}"></td></tr>
-<tr><td align=right>Special Tax 3 Collected: </td><td><INPUT NAME="tax3" TYPE="TEXT" SIZE=30 value="$in{'tax3'}"></td></tr>
-<tr><td align=right>Discounts Given: </td><td><INPUT NAME="discounts" TYPE="TEXT" SIZE=30 value="$in{'discounts'}"></td></tr>
-<tr><td align=right>Discount Code: </td><td><INPUT NAME="discountCode" TYPE="TEXT" SIZE=30 value="$in{'discountCode'}"></td></tr>
-<tr><td align=right>Net Profits Generated: </td><td><INPUT NAME="netProfit" TYPE="TEXT" SIZE=30 value="$in{'netProfit'}"></td></tr>
-<tr><td align=right>Order Sub Total: </td><td><INPUT NAME="subTotal" TYPE="TEXT" SIZE=30 value="$in{'subTotal'}"></td></tr>
-<tr><td align=right>Order Grand Total: </td><td><INPUT NAME="orderTotal" TYPE="TEXT" SIZE=30 value="$in{'orderTotal'}"></td></tr>
-<tr><td align=right>Affiliate Commision: </td><td><INPUT NAME="affiliateTotal" TYPE="TEXT" SIZE=30 value="$in{'affiliateTotal'}"></td></tr>
-<tr><td align=right>Affiliate ID: </td><td><INPUT NAME="affiliateID" TYPE="TEXT" SIZE=30 value="$in{'affiliateID'}"></td></tr>
-<tr><td align=right>Affiliate Misc: </td><td><INPUT NAME="affiliateMisc" TYPE="TEXT" SIZE=30 value="$in{'affiliateMisc'}"></td></tr>
-<tr><td align=right>User 1: </td><td><INPUT NAME="user1" TYPE="TEXT" SIZE=30 value="$in{'user1'}"></td></tr>
-<tr><td align=right>User 2: </td><td><INPUT NAME="user2" TYPE="TEXT" SIZE=30 value="$in{'user2'}"></td></tr>
-<tr><td align=right>User 3: </td><td><INPUT NAME="user3" TYPE="TEXT" SIZE=30 value="$in{'user3'}"></td></tr>
-<tr><td align=right>User 4: </td><td><INPUT NAME="user4" TYPE="TEXT" SIZE=30 value="$in{'user4'}"></td></tr>
-<tr><td align=right>User 5: </td><td><INPUT NAME="user5" TYPE="TEXT" SIZE=30 value="$in{'user5'}"></td></tr>
-<tr><td align=right>Admin Notes / Messages: </td><td><textarea name="adminMessages" cols="30" rows="7">$in{'adminMessages'}</textarea></td></tr>
-<tr><td align=right>Gateway Used: </td><td><INPUT NAME="GatewayUsed" TYPE="TEXT" SIZE=30 value="$in{'GatewayUsed'}"></td></tr>
-<tr><td align=right>Shipping Messages: </td><td><textarea name="shippingMessages" cols="30" rows="7">$in{'shippingMessages'}</textarea></td></tr>
-<tr><td align=right>XCOMMENTS: </td><td><textarea name="xcomments" cols="30" rows="7">$in{'xcomments'}</textarea></td></tr>
+<tr><td align=right>Order Status: </td><td><INPUT NAME="orderStatus" type="text" size=40 value="$in{'orderStatus'}"></td></tr>
+<tr><td align=right>Shipping/Tracking ID: </td><td><INPUT NAME="shiptrackingID" type="text" size=40 value="$in{'shiptrackingID'}"></td></tr>
+<tr><td align=right>Agree to Sales/Terms of Service: </td><td><INPUT NAME="termsOfService" type="text" size=40 value="$in{'termsOfService'}"></td></tr>
+<tr><td align=right>First Name: </td><td><INPUT NAME="firstName" type="text" size=40 value="$in{'firstName'}"></td></tr>
+<tr><td align=right>Last Name: </td><td><INPUT NAME="lastName" type="text" size=40 value="$in{'lastName'}"></td></tr>
+<tr><td align=right>Full Name: </td><td><INPUT NAME="fullName" type="text" size=40 value="$in{'fullName'}"></td></tr>
+<tr><td align=right>Company Name: </td><td><INPUT NAME="companyName" type="text" size=40 value="$in{'companyName'}"></td></tr>
+<tr><td align=right>Phone Number: </td><td><INPUT NAME="customerPhone" type="text" size=40 value="$in{'customerPhone'}"></td></tr>
+<tr><td align=right>Fax Number: </td><td><INPUT NAME="faxNumber" type="text" size=40 value="$in{'faxNumber'}"></td></tr>
+<tr><td align=right>email Address: </td><td><INPUT NAME="emailAddress" type="text" size=40 value="$in{'emailAddress'}"></td></tr>
+<tr><td align=right>Billing Address: </td><td><INPUT NAME="orderFromAddress" type="text" size=40 value="$in{'orderFromAddress'}"></td></tr>
+<tr><td align=right>Address line 2: </td><td><INPUT NAME="customerAddress2" type="text" size=40 value="$in{'customerAddress2'}"></td></tr>
+<tr><td align=right>Address line 3: </td><td><INPUT NAME="customerAddress3" type="text" size=40 value="$in{'customerAddress3'}"></td></tr>
+<tr><td align=right>Billing City: </td><td><INPUT NAME="orderFromCity" type="text" size=40 value="$in{'orderFromCity'}"></td></tr>
+<tr><td align=right>Billing State/Province: </td><td><INPUT NAME="orderFromState" type="text" size=40 value="$in{'orderFromState'}"></td></tr>
+<tr><td align=right>Billing Postal Code: </td><td><INPUT NAME="orderFromPostal" type="text" size=40 value="$in{'orderFromPostal'}"></td></tr>
+<tr><td align=right>Billing Country: </td><td><INPUT NAME="orderFromCountry" type="text" size=40 value="$in{'orderFromCountry'}"></td></tr>
+<tr><td align=right>Ship to Name: </td><td><INPUT NAME="shipToName" type="text" size=40 value="$in{'shipToName'}"></td></tr>
+<tr><td align=right>Ship to Address: </td><td><INPUT NAME="shipToAddress" type="text" size=40 value="$in{'shipToAddress'}"></td></tr>
+<tr><td align=right>Ship to Address line 2: </td><td><INPUT NAME="shipToAddress2" type="text" size=40 value="$in{'shipToAddress2'}"></td></tr>
+<tr><td align=right>Ship to Address line 3: </td><td><INPUT NAME="shipToAddress3" type="text" size=40 value="$in{'shipToAddress3'}"></td></tr>
+<tr><td align=right>Ship to City: </td><td><INPUT NAME="shipToCity" type="text" size=40 value="$in{'shipToCity'}"></td></tr>
+<tr><td align=right>Ship to State: </td><td><INPUT NAME="shipToState" type="text" size=40 value="$in{'shipToState'}"></td></tr>
+<tr><td align=right>Ship to Postal Code: </td><td><INPUT NAME="shipToPostal" type="text" size=40 value="$in{'shipToPostal'}"></td></tr>
+<tr><td align=right>Ship to Country: </td><td><INPUT NAME="shipToCountry" type="text" size=40 value="$in{'shipToCountry'}"></td></tr>
+<tr><td align=right>Ship to Residential Address: </td><td><INPUT NAME="shiptoResidential" type="text" size=40 value="$in{'shiptoResidential'}"></td></tr>
+<tr><td align=right>Insure Shipment? </td><td><INPUT NAME="insureShipment" type="text" size=40 value="$in{'insureShipment'}"></td></tr>
+<tr><td align=right>Shipping Method / Shipped by: </td><td><INPUT NAME="shipMethod" type="text" size=40 value="$in{'shipMethod'}"></td></tr>
+<tr><td align=right>Shipping Total: </td><td><INPUT NAME="shippingTotal" type="text" size=40 value="$in{'shippingTotal'}"></td></tr>
+<tr><td align=right>Sales Tax Collected: </td><td><INPUT NAME="salesTax" type="text" size=40 value="$in{'salesTax'}"></td></tr>
+<tr><td align=right>Special Tax 1 Collected: </td><td><INPUT NAME="tax1" type="text" size=40 value="$in{'tax1'}"></td></tr>
+<tr><td align=right>Special Tax 2 Collected: </td><td><INPUT NAME="tax2" type="text" size=40 value="$in{'tax2'}"></td></tr>
+<tr><td align=right>Special Tax 3 Collected: </td><td><INPUT NAME="tax3" type="text" size=40 value="$in{'tax3'}"></td></tr>
+<tr><td align=right>Discounts Given: </td><td><INPUT NAME="discounts" type="text" size=40 value="$in{'discounts'}"></td></tr>
+<tr><td align=right>Discount Code: </td><td><INPUT NAME="discountCode" type="text" size=40 value="$in{'discountCode'}"></td></tr>
+<tr><td align=right>buySAFE Fee: </td><td><INPUT NAME="buySafe" type="text" size=40 value="$in{'buySafe'}"></td></tr>
+<tr><td align=right>Net Profits Generated: </td><td><INPUT NAME="netProfit" type="text" size=40 value="$in{'netProfit'}"></td></tr>
+<tr><td align=right>Order Sub Total: </td><td><INPUT NAME="subTotal" type="text" size=40 value="$in{'subTotal'}"></td></tr>
+<tr><td align=right>Order Grand Total: </td><td><INPUT NAME="orderTotal" type="text" size=40 value="$in{'orderTotal'}"></td></tr>
+<tr><td align=right>Affiliate Commision: </td><td><INPUT NAME="affiliateTotal" type="text" size=40 value="$in{'affiliateTotal'}"></td></tr>
+<tr><td align=right>Affiliate ID: </td><td><INPUT NAME="affiliateID" type="text" size=40 value="$in{'affiliateID'}"></td></tr>
+<tr><td align=right>Affiliate Misc: </td><td><INPUT NAME="affiliateMisc" type="text" size=40 value="$in{'affiliateMisc'}"></td></tr>
+<tr><td align=right>User 1: </td><td><INPUT NAME="user1" type="text" size=40 value="$in{'user1'}"></td></tr>
+<tr><td align=right>User 2: </td><td><INPUT NAME="user2" type="text" size=40 value="$in{'user2'}"></td></tr>
+<tr><td align=right>User 3: </td><td><INPUT NAME="user3" type="text" size=40 value="$in{'user3'}"></td></tr>
+<tr><td align=right>User 4: </td><td><INPUT NAME="user4" type="text" size=40 value="$in{'user4'}"></td></tr>
+<tr><td align=right>User 5: </td><td><INPUT NAME="user5" type="text" size=40 value="$in{'user5'}"></td></tr>
+<tr><td align=right>Admin Notes / Messages: </td><td><textarea name="adminMessages" cols="40" rows="10">$in{'adminMessages'}</textarea></td></tr>
+<tr><td align=right>Gateway Used: </td><td><INPUT NAME="GatewayUsed" type="text" size=40 value="$in{'GatewayUsed'}"></td></tr>
+<tr><td align=right>Shipping Messages: </td><td><textarea name="shippingMessages" cols="40" rows="10">$in{'shippingMessages'}</textarea></td></tr>
+<tr><td align=right>XCOMMENTS: </td><td><textarea name="xcomments" cols="40" rows="10">$in{'xcomments'}</textarea></td></tr>
+<tr><td align=center colspan=2><br><b>NOTE:</b> the items below are not currently logged by the cart nor displayed on any invoices or packing slips, but you can use them for your order management needs right now.<br><br></td></tr>
+<tr><td align=right>user 6: </td><td><textarea name="user6" cols="40" rows="10">$in{'user6'}</textarea></td></tr>
+<tr><td align=right>user 7: </td><td><textarea name="user7" cols="40" rows="10">$in{'user7'}</textarea></td></tr>
+<tr><td align=right>user 8: </td><td><textarea name="user8" cols="40" rows="10">$in{'user8'}</textarea></td></tr>
+<tr><td align=right>user 9: </td><td><textarea name="user9" cols="40" rows="10">$in{'user9'}</textarea></td></tr>
+<tr><td align=right>user 10: </td><td><textarea name="user10" cols="40" rows="10">$in{'user10'}</textarea></td></tr>
+<tr><td align=right>Order Payment Type User 1: </td><td><INPUT NAME="order_payment_type_user1" type="text" size=40 value="$in{'order_payment_type_user1'}"></td></tr>
+<tr><td align=right>Order Payment Type User 2: </td><td><INPUT NAME="order_payment_type_user2" type="text" size=40 value="$in{'order_payment_type_user2'}"></td></tr>
+<tr><td align=right>GiftCard_number: </td><td><INPUT NAME="GiftCard_number" type="text" size=40 value="$in{'GiftCard_number'}"></td></tr>
+<tr><td align=right>GiftCard Amount Used: </td><td><INPUT NAME="GiftCard_amount_used" type="text" size=40 value="$in{'GiftCard_amount_used'}"></td></tr>
+<tr><td align=right>internal company notes 1: </td><td><textarea name="internal_company_notes1" cols="40" rows="10">$in{'internal_company_notes1'}</textarea></td></tr>
+<tr><td align=right>internal company notes 2: </td><td><textarea name="internal_company_notes2" cols="40" rows="10">$in{'internal_company_notes2'}</textarea></td></tr>
+<tr><td align=right>internal company notes 3: </td><td><textarea name="internal_company_notes3" cols="40" rows="10">$in{'internal_company_notes3'}</textarea></td></tr>
+<tr><td align=right>customer order notes 1: </td><td><textarea name="customer_order_notes1" cols="40" rows="10">$in{'customer_order_notes1'}</textarea></td></tr>
+<tr><td align=right>customer order notes 2: </td><td><textarea name="customer_order_notes2" cols="40" rows="10">$in{'customer_order_notes2'}</textarea></td></tr>
+<tr><td align=right>customer order notes 3: </td><td><textarea name="customer_order_notes3" cols="40" rows="10">$in{'customer_order_notes3'}</textarea></td></tr>
+<tr><td align=right>customer order notes 4: </td><td><textarea name="customer_order_notes4" cols="40" rows="10">$in{'customer_order_notes4'}</textarea></td></tr>
+<tr><td align=right>customer order notes 5: </td><td><textarea name="customer_order_notes5" cols="40" rows="10">$in{'customer_order_notes5'}</textarea></td></tr>
+<tr><td align=right>mailinglist subscribe: </td><td><INPUT NAME="mailinglist_subscribe" type="text" size=40 value="$in{'mailinglist_subscribe'}"></td></tr>
+<tr><td align=right>wishlist subscribe: </td><td><INPUT NAME="wishlist_subscribe" type="text" size=40 value="$in{'wishlist_subscribe'}"></td></tr>
+<tr><td align=right>insurance_cost: </td><td><INPUT NAME="insurance_cost" type="text" size=40 value="$in{'insurance_cost'}"></td></tr>
+<tr><td align=right>trade-in allowance: </td><td><INPUT NAME="trade_in_allowance" type="text" size=40 value="$in{'trade_in_allowance'}"></td></tr>
+<tr><td align=right>RMA number: </td><td><INPUT NAME="rma_number" type="text" size=40 value="$in{'rma_number'}"></td></tr>
+<tr><td align=right>customer contact notes 1: </td><td><textarea name="customer_contact_notes1" cols="40" rows="10">$in{'customer_contact_notes1'}</textarea></td></tr>
+<tr><td align=right>customer contact notes 2: </td><td><textarea name="customer_contact_notes2" cols="40" rows="10">$in{'customer_contact_notes2'}</textarea></td></tr>
+<tr><td align=right>Account Number: </td><td><INPUT NAME="account_number'" type="text" size=40 value="$in{'account_number'}"></td></tr>
+<tr><td align=right>sales_rep: </td><td><INPUT NAME="sales_rep" type="text" size=40 value="$in{'sales_rep'}"></td></tr>
+<tr><td align=right>sales rep notes 1: </td><td><textarea name="sales_rep_notes1" cols="40" rows="10">$in{'sales_rep_notes1'}</textarea></td></tr>
+<tr><td align=right>sales rep notes 2: </td><td><textarea name="sales_rep_notes1" cols="40" rows="10">$in{'sales_rep_notes2'}</textarea></td></tr>
+<tr><td align=right>how_did_you_ ind us: </td><td><INPUT NAME="how_did_you_find_us" type="text" size=40 value="$in{'how_did_you_find_us'}"></td></tr>
+<tr><td align=right>suggestion box: </td><td><textarea name="suggestion_box" cols="40" rows="10">$in{'suggestion_box'}</textarea></td></tr>
+<tr><td align=right>preferrred shipping date: </td><td><INPUT NAME="preferrred_shipping_date" type="text" size=40 value="$in{'preferrred_shipping_date'}"></td></tr>
+<tr><td align=right>ship order items separately as available: </td><td><INPUT NAME="ship_order_items_as_available" type="text" size=40 value="$in{'ship_order_items_as_available'}"></td></tr>
 ~;
 
  my ($quantity,$product,$pid,$category,$price,$shipping,$optionids,$productStatus,$downladables,$altorigin,$nontaxable,$cartuser5,$cartuser6,$formattedoptions,$priceafteroptions);
@@ -1349,7 +1487,7 @@
         }
 
 print qq~
-<tr><td colspan=2 align=center><INPUT TYPE="HIDDEN" NAME="cartContents" TYPE="TEXT" SIZE=30 value="$in{'cartContents'}">
+<tr><td colspan=2 align=center><INPUT TYPE="HIDDEN" NAME="cartContents" type="text" size=40 value="$in{'cartContents'}">
 <table>
 <TR>
 <TD COLSPAN=8 BGCOLOR="#99CC99" align=center width=100%><font face="Arial, Helvetica, sans-serif" size=+2><b>Individual items in this Order</b></font></TD>
@@ -1847,7 +1985,7 @@
 open(LOGFILE, "$filename4") || print "<br>THE $tempmonththingy $tempyearthingy ORDER LOG DOES NOT EXIST\n<tr><td width=620 colspan=8 align=center><font face=arial size=2>Sorry, No Orders</font></td></tr>\n";
 while (<LOGFILE>) {
 # print "$_<br>";
-($year,$month,$day,$orderLoggingHash{'invoiceNumber'},$orderLoggingHash{'customerNumber'},$orderLoggingHash{'orderStatus'},$orderLoggingHash{'firstName'},$orderLoggingHash{'lastName'},$orderLoggingHash{'fullName'},$orderLoggingHash{'companyName'},$orderLoggingHash{'emailAddress'},$orderLoggingHash{'orderFromState'},$orderLoggingHash{'orderFromPostal'},$orderLoggingHash{'orderFromCountry'},$orderLoggingHash{'shipMethod'},$orderLoggingHash{'shippingTotal'},$orderLoggingHash{'salesTax'},$orderLoggingHash{'tax1'},$orderLoggingHash{'tax2'},$orderLoggingHash{'tax3'},$orderLoggingHash{'discounts'},$orderLoggingHash{'netProfit'},$orderLoggingHash{'subTotal'},$orderLoggingHash{'orderTotal'},$orderLoggingHash{'affiliateTotal'},$orderLoggingHash{'affiliateID'},$orderLoggingHash{'affiliateMisc'}) = split(/\t/,$_);
+($year,$month,$day,$orderLoggingHash{'invoiceNumber'},$orderLoggingHash{'customerNumber'},$orderLoggingHash{'orderStatus'},$orderLoggingHash{'firstName'},$orderLoggingHash{'lastName'},$orderLoggingHash{'fullName'},$orderLoggingHash{'companyName'},$orderLoggingHash{'emailAddress'},$orderLoggingHash{'orderFromState'},$orderLoggingHash{'orderFromPostal'},$orderLoggingHash{'orderFromCountry'},$orderLoggingHash{'shipMethod'},$orderLoggingHash{'shippingTotal'},$orderLoggingHash{'salesTax'},$orderLoggingHash{'tax1'},$orderLoggingHash{'tax2'},$orderLoggingHash{'tax3'},$orderLoggingHash{'discounts'},$orderLoggingHash{'netProfit'},$orderLoggingHash{'subTotal'},$orderLoggingHash{'orderTotal'},$orderLoggingHash{'affiliateTotal'},$orderLoggingHash{'affiliateID'},$orderLoggingHash{'affiliateMisc'},$orderLoggingHash{'GatewayUsed'},$orderLoggingHash{'buySafe'}) = split(/\t/,$_);
 
 $orderLoggingHash{'orderTotal'} = &format_pricemgr($orderLoggingHash{'orderTotal'});
 
diff -aruN 5.0.000.src/protected/product_edit-ext_lib.pl 5.2.000.src/protected/product_edit-ext_lib.pl
--- 5.0.000.src/protected/product_edit-ext_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/product_edit-ext_lib.pl	2008-01-14 19:48:39.000000000 -0600
@@ -1,7 +1,8 @@
 # file ./store/protected/product_edit-ext_lib.pl
 
-$versions{'product_edit-ext_lib.pl'} = "5.0.000";
+$versions{'product_edit-ext_lib.pl'} = "5.2.000";
 $sc_userfieldsfile="$mgrdir/misc/userfields.pl";
+$mc_shipfilename = "$sc_data_file_dir/shipping_dimensions.file";
 &require_supporting_libraries(__FILE__,__LINE__,
   "$mgrdir/misc/userfields.pl");
 
@@ -367,6 +368,14 @@
            <input type=file name=upfile5 size=20><br>This is for uploading images only.  Does not do any automatic field/data entry for image names.  Use .gif .jpg or .png formats</font></td></tr>\n~;
  }
 
+# Added in by Bonnie at Scottcrew Web Services for Alternate Origins on Add screen
+if ($sc_alt_origin_enabled =~ /yes/) { # allow alternate origins
+  $alternate_origin_row = qq~<tr><td colspan=4><font FACE="ARIAL" SIZE="2">Alternate Shipping origins are enabled.  If this product is shipped from a different location than the original location within your shipping settings, then please enter the Zip/Postal Code and the State/Province this product is shipping from.  If not needed, leave blank.<br>
+           Zip/Postal Code: <input type=text name="alt_origin_postalcode" size=16 value="$alt_origin_postalcode"> &nbsp;&nbsp; 
+           State / Province: <input type=text name="alt_origin_stateprov" size=3 value="$alt_origin_stateprov"><br>
+           </td></tr>\n~;
+ }
+
 if($add_product_success eq "yes"){
 $msg .= qq~<br><FONT FACE=ARIAL SIZE=2 COLOR=RED>Product number <a 
 target="_BLANK"
@@ -486,6 +495,7 @@
 ############################################################################
 sub edit_item_form_new {
 local ($form,$msg,$imgup)="";
+my ($dimension_row,$alternate_origin_row)="";
 
 if ($mc_file_upload_ok =~ /yes/) { # allow images to be uploaded
   $imgup = qq~<tr><td colspan=4>Upload Image File(s): 
@@ -496,6 +506,32 @@
            <input type=file name=upfile5 size=20><br>
            </td></tr>\n~;
  }
+if ($sc_alt_origin_enabled =~ /yes/) { # allow alternate origins
+  $alternate_origin_row = qq~<tr><td colspan=4><font FACE="ARIAL" SIZE="2">Alternate Shipping origins are enabled.  If this product is shipped from a different location than the original location within your shipping settings, then please enter the Zip/Postal Code and the State/Province this product is shipping from.  If not needed, leave blank.<br>
+           Zip/Postal Code: <input type=text name="alt_origin_postalcode" size=16 value="$alt_origin_postalcode"> &nbsp;&nbsp; 
+           State / Province: <input type=text name="alt_origin_stateprov" size=3 value="$alt_origin_stateprov"><br>
+           </td></tr>\n~;
+ }
+
+if ($sc_dimensional_shipping_enabled =~ /yes/) { # allow dimensions per box
+  $dimension_row = qq~<tr><td colspan=4><font FACE="ARIAL" SIZE="2">Shipping Dimensions are enabled.  Enter the length, width, height of the box. If using a non-rectangular package and not using a shipper supplied container, enter in the girth of the widest point perpendicular to the length of the package.  Select the packaging type as well.  If you use more than one shipping company for real-time quotes, do not select anything other than "your packaging".  <b>If this product is to be boxed with other items, leave these fields blank </b>(it will use defaults from the real-time shipping settings instead).<br>
+Box Type: <select name="boxtype">
+<option>$boxtype</option>
+<option value="02">02 - UPS Your Packaging</option>
+<option value="03">03 - UPS Tube (38" Long, posters &amp; prints)</option>
+<option value="RECTANGULAR">USPS Your Packaging - Rectangular</option>
+<option value="NONRECTANGULAR">USPS Your Packaging - Non-Rectangular</option>
+<option value="FLAT RATE BOX">USPS Flat Rate Box - Priority Mail Only</option>
+<option value="FLAT RATE ENVELOPE">USPS Flat Rate Envelope</option>
+      <option value='RECTANGULARPACKAGING'>Your Packaging (rectagular for any shipper)</option>
+<option value="">None</option>
+</select> &nbsp;&nbsp;
+           Length: <input type=text name=length size=3 value=$length> &nbsp;&nbsp; 
+           Width: <input type=text name=width size=3 value=$width> &nbsp;&nbsp; 
+           Height: <input type=text name=height size=3 value=$height> &nbsp;&nbsp;
+           Girth: <input type=text name=girth size=3 value=$girth><br>
+           </td></tr>\n~;
+ }
 
 $form = qq~<HTML>
 <HEAD>
@@ -543,6 +579,8 @@
 $options_file_list
       </select> </td>
     </tr>
+$alternate_origin_row
+$dimension_row
     <tr>
       <td colspan=1><font FACE="ARIAL" SIZE="2"><b>Category</b><br><small>spaces & dashes okay. 50 characters max.</small></font><br><input NAME="category" TYPE="TEXT" SIZE="25"
         MAXLENGTH="50" value="$category"></td>
@@ -969,6 +1007,7 @@
 &add_new_record_to_prod_db($my_new_rec);
 
 $add_product_status="yes";
+&category_list_builder_for_store;
 &add_product_screen($add_product_status);
 
 }
@@ -1024,6 +1063,8 @@
   $userDefinedTwo, $userDefinedThree, $userDefinedFour, 
   $userDefinedFive, $options);
 local($temp);
+my($boxindicator);
+
 
 $formatted_description = $in{'description'};
 $formatted_description =~ s/\s+/ /g;
@@ -1065,7 +1106,7 @@
 }
 
 # NO BLANKS OR WHITESPACE ALLOWED!
-my @arrayThing2 = (new_sku,price,shipping_price,image);
+my @arrayThing2 = (new_sku,price,shipping_price,image,alt_origin_postalcode,alt_origin_stateprov,height,width,length,girth);
 foreach $arrayThing2 (@arrayThing2) {
     $in{$arrayThing2} =~ s/\s+//g;
 }
@@ -1125,7 +1166,26 @@
    }
  }
 
+if (($sc_alt_origin_enabled =~ /yes/i)||($sc_dimensional_shipping_enabled =~ /yes/i)) {
+    if (($in{'length'} ne '') && ($in{'width'} ne '') && ($in{'height'} ne '')) {
+       $boxindicator = "yes";
+    }
+
+# NO BLANKS OR WHITESPACE ALLOWED!
+my @arrayThing3 = (alt_origin_postalcode,alt_origin_stateprov,height,width,length,girth);
+foreach $arrayThing3 (@arrayThing3) {
+    $in{$arrayThing3} =~ s/\s+//g;
+}
+
+    my $raw_line2 =  
+      "$in{'ProductEditSku'}|$boxindicator|$in{'length'}|$in{'width'}" .
+      "|$in{'height'}|$in{'girth'}|$in{'boxtype'}|$in{'alt_origin_postalcode'}" .
+      "|$in{'alt_origin_stateprov'}";
+    my $result2 = &put_prod_dimensions_raw_line($in{'ProductEditSku'},$raw_line2);
+}
+
 $in{'category'} = $in{'save_category'}; 
+&category_list_builder_for_store;
 &edit_product_screen;
 
 ### End
@@ -1137,6 +1197,8 @@
 
 &del_prod_from_db($in{'DeleteWhichProduct'});
 
+&category_list_builder_for_store;
+
 &delete_product_screen;
 
 }
@@ -1256,5 +1318,87 @@
 ~;
 print &$manager_page_footer;
 }
-#######################################################################################
+############################################################
+#
+# get a row from the product shipping dimensions database.
+# added by Mister Ed May 17, 2007
+#
+############################################################
+
+sub get_prod_shipping_dimensions_in_db_row_for_edit {
+  my ($product_id) = @_;
+  my ($db_product_id,$save_the_line,$filename,$result);
+  my ($sku,$boxindicator,$length,$width,$height,$girth,$boxtype,$alt_origin_postalcode,$alt_origin_stateprov);
+  $db_product_id = "";
+                #
+                # First we open the data file.
+                # If the open fails. We call the
+                # file open error routine in order
+                # to log the error
+                #
+
+  open(DATAFILE, "$mc_shipfilename") || &file_open_error("$mc_shipfilename",
+      "Read Dimensions Database",__FILE__,__LINE__);
+
+  while (($line = <DATAFILE>) && ($product_id ne $db_product_id)) {
+    chomp($line);
+    ($sku,$boxindicator,$length,$width,$height,$girth,$boxtype,$alt_origin_postalcode,$alt_origin_stateprov) = split(/\|/,$line);
+    $save_the_line = $line;
+    $db_product_id = $sku;
+  }
+
+  if ($product_id eq $db_product_id) { 
+	$result = "$save_the_line";
+  }
+  close (DATAFILE);
+
+  return $result;
+
+} 
+######################################################################################
+sub put_prod_dimensions_raw_line {
+  my($product_id, $db_raw_line) = @_;
+  local($result,$db_product_id,$ProductEditSku)='';
+  my($junk, $line, @lines);
+                #
+                # First we open the data file.
+                # If the open fails. We call the
+                # file open error routine in order
+                # to log the error
+                #
+#Note: could check to see if $product_id and $ProductEditSku match!
+($ProductEditSku,$junk) = split(/\|/,$db_raw_line,2);
+ 
+&get_file_lock("${mc_shipfilename}.lock");
+open(OLDFILE, "$mc_shipfilename") || &my_die("Can't Open $mc_shipfilename");
+@lines = <OLDFILE>;
+#print @lines;
+close (OLDFILE);
+open(NEWFILE,">$mc_shipfilename") || &my_die("Can't Open $mc_shipfilename");
+
+foreach $line (@lines){
+  ($ProductEditSku, $junk) = split(/\|/,$line,2);
+
+  if ($ProductEditSku eq $product_id) {
+   print NEWFILE $db_raw_line . "\n";
+   $result=1;
+  } else {
+   print NEWFILE $line . "\n";
+  }
+ }
+
+if ($result ne 1 ) {
+  print NEWFILE $db_raw_line . "\n";
+  $result=1;
+ }
+
+close (NEWFILE);
+&release_file_lock("${mc_shipfilename}.lock");
+
+
+return $result;
+
+} # End of put_prod_db_raw_line 
+
+############################################################
 1; # Library
diff -aruN 5.0.000.src/protected/ship_settings-ext_lib.pl 5.2.000.src/protected/ship_settings-ext_lib.pl
--- 5.0.000.src/protected/ship_settings-ext_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/ship_settings-ext_lib.pl	2007-12-19 23:21:20.000000000 -0600
@@ -35,7 +35,7 @@
 #
 ##########################################################################
 
-$versions{'ship_settings-ext_lib.pl'} = "5.0.000";
+$versions{'ship_settings-ext_lib.pl'} = "5.0.002";
 $sc_custom_shipping_methodname_string = '';
 $sc_shipadminfile="$mgrdir/misc/ship_admin.pl";
 
@@ -78,7 +78,6 @@
 }
 
 #set admin file stuff. reduces variable overhead
-$myset2 .= "\$sc_alt_origin_db_counter2 = \"$in{'sc_alt_origin_db_counter2'}\";\n";
 $myset2 .= "\$sc_howmanycustomshippingmethods = \"$in{'sc_howmanycustomshippingmethods'}\";\n";
 
 $myset .= "\$sc_ship_thingy_p_id_indicator_enabled = \"$in{'sc_ship_thingy_p_id_indicator_enabled'}\";\n";
@@ -87,7 +86,6 @@
 $myset .= "\$sc_handling_charge_type = \"$in{'sc_handling_charge_type'}\";\n";
 $myset .= "\$sc_add_handling_cost_if_shipping_is_zero = \"$in{'sc_add_handling_cost_if_shipping_is_zero'}\";\n";
 $myset .= "\$sc_alt_origin_enabled = \"$in{'sc_alt_origin_enabled'}\";\n";
-$myset .= "\$sc_alt_origin_db_counter = \"$sc_alt_origin_db_counter\";\n";
 $myset .= "\$sc_use_custom_shipping_logic = \"$in{'sc_use_custom_shipping_logic'}\";\n";
 $myset .= "\$sc_location_custom_shipping_logic = \"$in{'sc_location_custom_shipping_logic'}\";\n";
 $myset .= "\$sc_use_SBW2 = \"$in{'sc_use_SBW2'}\";\n";
@@ -95,6 +93,7 @@
 $myset .= "\$sc_custom_shipping_logic = qq`$sc_custom_shipping_logic`;\n";
 $myset .= "\$sc_use_SBW = \"$in{'sc_use_SBW'}\";\n";
 $myset .= "\$sc_use_socket = \"$in{'sc_use_socket'}\";\n";
+$myset .= "\$sc_dimensional_shipping_enabled = \"$in{'sc_dimensional_shipping_enabled'}\";\n";
   $myset .= "\$sc_use_UPS = \"$in{'sc_use_UPS'}\";\n";
     $myset .= "\$sc_UPS_Origin_ZIP = \"$in{'sc_UPS_Origin_ZIP'}\";\n";
     $myset .= "\$sc_UPS_max_wt = \"$in{'sc_UPS_max_wt'}\";\n";
@@ -107,20 +106,26 @@
     $myset .=  "\$sc_ups_non_xml_adjust_rate = \"$in{'sc_ups_non_xml_adjust_rate'}\";\n";
 
 $myset .= "\$sc_use_USPS = \"$in{'sc_use_USPS'}\";\n";
+my $usps_temp_thingy = $in{'sc_use_USPS'};
+if ($usps_temp_thingy =~ /yes/i) {
   $myset .= "\$sc_USPS_max_wt = \"$in{'sc_USPS_max_wt'}\";\n";
   $myset .= "\$sc_USPS_Origin_ZIP = \"$in{'sc_USPS_Origin_ZIP'}\";\n";
   $myset .= "\$sc_USPS_use_API = \"$in{'sc_USPS_use_API'}\";\n";
   $myset .= "\$sc_USPS_userid = \"$in{'sc_USPS_userid'}\";\n";
-  $myset .= "\$sc_USPS_password = \"$in{'sc_USPS_password'}\";\n";
+#  $myset .= "\$sc_USPS_password = \"$in{'sc_USPS_password'}\";\n";
   $myset .= "\$sc_USPS_host_URL = \"$in{'sc_USPS_host_URL'}\";\n";
+  $myset .= "\$USPS_PackageType = \"$in{'USPS_PackageType'}\";\n";
+  $myset .= "\$sc_USPS_avg_package_length = \"$in{'sc_USPS_avg_package_length'}\";\n";
+  $myset .= "\$sc_USPS_avg_package_width = \"$in{'sc_USPS_avg_package_width'}\";\n";
+  $myset .= "\$sc_USPS_avg_package_height = \"$in{'sc_USPS_avg_package_height'}\";\n";
+  $myset .= "\$sc_USPS_avg_package_girth = \"$in{'sc_USPS_avg_package_girth'}\";\n";
   $myset2 .=  "\$sc_uspsparcelpost = \"$in{'sc_uspsparcelpost'}\";\n";
   $myset2 .=  "\$sc_uspsprioritymail = \"$in{'sc_uspsprioritymail'}\";\n";
   $myset2 .=  "\$sc_uspsexpressmail = \"$in{'sc_uspsexpressmail'}\";\n";
-  $myset2 .=  "\$sc_uspseconomyparcelpost = \"$in{'sc_uspseconomyparcelpost'}\";\n";
-  $myset2 .=  "\$sc_uspsairparcelpost = \"$in{'sc_uspsairparcelpost'}\";\n";
+  $myset2 .=  "\$sc_uspspriorityintern = \"$in{'sc_uspspriorityintern'}\";\n";
+  $myset2 .=  "\$sc_uspsexpressintern = \"$in{'sc_uspsexpressintern'}\";\n";
   $myset2 .=  "\$sc_uspsglobexpmail = \"$in{'sc_uspsglobexpmail'}\";\n";
-  $myset2 .=  "\$sc_uspsglobexpgardoc = \"$in{'sc_uspsglobexpgardoc'}\";\n";
-  $myset2 .=  "\$sc_uspsglobexpgarrnd = \"$in{'sc_uspsglobexpgarrnd'}\";\n";
+}
 
 
 # build shipping method stuff for cut and paste box.
@@ -158,36 +163,28 @@
 }
 
 if ($in{'sc_uspsparcelpost'} =~ /yes/i) {
-  $sc_shiptomethod_4forms .= qq~\n<OPTION VALUE="USPS Parcel Post (Parcel)">
+  $sc_shiptomethod_4forms .= qq~\n<option value="USPS Parcel Post (Parcel)">
 USPS Parcel Post (5-14 days)</option>~;
 }
 if ($in{'sc_uspsprioritymail'} =~ /yes/i) {
-  $sc_shiptomethod_4forms .= qq~\n<OPTION VALUE="USPS Priority Mail (Priority)">
+  $sc_shiptomethod_4forms .= qq~\n<option value="USPS Priority Mail (Priority)">
 USPS Priority Mail (3-7 days)</option>~;
 }
 if ($in{'sc_uspsexpressmail'} =~ /yes/i) {
-  $sc_shiptomethod_4forms .= qq~\n<OPTION VALUE="USPS Express Mail (Express)">
-USPS Express Mail (1-3 days)</OPTION>~;
+  $sc_shiptomethod_4forms .= qq~\n<option value="USPS Express Mail (Express)">
+USPS Express Mail (1-3 days)</option>~;
 }
-if ($in{'sc_uspseconomyparcelpost'} =~ /yes/i) {
-  $sc_shiptomethod_4forms .= qq~\n<OPTION VALUE="USPS (Economy \(Surface\) Parcel Post)">
-Economy (Surface) Parcel Post (4-6 weeks - international)</OPTION>~;
-}
-if ($in{'sc_uspsairparcelpost'} =~ /yes/i) {
-  $sc_shiptomethod_4forms .= qq~\n<OPTION VALUE="USPS (Airmail Parcel Post)">
-Airmail Parcel Post (4-10 days - international)</OPTION>~;
+if ($in{'sc_uspspriorityintern'} =~ /yes/i) {
+  $sc_shiptomethod_4forms .= qq~\n<option value="USPS (Priority Mail International)">
+Priority Mail International (6-10 days)</option>~;
+}
+if ($in{'sc_uspsexpressintern'} =~ /yes/i) {
+  $sc_shiptomethod_4forms .= qq~\n<option value="USPS (Express Mail International)">
+Express Mail International (3-5 days)</option>~;
 }
 if ($in{'sc_uspsglobexpmail'} =~ /yes/i) {
-  $sc_shiptomethod_4forms .= qq~\n<OPTION VALUE="USPS (Global Express Mail)">
-Global Express Mail (3-5 days - international)</OPTION>~;
-}
-if ($in{'sc_uspsglobexpgardo'} =~ /yes/i) {
-  $sc_shiptomethod_4forms .= qq~\n<OPTION VALUE="USPS (Global Express Guaranteed Document Service)">
-Global Express Guaranteed - Document (2-3 days - international)</OPTION>~;
-}
-if ($in{'sc_uspsglobexpgarrnd'} =~ /yes/i) {
-  $sc_shiptomethod_4forms .= qq~\n<OPTION VALUE="USPS (Global Express Guaranteed Document Service)">
-Global Express Guaranteed - Non-Document (2-3 days - international)</OPTION>~;
+  $sc_shiptomethod_4forms .= qq~\n<option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed (1-3 days)</option>~;
 }
 
 if ($in{'sc_upsgroundres'} =~ /yes/i) {
@@ -263,7 +260,7 @@
 <CENTER>
 <TABLE cellspacing=0 border=0>
 <TR>
-<TD><HR></TD>
+<TD><br/><HR></TD>
 </TR>
 <TR>
 <TD bgcolor=#99CC99>
@@ -272,7 +269,7 @@
 <TR>
 <TD bgcolor=#99CC99><HR></TD>
 </TR>
-</TABLE>
+</TABLE><br/>
 </CENTER>
 
 ENDOFTEXT
@@ -379,7 +376,7 @@
 <TD COLSPAN=2 bgcolor=#99CC99><HR></TD>
 </TR>
 <TR>
-<td><br><b>Use Alternate Origins?</b>  Great for drop-shipped products and/or multiple shipping location shippers.  To use this, select a default origin for each shipping method default (UPS, USPS, etc), ususally where most of your products will ship from. Then in each individual product that ships from a different location, enter the origination zipcode / postal code for that particular product.  No limit to locations/origination points.  You <b>must</b> indicate (below) a user database field in the product database that you will use the postal codes in ... or it will not work!<br><i>Limitations:</i> Must be from same country and use same shipping methods... or simular methods (cannot compute multiple shipping methods without some extensive custom programming).</td>
+<td><br><b>Use Alternate Origins?</b>  Great for drop-shipped products and/or multiple shipping location shippers.  To use this, select a default origin for each shipping method default (UPS, USPS, etc), ususally where most of your products will ship from. Then in each individual product that ships from a different location, enter the origination zipcode/postal-code and an origination state/province for that particular product.  No limit to locations/origination points.<br><i>Limitations:</i> Must be from same country and use same shipping methods... or simular methods (cannot compute multiple shipping methods without some extensive custom programming).</td>
 <TD>
 <SELECT NAME=sc_alt_origin_enabled>
 <OPTION>$sc_alt_origin_enabled</OPTION>
@@ -389,25 +386,6 @@
 </TD>
 </td>
 </TR>
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-
-<TR>
-<td><b>Which User field</b> in product database do you wish to use?</td>
-<TD>
-<SELECT NAME=sc_alt_origin_db_counter2>
-<OPTION>$sc_alt_origin_db_counter2</OPTION>
-<OPTION value="">None</OPTION>
-<OPTION>User 2</OPTION> 
-<OPTION>User 3</OPTION>
-<OPTION>User 4</OPTION>
-<OPTION>User 5</OPTION>
-$user10_thingy
-$user20_thingy
-</SELECT>
-</TD>
-</td></tr>
 
 <TR>
 <TD COLSPAN=2><br></TD>
@@ -570,7 +548,7 @@
 
 print <<ENDOFTEXT;
 <TR>
-<TD COLSPAN=2><HR></TD>
+<TD COLSPAN=2><br/><HR></TD>
 </TR>
 
 
@@ -600,7 +578,7 @@
 </TR>
 
 <TR>
-<td colspan=2><b>Allow Shipments via which services:</b><br><br>
+<td colspan=2><b>Allow Shipments via which services?</b><br/><small>(selecting yes or no on a shipping method does not change shipping options on order forms)</small><br><br>
 &nbsp;&nbsp;
 USPS:<SELECT NAME=sc_use_USPS>
 <OPTION>$sc_use_USPS</OPTION>
@@ -664,7 +642,7 @@
 if (($sc_use_USPS =~ /yes/i)||($sc_use_USPS eq '')) {
 print <<ENDOFTEXT;
 <TR>
-<TD COLSPAN=2><HR></TD>
+<TD COLSPAN=2><br/><HR></TD>
 </TR>
 <TR>
 <TD COLSPAN=2 bgcolor=#99CC99>
@@ -683,54 +661,45 @@
 MAXLENGTH="75" VALUE="$sc_USPS_host_URL"><br>
 USPS API Userid: <INPUT NAME="sc_USPS_userid" TYPE="TEXT" SIZE=14
 MAXLENGTH="25" VALUE="$sc_USPS_userid">
-&nbsp;&nbsp;&nbsp;&nbsp;
+<!--&nbsp;&nbsp;&nbsp;&nbsp;
 USPS API Password: <INPUT NAME="sc_USPS_password" TYPE="TEXT" SIZE=14
-MAXLENGTH="25" VALUE="$sc_USPS_password"><br>
+MAXLENGTH="25" VALUE="$sc_USPS_password">--><br>
 USPS ORIGIN ZIP: <INPUT NAME="sc_USPS_Origin_ZIP" TYPE="TEXT" SIZE=5
 MAXLENGTH="5" VALUE="$sc_USPS_Origin_ZIP"><br><br>
-Do you offer USPS Parcel Post: <SELECT NAME="sc_uspsparcelpost">
-<OPTION>$sc_uspsparcelpost</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT><br>
-Do you offer USPS Priority Mail: <SELECT NAME="sc_uspsprioritymail">
-<OPTION>$sc_uspsprioritymail</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT><br>
-Do you offer USPS Express Mail: <SELECT NAME="sc_uspsexpressmail">
-<OPTION>$sc_uspsexpressmail</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT><br><br>
-International (Outside of US & PR) Shipping Options:<br>
-Do you offer USPS Economy (Surface) Parcel Post: <SELECT NAME="sc_uspseconomyparcelpost">
-<OPTION>$sc_uspseconomyparcelpost</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT><br>
-Do you offer USPS <OPTION VALUE="USPS (Airmail Parcel Post)">
-Airmail Parcel Post 4-10 days: <SELECT NAME="sc_uspsairparcelpost">
-<OPTION>$sc_uspsairparcelpost</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT><br>
-Do you offer USPS <OPTION VALUE="USPS (Global Express Mail)">
-Global Express Mail 3-5 days: <SELECT NAME="sc_uspsglobexpmail">
-<OPTION>$sc_uspsglobexpmail</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT><br>
-Do you offer USPS Global Express Guaranteed - Document 2-3 days: <SELECT NAME="sc_uspsglobexpgardoc">
-<OPTION>$sc_uspsglobexpgardoc</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT><br>
-Do you offer USPS Global Express Guaranteed - Non-Document 2-3 days: <SELECT NAME="sc_uspsglobexpgarrnd">
-<OPTION>$sc_uspsglobexpgarrnd</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT><br>
+Do you offer USPS Parcel Post: <select name="sc_uspsparcelpost">
+<option>$sc_uspsparcelpost</option>
+<option>yes</option>
+<option>no</option>
+</select><br/>
+Do you offer USPS Priority Mail: <select name="sc_uspsprioritymail">
+<option>$sc_uspsprioritymail</option>
+<option>yes</option>
+<option>no</option>
+</select><br/>
+Do you offer USPS Express Mail: <select name="sc_uspsexpressmail">
+<option>$sc_uspsexpressmail</option>
+<option>yes</option>
+<option>no</option>
+</select><br/><br/>
+<b>International (Outside of US & PR) Shipping Options:</b><br/>
+Do you offer USPS <option value="USPS (Priority Mail International)">
+Priority Mail International 6-10 days: <select name="sc_uspspriorityintern">
+<option>$sc_uspspriorityintern</option>
+<option>yes</option>
+<option>no</option>
+</select><br/>
+Do you offer USPS <option value="USPS (Express Mail International)">
+Priority Mail International 3-5 days: <select name="sc_uspsexpressintern">
+<option>$sc_uspsexpressintern</option>
+<option>yes</option>
+<option>no</option>
+</select><br/>
+Do you offer USPS <option value="USPS (Global Express Guaranteed)">
+Global Express Guaranteed 1-3 days: <select name="sc_uspsglobexpmail">
+<option>$sc_uspsglobexpmail</option>
+<option>yes</option>
+<option>no</option>
+</select><br/>
 </TD>
 </TR>
 ENDOFTEXT
@@ -739,7 +708,7 @@
 if (($sc_use_UPS =~ /yes/i)||($sc_use_UPS eq '')) {
 print <<ENDOFTEXT;
 <TR>
-<TD COLSPAN=2><HR></TD>
+<TD COLSPAN=2><br/><HR></TD>
 </TR>
 <TR>
 <TD COLSPAN=2 bgcolor=#99CC99>
diff -aruN 5.0.000.src/protected/store_admin_actions.pl 5.2.000.src/protected/store_admin_actions.pl
--- 5.0.000.src/protected/store_admin_actions.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/store_admin_actions.pl	2007-12-19 23:21:21.000000000 -0600
@@ -1,6 +1,6 @@
 ###############################################################################
 #
-$versions{'store_admin_actions.pl'} = "5.0.000";
+$versions{'store_admin_actions.pl'} = "5.2.000";
 #
 ###############################################################################
 sub upcase {
@@ -213,8 +213,7 @@
  {
    $str .= "\n<br />";
  }
- $str .= qq~\n<a href="manager.cgi?log_out=yes">Log Out</a>~;
- $str .= "</div>"; 
+ $str .= "<br /></div>"; 
 $manager_menu = $str;
 }
 #######################################################################################
@@ -445,4 +444,19 @@
  return $logic;
 }
 ###############################################################################
+sub str_encode { # encode a string for cgi or other purposes
+  my($str)=@_;
+  my($mypat)='[\x00-\x1F"\x27#%/+;<>=?\x7F-\xFF]';
+  $str =~ s/($mypat)/sprintf("%%%02x",unpack('c',$1))/ge;
+  $str =~ tr/ /+/;
+  return $str;
+ }
+#######################################################################
+sub str_decode { # decode a string for cgi or other purposes
+  my($str)=@_;
+  $str =~ tr/+/ /;
+  $str =~ s/%(..)/pack("c",hex($1))/ge;
+  return $str;
+ }
+#######################################################################
 1;
diff -aruN 5.0.000.src/protected/store_admin_html.pl 5.2.000.src/protected/store_admin_html.pl
--- 5.0.000.src/protected/store_admin_html.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/store_admin_html.pl	2008-01-21 22:22:25.000000000 -0600
@@ -1,13 +1,13 @@
 ######################################################################################
 # This file contains the HTML for the store admin screens
 ######################################################################################
-$versions{'store_admin_html.pl'} = "5.0.000";
+$versions{'store_admin_html.pl'} = "5.2.000";
 &require_supporting_libraries(__FILE__,__LINE__,
   "$mgrdir/misc/mgr_miscmain.pl");
 if ($mc_max_top_menu_items eq '') { 
   $mc_max_top_menu_items = 6;
  }
-&add_item_to_manager_menu("View New Orders","order_log=yes","");
+#&add_item_to_manager_menu("View New Orders","order_log=yes","");
 &add_item_to_manager_menu("Error Log","error_log=yes","");
 if ($mgr_shall_i_log_accesses =~ /yes/i) {
   &add_item_to_manager_menu("Tracking","tracking_screen=yes","");
@@ -259,7 +259,7 @@
 $header_code
 <style>
 body{
-  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-family: Arial, Bitstream Vera Sans, Helvetica, sans-serif;
   margin: 0px;
   padding: 0px;
 }
@@ -284,18 +284,19 @@
 
 /* ~~~ Top Links just below the folder tabs ~~~ */
 .top_links{
-  font-size: 11px;
+  font-size: 10px;
+  font-weight: normal;
   color: #ffcc00; 
-  background-image : url($imageURLthingy/button-bar-bg.jpg);
-  padding: 0px 0px 5px 225px;
-  height: 33px;
+  background-color: #257B29;
+  padding: 0px 0px 2px 25px;
+  height: 30px;
   text-align: center;
 }
 /* ~~~ Left Menu Links ~~~ */
 .left_menu{
   background-color: #257B29;
   font-size: 10px;
-  width: 175px;
+  width: 3px;
   color: #FFCC00;
   padding: 10px 0px 20px 10px;
   vertical-align : top;
@@ -333,17 +334,17 @@
   font-size: 10pt;
   margin:0px 0px 0px 0px;
   padding:0px 0px 0px 0px;
-  width: 206px;
+  width: 226px;
 }
 h1{
   color: #257B29;
-  font-family: Arial, Helvetica, sans-serif;
+  font-family: Arial, Bitstream Vera Sans, Helvetica, sans-serif;
   text-align: center;
   font-size: 28px;
 }
 h2{
   font-size: 20px;
-  font-family: Arial, Helvetica, sans-serif;
+  font-family: Arial, Bitstream Vera Sans, Helvetica, sans-serif;
   color: #257B29;
   font-weight: bold;
   text-align: center;
@@ -369,7 +370,7 @@
 }
 .notes{
   font-size: 8pt;
-  font-family: Arial, Helvetica, sans-serif;
+  font-family: Arial, Bitstream Vera Sans, Helvetica, sans-serif;
   font-style : italic;
   margin: 0px 0px 0px 0px;
   padding: 2px 0px 10px 0px;
@@ -386,19 +387,46 @@
 /* ~~~ Hyper Links ~~~ */
 a.buttons:link {
   text-decoration: none; 
+  font-size: 11px;
   font-weight: normal; 
   color: #FFCC00;
 }
 a.buttons:visited {
   text-decoration: none; 
+  font-size: 11px;
   color: #FFCC00;
 }
 a.buttons:active  {
   text-decoration: none; 
+  font-size: 11px;
   color: #FFCC00;
 }
 a.buttons:hover {
   text-decoration: none; 
+  font-size: 11px;
+  color: #257B29; 
+  background-color: #FED700;
+}
+
+a.centbuttons:link {
+  text-decoration: none; 
+  font-size: 11px;
+  font-weight: normal; 
+  color: #FFCC00;
+}
+a.centbuttons:visited {
+  text-decoration: none; 
+  font-size: 11px;
+  color: #FFCC00;
+}
+a.centbuttons:active  {
+  text-decoration: none; 
+  font-size: 11px;
+  color: #FFCC00;
+}
+a.centbuttons:hover {
+  text-decoration: none; 
+  font-size: 11px;
   color: #257B29; 
   background-color: #FED700;
 }
@@ -430,7 +458,7 @@
 }
 /* ~~~ Copyright ~~~ */
 .copyright{
-  font-family: Arial, sans-serif;
+  font-family: Arial, Bitstream Vera Sans, Helvetica, sans-serif;
   font-size:8pt;
   color:#FFCC00;
   background-color: #257B29;
@@ -445,7 +473,7 @@
 /* ~~~ Manager Items ~~~ */
 .manager_menu{
   font-size: 10pt;
-  font-family: Arial, Helvetica, sans-serif;
+  font-family: Arial, Bitstream Vera Sans, Helvetica, sans-serif;
   text-align: center;
 }
 .manager_menu a:visited{
@@ -465,7 +493,7 @@
 				<tr>
 					<td width="534"><img src="$imageURLthingy/header.gif" width="534" height="72" border="0"></td>
 					<td align=right background="$imageURLthingy/background.gif"/><div valign=top align=right><img src="$imageURLthingy/Agora-logo-white2.gif" width="286" height="55" border="0" alt="The Official Website of AgoraCart and Agora.cgi"><img src="$imageURLthingy/blank.gif" width="50" height="1" border="0"> </div>
-</td></tr></table>
+						</td></tr></table>
 
     </td>
   </tr>
@@ -475,28 +503,34 @@
         <tr class="folder_tabs">
            <td class="first"><a href="$sc_store_url" class="buttons" target="_blank">View Your Store</a></td>
           <td width="33"><img src="$imageURLthingy/agora-cart-button.jpg" width="33" height="28"></td>
-          <td><a href="manager.cgi?change_settings_screen=yes" class="buttons">Your Store Settings</a></td>
-          <td width="33"><img src="$imageURLthingy/agora-cart-button.jpg" width="33" height="28"></td>
-          <td><a href="manager.cgi?order_log=yes" class="buttons">View New Orders</a></td>
+          <td><a href="manager.cgi?change_settings_screen=yes" class="buttons">Your Store Settings/Managers</a></td>
           <td width="33"><img src="$imageURLthingy/agora-cart-button.jpg" width="33" height="28"></td>
           <td><a href="manager.cgi?order_management_settings_screen=yes" class="buttons">Order Management</a></td>
           <td width="33"><img src="$imageURLthingy/agora-cart-button.jpg" width="33" height="28"></td>
+          <td><a href="manager.cgi?content_management_settings_screen=yes" class="buttons">CMS - Content Management</a></td>
+          <td width="33"><img src="$imageURLthingy/agora-cart-button.jpg" width="33" height="28"></td>
           <td><a href="http://www.AgoraCart.com/agorawiki/" class="buttons" target="_blank">User Manuals & Wiki</a></td>  
           <td width="33"><img src="$imageURLthingy/agora-cart-button.jpg" width="33" height="28"></td> 
           <td><a href="http://www.agoraguide.com/faq/" class="buttons" target="_blank">Free User Forums</a> </td>
-          <td width="33"><img src="$imageURLthingy/agora-cart-button.jpg" width="33" height="28"></td><td><a href="http://www.AgoraCart.com/proforum.htm" class="buttons" target="_blank">Pro Version Memberships</a></td>
+          <td width="33"><img src="$imageURLthingy/agora-cart-button.jpg" width="33" height="28"></td><td><a href="http://www.AgoraCart.com/proforum.htm" class="buttons" target="_blank">Upgrade to Gold Version</a></td>
         </tr>
       </table>
     </td>
   </tr>
   <tr>
+    <td bgcolor="#FFCC00" width="100%" height="1"><img src="$imageURLthingy/blank.gif" height="1" width="1px" /></td>
+  </tr>
+  <tr>
     <td>
       <table width="100%" class="top_links" border="0" cellpadding="0" cellspacing="0">
         <tr>
           <td>
-            <a class="buttons" href="manager.cgi?add_screen=yes">Product Add</a> &nbsp; |  &nbsp;
-            <a class="buttons" href="manager.cgi?edit_screen=yes">Product Edit</a> &nbsp; | &nbsp;
-            <a class="buttons" href="manager.cgi?delete_screen=yes">Product Delete</a>
+            <a class="centbuttons" href="manager.cgi?add_screen=yes">Product Add</a> &nbsp; |  &nbsp;
+            <a class="centbuttons" href="manager.cgi?edit_screen=yes">Product Edit</a> &nbsp; | &nbsp;
+            <a class="centbuttons" href="manager.cgi?delete_screen=yes">Product Delete</a> &nbsp;&nbsp; | &nbsp;&nbsp;
+            <a class="centbuttons" href="manager.cgi?order_log=yes">View New Orders</a> &nbsp;&nbsp; | &nbsp;&nbsp;
+            <a class="centbuttons" href="manager.cgi?login_screen=yes">Store Manager Home</a> &nbsp; | &nbsp;
+            <a class="centbuttons" href="manager.cgi?log_out=yes">Log Out</a>
           </td>
         </tr>
       </table>
@@ -506,57 +540,7 @@
     <td>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
-          <td class="left_menu">
-            <a class="buttons" href="#"><small>More Managers at Right<small></a> &rArr;<br/>
-            <p class="lm_first">Your Store - basics</p>
-            &gt; <a class="buttons" href="manager.cgi?order_log=yes">View New Orders</a><br />
-            &gt; <a class="buttons" href="manager.cgi?order_management_settings_screen=yes">Order Management</a><br />
-            &gt; <a class="buttons" href="manager.cgi?merchandising_tools_settings_screen=yes">Merchandising Tools</a><br />
-            &gt; <a class="buttons" href="manager.cgi?change_settings_screen=yes">Your Store Mgrs/Settings</a><br />
-            &gt; <a class="buttons" href="manager.cgi?add_screen=yes">Product Add</a><br />
-            &gt; <a class="buttons" href="manager.cgi?edit_screen=yes">Product Edit</a><br />
-            &gt; <a class="buttons" href="manager.cgi?delete_screen=yes">Product Delete</a><br />
-            &gt; <a class="buttons" href="manager.cgi?error_log=yes">Error Log</a><br />
-            &gt; <a class="buttons" href="manager.cgi?log_out=yes">Log Out</a><br />
-
-            <p class="lm_first">Get Help & Support</p>
-            &gt; <a class="buttons" href="http://www.AgoraCart.com/agorawiki/" target="_blank">User Manuals / Wiki</a><br />
-            &gt; <a class="buttons" href="http://www.agoraguide.com/faq/" target="_blank">Free User Forums</a><br />
-            &gt; <a class="buttons" href="http://www.allisonsonline.com/training/agora.cgi" target="_blank">Ralph's Site 4 Newbies</a><br />
-            &gt; <a class="buttons" href="http://www.AgoraCart.com/pages/Authorized_Solutions_Providers/" target="_blank">Certified Agora Pros</a><br />
-            &gt; <a class="buttons" href="http://www.AgoraXchange.com/" target="_blank">Hire a Freelancer</a><br />
-            &gt; <a class="buttons" href="http://www.agoracart.com/proshop/agora.cgi?product=Tech_Support" target="_blank">TechSupport</a><br />
-
-            <p class="lm_first">Pro Version Links</p>
-            &gt; <a class="buttons" href="http://www.AgoraCart.com/proforum.htm" target="_blank">Pro Member Benefits</a><br />
-            &gt; <a class="buttons" href="http://www.AgoraCart.com/proshop/agora.cgi?product=Members_Only" target="_blank">Join Today!</a><br />
-            &gt; <a class="buttons" href="http://www.AgoraCartPro.com/" target="_blank">AgoraCartPro.com</a><br />
-
-            <p class="lm_first">Downloads & Add-ons</p>
-            &gt; <a class="buttons" href="http://www.AgoraCart.org/download/" target="_blank">More Downloads</a><br />
-            &gt; <a class="buttons" href="http://www.AgoraCart.com/proshop/agora.cgi" target="_blank">The AgoraCart.com Store</a><br />
-
-            <p class="lm_first">Showcases</p>
-            &gt; <a class="buttons" href="http://www.AgoraCart.com/pages/Shopping/" target="_blank">Shop Live Stores</a><br />
-
-            <p class="lm_first">\@ AgoraCart.org</p>
-            &gt; <a class="buttons" href="http://www.AgoraCart.org/" target="_blank">AgoraCart.org</a><br />
-            &gt; <a class="buttons" href="http://www.AgoraCart.com/ancient_greek_agora" target="_blank">The Ancient Greek Agora</a><br />
-            &gt; <a class="buttons" href="http://www.AgoraCart.com/blog" target="_blank">Blog: News &amp; Updates</a><br />
-            &gt; <a class="buttons" href="http://www.AgoraCart.org/paymentgateways.htm" target="_blank">Supported Gateways</a><br /> 
-            &gt; <a class="buttons" href="http://www.AgoraCart.org/logos.htm" target="_blank">"Powered by" Logos</a><br />
-            &gt; <a class="buttons" href="http://www.AgoraCart.org/coolhacks.htm" target="_blank">Cool Hacks Contest</a><br />
-            &gt; <a class="buttons" href="http://www.AgoraCart.org/foundersclub.htm" target="_blank">Founders Club (sponsors)</a><br />
-
-            <br /><br />
-            <p class="center">
-              <a href="http://www.hotscripts.com/Detailed/11562.html" target="_blank">
-                <img src="http://images.hotscripts.com/dynamic/rating.gif?11562" /></a>
-              <br /><br />
-            </p>
-      
-            <img src="$imageURLthingy/spacer.gif" height="1" width="175px" />
-          </td>
+          <td class="left_menu" height="100%"><img src="$imageURLthingy/blank.gif" height="1" width="1px" /></td>
           <td class="main_body">
         <table width="100%" cellpadding=0 cellspacing=0 border=0>
         <tr>
@@ -566,9 +550,11 @@
 $manager_menu
 $errs
 $messages
+
 ENDOFTEXT
+
   return $my_header;
- }
+}
 #######################################################################################
 sub welcome_screen {
  &$manager_welcome_screen;
@@ -580,17 +566,27 @@
 my $temp_store_url_checker = "${sc_domain_name_for_cookie}";
 if ((($sc_self_serve_images =~ /no/i) && (($temp_store_url_checker =~ /cgi/i) && ($temp_store_url_checker =~ /bin/i))) || ($sc_self_serve_images =~ /yes/i) || (($sc_self_serve_images =~ /no/i) && (($sc_store_url =~ /cgi/i) && ($sc_store_url =~ /bin/i)))) {
   $imageURLthingy = "manager.cgi?picserve=";
-} 
+}
+
+use LWP::Simple;
+my $imagemasterlist = get("http://www.agoracart.com/downloadupdates/imagelist.txt");
+if ($imagemasterlist ne '') {
+my @line = split(/\n/, $imagemasterlist);
+foreach $imageline (@line) {
+ my ($imagename) = split(/\|/, $imageline);
+ chomp $imagename;
+ $imagename =~ /([\w\-\/]+)\.(\w+)/;
+ $imagename = "$1.$2";
+   if (!(-e "./$mgrdir/images/$imagename")) {
+      getstore("http://www.agoracart.com/downloadupdates/$imagename","./$mgrdir/images/$imagename");
+      `chmod 644 ./$mgrdir/images/$imagename`;
+   }
+}
+}
 
 print <<ENDOFTEXT;
 <CENTER>
 <TABLE BORDER=0 CELLPADDING=2>
-
-<TR>
-<TD COLSPAN=2>
-<HR>
-</TD>
-</TR>
 ENDOFTEXT
 
 if($error_message ne "")
@@ -620,23 +616,18 @@
 print <<ENDOFTEXT;
 
 <TR>
-<TD COLSPAN=2 class=main_text2><P><strong>$username, Welcome your AgoraCart store manager!</strong><br></P>
-<font size=+1><b>Resources:</b></font><br>
-
-<center><a href="http://www.agoracart.com/agorawiki/" target="_blank">User Manual</a>  | 
+<TD COLSPAN=2 class=main_text2>
+<center><a href="http://www.agoracart.com/agorawiki/index.php?title=The_AgoraCart_Project:User_Manual" target="_blank">User Manual</a>  | 
 <a href="http://www.agoracart.com/agorawiki/index.php?title=The_AgoraCart_Project:FAQ" target="_blank">FAQ</a>  | 
 <a href="http://www.agoracart.com/agorawiki/index.php?title=3rd_Party_Reference_%26_Tutorials" target="_blank">Misc Reference \& Tutorials</a>  | 
 <a href="DOCS/" target="_blank">Your Store's DOCS directory</a><br/>
 <a href="http://www.AgoraCart.com/blog" target="_blank">Blog: News & Updates</a>  | 
-<a href="http://www.agoracart.org/paymentgateways.htm" target="_blank">Payment Processing Gateways Supported</a></center><hr/>
-<font size=+1><b>Project Sponsors:</b></font><br/><center>
-<a href="http://www.NiftyPay.com" target="_new"><img src="$imageURLthingy/niftylogo1.png" width="132" height="45" border="0"></a> &nbsp; <a href="http://www.WebStyleStats.com" target="_new"><img src="$imageURLthingy/webstyle.jpg" width="120" height="55" border="0"></a> &nbsp; <a href="http://www.SnooperClick.com" target="_new"><img src="$imageURLthingy/snooperclick.jpg" width="158" height="39" border="0" ></a> &nbsp; <a href="http://www.iMegaMall.com" target="_new"><img src="$imageURLthingy/Imega5d.gif" width="180" height="44" border="0" ></a><br/>
-</center>
+<a href="http://www.agoracart.com/paymentgateways.htm" target="_blank">Payment Processing Gateways Supported</a></center><hr/>
 ENDOFTEXT
 #read files for updates added by Mister Ed Jan 2006
 $target_file = "http://www.agoracart.com/news.txt";
 if ($mc_first_time_user_to_agora_check2 eq '') {
-    $target_file = "http://www.agoracart.com/news_new.txt";
+    $target_file = "http://www.agoracart.com/news_fnew.txt";
 }
 use LWP::Simple;
 my $file = get($target_file);
@@ -646,7 +637,7 @@
 print <<ENDOFTEXT;
 
 <font size=+1><b>Please Donate:</b></font><br>
-Like many Open Source Projects, we rely heavily upon donations to keep our project running. If you found this program useful, please donate what you can, such as: time, money, templates, or code.  Opportunities to contribute include becoming a Pro Member/Supporter (aka Pro member or Members Only), contributing templates or perl code improvements, helping others in our user forums, or even supporting our affiliated services.  If you cannot contribute time or code, our suggested donation is \$1.00 average per month over a year. &nbsp;&nbsp; Regardless, we will greatly appreciate your support, so please donate and donate as often as you are able to.
+Like many Open Source Projects, we rely heavily upon donations to keep our project running. If you found this program useful, please donate what you can, such as: time, money, templates, or code.  Opportunities to contribute include becoming a Gold Member/Supporter (aka Gold member or Members Only), contributing templates or perl code improvements, helping others in our user forums, or even supporting our affiliated services.  If you cannot contribute time or code, our suggested donation is \$15.00 average per year. &nbsp;&nbsp; Regardless, we will greatly appreciate your support, so please donate and donate as often as you are able to.
 <br><br>
 <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_new">
           				<b>Donation by PayPal:</b>&nbsp;&nbsp;
@@ -655,7 +646,6 @@
 										<input type="hidden" name="item_name" value="AgoraCart Donation"/>
 											Amount of Donation:&nbsp;&nbsp;
 											<select name="amount" size=1>
-												<option>12.00</option>
 												<option>5.00</option>
 												<option>10.00</option>
 												<option>15.00</option>
@@ -674,12 +664,6 @@
 												<option>200.00</option>
 												<option>225.00</option>
 												<option>250.00</option>
-												<option>275.00</option>
-												<option>300.00</option>
-												<option>350.00</option>
-												<option>400.00</option>
-												<option>450.00</option>
-												<option>500.00</option>
 											</select>&nbsp;&nbsp;
 											<input type="hidden" name="cn" value="Special Instructions"/>
 											<input type="hidden" name="no_note" value="1"/>
@@ -708,7 +692,6 @@
 <INPUT type="hidden" name="mast" value="https://secure.serverc.net/~agoracgi/images2/Agora-logo-white2.gif">
           				<b>Donation by Visa/MC/Discover/eCheck: </b>&nbsp;&nbsp; Amount of Donation:&nbsp;
 <select name="1-cost" size=1>
-												<option>12.00</option>
 												<option>5.00</option>
 												<option>10.00</option>
 												<option>15.00</option>
@@ -727,12 +710,6 @@
 												<option>200.00</option>
 												<option>225.00</option>
 												<option>250.00</option>
-												<option>275.00</option>
-												<option>300.00</option>
-												<option>350.00</option>
-												<option>400.00</option>
-												<option>450.00</option>
-												<option>500.00</option>
 											</select>&nbsp;
 										<input type=hidden name="visaimage" value="1"/>
 										<input type=hidden name="mcimage" value="1"/>
@@ -747,6 +724,12 @@
 </TR>
 </TABLE>
 </CENTER>
+            <p class="center">
+              <a href="http://www.hotscripts.com/Detailed/11562.html" target="_blank">
+                <img src="http://images.hotscripts.com/dynamic/rating.gif?11562" /></a>
+              <br />
+            </p>
+
 <HR>
 <CENTER>
 <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>
@@ -791,7 +774,7 @@
 open(LOGFILE, "$logfile") || print "<tr><td width=620 colspan=8 align=center><font face=arial size=2>Sorry, Cannot Find Order Log File</font></td></tr>\n";
 while (<LOGFILE>) {
 
-($year,$month,$day,$orderLoggingHash{'invoiceNumber'},$orderLoggingHash{'customerNumber'},$orderLoggingHash{'orderStatus'},$orderLoggingHash{'firstName'},$orderLoggingHash{'lastName'},$orderLoggingHash{'fullName'},$orderLoggingHash{'companyName'},$orderLoggingHash{'emailAddress'},$orderLoggingHash{'orderFromState'},$orderLoggingHash{'orderFromPostal'},$orderLoggingHash{'orderFromCountry'},$orderLoggingHash{'shipMethod'},$orderLoggingHash{'shippingTotal'},$orderLoggingHash{'salesTax'},$orderLoggingHash{'tax1'},$orderLoggingHash{'tax2'},$orderLoggingHash{'tax3'},$orderLoggingHash{'discounts'},$orderLoggingHash{'netProfit'},$orderLoggingHash{'subTotal'},$orderLoggingHash{'orderTotal'},$orderLoggingHash{'affiliateTotal'},$orderLoggingHash{'affiliateID'},$orderLoggingHash{'affiliateMisc'}) = split(/\t/,$_);
+($year,$month,$day,$orderLoggingHash{'invoiceNumber'},$orderLoggingHash{'customerNumber'},$orderLoggingHash{'orderStatus'},$orderLoggingHash{'firstName'},$orderLoggingHash{'lastName'},$orderLoggingHash{'fullName'},$orderLoggingHash{'companyName'},$orderLoggingHash{'emailAddress'},$orderLoggingHash{'orderFromState'},$orderLoggingHash{'orderFromPostal'},$orderLoggingHash{'orderFromCountry'},$orderLoggingHash{'shipMethod'},$orderLoggingHash{'shippingTotal'},$orderLoggingHash{'salesTax'},$orderLoggingHash{'tax1'},$orderLoggingHash{'tax2'},$orderLoggingHash{'tax3'},$orderLoggingHash{'discounts'},$orderLoggingHash{'netProfit'},$orderLoggingHash{'subTotal'},$orderLoggingHash{'orderTotal'},$orderLoggingHash{'affiliateTotal'},$orderLoggingHash{'affiliateID'},$orderLoggingHash{'affiliateMisc'},$orderLoggingHash{'GatewayUsed'},$orderLoggingHash{'buySafe'}) = split(/\t/,$_);
 
 $orderLoggingHash{'orderTotal'} = &format_pricemgr($orderLoggingHash{'orderTotal'});
 
@@ -800,6 +783,10 @@
    $sorry_thingy= "stop";
   }
 
+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>~;
+}
 
 if ($sorry_thingy ne "stop") {
 print qq~<tr>
@@ -821,7 +808,7 @@
 $order_filename = "$scm_order_logpath/$orderLoggingHash{'invoiceNumber'}" . "-" . "$orderLoggingHash{'customerNumber'}";
 print qq~
 <td valign=middle align=center><font face=arial size=2>$sc_money_symbol $orderLoggingHash{'orderTotal'}</font></td>
-<td valign=middle align=center><font face=arial size=2><a href="manager.cgi?invoiceviewertrigger=invoiceviewertrigger&invoiceNumber=$orderLoggingHash{'invoiceNumber'}&customerNumber=$orderLoggingHash{'customerNumber'}&year=$year&month=$month" target="_new">View Invoice</a><br><a href="manager.cgi?viewertrigger=viewertrigger&invoiceNumber=$orderLoggingHash{'invoiceNumber'}&customerNumber=$orderLoggingHash{'customerNumber'}&year=$year&month=$month">View/Update</a><br><a href="manager.cgi?packingviewertrigger=packingviewertrigger&invoiceNumber=$orderLoggingHash{'invoiceNumber'}&customerNumber=$orderLoggingHash{'customerNumber'}&year=$year&month=$month" target="_new">Packing Slip</a><br><a href="manager.cgi?originalviewertrigger=originalviewertrigger&invoiceNumber=$orderLoggingHash{'invoiceNumber'}&customerNumber=$orderLoggingHash{'customerNumber'}&year=$year&month=$month" target="_new">Original Order</a><br><a href="manager.cgi?deleteviewertrigger=yes&invoiceNumber=$orderLoggingHash{'invoiceNumber'}&customerNumber=$orderLoggingHash{'customerNumber'}&year=$year&month=$month">Delete/Remove</a><br></font></td>
+<td valign=middle align=center><font face=arial size=2><a href="manager.cgi?invoiceviewertrigger=invoiceviewertrigger&invoiceNumber=$orderLoggingHash{'invoiceNumber'}&customerNumber=$orderLoggingHash{'customerNumber'}&year=$year&month=$month" target="_new">View Invoice</a><br><a href="manager.cgi?viewertrigger=viewertrigger&invoiceNumber=$orderLoggingHash{'invoiceNumber'}&customerNumber=$orderLoggingHash{'customerNumber'}&year=$year&month=$month">View/Update</a><br><a href="manager.cgi?packingviewertrigger=packingviewertrigger&invoiceNumber=$orderLoggingHash{'invoiceNumber'}&customerNumber=$orderLoggingHash{'customerNumber'}&year=$year&month=$month" target="_new">Packing Slip</a><br><a href="manager.cgi?originalviewertrigger=originalviewertrigger&invoiceNumber=$orderLoggingHash{'invoiceNumber'}&customerNumber=$orderLoggingHash{'customerNumber'}&year=$year&month=$month" target="_new">Original Order</a><br><a href="manager.cgi?deleteviewertrigger=yes&invoiceNumber=$orderLoggingHash{'invoiceNumber'}&customerNumber=$orderLoggingHash{'customerNumber'}&year=$year&month=$month">Delete/Remove</a><br>$buysafe_display</font></td>
 </tr>
 ~;
 }
@@ -891,15 +878,15 @@
 #############################################################################################
 sub display_main_settings_choices {
 my ($maxcols) = 3;
-local ($colwidth) = int(630/$maxcols);
+local ($colwidth) = int(690/$maxcols);
 local (%my_list, @my_keys, $inx, $items, $link);
 print <<ENDOFTEXT;
 <CENTER>
-<TABLE WIDTH=630 BORDER=0 CELLPADDING=5 CELLSPACING=0>
+<TABLE WIDTH=690 BORDER=0 CELLPADDING=5 CELLSPACING=0>
 ENDOFTEXT
 if ($mc_change_main_settings_ok =~ /yes/i) {
 print <<ENDOFTEXT;
-  <TR WIDTH=630>
+  <TR WIDTH=690>
   <TD colspan=$maxcols>
         <center><FORM METHOD=POST ACTION=manager.cgi>
   <INPUT TYPE=SUBMIT NAME="main_settings_screen" 
@@ -916,7 +903,7 @@
   if ($menu_items_disabled{$link} eq '') {
     $items++;
     if ($items == 1) {
-      print "<TR WIDTH=630>\n";
+      print "<TR WIDTH=690>\n";
      }
     print <<ENDOFTEXT; 
   <TD colspan=1 WIDTH=$colwidth>
@@ -952,11 +939,11 @@
 #############################################################################################
 sub display_ordermanagement_settings_choices {
 my ($maxcols) = 3;
-local ($colwidth) = int(630/$maxcols);
+local ($colwidth) = int(690/$maxcols);
 local (%my_list, @my_keys, $inx, $items, $link);
 print <<ENDOFTEXT;
 <CENTER>
-<TABLE WIDTH=630 BORDER=0 CELLPADDING=5 CELLSPACING=0>
+<TABLE WIDTH=690 BORDER=0 CELLPADDING=5 CELLSPACING=0>
 ENDOFTEXT
 
 $items = 0;
@@ -965,7 +952,7 @@
   if ($menu_items_disabled{$link} eq '') {
     $items++;
     if ($items == 1) {
-      print "<TR WIDTH=630>\n";
+      print "<TR WIDTH=690>\n";
      }
     print <<ENDOFTEXT; 
   <TD colspan=1 WIDTH=$colwidth>
@@ -1003,12 +990,12 @@
 #############################################################################################
 sub display_merchandisingtools_settings_choices {
 my ($maxcols) = 3;
-local ($colwidth) = int(630/$maxcols);
+local ($colwidth) = int(690/$maxcols);
 local (%my_list, @my_keys, $inx, $items, $link);
 
 print <<ENDOFTEXT;
 <CENTER>
-<TABLE WIDTH=630 BORDER=0 CELLPADDING=5 CELLSPACING=0>
+<TABLE WIDTH=690 BORDER=0 CELLPADDING=5 CELLSPACING=0>
 ENDOFTEXT
 
 $items = 0;
@@ -1017,7 +1004,7 @@
   if ($menu_items_disabled{$link} eq '') {
     $items++;
     if ($items == 1) {
-      print "<TR WIDTH=630>\n";
+      print "<TR WIDTH=690>\n";
      }
     print <<ENDOFTEXT; 
   <TD colspan=1 WIDTH=$colwidth>
@@ -1287,9 +1274,9 @@
 }
 #############################################################################################
 #added by Mister Ed October 2005
-sub merchandising_tools_settings_screen {
+sub content_management_settings_screen {
 local ($the_id,$temp,$whoami);
-print &$manager_page_header("Merchandising Tools Management Options","","","","");
+print &$manager_page_header("CMS - Content Management Options","","","","");
 $temp = $ENV{'PATH'};
 $ENV{'PATH'} = "/bin:/usr/bin";
 $the_id = `id`;
@@ -1304,8 +1291,7 @@
 <TABLE>
 <TR>
 <TD>
-<FONT FACE=ARIAL>Welcome to the Merchandising Tools section of the
-<b>AgoraCart</b> System Manager.
+<FONT FACE=ARIAL>Welcome to the <b>AgoraCart</b> Content Management System for your store.
 </TD>
 </TR>
 </TABLE>
diff -aruN 5.0.000.src/protected/store_css_design-ext_lib.pl 5.2.000.src/protected/store_css_design-ext_lib.pl
--- 5.0.000.src/protected/store_css_design-ext_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/store_css_design-ext_lib.pl	2007-12-19 23:21:21.000000000 -0600
@@ -1,28 +1,26 @@
 # file ./store/protected/store_css_design-ext_lib.pl
 
-$versions{'store_css_design-ext_lib.pl'} = "5.0.000";
+$versions{'store_css_design-ext_lib.pl'} = "5.2.000";
 #######################################################################################
 # Misc Variables 
   $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">~;
 #######################################################################################
 {
  local ($modname) = 'store_css_design';
- &register_extension($modname,"Store CSS Design Editor",$versions{$modname});
- &add_settings_choice("store css design editor","Store Design - CSS Editor",
+ &register_extension($modname,"Store CSS File Editor",$versions{$modname});
+ &add_settings_choice("store CSS file editor","Store CSS File Editor",
   "store_design_editor_screen");
  &register_menu('store_design_editor_screen',"change_store_design_editor_screen",
-  $modname,"Display CSS Design Settings");
+  $modname,"Display CSS File Editor");
  &register_menu('ChangeStoreDesign',"action_change_design_settings",
-  $modname,"Write CSS Design Settings");
+  $modname,"Write CSS File Editor");
 }
 
 &require_supporting_libraries(__FILE__,__LINE__,
   "$mgrdir/misc/mgr_css.pl");
 ################################################################################
-sub set_css_file_path{
+sub set_css_file_2path{
   # Set the path to the style sheet
   $i=1;
   $mc_css_file_path = "";
@@ -32,7 +30,7 @@
     $i++;
   }
 }
-#######################################################################################
+################################################################################
 sub action_change_design_settings {
   my($info);
   local($css_file_path);
@@ -40,42 +38,19 @@
 
   &ReadParse;
 
-  $mc_template_css_at_root = $in{'mc_template_css_at_root'};
-  $myset2 .= "\$mc_template_css_at_root = \"$in{'mc_template_css_at_root'}\";\n";
+&require_supporting_libraries(__FILE__,__LINE__,
+  "$mgrdir/misc/mgr_miscmain.pl");
 
   my $tempURLthingyForTemplates = "html/html-templates/templates/$sc_headerTemplateName/$templatestylename";
 
   #setting the path to the css file
-  $mc_levels_to_root = "$in{'mc_levels_to_root'}";
-  $myset2 .= "\$mc_levels_to_root = \"$in{'mc_levels_to_root'}\";\n";
   &set_css_file_path;
 
- $myset2 .= "\$mc_css_file_path = \"$mc_css_file_path\";\n";
 
   if ($mc_template_css_at_root =~ /yes/i) {
       $tempURLthingyForTemplates = "$mc_css_file_path$templatestylename";
   }
 
-  # need to place all of that into the $sc_standard_head_info variable in the correct format
-   $myset .= "\$sc_standard_head_info = qq~<link rel=\"stylesheet\" type=\"text/css\" href=\"$mc_css_file_path$stylename\" media=\"screen\">\n";
-  $myset .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$tempURLthingyForTemplates\" media=\"screen\">\n";
-  $myset .= "$mc_meta_tags_css\n";
-  $myset .= qq!$in{'mc_additional_head_info'}\n~;\n!;
-
-if ($sc_ssl_location_url2 ne ''){
-  my $temp_SSL = $sc_ssl_location_url2;
-  $temp_SSL =~ s/agora\.cgi//i;
-  $myset .= "\$sc_secure_standard_head_info = qq!<link rel=\"stylesheet\" type=\"text/css\" href=\"$temp_SSL$stylename\" media=\"screen\">\n";
-  $myset .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$temp_SSL$tempURLthingyForTemplates\" media=\"screen\">\n";
-  $myset .= "$mc_meta_tags_css\n";
-  $myset .= qq~$in{'mc_additional_head_info'}\n!;\n~;
-  $in{'mc_additional_head_info'} = &my_escape($in{'mc_additional_head_info'});
-  $myset2 .= "\$mc_additional_head_info = qq~$in{'mc_additional_head_info'}~;\n";
-}
-
-  #DOCTYPE
-  $myset .= "\$sc_doctype =  qq~$mc_doctype~;\n";
-  
   #manager row count display
   $myset2 .= "\$mc_css_row_count = \"$in{'mc_css_row_count'}\";\n";
 
@@ -90,9 +65,7 @@
     print NEWCSSFILE $new_css_file;
   close (NEWCSSFILE);
   
-  
-  &update_store_settings('cssdesign',$myset); # store css settings
-  &update_CSS_MGR_settings("$mgrdir/misc/mgr_css.pl",$myset2); # mgr css settings
+    &update_CSS_MGR_settings("$mgrdir/misc/mgr_css.pl",$myset2); # mgr css settings
   &change_store_design_editor_screen;
  }
 
@@ -102,7 +75,7 @@
 {
 print &$manager_page_header("Store CSS Design Editor","","","","");
 
-&set_css_file_path;
+&set_css_file_2path;
 
 print <<ENDOFTEXT;
 <CENTER>
@@ -116,7 +89,7 @@
 <TD>
 <FONT FACE=ARIAL>Welcome to the <b>AgoraCart</b> System Manager
 Storewide CSS Design settings.  This manager allows you to setup your 
-main store CSS (cascading style sheet) and template CSS settings as well as edit the files themselves if you'd like.  See the <a href="manager.cgi?change_store_layout_screen=yes">Store Layout Manager</a> for other misc layout items not covered here.  <small><b>NOTE: if using a template, setup the <a href="manager.cgi?change_Template_screen=yes">Store Templates - Header/Footer</a> Manager before changing any CSS settings in this manager</b></small></TD>
+main store CSS (cascading style sheet) by editing the files themselves.  See the <a href="manager.cgi?change_store_layout_screen=yes">Layout & Design Settings - Misc</a> Manager for other layout and design settings not covered here.</TD>
 </TR>
 </TABLE>
 </CENTER>
@@ -153,80 +126,21 @@
 <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BORDER=0>
 
 <TR>
-<TD COLSPAN=2><HR/></TD>
-</TR>
-
-<TR>
-<TD colspan="2"><br/><b>Number of levels between agora.cgi and the CSS file.</b><br/>
-By default the CSS file ($stylename) is installed in the <em>store</em> dir along 
-with the agora.cgi file. If you've moved the CSS file from this location please 
-specify the number of levels to access it. Also if the <em>store</em> dir is 
-inside of the cgi-bin you may have to move the CSS file to the root dir. To do so 
-simply adjust the levels to the CSS file below to take you outside of the cgi-bin.<br/>
-<small>Examples:<br/>
-location of agora.cgi -> http://www.domain.com/cgi-bin/store/<br/>
-location of css file ---> http://www.domain.com/<br/>
-Number of levels would be <b>2</b>.</small><br/><br/>
-<b>Number of Levels to CSS file:</b>
-<SELECT NAME="mc_levels_to_root">
-<OPTION>$mc_levels_to_root</OPTION>
-<OPTION>0</OPTION>
-<OPTION>1</OPTION>
-<OPTION>2</OPTION>
-<OPTION>3</OPTION>
-<OPTION>4</OPTION>
-<OPTION>5</OPTION>
-<OPTION>6</OPTION>
-</SELECT>
-<br><br>
-<b>Do you need to make a copy of the template CSS file in same location as the main CSS file?</b>
-<SELECT NAME="mc_template_css_at_root">
-<OPTION>$mc_template_css_at_root</OPTION>
-<OPTION>no</OPTION>
-<OPTION>yes</OPTION>
-</SELECT>
-<!--<br><br>
-Enter the entire SSL URL for the CSS file:<br><small>NOTE: use only if having problems with some gateways that don't pass client back over to store properly in SSL modes. Enter in https://secure.server.com/~accountname/store/agorastyles.css format as applies to your webhosting SSL capabilities</small><br>
-<INPUT NAME="sc_secure_css_url" TYPE="TEXT" SIZE=40 
-MAXLENGTH="70" VALUE="$sc_secure_css_url">-->
-</TD>
-</TR>
-
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-
-<TR>
-<TD colspan="2"><b>Additional items to be included inside of the &lt;head&gt; section</b><br/>
-This would be where you include any <b>javascript</b> or <b>meta tags</b> you wish to show up on
-all pages thoughout the entire site. You can also enter additional style sheets, just 
-make sure there are no confliting entries between the two.
-<small>DO NOT enter the full web path, instead enter it in the form ../../. 
-If you include the hostname and try running in secure mode you might have issues 
-with getting the padlock to show up.</small><br/>
-Example: <b>&lt;script type="text/javascript" language="javascript" 
-src="../../scripts/functions.js"&gt;&lt;/script&gt;</b><br/>
-<TEXTAREA NAME="mc_additional_head_info" 
-cols="68" rows="5">$mc_additional_head_info</TEXTAREA> </TD>
+<TD COLSPAN=2><br /><HR/><br /></TD>
 </TR>
 
 
 <TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-
-<TR>
-<TD COLSPAN="1" align=left>
-<b>CSS File:</b>
-</TD>
-<TD COLSPAN="1" align=right>
-Number of Rows:<br/>
+<TD COLSPAN="2" align=left>
+Number of Rows to Display for Each File Below <small>(must save to update view)</small>: 
 <INPUT TYPE=TEXT SIZE=5 
 NAME="mc_css_row_count"
 VALUE="$mc_css_row_count">
 </TD>
 </TR>
-
+<TR>
+<TD COLSPAN=2><br /><HR/><br /></TD>
+</TR>
 ENDOFTEXT
 # set the path to the CSS File 
 open (CSSFile, "< $mc_css_file_path$stylename");# || die ('Could not find file') ;
diff -aruN 5.0.000.src/protected/store_layout_display-ext_lib.pl 5.2.000.src/protected/store_layout_display-ext_lib.pl
--- 5.0.000.src/protected/store_layout_display-ext_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/store_layout_display-ext_lib.pl	2007-12-19 23:21:22.000000000 -0600
@@ -25,18 +25,17 @@
 # written permission.
 #
 ##########################################################################
-$versions{'store_layout_display-ext_lib.pl'} = "5.0.000";
+$versions{'store_layout_display-ext_lib.pl'} = "5.2.000";
 
 {
  local ($modname) = 'misc_store_layout_display';
- &register_extension($modname,"Misc Store Layout Settings",$versions{$modname});
- &add_settings_choice("Store Design Misc Layout","Store Design - Misc Settings",
+ &register_extension($modname,"Layout and Design Settings - Misc",$versions{$modname});
+ &add_settings_choice("Layout and Design Settings - Misc","Layout & Design Settings - Misc",
   "change_store_layout_screen");
  &register_menu('LayoutSettings',"write_store_layout_settings",
   $modname,"Write Store Layout Settings");
  &register_menu('change_store_layout_screen',"display_store_layout_screen",
   $modname,"Display Store Layout Settings");
-# &add_item_to_manager_menu("Store Layout","change_store_layout_screen=yes","");
 }
 #######################################################################################
 sub write_store_layout_settings {
@@ -72,6 +71,8 @@
 $myset .= "\$sc_totals_table_ship_label = \"$in{'sc_totals_table_ship_label'}\";\n";
 $myset .= "\$sc_totals_table_disc_label = \"$in{'sc_totals_table_disc_label'}\";\n";
 $myset .= "\$sc_totals_table_stax_label = \"$in{'sc_totals_table_stax_label'}\";\n";
+$myset .= "\$sc_show_subtotal_label_box = \"$in{'sc_show_subtotal_label_box'}\";\n";
+$myset .= "\$sc_totals_table_subtot_label = \"$in{'sc_totals_table_subtot_label'}\";\n";
 $myset .= "\$sc_totals_table_gtot_label = \"$in{'sc_totals_table_gtot_label'}\";\n";
 $myset .= "\$sc_totals_table_itot_label = \"$in{'sc_totals_table_itot_label'}\";\n";
 $myset .= "\$sc_totals_table_thdr_label = \"$in{'sc_totals_table_thdr_label'}\";\n";
@@ -81,6 +82,9 @@
 $myset .= "\$sc_display_cartlinkhome = \"$in{'sc_display_cartlinkhome'}\";\n";
 $myset .= "\$sc_display_cartlinkhome_name = \"$in{'sc_display_cartlinkhome_name'}\";\n";
 
+my $temp_footer_text = &my_escape($in{'sc_footer_copyright_text'});
+$myset .= "\$sc_footer_copyright_text = \"$temp_footer_text\";\n";
+
   &update_store_settings('layout',$myset); # layout settings
   &display_store_layout_screen;
  }
@@ -93,6 +97,18 @@
     $sc_show_shipping_label_box = "yes";
 }
 
+if ($sc_show_subtotal_label_box eq "") {
+    $sc_show_shipping_label_box = "no";
+}
+
+if ($sc_totals_table_subtot_label eq "") {
+    $sc_totals_table_subtot_label = "Sub Total";
+}
+
+if ($sc_footer_copyright_text eq "") {
+    $sc_footer_copyright_text = "2002-2008 by K-Factor Technologies Inc.";
+}
+
 if ($sc_search_error_message eq "") {
     $sc_search_error_message = qq~I'm sorry, no matches were found. Please try your search again.~;
 }
@@ -107,7 +123,7 @@
 <TABLE>
 <TR>
 <TD>
-<FONT FACE=ARIAL>Welcome to the <b>AgoraCart</b> Store Layout Manager.  The Store Layout manager controls misc variables like messages, cart order table titles, and controls for cartlink pages.  To change store attributes like fonts, colors, widths and more; please see the <a href="manager.cgi?store_design_editor_screen=yes">Store CSS Design Manager</a>.</TD>
+<FONT FACE=ARIAL>Welcome to the <b>AgoraCart</b> Store Layout Manager.  The Store Layout manager controls misc variables like messages, cart order table titles, and controls for cartlink pages.  To change store attributes like fonts, colors, widths and more; please see the <a href="manager.cgi?store_design_editor_screen=yes">Store CSS File Editor</a>.</TD>
 </TR>
 </TABLE>
 </CENTER>
@@ -147,7 +163,7 @@
 </TR>
 
 <TR>
-<TD colspan=2><b>Use Category Name for Header/Footer Includes?</b>  <small>Default is YES which allows you to create and use headers and/or footers for each individual category of products being viewed.  For example, if you have a category named PERL (as listed in product database) and you want to have a custom header (but still use the standard store footer) in that category in such a fashion that is different from the standard store header, then you would create a file called header-PERL.inc (prepend with header-, then the category name - case sensitive, and appended with the .inc which stands for "include".  Category specific footers would be similar in naming convention, but using footer prepended to name instead of header: footer-PERL.inc).  Repeat for every product category you wish to be different from the standard store header (named: store_header.inc) or the standard store footer (named: stoe_footer.inc). <br><br>These files would go into the store's "html/html-templates" sub-directory.  <b>You do not need custom headers or footers for every category name</b>, but if they are put into the store's "html/html-templates" sub-directory, then they will be automatically used the next time that any product or list of products from that category are viewed by a visitor.  You can use either a header or a footer or both as long as they match up layout wise. <b>Speed Enhancement:</b> Your store will run faster with this set to no.</small></TD>
+<TD colspan=2><b>Use Category Name for Header/Footer Includes?</b>  <small>Default is YES which allows you to create and use headers and/or footers for each individual category of products being viewed.  For example, if you have a category named PERL (as listed in product database) and you want to have a custom header (but still use the standard store footer) in that category in such a fashion that is different from the standard store header, then you would create a file called header-PERL.inc (prepend with header-, then the category name - case sensitive, and appended with the .inc which stands for "include".  Category specific footers would be similar in naming convention, but using footer prepended to name instead of header: footer-PERL.inc).  Repeat for every product category you wish to be different from the standard store header (named: store_header.inc) or the standard store footer (named: store_footer.inc). <br><br>These files would go into the store's "html/html-templates" sub-directory.  <b>You do not need custom headers or footers for every category name</b>, but if they are put into the store's "html/html-templates" sub-directory, then they will be automatically used the next time that any product or list of products from that category are viewed by a visitor.  You can use either a header or a footer or both as long as they match up layout wise. <b>Speed Enhancement:</b> Your store will run faster with this set to no.</small></TD>
 <TD colspan=2><SELECT NAME="sc_use_category_name_as_header">
 <OPTION>$sc_use_category_name_as_header</OPTION>
 <OPTION>yes</OPTION>
@@ -272,8 +288,17 @@
 MAXLENGTH="30" VALUE="$sc_totals_table_stax_label">&nbsp;&nbsp;&nbsp;&nbsp;
 Grand Total Label: <INPUT NAME="sc_totals_table_gtot_label" TYPE="TEXT" SIZE=20 
 MAXLENGTH="30" VALUE="$sc_totals_table_gtot_label"><br><br>
+Display Sub Total label instead of Grand Total label?<br>
+<small>This will change the Grand Total title to the Sub Total title at view cart and at the checkout form. Grand Total will not be shown until the verify page right before payment is made.  Set to "yes" if your customers are getting confused by the totals before making actual payments.</small>
+<SELECT NAME=sc_show_subtotal_label_box>
+<option>$sc_show_subtotal_label_box</option>
+<option>yes</option>
+<option>no</option>
+</SELECT><br><br>
+Sub Total Label: <INPUT NAME="sc_totals_table_subtot_label" TYPE="TEXT" SIZE=20 
+MAXLENGTH="30" VALUE="$sc_totals_table_subtot_label"><br><br>
 Item Cost Subtotal Label: <INPUT NAME="sc_totals_table_itot_label" TYPE="TEXT" SIZE=30 
-MAXLENGTH="35" VALUE="$sc_totals_table_itot_label"><br>
+MAXLENGTH="35" VALUE="$sc_totals_table_itot_label"><br><br>
 Order Totals Header Label: <INPUT NAME="sc_totals_table_thdr_label" TYPE="TEXT" SIZE=30 
 MAXLENGTH="35" VALUE="$sc_totals_table_thdr_label">
 </font>
@@ -333,6 +358,18 @@
             <textarea NAME="sc_search_error_message" ROWS="5" COLS="50" 
             wrap="soft">$sc_search_error_message</textarea><br><br>
 
+</TD>
+</TR>
+
+<TR>
+<TD colspan=2><br><font size="2" face="Arial, Helvetica, sans-serif">
+<b>Cart Footer Copyright Text:</b><br />
+Used by default in the Copyright &copy;" portion of official templates/themes.  Must be added to custom templates.<br /></font>
+            <textarea NAME="sc_footer_copyright_text" ROWS="2" COLS="50" 
+            wrap="soft">$sc_footer_copyright_text</textarea><br><br>
+</TD>
+</TR>
+
 <TR>
 <TD COLSPAN=4><HR></TD>
 </TR>
diff -aruN 5.0.000.src/protected/template_manager-ext_lib.pl 5.2.000.src/protected/template_manager-ext_lib.pl
--- 5.0.000.src/protected/template_manager-ext_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/template_manager-ext_lib.pl	2007-12-19 23:21:22.000000000 -0600
@@ -38,21 +38,13 @@
 # K-Factor Technologies, Inc. in order to distribute this add-on to AgoraCart (aka Agora.cgi).
 #
 ##########################################################################
-$versions{'template_manager-ext_lib.pl'} = "5.0.000";
-
-$templates_file_dir = "html/html-templates/templates";
-$sm_templatelinks = '';
-$sm_old_templateName = '';
-$templatechange_user_settings = "./admin_files/agora_user_lib.pl";
-$sc_buttonSetURLthingy = "./html/images/buttonsets";
+$versions{'template_manager-ext_lib.pl'} = "5.2.000";
 
 {
  local ($modname) = 'template_manager';
  &register_extension($modname,"Template Manager",$versions{$modname});
- &add_settings_choice("Store Templates Settings","Store Templates - Header/Footer",
+ &add_settings_choice("Store Header Footer Template Editor","Store Header/Footer File Editor",
   "change_Template_screen");
- &register_menu('TemplateSettings',"write_Template_settings",
-  $modname,"Write Template Settings");
  &register_menu('StoreHeaderTemplateSettings',"write_StoreHeaderTemplate_settings",
   $modname,"Write Store Header Template Settings");
  &register_menu('StoreFooterTemplateSettings',"write_StoreFooterTemplate_settings",
@@ -63,7 +55,7 @@
   $modname,"Write Secure Footer Template Settings");
  &register_menu('change_Template_screen',"display_Template_screen",
   $modname,"Display Template Manager");
- &add_merchtools_settings_choice("template settings","Store Templates - Header/Footer",
+ &add_merchtools_settings_choice("Store Header Footer Template Editor","Store Header/Footer File Editor",
   "change_Template_screen");
 }
 #######################################################################################
@@ -98,60 +90,6 @@
   close (NEWSTOREFILE);
 &display_Template_screen;
 }
-#######################################################################################
-sub write_Template_settings {
- my ($myset)="";
-
-my($item,$zitem) = '';
-
- &ReadParse;
-
-$sm_old_templateName = $sc_headerTemplateName;
-$sc_headerTemplateName = $in{'sc_headerTemplateName'};
-
-my ($sc_headerTemplateRoot,$junk) = split (/\//, $sc_headerTemplateName);
-$myset .= "\$sc_headerTemplateName = \"$in{'sc_headerTemplateName'}\";\n";
-$myset .= "\$sc_headerTemplateRoot = \"$sc_headerTemplateRoot\";\n";
-
-$sc_buttonSetName = $in{'sc_buttonSetName'};
-$sc_buttonSetURL = "$URL_of_images_directory/buttonsets/$sc_buttonSetName";
-$myset .= "\$sc_buttonSetName = \"$in{'sc_buttonSetName'}\";\n";
-$myset .= "\$sc_buttonSetURL = \"$sc_buttonSetURL\";\n";
-$myset .= "\$sc_displayDynamicCategories = \"$in{'sc_displayDynamicCategories'}\";\n";
-$myset .= "\$sc_headerStoreTitle = \"$in{'sc_headerStoreTitle'}\";\n";
-$myset .= "\$sc_headerStoreTagLine = \"$in{'sc_headerStoreTagLine'}\";\n";
-$sc_store_header_file = "$sc_templates_dir/templates/$sc_headerTemplateRoot/store_header.html";
-$sc_store_footer_file = "$sc_templates_dir/templates/$sc_headerTemplateRoot/store_footer.html";
-$sc_secure_store_header_file = "$sc_templates_dir/templates/$sc_headerTemplateRoot/secure_store_header.html";
-$sc_secure_store_footer_file = "$sc_templates_dir/templates/$sc_headerTemplateRoot/secure_store_footer.html";
-$myset .= "\$sc_store_header_file = \"$sc_store_header_file\";\n";
-$myset .= "\$sc_store_footer_file = \"$sc_store_footer_file\";\n";
-$myset .= "\$sc_secure_store_header_file = \"$sc_secure_store_header_file\";\n";
-$myset .= "\$sc_secure_store_footer_file = \"$sc_secure_store_footer_file\";\n";
-
-if ($sc_headerTemplateName ne $sm_old_templateName) {
-  open(USERSETTINGS,"< $templatechange_user_settings") || &my_die("Can't Open $templatechange_user_settings");
-    while (<USERSETTINGS>) {
-      $store_settings{CSSDESIGN} =~ s/$sm_old_templateName/$sc_headerTemplateName/g;
-    }
-  close(USERSETTINGS);
-
-  &update_store_settings('CSSDESIGN',$store_settings{CSSDESIGN});
-  &require_supporting_libraries(__FILE__,__LINE__,"$mgrdir/misc/mgr_css.pl");
-
-  # copy original CSS file for template change to location needed, if at alternate location
-  # added by Mister Ed for 5.0.1 version fixes.
-  if ($mc_template_css_at_root =~ /yes/i) {
-      my $tempURLthingyForTemplates = "$templates_file_dir/$sc_headerTemplateName/$templatestylename";
-      my $tempURLthingyForTemplates2 = "$mc_css_file_path$templatestylename";
-      use File::Copy;
-      copy($tempURLthingyForTemplates, $tempURLthingyForTemplates2);
-  }
-}
-&update_store_settings('TEMPLATE',$myset);
-
-&display_Template_screen;
- }
 ################################################################################
 sub display_Template_screen
 {
@@ -179,6 +117,7 @@
         }
     }
 
+
     if ($sc_self_serve_images =~ /no/i) {
          $sc_buttonSetURLthingy = "$URL_of_images_directory/buttonsets";
     }
@@ -200,7 +139,7 @@
 <TABLE>
 <TR>
 <TD>
-<FONT FACE=ARIAL size=2>Welcome to the <b>AgoraCart</b>  Store Manager - Default Store Header/Footer Template Manager.  This area allows you to chose a header and footer template that will be used by default in the design/look of your store (basically the default design applied store wide unless customized pages are found).  Using your own headers/footers is fairly easy, but not recommended for those without HTML editing experience. For faster setup, use a template already available and/or that will be downloadable in the near future.<br><br> <i>NOTE: You can use your own templates if you wish, but this will require you to create your own headers and footers and upload them to the store's html/html-templates/templates/Custom sub directory and then put the .css file for your custom look in the html/html-templates/templates/Custom/CustomOne sub directory of your store (one more level down).  If you wish to use custom header and/or footer files by category name (using the formats of header-CATEGORYNAME.inc and/or footer-CATEGORYNAME.inc and is auto-detected, if enabled in the "Store Design - Misc Settings" manager), then you will need to create those files separately and place them in the html/html-templates sub directory of your store.  Make sure to upload all HTML and CSS files in ASCII mode.</i></center></TD>
+<font face="Arial, Helvetica, sans-serif" size=2><b>Welcome to the AgoraCart Store Default Header/Footer Template Editor</b>.  This area allows you to edit the main store header and footer template files directly that will be used by default in the design/look of your store (basically the default design applied store wide unless customized header or footer files are found).  To change main/default store headers/footers, please see the <a href="manager.cgi?change_settings_screen=yes">Your Store's Primary/Core Settings Manager</a>.  Using your own headers/footers is fairly easy, but not recommended for those without HTML editing experience. For faster setup, use a template already available<br><br> <i>NOTE: You can use your own templates if you wish, but this will require you to create your own headers and footers and upload them to the store's html/html-templates/templates/Custom sub directory and then put the .css file for your custom look in the html/html-templates/templates/Custom/CustomOne sub directory of your store (one more level down).   The Custom/CustomOne sub-directory names can be anything you like, such as CompanyName/SpringSaleTemplate, CompanyName/XmasTemplate, etc.  If you wish to use custom header and/or footer files by category name, you will need to create those files separately and place them in the html/html-templates sub directory of your store (using the formats of header-CATEGORY-NAME-HERE.inc and/or footer-CATEGORY-NAME-HERE.inc, which is auto-detected automatically if enabled in the <a href="manager.cgi?change_store_layout_screen=yes">Layout & Design Settings - Misc</a> Manager).  Make sure to upload all HTML and CSS files in ASCII mode.</i></center></TD>
 </TR>
 </TABLE>
 </CENTER>
@@ -223,86 +162,6 @@
 ENDOFTEXT
 }
 
-print qq~
-<br>
-<FORM ACTION="manager.cgi" METHOD="POST">
-   <div align="center">
-   <table border="0" cellspacing="0">
-<TR>
-<TD>
-<b>Select a Template: </b>
-</TD><TD>
-<br>
-<SELECT NAME=sc_headerTemplateName>
-<OPTION SELECTED>$sc_headerTemplateName</OPTION>
-$sm_templatelinks
-</SELECT>
-<br><br>
-</TD>
-</TR>
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-<TR>
-<TD>
-<b>Select a Button Set: </b>
-</TD><TD>
-<br>
-<SELECT NAME=sc_buttonSetName>
-<OPTION SELECTED>$sc_buttonSetName</OPTION>
-$sm_buttonsetlinks
-</SELECT>
-
-<br><br>
-</TD>
-</TR>
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-<TR>
-<TD>
-<b>Display Categories</b> (and sub categories if enabed)<b>?</b> 
-</TD><TD>
-<br>
-<SELECT NAME=sc_displayDynamicCategories>
-<OPTION SELECTED>$sc_displayDynamicCategories</OPTION>
-<OPTION>yes</OPTION>
-<OPTION>no</OPTION>
-</SELECT>
-
-<br><br>
-</TD>
-</TR>
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-<TR>
-<TD>
-<b>Store Name and Tag Line:</b><br>
-<small>This is the store name/title diplayed to your customers in the heading of the template. Do not use special metacharacters (\$,%,&,\@ etc). 45 characters max.    The shorter the better to ensure the store template does not get distorted due to the long text line. Leave blank if you do not want this line to show.</small>:
-<br>
-<INPUT TYPE=TEXT SIZE=45 maxlength=45 NAME="sc_headerStoreTitle" VALUE="$sc_headerStoreTitle">
-<br><br>
-</TD>
-</TR>
-<TR>
-<TD COLSPAN=2><HR></TD>
-</TR>
-<TR>
-<TD colspan=2>
-<b>Tag Line:</b><br>
-<small>This is located just beneath the Store title listed above. Do not use special metacharacters (\$,%,&,\@ etc).  60 characters max.  The shorter the better to ensure the store template does not get distorted due to the long text line. Leave blank if you do not want this line to show.</small>:
-<br>
-<INPUT TYPE=TEXT SIZE=45 maxlength=60 NAME="sc_headerStoreTagLine" VALUE="$sc_headerStoreTagLine">
-<br><br>
-</TD>
-</TR>
- </table>
-   <p align="center">&nbsp;</p>
-   <p align="center"><font face="Arial"><INPUT TYPE="HIDDEN" NAME="system_edit_success" value="yes">
-<INPUT NAME="TemplateSettings" TYPE="SUBMIT" value="Update Template Settings"></font></p>
-   </form>
-~;
 
 open (STOREHEADER, "<$sc_store_header_file");# || die ('Could not find file') ;
 local $full_store_header_file;
diff -aruN 5.0.000.src/protected/upgrade_manager-ext_lib.pl 5.2.000.src/protected/upgrade_manager-ext_lib.pl
--- 5.0.000.src/protected/upgrade_manager-ext_lib.pl	2006-10-31 09:40:27.000000000 -0600
+++ 5.2.000.src/protected/upgrade_manager-ext_lib.pl	2008-01-21 21:21:26.000000000 -0600
@@ -2,19 +2,20 @@
 #
 # Show versions of files from the manager (if logged in)
 # http://.../.../manager.cgi?versions=1
-#
+
 # 20050829 ASY Changes:
 #   * Fixed order so that *all* versions are found and displayed, not just what
 #     has been registered
 #   * Optimized subroutine a little here and there
 #   * Added showin and showenv handlers to show %in and %ENV upon request
-#
+
 # 20050830 ASY Changes:
 #   * Minor reformatting and code changes
 #   * Factored out versions discovery to subroutine
 #   * Factored out table building subroutine
 
-# 20060204 Mister Ed Changes
+# CHANGES BY MISTER ED
+# 20060204 Mister Ed Changes (Feb 2006)
 # add update file read routines for regular version
 # add update file read routines for pro version
 # pass credentials if pro version
@@ -23,12 +24,39 @@
 # added table for files not used from update file, excluding order libs and order managers.
 # renamed to upgrade_manager-ext_lib.pl
 # added get_and_update_cart_file sub routine (function)
-#
-# NOTE: I'm trying to hide these subroutines (except for the registered ones) so they
-#       can't be called by accident or from outside the main subroutine. 
+
+# 20071009 Mister Ed Changes (October 2007)
+# added payment gateway installer / remover.
+# added in template and template skin installer/remover.
+# added in button set installer / remover.
+# streamlined a few redundant module calls.
+# streamlined code not needed.
+
+# Flow: (outdated)
+
+#  Initial:
+#   Update and parse current library page (hash)
+#   Get current installed library versions (hash)
+#   Determine which libraries have updates (hash)
+#   Build table that displays library, installed version and either
+#   'uptodate' or link to update that library
+#   Display page with above table and link to update all libraries if
+#   any libraries need update (don't display link if no libraries need update)
+
+#  Update Single Library:
+#   Get URL from current library page for library to be updated
+#   Get file from URL if not already downloaded
+#   Unpack file (not used yet)
+#   Check md5 sum if possible (add later)
+#   syntax check file - success? (add later)
+#     N: Notify user and return
+#     Y: Install library
+
+#  Update Multiple Libraries:
+#   Loop through single library update subroutine for each library update requested
 
 local($modname) = "upgrade_manager-ext_lib.pl";
-$versions{'upgrade_manager-ext_lib.pl'} = "5.0.000";
+$versions{'upgrade_manager-ext_lib.pl'} = "5.2.000";
 $updateErrorMessage = "";
 $mgr_upgrade_error_message = '';
 { 
@@ -42,6 +70,26 @@
 	$modname,"Show Module Versions");
  &register_menu('updateCartFile',"get_and_update_cart_file",
 	$modname,"Get and save-write updated cart file");
+ &register_menu('displayTemplateInstaller',"display_templates_install_page",
+	$modname,"Display Template Installer options");
+
+ &register_menu('clickinstallnewtemplateset',"perform_templates_install",
+	$modname,"Install Selected New Template");
+ &register_menu('clickinstallnewbuttonset',"perform_buttonset_install",
+	$modname,"Install Selected New Buttonset");
+
+ &register_menu('clicktoremovetemplateset',"perform_template_skin_removal",
+	$modname,"Remove Selected Template Skin");
+ &register_menu('clicktoremovebuttonset',"perform_buttonset_removal",
+	$modname,"Remove Selected Button Set");
+
+ &register_menu('displayPaymentGatewayInstaller',"display_gateway_install_page",
+	$modname,"Display Payment Gateway Install options");
+ &register_menu('clicktoinstallpaymentgateway',"perform_payment_gateway_install",
+	$modname,"Install Payment Gateway Files");
+ &register_menu('clicktoremovepaymentgateway',"perform_payment_gateway_removal",
+	$modname,"Remove Payment Gateway Files");
+}
 ################################################################################
 #added by Mister Ed Feb 2 2006
 sub get_and_update_cart_file {
@@ -50,7 +98,6 @@
 my $file = "";
 my $test = "";
 $target_file = "http://www.agoracart.com/downloadupdates/$filename";
-use LWP::Simple;
 $file = get($target_file);
 $filename2 =~ /^([\/-\@\w.\-]+)$/; 
 $filename2 = $1;
@@ -105,7 +152,23 @@
 ENDOFTEXT
 }
 print qq~<font size="2" face="Arial, Helvetica, sans-serif"><br/><br/>For any updgrades to currently installed files, a backup will be created in the form of filename.time in case something goes wrong as well as to ensure that each backup file is unique.* If you download a NEW file (not currently installed) ending in .cgi, you will need to chmod it to 755 after download ing it; use FTP of an online file manager to do this.<br><br><div align=center>Available gateways not listed below must be manually installed.<br/>Current payment processing gateways can be found in the download sections of AgoraCart.com or AgoraCartPro.com.<br/>For more information on available gateways, please visit the <a href="http://www.AgoraCart.com/paymentgateways.htm" target="_new">Supported Gateways Page at AgoraCart.com</a></div></font>
+
+<br><div align="center">
+<table border ="0" cellspacing="0" cellpadding="6"><tr>
+<td>
+<form method="post" action="manager.cgi">
+<input name="displayTemplateInstaller" type="submit" value="Template / Buttonset Installer">
+</form>
+</td>
+<td>
+<form method="post" action="manager.cgi">
+<input name="displayPaymentGatewayInstaller" type="submit" value="Payment Gateway Installer">
+</form>
+</td>
+</tr></table></div>
+</font>
 ~;
+
   print $versions . $in . $env;
 
  print "<font size=\"1\" face=\"Arial, Helvetica, sans-serif\"><br/><br/>* (time = number of seconds since 1970 (EPOCH) in most cases.  Backups require the Perl File::Copy module to be installed which is already installed on most servers).</font><br/><br/>";
@@ -197,5 +260,493 @@
   return wantarray ? %installed_versions : \%installed_versions;
 }
 ################################################################################
-} 
+sub perform_buttonset_removal {
+
+    $in{'sc_removebuttonSetName'} =~ /([\w\-\/]+)/;
+    $in{'sc_removebuttonSetName'} = "$1";
+    my $filename = "$in{'sc_removebuttonSetName'}";
+    my $local_buttonset = "html/images/buttonsets/$filename";
+
+    if ($sc_buttonSetName =~ /$in{'sc_removebuttonSetName'}/i) {
+        $in{'sc_removebuttonSetName'} = '';
+    }
+
+ if ($in{'sc_removebuttonSetName'} ne '') {
+    if (-e "./$local_buttonset") {
+        my $result = `rm -rf "./html/images/buttonsets/$filename"`;
+        $updateErrorMessage .= "Button set removal is complete";
+    }
+
+ } else {
+    $updateErrorMessage = "No Button Set Selected or current Button Set in use was selected. Request Cancelled.<br />";
+ }
+
+ &display_templates_install_page;
+}
+################################################################################
+sub perform_template_skin_removal {
+
+    $in{'sc_removeheaderTemplateName'} =~ /([\w\-\/]+)/;
+    $in{'sc_removeheaderTemplateName'} = "$1";
+    my $filename = "$in{'sc_removeheaderTemplateName'}";
+    my $local_skin = "html/html-templates/templates/$filename";
+
+    if ($sc_headerTemplateName =~ /$in{'sc_removeheaderTemplateName'}/i) {
+        $in{'sc_removeheaderTemplateName'} = '';
+    }
+
+ if ($in{'sc_removeheaderTemplateName'} ne '') {
+    if (-e "./$local_skin") {
+        my $result = `rm -rf "./html/html-templates/templates/$filename"`;
+        $updateErrorMessage .= "Template or skin removal is complete";
+    }
+
+ } else {
+    $updateErrorMessage = "No template selected or current template in use was selected. Request Cancelled.<br />";
+ }
+
+ &display_templates_install_page;
+}
+################################################################################
+sub perform_templates_install {
+
+    $in{'sc_newheaderTemplateName'} =~ /([\w\-\/]+)/;
+    $in{'sc_newheaderTemplateName'} = "$1";
+    my $filename = "$in{'sc_newheaderTemplateName'}";
+    my $local_dir = "html/html-templates/templates/$filename.tar";
+    my $result = '';
+
+
+ if ($in{'sc_newheaderTemplateName'} ne '') {
+    if (!(-e "./$local_dir")) {
+        my $target_file = "http://www.agoracart.com/downloadupdates/templates/$filename.tar";
+        getstore("$target_file","./$local_dir");
+    }
+
+    if (-e "./$local_dir") {
+        chdir("./html/html-templates/templates");
+        my $result = `tar -xvpf "$filename.tar" 2>&1`;
+        $updateErrorMessage .= "<pre>$result</pre>";
+        unlink "$filename.tar";
+        chdir("../../../");
+    }
+
+ } else {
+    $updateErrorMessage = "No Template Selected. Request Cancelled.<br />";
+ }
+
+ &display_templates_install_page;
+}
+################################################################################
+sub perform_buttonset_install {
+
+    $in{'sc_newbuttonSetName'} =~ /([\w\-\/]+)/;
+    $in{'sc_newbuttonSetName'} = "$1";
+    my $filename = "$in{'sc_newbuttonSetName'}";
+    my $local_dir = "html/images/buttonsets/$filename.tar";
+    my $result = '';
+
+ if ($in{'sc_newbuttonSetName'} ne '') {
+    if (!(-e "./$local_dir")) {
+        my $target_file = "http://www.agoracart.com/downloadupdates/buttonsets/$filename.tar";
+        getstore("$target_file","./$local_dir");
+    }
+
+    if (-e "./$local_dir") {
+        chdir("./html/images/buttonsets");
+        my $result = `tar -xvpf "$filename.tar" 2>&1`;
+        $updateErrorMessage .= "<pre>$result</pre>";
+        unlink "$filename.tar";
+        chdir("../../../");
+    }
+
+ } else {
+        $updateErrorMessage = "No Button Set Selected. Request Cancelled.<br />"
+    }
+
+    &display_templates_install_page;
+}
+################################################################################
+sub perform_payment_gateway_removal {
+
+    $in{'sc_PaymentGatewayToremove'} =~ /([\w\-\/]+)/;
+    $in{'sc_PaymentGatewayToremove'} = "$1";
+    my $filename = "$in{'sc_PaymentGatewayToremove'}";
+    $updateErrorMessage = '';
+
+    if ($sc_gateway_name =~ /$filename/i) {
+        $in{'sc_PaymentGatewayToremove'} = '';
+        $updateErrorMessage = "You attempted to Delete your Primary Gateway. Please change your store settings before trying to remove the $filename payment gateway files.<br />";
+    }
+
+  if ($in{'sc_PaymentGatewayToremove'} ne '') {
+
+      if ($in{'removepguserlib'}) {
+         my $local_delete = "$sc_admin_dir/$filename"."-user_lib.pl";
+         if (-e "$local_delete") { `rm -f $local_delete`;}
+      }
+      if ($in{'removepgorderform'}) {
+         my $local_delete = "$sc_html_dir/forms/$filename"."-orderform.html";
+         if (-e "$local_delete") { `rm -f $local_delete`;}
+      }
+      if ($in{'removepgorderlib'}) {
+         my $local_delete = "$sc_lib_dir/$filename"."-order_lib.pl";
+         if (-e "$local_delete") { `rm -f $local_delete`;}
+      }
+      if ($in{'removepgmgrlib'}) {
+         my $local_delete = "$sc_lib_dir/$filename"."-mgr_lib.pl";
+         if (-e "$local_delete") { `rm -f $local_delete`;}
+      }
+      if ($in{'removepgsecondorderlib'}) {
+         my $local_delete = "./add_ons/$filename"."-order_lib.pl";
+         if (-e "$local_delete") { `rm -f $local_delete`;}
+      }
+
+      $updateErrorMessage = "Selected Gateway Files were removed.<br />"
+
+  } else {
+        $updateErrorMessage .= "No Gateway Selected. Request Cancelled.<br />"
+  }
+
+    &display_gateway_install_page;
+}
+################################################################################
+sub perform_payment_gateway_install {
+
+    $in{'sc_newPaymentGatewayToinstall'} =~ /([\w\-\/]+)/;
+    $in{'sc_newPaymentGatewayToinstall'} = "$1";
+    my ($filename,$memberlevel) = split(/\//, $in{'sc_newPaymentGatewayToinstall'});
+    my $src_location = "http://www.agoracart.com/downloadupdates/$filename";
+
+
+  if ($in{'sc_newPaymentGatewayToinstall'} ne '') {
+
+      if ($in{'installpguserlib'}) {
+         my $local_save = "$sc_admin_dir/$filename"."-user_lib.pl";
+         my $target_file = "$src_location"."-user_lib.txt";
+         getstore("$target_file","./$local_save");
+      }
+      if ($in{'installpgorderform'}) {
+         my $local_save = "$sc_html_dir/forms/$filename"."-orderform.html";
+         my $target_file = "$src_location"."-orderform.txt";
+         getstore("$target_file","./$local_save");
+      }
+      if ($in{'installpgorderlib'}) {
+         my $local_save = "$sc_lib_dir/$filename"."-order_lib.pl";
+         my $target_file = "$src_location"."-order_lib.txt";
+         getstore("$target_file","./$local_save");
+      }
+      if ($in{'installpgmgrlib'}) {
+         my $local_save = "$sc_lib_dir/$filename"."-mgr_lib.pl";
+         my $target_file = "$src_location"."-mgr_lib.txt";
+         getstore("$target_file","./$local_save");
+      }
+      if ($in{'installpgsecondorderlib'}) {
+         my $local_save = "./add_ons/$filename"."-order_lib.pl";
+         my $target_file = "$src_location"."-order_lib.txt";
+         getstore("$target_file","./$local_save");
+      }
+
+      $updateErrorMessage = "Selected Gateway Files were installed.<br />"
+
+  } else {
+        $updateErrorMessage = "No Gateway Selected. Request Cancelled.<br />"
+  }
+
+  &display_gateway_install_page;
+}
+################################################################################
+sub display_gateway_install_page {
+
+  print &$manager_page_header("AgoraCart Payment Gateway Install - Remove","","","","");
+
+  my $error1 = "Authorization Required";
+  my $error2 = "This server could not verify";
+
+  my $mylist_of_gateway_options = "";
+  @gwlist = split(/\|/,$mc_gateways);
+  foreach $item (@gwlist) {
+    if ($item ne "") {
+      $item_lc = $item;
+      $item_lc =~ tr/A-Z/a-z/;
+      $zlist{$item_lc} = "<OPTION>$item</OPTION>\n";
+     } 
+   }
+  foreach $item (sort(keys %zlist)) {
+    $mylist_of_gateway_options .= $zlist{$item};
+   }
+
+my $target_file = "http://www.agoracart.com/paygatesbasic.txt";
+  my $file = get($target_file);
+  my @line = split(/\n/, $file);
+  foreach $line (@line) {
+    chomp $line;
+    $mylist_of_new_gateways .= qq~<option value="$line">$line</option>\n~;
+  }
+
+
+if($in{'system_edit_success'} ne "")
+{
+print <<ENDOFTEXT;
+<CENTER><br>
+<TABLE>
+<TR>
+<TD>
+<FONT FACE=ARIAL SIZE=2 COLOR=RED>Updates Attempted:<br />$updateErrorMessage</FONT>
+</TD>
+</TR>
+</TABLE>
+</CENTER>
+ENDOFTEXT
+}
+
+print qq~
+<table border="0" cellpadding="9" cellspacing="0">
+<tr>
+<td colspan=3><hr /></td>
+</tr>
+<tr>
+<td width=20%><font face=arial>
+<b>Select a Payment Gateway to Install or Re-Install: </b>
+</td><td><font face=arial>
+<br />
+<form action="manager.cgi" method="post">
+<select name=sc_newPaymentGatewayToinstall>
+<option></option>
+$mylist_of_new_gateways
+</select>
+<br /><small><br />
+<input type="checkbox" name="installpguserlib" value="1"> Install Blank Settings File<br />
+<input type="checkbox" name="installpgorderform" value="1"> Install Default Order Form<br />
+<input type="checkbox" name="installpgmgrlib" value="1"> Install Gateway Settings for Store Manager<br />
+<input type="checkbox" name="installpgorderlib" value="1"> Install Order Processing Libraries<br />
+<input type="checkbox" name="installpgsecondorderlib" value="1"> Install Order Processing Libraries for Secondary Gateway<br />&nbsp;&nbsp;&nbsp;&nbsp; (goes in add_ons sub-directory of your store)
+</small>
+</font>
+</td>
+<td><font face=arial>
+<br />
+<input type="hidden" name="system_edit_success" value="yes">
+<input name="clicktoinstallpaymentgateway" type="submit" value="Click to Install as Selected">
+</form>
+<br />
+</td>
+</tr>
+<tr><td></td>
+<td colspan=2><font face=arial>
+* <small>This section allows you to install new gateways or reinstall default files from existing gateways.  You can install any combination of the files as needed, even installing the order libs to use as a secondary payment option for your customers. If you have updated a gateway in the main upgrade manager, the secondary files in the add_ons directory of your store will not be upgraded automatically, so you will have to use this too and check only the box next to  "Install Order Processing Libraries for Secondary Gateway" box to update the secondary order lib files.  <b>NOTE:</b> if you install gateway files via this method, existing files for the selected gateway will be overwritten IF and only IF they exist already.  For example if you altered your order form previously for the Offline payment gateway and you select to install the order form option for the Offline gateway, your custom order form for the Offline gateway will be replaced with the deafult one. However, if you installed the order form for the NiftyPay gateway, your custom Offline Order form would go untouched.<br /><br />
+<a href="http://www.agoracart.com/agorawiki/index.php?title=What_is_a_Payment_Gateway" target="_blank">What is a Payment Gateway</a>?  &nbsp;&nbsp; <a href="http://www.agoracart.com/agorawiki/index.php?title=Payment_Gateway_Basics_%26_x-comments">Payment Gateway Basics</a>
+</small><br />
+</font></td>
+</tr>
+<tr>
+<td colspan=3><hr /></td>
+</tr>
+<tr>
+<td width=20%><font face=arial>
+<b>Select a Payment Gateway to Remove or Disable: </b>
+</td><td><font face=arial>
+<br />
+<form action="manager.cgi" method="post">
+<select name="sc_PaymentGatewayToremove">
+<option></option>
+$mylist_of_gateway_options
+</select>
+<br /><small><br />
+<input type="checkbox" name="removepguserlib" value="1"> Remove Gateway Settings File<br />
+<input type="checkbox" name="removepgorderform" value="1"> Remove Existing Order Form<br />
+<input type="checkbox" name="removepgmgrlib" value="1"> Remove Gateway Settings Manager<br />
+<input type="checkbox" name="removepgorderlib" value="1"> Remove Order Processing Libraries<br />
+<input type="checkbox" name="removepgsecondorderlib" value="1"> Remove Order Processing Libraries for Secondary Gateway<br />&nbsp;&nbsp;&nbsp;&nbsp; (in add_ons sub-directory of your store)
+</small>
+</font>
+</td>
+<td><font face=arial>
+<br />
+<input type="hidden" name="system_edit_success" value="yes">
+<input name="clicktoremovepaymentgateway" type="submit" value="Click to Remove as Selected">
+</form>
+<br />
+</td>
+</tr>
+<tr><td></td>
+<td colspan=2><font face=arial>
+* <small>This section allows you to remove entire payment gateways or portions of existing gateways.  You can removel any combination of the files as needed, even the order libs used as a secondary payment option for your customers. Once the Manager Settings file for a gateway is removed, you can no longer remove files for that gateway, so make sure to delete all the desired gateway files before or at the same time as deleting this file.  Also, you can remove the secondary gateway libs from the add_ons sub-dir of your store, if present, using this tool, yet keep the gateway intact and functional as a primary gateway.  <b>NOTE: once you remove the file(s) for the selected gateway, it is gone forever, so make sure you select the correct gateway as there are no second chances with this tool.</b><br />
+</small><br />
+</font></td>
+</tr>
+<tr>
+<td colspan=3><hr /></td>
+</tr>
+</table>
+~;
+
+
+  print &$manager_page_footer;
+
+  &call_exit;
+}
+################################################################################
+sub display_templates_install_page {
+  print &$manager_page_header("AgoraCart Template and Skin Installer","","","","");
+
+  $sm_templatelinks2 = qq~<option value=""></option>\n~;
+  $sm_buttonsetlinks2 = qq~<option value=""></option>\n~;
+
+    opendir (TEMPLATES, "$templates_file_dir"); 
+    @myfiles = readdir(TEMPLATES); 
+    closedir (TEMPLATES);
+    foreach $zfile (@myfiles){
+        if (!($zfile =~ /\./)) {
+           $sm_templatelinks .= qq~<option value="$zfile">$zfile - Delete Entire Template</option>\n~;
+           opendir (INTEMPLATES, "$templates_file_dir/$zfile"); 
+           @myfiles2 = readdir(INTEMPLATES); 
+           closedir (INTEMPLATES);
+           foreach $zzfile (@myfiles2){
+             if (!($zzfile =~ /\./)) {
+                $sm_templatelinks .= qq~<option value="$zfile/$zzfile">$zzfile - This Skin Only</option>\n~;
+             }
+           }
+           @myfiles2 = ""; 
+        }
+    }
+
+
+    if ($sc_self_serve_images =~ /no/i) {
+         $sc_buttonSetURLthingy = "$URL_of_images_directory/buttonsets";
+    }
+    opendir (BUTTONSETS, "$sc_buttonSetURLthingy"); 
+    @myfiles = readdir(BUTTONSETS); 
+    closedir (BUTTONSETS);
+    foreach $zfile (@myfiles){
+        if (!($zfile =~ /\./)) {
+                $sm_buttonsetlinks .= qq~<option value="$zfile">$zfile</option>\n~;
+        }
+    }
+
+if($in{'system_edit_success'} ne "")
+{
+print <<ENDOFTEXT;
+<CENTER><br>
+<TABLE>
+<TR>
+<TD>
+<FONT FACE=ARIAL SIZE=2 COLOR=RED>Updates Attempted: $updateErrorMessage</FONT>
+</TD>
+</TR>
+</TABLE>
+</CENTER>
+ENDOFTEXT
+}
+
+  my $target_file2 = "http://www.agoracart.com/templatesbasic.txt";
+  use LWP::Simple;
+  my $file = get($target_file2);
+  @line = split(/\n/, $file);
+  foreach $line (@line) {
+     chomp $line;
+     $sm_templatelinks2 .= qq~<option value="$line">$line</option>\n~;
+  }
+
+  my $target_file3 = "http://www.agoracart.com/buttonsbasic.txt";
+  my $file2 = get($target_file3);
+  @line = split(/\n/, $file2);
+  foreach $line (@line) {
+     chomp $line;
+     $sm_buttonsetlinks2 .= qq~<option value="$line">$line</option>\n~;
+  }
+
+
+print qq~
+<table border="0" cellpadding="9" cellspacing="0">
+<tr>
+<td colspan=3><hr /></td>
+</tr>
+<tr>
+<td width=20%><font face=arial>
+<b>Select a Template: </b>
+</td><td>
+<br />
+<form action="manager.cgi" method="post">
+<select name=sc_newheaderTemplateName>
+<option></option>
+$sm_templatelinks2
+</select>
+<input type="hidden" name="system_edit_success" value="yes">
+<input name="clickinstallnewtemplateset" type="submit" value="Click to Install">
+</form>
+<br />
+</td>
+<td><font face=arial>
+<br />
+<form action="manager.cgi" method="post">
+<select name=sc_removeheaderTemplateName>
+<option></option>
+$sm_templatelinks
+</select>
+<input type="hidden" name="system_edit_success" value="yes">
+<input name="clicktoremovetemplateset" type="submit" value="Click to Remove">
+</form>
+<br />
+</td>
+</tr>
+<tr>
+<td colspan=3><font face=arial>
+<div align="center"><small><a href="http://www.agoracart.com/templates.html" target="_blank">Samples: Free Templates</a><br /><br /></small></div>
+* <small>These templates are the store header and footers for the main design.  Once installed, you can visit the "primary/main store settings manager" to select the newly installed template(s).  Only Templates not installed by default are shown in the install list, even if you deleted a default skin/template.  It is a comprehensive list of available <b>add-on</b> freebie templates.  Templates and skins may be installed via this interface or manually, see the various user forums and wiki for more information.  Note: if you have one of these templates installed, or a custom template with the same name, it will be overwritten and prior versions will be lost upon installation.  If your server does not support the automagic downloads, then you can manually upload the tarball (filename.tar) to the html/html-templates/templates sub-directory of your store in binary mode, then select the template name above and it will untar (aka unzip or uncompress) the template file for you. If nothing shows up, then there are NO additional add-on templates available yet.
+</small><br />
+</font></td>
+</tr>
+<tr>
+<td colspan=3><hr /></td>
+</tr>
+<tr>
+<td width=20%><font face=arial>
+<b>Select a Button Set: </b></font>
+</td><td>
+<br />
+<form action="manager.cgi" method="post">
+<select name=sc_newbuttonSetName>
+<option></option>
+$sm_buttonsetlinks2
+</select>
+
+<input type="hidden" name="system_edit_success" value="yes">
+<input name="clickinstallnewbuttonset" type="submit" value="Click to Install">
+</form>
+<br />
+</font>
+</td>
+<td><font face=arial>
+<br />
+<form action="manager.cgi" method="post">
+<select name=sc_removebuttonSetName>
+<option></option>
+$sm_buttonsetlinks
+</select>
+<input type="hidden" name="system_edit_success" value="yes">
+<input name="clicktoremovebuttonset" type="submit" value="Click to Remove">
+</form>
+<br />
+</td>
+</tr>
+<tr>
+<td colspan=3><font face=arial>
+<div align="center"><small><a href="http://www.agoracart.com/buttonsets.html" target="_blank">Samples: Free Button Sets</a><br /><br /></small></div>
+* <small>These button sets are the images such as the add-to-cart buttons and similar themed images you find in your customer's shopping experience.  Once installed, you can visit the "primary/main store settings manager" to select the newly installed button set(s).  Only Button Sets not installed by default are shown on the install list, even if you previously deleted a default button set.  It is a comprehensive list of available <b>add-on</b> freebie button sets.  Button Sets may be installed via this interface or manually, see the various user forums and wiki for more information.  Note: if you have one of these button sets installed, or a custom button set with the same name, it will be overwritten and prior versions will be lost upon installation.  If your server does not support the automagic downloads, then you can manually upload the tarball (filename.tar) to the html/images/buttonsets sub-directory of your store in binary mode, then select the button set name above and it will untar (aka unzip or uncompress) the button set file for you. If nothing shows up, then there are NO additional add-on button sets available yet.</small><br />
+* <small></small><br />
+</font></td>
+</tr>
+<tr>
+<td colspan=3><hr /></td>
+</tr>
+</table>
+~;
+
+
+  print &$manager_page_footer;
+
+  &call_exit;
+}
+################################################################################
 1; 
