var _g_eceDefCookieName = "_eceCartv2_" + "12583";
var _g_eceDefCookieMax = 5;
var _g_eceDefCookieSizeMax = 4000;
var _g_eceDefExpDate = new Date();
_g_eceDefExpDate.setTime(new Date().getTime() + (2 * 24 * 60 * 60 * 1000));
function _eceGetSubDomain()
{
if (document.getElementById && location && location.hostname)
{
var _eceUseDomain = location.hostname.toLowerCase();
var _eceUseDomainArray = _eceUseDomain.split(".");
if (_eceUseDomainArray.length >= 2)
{
if (_eceUseDomainArray[_eceUseDomainArray.length - 1].length >= 2)
{
if (isNaN(_eceUseDomainArray[_eceUseDomainArray.length - 1]))
{
var _eceTmpDomainStr = _eceUseDomainArray[_eceUseDomainArray.length - 2] + "." + _eceUseDomainArray[_eceUseDomainArray.length - 1];
if ((_eceUseDomainArray[_eceUseDomainArray.length - 2].length <= 2 || _eceUseDomainArray[_eceUseDomainArray.length - 2] == "com") && _eceUseDomainArray.length > 2)
_eceTmpDomainStr = _eceUseDomainArray[_eceUseDomainArray.length - 3] + "." + _eceTmpDomainStr;
return ("; domain=." + _eceTmpDomainStr);
//return ("; domain=." + _eceUseDomainArray[_eceUseDomainArray.length - 2] + "." + _eceUseDomainArray[_eceUseDomainArray.length - 1]);
}
}
}
}
return "";
}
function _eceGetCookie (cookieName)
{
var retStr = "";
if (document.cookie)
{
if (!cookieName)
cookieName = _g_eceDefCookieName;
var cookieArray = document.cookie.split(";")
var nCount = 0;
for (var n = 0; n < cookieArray.length; n++)
{
while(cookieArray[n].charAt(0) == ' '){cookieArray[n] = cookieArray[n].substring(1)}
if (cookieArray[n].indexOf(cookieName) == 0)
{
retStr += cookieArray[n].substring(cookieName.length+1 + (nCount > 0 ? 1 : 0));
nCount++;
}
}
}
return retStr;
}
function _eceWriteCookie (cookieValue, cookieName)
{
if (cookieValue.length > (_g_eceDefCookieMax * _g_eceDefCookieSizeMax))
{
alert("Maximum cart size exceeded.");
return "";
}
if (!cookieName)
cookieName = _g_eceDefCookieName;
_eceResetCart(cookieName);
for (var n = 0; n < _g_eceDefCookieMax; n++)
{
if ( cookieValue.length > _g_eceDefCookieSizeMax)
{
var setCookie = cookieName + (n > 0 ? n : "") + "=" + cookieValue.substring(0, _g_eceDefCookieSizeMax);
document.cookie = setCookie + "; expires=" + _g_eceDefExpDate.toGMTString() + "; path=/" + _eceGetSubDomain();
cookieValue = cookieValue.substring(_g_eceDefCookieSizeMax);
}
else
{
var setCookie = cookieName + (n > 0 ? n : "") + "=" + cookieValue;
document.cookie = setCookie + "; expires=" + _g_eceDefExpDate.toGMTString() + "; path=/" + _eceGetSubDomain();
break;
}
}
return "";
}
function _eceResetCart(cookieName)
{
if (!cookieName)
cookieName = _g_eceDefCookieName;
var cookieArray = document.cookie.split(";")
for (var n = 0; n < cookieArray.length; n++)
{
while(cookieArray[n].charAt(0) == ' '){cookieArray[n] = cookieArray[n].substring(1)}
for (var x = 0; x < _g_eceDefCookieMax; x++)
{
var useCookiename = cookieName + (x > 0 ? x : "") + "=";
if (cookieArray[n].indexOf(useCookiename) == 0)
document.cookie = useCookiename + "" + "; expires=-1; path=/" + _eceGetSubDomain();
}
}
}
var _g_eceDefCartButton = "https://services.mercantec.com/images/sample_add.jpg";
var _g_eceMerchantID = "12583";
var _g_eceCartButton = "";
var _g_ecePostAddLink = "http://basketandfloral.com/Shopping_cart.htm";
var _g_eceDefQtyText = "Quantity:";
var _g_eceImgAltText = 'alt="' + "Add To Cart" + '"';
var _g_eceQtyText = "";
if (!_g_eceQtyText)
_g_eceQtyText = _g_eceDefQtyText;
if (_g_eceCartButton)
_g_eceImgAltText = "";
else
_g_eceCartButton = _g_eceDefCartButton;
function _eceAttributeOptionsStructure(ID, name, priceUnit, price, displayOrder, selected)
{
this.ID = ID;
this.name = name;
this.priceUnit = priceUnit;
this.price = price;
this.displayOrder = displayOrder;
this.selected = selected;
}
function _eceAttributeStructure(name, type, displayOrder, options)
{
this.name = name;
this.type = type;
this.displayOrder = displayOrder;
this.options = options
}
function _eceProductStructure(ID, name, description, price, shipping, attributesString, attributes)
{
this.ID = ID;
this.name = name;
this.description = description;
this.price = price;
this.shipping = shipping;
this.attributesString = attributesString;
this.attributes = attributes;
}
function _eceAttributeInputStructure(ID, input)
{
this.ID = ID;
this.input = input;
}
var _g_eceProductArray = new Array();
_g_eceProductArray[0] = new _eceProductStructure("141363", "Balloons Jumbo Mylars Balloon Bouquets", "Jumbo Balloons Bouquets ", "$0.00", "$0.00", '
| |
| |
', new Array (new _eceAttributeStructure("", "1", "1", new Array (new _eceAttributeOptionsStructure("307092", "Character Bouquets ", "$", "0.0000", "1", "False"), new _eceAttributeOptionsStructure("307093", "Over-the-Hill", "$", "42.9900", "2", "False"), new _eceAttributeOptionsStructure("307094", "Rock-n-Roll", "$", "42.9900", "3", "False"), new _eceAttributeOptionsStructure("307095", "Sweet 16 ", "$", "42.9900", "4", "False"), new _eceAttributeOptionsStructure("307096", "Spiderman", "$", "42.9900", "5", "False"), new _eceAttributeOptionsStructure("307097", "Sponge Bob", "$", "42.9900", "6", "False"), new _eceAttributeOptionsStructure("307098", "Age 16", "$", "42.9900", "7", "False"), new _eceAttributeOptionsStructure("307104", "Princess", "$", "42.9900", "8", "False"), new _eceAttributeOptionsStructure("307105", "Cat in the Hat", "$", "42.9900", "9", "False"), new _eceAttributeOptionsStructure("307106", "Sports", "$", "42.9900", "10", "False"), new _eceAttributeOptionsStructure("307107", "Scooby Doo", "$", "42.9900", "11", "False"), new _eceAttributeOptionsStructure("307108", "Mickey", "$", "42.9900", "12", "False"), new _eceAttributeOptionsStructure("307109", "Minnie", "$", "42.9900", "13", "False"), new _eceAttributeOptionsStructure("307110", "Batman", "$", "42.9900", "14", "False"), new _eceAttributeOptionsStructure("307111", "Barbie", "$", "42.9900", "15", "False"), new _eceAttributeOptionsStructure("307112", "Shrek", "$", "42.9900", "16", "False"), new _eceAttributeOptionsStructure("307113", "H.Montana", "$", "42.9900", "17", "False"), new _eceAttributeOptionsStructure("307114", "H.S. Musical", "$", "42.9900", "18", "False"), new _eceAttributeOptionsStructure("307115", "Transformers", "$", "42.9900", "19", "False"), new _eceAttributeOptionsStructure("307116", "Hello Kitty", "$", "42.9900", "20", "False"), new _eceAttributeOptionsStructure("307117", "My Little Pony", "$", "42.9900", "21", "False"), new _eceAttributeOptionsStructure("307118", "Dora", "$", "42.9900", "22", "False"), new _eceAttributeOptionsStructure("307119", "Winnie the Pooh", "$", "42.9900", "23", "False"), new _eceAttributeOptionsStructure("307120", "Pirates", "$", "42.9900", "24", "False"), new _eceAttributeOptionsStructure("307121", "Mickey Mouse Club", "$", "42.9900", "25", "False"), new _eceAttributeOptionsStructure("307122", "Add a Name (below)", "$", "45.9900", "26", "False"), new _eceAttributeOptionsStructure("307123", "Sweet 16 pink black", "$", "42.9900", "27", "True"), new _eceAttributeOptionsStructure("307124", "Sweet 16 star ", "$", "39.9900", "28", "False"), new _eceAttributeOptionsStructure("307125", "16 multi color", "$", "42.9900", "30", "False"), new _eceAttributeOptionsStructure("307126", "Sweet 16 pink white", "$", "42.9900", "29", "False"), new _eceAttributeOptionsStructure("310233", "HB you're a star", "$", "42.9900", "31", "False"), new _eceAttributeOptionsStructure("310234", "New Born Baby", "$", "42.9900", "32", "False"))), new _eceAttributeStructure("", "1", "2", new Array (new _eceAttributeOptionsStructure("307129", "Specialty Weight", "$", "0.0000", "1", "True"), new _eceAttributeOptionsStructure("307130", "Hard Candy", "$", "3.0000", "2", "False"), new _eceAttributeOptionsStructure("307131", "Chocolate", "$", "5.0000", "3", "False"), new _eceAttributeOptionsStructure("307132", "Chocolate", "$", "10.0000", "4", "False"), new _eceAttributeOptionsStructure("307133", "Chocolate", "$", "15.0000", "5", "False"), new _eceAttributeOptionsStructure("307134", "Teddy Bear", "$", "12.0000", "6", "False"), new _eceAttributeOptionsStructure("307135", "Teddy Bear", "$", "16.0000", "7", "False"), new _eceAttributeOptionsStructure("307136", "Teddy Bear", "$", "25.0000", "8", "False")))));
function _eceAddToCart(itemID, itemQty, linkThrough, _ecePostAddLink, formObj, attCounter)
{
_ecePostAddLink = unescape(_ecePostAddLink);
if (itemQty.length == 0)
{
alert("Quantity cannot be empty.");
return false;
}
else if (isNaN(itemQty))
{
alert("Quantity must be numeric.");
return false;
}
else if (parseInt(itemQty) < 1)
{
alert("Quantity must be greater than 0.");
return false;
}
var currentName = _eceGetCookie();
var newProdArray = new Array()
var bFound = false;
var attribArray = new Array();
if (formObj && attCounter)
{
for (n = 0; n < formObj.elements.length; n++)
{
var baseName = "a" + attCounter + "-";
if (formObj.elements[n].name.indexOf(baseName) == 0)
{
switch(formObj.elements[n].type)
{
case "select-one":
case "select-multiple":
for (var x = 0; x < formObj.elements[n].options.length; x++)
{
if (formObj.elements[n].options[x].selected)
attribArray[attribArray.length] = formObj.elements[n].options[x].value;
}
break;
case "radio":
case "checkbox":
if (formObj.elements[n].checked)
attribArray[attribArray.length] = formObj.elements[n].value;
break;
case "text":
case "textarea":
if (formObj.elements[n].value.replace(/\s/g, "").length > 0)
{
var name = formObj.elements[n].name.split("-");
if (name.length == 3)
attribArray[attribArray.length] = name[2] + "=" + escape(formObj.elements[n].value);
}
break;
}
}
}
}
if(currentName.length > 0)
{
var prodArray = currentName.split(",")
for (var n = 0; n < prodArray.length; n++)
{
var inputsMatch = true;
var localFound = false;
var item = prodArray[n].split(":")
if (item.length == 2)
item[2] = "";
if (item.length == 3)
{
if (item[0] == itemID && item[2] == attribArray.join("&"))
{
var newQty = parseInt(item[1]) + parseInt(itemQty)
newProdArray[newProdArray.length] = item[0] + ":" + newQty + ":" + item[2];
bFound = true;
}
else if (item[0] != 'm')
newProdArray[newProdArray.length] = item[0] + ":" + item[1] + ":" + item[2];
}
}
}
if (!bFound)
{
newProdArray[newProdArray.length] = itemID + ":" + itemQty + ":" + attribArray.join("&");
}
var cookie = newProdArray.join(",");
_eceWriteCookie (cookie);
// if (document.getElementById && !_ecePostAddLink)
// linkThrough = false;
var postAddLink = (_ecePostAddLink ? _ecePostAddLink : location.href);
if (linkThrough)
location.href = postAddLink;
else
{
if (typeof(this._eceDisplayMiniCart) != 'undefined')
{
if (typeof(this._eceDisplayMiniCart) == 'function')
_eceDisplayMiniCart(true);
}
}
}
function _eceWriteProduct(useQty, useProductInfo)
{
var _ecePostAddLink = escape(_g_ecePostAddLink);
for (var n = 0; n < _g_eceProductArray.length; n++)
{
document.writeln('');
}
}
_eceWriteProduct(false, false);