// This script is the sole property of 4D Internet Solutions. Copyright 2007, 4D Internet Solutions, Inc. All rights reserved.//read cookievar cartCookie = unescape(readCookie('mssFloatingCart'));var storeId = "archivesmhg"; // add store id between quotes.function writeCart(){	var links = new Array();	var titles = new Array();	var pids = new Array();	var prices = new Array();	var units = new Array();	var total = "";	var cartURL = "http://order.store.yahoo.net/cgi-bin/wg-order?catalog=" + storeId;	var myCheckout = "https://order.store.yahoo.net/ymix/MetaController.html?ysco_key_event_id=1&ysco_key_store_id=" + storeId + "&sectionId=ysco.ship-bill"	var showCart = 1; // 1 = yes; 0 = no;	var showChechout = 1; // 1 = yes; 0 = no;	if (cartCookie && cartCookie != ""){		var eachArray = cartCookie.split("^");		if (eachArray[0] && eachArray[0].length > 0){			var eachElement = eachArray[0].split("|:|");			total = eachElement[0];		}				if (eachArray[1] && eachArray[1].length > 0) {			var numItems = eachArray[1].split("|:|").length - 1;			} else {				return null; 		}		// write floating cart header and number of items in cart			if (numItems > 0 ){			document.write("<div class=\"fcartBG\">");			document.write("<div class=\"floatingCartHeader\">You have " + numItems + " items...</div>");						// loop through each array from cookie			for (i = 0; i < eachArray.length -1; i++){				if (eachArray[i] && eachArray[i] != ""){					var eachElement = eachArray[i].split("|:|");						var x = 0;					// build javascript arrays from cookie data					for (j = 0; j < eachElement.length; j++){						if (eachElement[j] && eachElement[j] != ""){							if (i == 1){								links[x] = eachElement[j]								}							if (i == 2){								titles[x] = eachElement[j]; 								}							if (i == 3){								pids[x] = eachElement[j]; 								}							if (i == 4){								prices[x] = eachElement[j]; 								}							if (i == 5){								units[x] = eachElement[j]; 								}							x = x + 1;							}						}					}				}			//loop through each cookie array and write the cart  using the javascript arrays			for (i = 0; i < numItems; i++){				if (eachArray[i] && eachArray[i] != "" && links[i] && links[i] != ""){					document.write("<div class=\"fcart\">");					document.write("<div class=\"fcart-name\"><a href=\"" + links[i].toLowerCase() + "\">" + titles[i] + "</a></div>");					document.write("<div class=\"fcart-price\">Price: " + prices[i] + "</div>");					document.write("<div class=\"fcart-qty\"> Qty: " + units[i] + "</div>");					document.write("</div>");					}				}							// write subtotal				document.write("<div class=\"fcart-total\">Sub Total: " + total + "</div>");					// write View Cart Link							if (showCart == 1 ){				document.write("<div class=\"fviewCart\"><a href=\"" + cartURL + "\">View/Edit Your Cart</a> >>></div>");			}					if (showChechout == 1 ){				document.write("<div class=\"fcheckout\"><a href=\"" + myCheckout + "\">"); 				document.write("<img src=\"http://site.thearchivesstore.com/images/XpressCheckout.gif\"></a></div>");			}						// Close fcartBG div			document.write("</div>");							} // close test for numItems > 0 	} // close test for cartCookie } // close function 