1 // stub out some problematic things
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 var count_el = document.getElementById('clone_cart_count');
45 if(getCookie('CloneCart')!="")
47 n_clones = 1;//first clone in cookie does not begin with a comma (fencepost problem)
49 while((p=cookies.indexOf(",",p))!=-1)
55 count_el.innerHTML = n_clones;
59 count_el.innerHTML = 'No';
63 function check_clonecart()
65 //if we are on the order routing page, hide cart
66 if(document.URL.indexOf("route-order.pl")!=-1)
68 hideLayer('clone_shoppingcart');
71 //if there is something in the cart, show cart
72 if(getCookie('CloneCart')!="" && getCookie('CloneCart')!=null)
74 showLayer('clone_shoppingcart');
77 //otherwise, hide cart
78 hideLayer('clone_shoppingcart');
84 jQuery( check_clonecart ); // check the clone cart on document load
85 jQuery( count_clones );