4 // Toggles the layer visibility on
5 function showLayer(layerName) {
6 document.getElementById(layerName).style.visibility="visible";
9 // Toggles the layer visibility off
10 function hideLayer(layerName) {
11 document.getElementById(layerName).style.visibility = "hidden";
14 ////////////////////////////////////
16 ////////////////////////////////////
18 function getCookie(name) {
19 var dc = document.cookie;
20 var prefix = name + "=";
21 var begin = dc.indexOf("; " + prefix);
23 begin = dc.indexOf(prefix);
24 if (begin != 0) return null;
28 var end = document.cookie.indexOf(";", begin);
32 return unescape(dc.substring(begin + prefix.length, end));
35 ////////////////////////////////////////////////////////////
37 ////////////////////////////////////////////////////////////
38 function count_clones()
43 cookies=document.cookie;
44 if(getCookie('CloneCart')!="")
46 n_clones = 1;//first clone in cookie does not begin with a comma (fencepost problem)
48 while((p=cookies.indexOf(",",p))!=-1)
53 document.write(n_clones);
61 function check_clonecart()
63 //if we are on the order routing page, hide cart
64 if(document.URL.indexOf("route-order.pl")!=-1)
66 hideLayer('clone_shoppingcart');
69 //if there is something in the cart, show cart
70 if(getCookie('CloneCart')!="" && getCookie('CloneCart')!=null)
72 showLayer('clone_shoppingcart');
75 //otherwise, hide cart
76 hideLayer('clone_shoppingcart');