// buyItem function buyItem(newItem, newPrice, newQuantity) { if (newQuantity <= 0) { rc = alert( 'La cantidad es incorrecta!' ); } else { if ( confirm('¿Desea agregar '+newQuantity+' '+newItem+' a su carretilla?') ) { index = -1; if( document.cookie ) { index = document.cookie.indexOf("TheBasket"); } countbegin = document.cookie.indexOf( "=" , index)+1 ; countend = document.cookie.indexOf( ";" , index ) ; if (countend == -1) { countend = document.cookie.length; } thisPath = "/sites/debebes/"; cookieanterior = document.cookie.substring(countbegin, countend) ; document.cookie="TheBasket" + "=" + cookieanterior + "[" + newItem + "|" + newPrice + "|" + newQuantity + "]" + " ;path=" + thisPath; self.location = "/sites/debebes/virtualstore.nsf/carretilla.html"; } } } // getCookie function getCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } // fixDate function fixDate(date) { var base = new Date(0); var skew = base.getTime(); if (skew > 0) date.setTime(date.getTime() - skew); } // SaveCartContent function SaveCartContent(CookieName) { if(document.cookie) { indice = document.cookie.indexOf(CookieName); if (indice != -1) { comienzo = (document.cookie.indexOf("=", indice) + 1); finals = document.cookie.indexOf(";", indice); if (finals == -1) { finals = document.cookie.length; } return document.cookie.substring(comienzo, finals); } } return 0; } // Show Images function ShowIMG(url) { var nombre = "IMG"; win = window.open( url , nombre , 'width=600,height=600 scrollbars=yes,resizable=no,status=no,location=no,menubar=no'); }