/************************************************************************* getCartItem-Gets the Actinic Cart Value & No of Items** Input: nIndex-Cart item index to retrieve*1 = TOTAL_VALUE*3 = CART_COUNT** Returns:Requested cart item or 0 (zero) if not found*************************************************************************///CART_CONTENT = Cookie name//1 = TOTAL_VALUE//3 = CART_COUNTfunction getCartItem(nIndex){var act_cart= getCookie("CART_CONTENT")var sTemp =(act_cart != null) ? sTemp=act_cart.split("\t"):0;return (sTemp.length > 0) ? sTemp[nIndex] : 0;}/************************************************************************* win- calls up the WUP window** Input - None* Returns - None************************************************************************/function win(){var sMsg = window.open("paycash1.htm","","height = 507, width = 400, left = 378, top = 40");}/************************************************************************* GotoAnchor - JS for jumping to an anchor - some user agents don't handle*anchors correctly if BASE HREF is present** Input: sAnchor** Returns:nothing*************************************************************************/function GotoAnchor(sAnchor){window.location.hash = sAnchor;}/************************************************************************* getFullCart-fetches cart content summary** Returns:-HTML string for summary display** Graham Bradley 2006* Comments & bug reports to ** To make editing the output HTML easier, output code has been split into* nine 'template' strings.**tableOpen-the opening table code*itemLine-repeated for each item in the cart*shippingLine-for displaying shipping charges (if any)*vatLine-for displaying VAT on items & shipping (if any)*discountLine-for displaying discount total (if any)*surchargeLine-for displaying surcharge total (if any)*totalLine-for displaying the cart total*tableClose-the closing table code*emptyLine-displayed when cart is empty** Within these templates, you can use variables to insert values into* the summary, similar to variables in Actinic:**VAR:QUANTITY-The quantity of item in cart*VAR:TITLE-Abbreviated name of item*VAR:LINK-URL of item via the cgi-bin*VAR:PRICE-Formatted price of item*VAR:SHIPPING-Total of shipping applied*VAR:VAT-Total VAT on cart items & shipping*VAR:DISCOUNT-Total of discounts applied*VAR:SURCHARGE-Total of surcharges applied*VAR:TOTAL-Grand total** Variables can only be used in the templates in which they are found.*************************************************************************/function getFullCart(){var tableOpen="
";var itemLine="
| VAR:QUANTITYx |
VAR:TITLE...
|
VAR:PRICE |
"var shippingLine="
| Shipping |
VAR:SHIPPING |
"var vatLine="
| VAT |
VAR:VAT |
"var discountLine="
| Discounts |
VAR:DISCOUNT |
"var surchargeLine="
| Surcharges |
VAR:SURCHARGE |
"var totalLine="
|
Total
|
VAR:TOTAL
|
"var tableClose="
"var emptyLine="No items in cart.";var cookie=getCartItem(4);if (!cookie){return emptyLine;}var re=new Array();var match=new Array();var total=0;var str;re[1]=/cur=([^&]*)&!/g;re[2]=/&!(.*)/g;re[3]=/ss=(.*)cur=/i;re[4]=/tx=(.*)sh=/i;re[5]=/sh=(.*)ss=/i;for (i=1;i
]*)>/;re[2]=/>([^>]*)>/;re[3]=/>([^>]*)$/;str=tableOpen;for (i=0;i
0){str+=shippingLine.replace("VAR:SHIPPING",match[1]+(match[5]/100));total=total+=(match[5]/100);}if (match[4] > 0){str+=vatLine.replace("VAR:VAT",match[1]+(match[4]/100));total=total+=(match[4]/100);}gTotal=getCartItem(1);var r=/(\d*);/gi;var m=new Array();var f=new Array();while((m = r.exec(gTotal))!=null){f[f.length]=m[1];}for (i=0;i
gTotal){str=str+=discountLine.replace("VAR:DISCOUNT","-"+match[1]+(total-gTotal).toFixed(2));}else if (total