var t = true; var f = false; var loaded = f; var u = 'undefined'; function de(id) { return document.getElementById(id); } function db() { return document.body; } var IsOlderIE = f; if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { IsOlderIE = new Number(RegExp.$1) < 7 ? t : f; } var fltr = IsOlderIE; var fltrv = 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader'; var HDDs = ''; var SearchTextDefault = 'Enter keyword or item number'; var cCo = null; var MsgTOCart, MsgTODeals, MsgTOSrch, MsgTOCs, MsgTOCsE, MsgTONavRef, MsgTONavDim; var MsgOnTOD = 200; var MsgOffTOD = 300; var navExp = new Array(-1, ''); var fcO = {}; fcO.fcC = function fcC() { }; fcO.MsgBxC = ''; var MsgCartClk = f; var MsgDealsClk = f; var MsgCsEClk = f; var MsgCsClk = f;
function MsgAutoShip(e) { var AutoShipMsg = '<div class="cf"><div class="right"><img src="/Images/AutoShip-Logo-S-T.gif" width="120" height="49" border="0" style="margin-left:10px" /></div><div class="fA fs3 txtB col1">Save time, save money and never run out of your favorite supplements and personal care items again!</div></div><div class="fA fs3 txtB col1" style="margin-top:15px;">Vitacost\'s AutoShip! program is free, flexible and will always keep you well-stocked.</div><div class="cf"><div class="left" style="width:49%;"><div style="margin:15px 7px 0 0;">AutoShip! is the most convenient, cost-effective way to reorder the products you use the most. Simply select the items you want along with the shipping schedule you prefer and we will take care of the rest - at no extra cost!</div><div style="margin:15px 7px 0 0;">Your card will be billed when we ship your order. You can change or cancel your AutoShip! order at anytime just by contacting us. Also, feel confident in knowing that your order is fully covered by our hassle-free 5-Star Money Back Guarantee.</div><div class="txtB" style="margin:15px 7px 0 0;">With all of these great perks, why wait? Join today!<div> <a href="javascript:;" onClick=redirect("/Autoship");>Learn more</a></div></div></div><div class="left" style="width:51%;"><div style="margin:18px 0 0 8px; border:solid 1px #666666;background-color:#FFFFFF;padding:10px;"><div class="txtB">Why choose Vitacost\'s AutoShip! Program?</div><b><ul class="linkList0 col1" style="margin-top:8px;"><li>Enjoy exclusive special offers not available to the public</li><li>Set your own schedule by choosing 15, 30, 45 or higher day shipping intervals</li><li>Never run out of your favorite products!</li></ul></b></div></div><div class="left" style="width:51%;"><div style="margin:18px 0 5px 8px; border:solid 1px #666666;background-color:#FFFFFF;padding:10px;"><img src="/Images/AutoShip-Save.gif" width="170" height="70" style="margin:0 20px 0 10px" /></div></div></div>'; VitacostMsgBox('AutoShipMsgBox', 500, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, AutoShipMsg, 'BackgroundColor=FDFDEA;Padding=15;ShowCloseLink=True'); }
function MsgCSC(e) { var CSCMsg = '<div style="margin-bottom:14px;"><div>The card security code (CSC) is a unique three or four-digit number printed on your debit/credit card. Some card issuers refer to this number as the "Card Security Code", "Personal Security Code" or as "Card Verification Value".</div><div style="padding:10px 0 10px 0">Examples:</div><div class="cf"><div class="left" style="width:145px;"><div style="padding-right:6px;"><div style="margin-bottom:3px;">Visa, MasterCard<br>and Discover</div><div><img src="/images/cc-cscB.gif" width="139" height="87" border="0"></div></div></div><div class="right" style="width:145px;"><div style="padding-left:6px;"><div style="margin-bottom:3px;"> <br>American Express</div><div><img src="/images/cc-cscF.gif" width="139" height="87" border="0"></div></div></div></div></div>'; VitacostMsgBox('CSCMsgBox', 335, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, CSCMsg, 'BackgroundColor=FDFDEA;Padding=15;ShowCloseLink=True'); }
function MsgShipping(e) { var ShipMsg = '<div style="margin-bottom:14px;"><div class="fs1 txtB" style="color:#BD0000"><img src="/Images/VitacostBox1-YB.gif" border="0" align="right"/><div class="fs3 txtB">SPECIAL ORDER ITEM </div><br />This product usually ships within 7-14 days.</div><br><div>This item is not typically stocked in our warehouse, however, we are pleased to special order it for you. <br /><br /> Please note this item usually requires additional processing time.<br></div></div>'; VitacostMsgBox('ShippingMsgBox', 335, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, ShipMsg, 'BackgroundColor=FDFDEA;Padding=15;ShowCloseLink=True'); }
var fromUserSCVI = true;
function MsgShippingVIAdd(e, btnID) { if (fromUserSCVI) { var ShipMsgSCVI = '<div style="margin-bottom:14px;"><div class="fs1 txtB" style="color:#BD0000"><img src="/Images/VitacostBox1-YB.gif" border="0" align="right"/><div class="fs3 txtB">SPECIAL ORDER ITEM </div><br />This product usually ships within 7-14 days.</div><br><div>This item is not typically stocked in our warehouse, however, we are pleased to special order it for you. <br /><br /> Please note this item usually requires additional processing time.<br></div></div><div class="txtC"><a href="javascript:;" onclick="javascript:fromUserSCVI=false;document.getElementById(\'' + btnID + '\').click();" class="">Click to Proceed</a></div>'; VitacostMsgBox('ShippingMsgBoxSCVI', 335, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, ShipMsgSCVI, 'BackgroundColor=FDFDEA;Padding=15'); return false; } else { return true } }
function MsgShippingVIProceed(e, btnID) { if (fromUserSCVI) { var ShipMsgSCVI = '<div style="margin-bottom:14px;"><div class="fs1 txtB" style="color:#BD0000"><img src="/Images/VitacostBox1-YB.gif" border="0" align="right"/>ORDER ALERT</div><br><div><b>Your order contains Special Order item(s)</b><br /><br />This item(s) is not typically stocked in our warehouse, and requires additional processing.<br /><br /><span style="color:Red">Please note Special Order items usually ship within 7-14 days.</span><br /></div></div><div class="txtC"><a href="javascript:;" onclick="javascript:fromUserSCVI=false;document.getElementById(\'' + btnID + '\').click();" class="">Click to Proceed</a></div>'; VitacostMsgBox('ShippingMsgBoxSCVI', 335, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, ShipMsgSCVI, 'BackgroundColor=FDFDEA;Padding=15'); return false; } else { return true } }
function MsgVI(e, VIBuyLnk) { var ShipMsg = '<div style="margin-bottom:14px;"><div class="fs1 txtB" style="color:#BD0000"><img src="/Images/VitacostBox1-YB.gif" border="0" align="right"/><div class="fs3 txtB">SPECIAL ORDER ITEM </div><br />This product usually ships within 7-14 days.</div><br><div>This item is not typically stocked in our warehouse, however, we are pleased to special order it for you. <br /><br /> Please note this item usually requires additional processing time.<br /><br /><div class="txtC"><a href="' + VIBuyLnk + '" class="">Click to Proceed</a></div></div></div>'; VitacostMsgBox('ShippingMsgBox', 335, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, ShipMsg, 'BackgroundColor=FDFDEA;Padding=15;'); }
function MsgSourceCode(e) { var SourceCodeMsg = '<div style="margin-bottom:14px;"><ul class="linkList3"><li>Source codes are used for promotional offers that may include additional discounts, gift with purchase, etc.</li><li>Source codes are not required for check out.</li><li>If you do not have a Source code, leave the field blank.</li><li>All Source Codes have restrictions and expiration dates. Please be sure to review details associated with the Source Code you are using.</li></ul></div>'; VitacostMsgBox('SourceCodeMsgBox', 335, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, SourceCodeMsg, 'BackgroundColor=FDFDEA;Padding=15;ShowCloseLink=True'); }
function MsgSSL(e, PrivacyLink) { var SSLMsg = '<div style="margin-bottom:12px;"><b>Vitacost\'s Security Features:</b><br><br>Vitacost guarantees your privacy. We are a Comodo Secure Site, which means your confidential information is also protected. We employ the Internet\'s strongest security technologies, including Secure Sockets Layer (SSL) and Comodo. The information is encrypted on your computer, sent through the Internet as jumbled code, and decoded on Vitacost.com\'s secure server. It cannot be read in transit.<br><br>To read our full Privacy Policy, please <a href="' + PrivacyLink + '" target="_blank">click here</a>.</div><div class="sepH" style="margin-bottom:10px;"></div>'; VitacostMsgBox('SSLMsgBox', 360, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, SSLMsg, 'BackgroundColor=FDFDEA;Padding=15;ShowCloseLink=True'); }
function MsgORAC(e) { var ORACMsg = '<div style="padding-bottom:10px;">ORAC (Oxygen Radical Absorbance Capacity) is an assay measuring the free radical scavenging capacity of botanical sources for human consumption. The USDA estimates that the average person needs 3,000-5,000 ORAC units per day in order to generate enough free radical scavenging capacity for significantly protecting plasma and tissue. Most Americans have a daily intake of 1,200 ORAC units only.</div>'; VitacostMsgBox('ORACMsgBox', 375, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, ORACMsg, 'BackgroundColor=FDFDEA;Padding=10;ShowCloseLink=True'); }
function MsgTOC(TOO) { if (TOO) { clearTimeout(TOO); } }
function MsgFCFnc(id) { fcO.fcC = function fcC() { VitacostMsgBoxRemove(id) }; fcO.MsgBxC = id }
function MsgFC(id) { if (fcO.MsgBxC != id) { fcO.fcC(); } }
function MsgSrch(id, to) { if (!loaded) { return; } MsgTOC(MsgTOSrch); if (de('SrchMsgBox')) { MsgSearchFC(); } if (!de('SrchMsgBox') && (typeof (previousSearches) != u || typeof (searchWithinResults) != u)) { if (!to) { MsgTOSrch = setTimeout(function() { MsgSrch(id, t) }, MsgOnTOD); return; } MsgSearchFC(); var SearchTextCnt = '<div class="nAt-SH cf">'; if (typeof (searchWithinResults) != u) { SearchTextCnt += '<div class="sepH"></div><table cellpadding="0" cellspacing="0" border="0"><tr><td class="nAt-SHswrChk"><input type="checkbox" name="spSWR"' + (de('spSWRvar') ? ' checked="checked"' : '') + ' onClick="MsgSrchWR(this);" /></td><td class="nAt-SHswrTxt">Search within results</td></tr></table>'; } if (typeof (previousSearches) != u) { SearchTextCnt += '<div class="sepH"></div><span>Previous searches:</span><ul class="linkList0">'; for (i = 0; i < previousSearches.length; i++) { SearchTextCnt += '<li><a href="' + PPDNS + previousSearches[i][1] + '"' + ESCMoc + '>' + previousSearches[i][0] + '</a>' + (previousSearches[i][1].indexOf('Ntk=articles') > -1 ? ' (Health Library)' : '') + '</li>'; } SearchTextCnt += '</ul>' } SearchTextCnt += '</div>'; VitacostMsgBoxBottomAttached('SrchMsgBox', de('NttTBW').clientWidth - 2, ElPos(de('NttTBW')).x - 1, ElPos(de('NttTBW')).y + 21, f, f, f, SearchTextCnt, 'BackgroundStyle=#FFFFFF;', 'blk', 'MsgTOC(MsgTOSrch);de(\'SrchMsgBox\').isHovered=true;', 'de(\'SrchMsgBox\').isHovered=false; MsgSearchMO(event,\'' + id + '\',\'NttTBW\');'); } }
function MsgSrchWR(cb) { var frm = document.forms['ProductSearch']; if (cb.checked) { var objFormVar = document.createElement('input'); objFormVar.id = 'spSWRvar'; objFormVar.type = 'hidden'; objFormVar.name = 'within'; objFormVar.value = 'withinResults'; frm.appendChild(objFormVar); } else if (de('spSWRvar')) { frm.removeChild(de('spSWRvar')); } }
function MsgSearchMO(e, id, ids, to) { if (!de(id).hasFocus) { MsgTOC(MsgTOSrch); if (de('SrchMsgBox') && !to) { var e2 = new ObjC(e); MsgTOSrch = setTimeout(function() { MsgSearchMO(e2, id, ids, t) }, MsgOffTOD); return; } VitacostMsgBoxRemoveOnMouseOut(e, 'SrchMsgBox', ids) }; }
function MsgSearchFC() { if (fcO.MsgBxC != 'SrchMsgBox') { fcO.fcC(); } fcO.fcC = function fcC() { VitacostMsgBoxRemove('SrchMsgBox') }; fcO.MsgBxC = 'SrchMsgBox' }
function MsgNavRefExp(e, i, o) { if (!loaded) { return; } if (typeof (navExps) != u) { if (navExp[1] != '') { de('navRefCnr' + navExp[0]).innerHTML = navExp[1]; navExp[1] = ''; } if (de('RefMsgBox')) { VitacostMsgBoxRemove('RefMsgBox'); } var navRefCnr = de('navRefCnr' + i); if (i < navExps.length - 1) { MsgNavRefCss(navExps.length - 1, f); } navExp[0] = i; navExp[1] = navRefCnr.innerHTML; var refIS = 3; var c = (navExps[i].length - refIS) / 3; var Cs = 3; var rPC; if (c < 8) { Cs = 1; rPC = c; } else if (c < 13) { Cs = 2; if (c < 11) { rPC = 5; } else { rPC = 5 + c - 10; } } else if (c % 3 == 0) { rPC = c / 3; } else { rPC = parseInt(c / 3) + 1; } var over30H = 216; var navCol = '<li><a class="nAl-RefExp" onClick="MsgNavRefCol(event,' + i + ',this); return false;" href="/">Show less...</a></li>'; if (c < 31) { if (navExps[i][0] == '') { navExps[i][0] = MsgNavExpEx(navExps[i], c, 1, rPC, refIS) + navCol; } navRefCnr.innerHTML = navExps[i][0]; } else { navRefCnr.innerHTML = '<div style="height:' + over30H + 'px"><div></div></div>' + navCol; } if (Cs > 1) { var refC = de('A_LN_REFS'); var refDC = de('navRefCnr' + i); var refX = ElPos(refC).x + refC.clientWidth; var refY = ElPos(refDC).y - 13; var refW = 196; var refCnt = ''; var refLstH = navRefCnr.clientHeight; if (navExps.length - 1 == i) { over30H += 12; MsgNavRefCss(i, t); } if (Cs == 2) { if (navExps[i][1] == '') { refCnt = '<div class="nAl-RefsEx cf"><div class="right" style="width:1px;height:' + (navExps.length - 1 == i ? navRefCnr.clientHeight + 12 : navRefCnr.clientHeight) + 'px;"><div></div></div><div style="float:left;width:' + (refW - 1) + 'px;"><div style="margin:11px 0 6px 0;"><ul class="linkList6">' + MsgNavExpEx(navExps[i], c, 2, rPC, refIS) + '</ul></div></div></div>'; } } else if (Cs == 3) { refW = 392; if (c > 30) { refW += 24 } if (navExps[i][1] == '') { if (c > 30) { var cntX = -214; refCnt = '<div class="nAl-RefsEx cf"><div class="right" style="width:1px;height:' + (over30H + 21) + 'px"><div></div></div><div style="width:' + (refW - cntX - 7) + 'px;position:absolute;left:' + cntX + 'px;background-color:#000000;margin:10px 0 11px 0;"><div style="margin:1px 1px 1px 1px;background-color:#FFFFFF;"class="cf"><div style="position:absolute;width:230px;height:7px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/crt-iShT.png\');' : 'background:url(/Images/NavA/crt-iShT.png) no-repeat;') + '"><div></div></div><div style="position:absolute; top:8px; width:8px; height:' + (over30H - 12) + 'px; ' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/crt-iShL.png\');' : 'background:url(/Images/NavA/crt-iShL.png) repeat-y;') + '"><div></div></div><div style="position:absolute; top:' + (over30H - 4) + 'px; width:230px; height:5px; ' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/crt-iShB.png\');' : 'background:url(/Images/NavA/crt-iShB.png) no-repeat;') + '"><div></div></div><div style="height:' + over30H + 'px;overflow:auto;padding-left:8px;"><div style="float:left;width:204px;"><ul class="linkList6">' + MsgNavExpEx(navExps[i], c, 1, rPC, refIS) + '</ul></div><div style="float:left;width:196px;"><ul class="linkList6">' + MsgNavExpEx(navExps[i], c, 2, rPC, refIS) + '</ul></div><div style="float:left;width:196px;"><ul class="linkList6">' + MsgNavExpEx(navExps[i], c, 3, rPC, refIS) + '</ul></div></div></div></div></div>'; } else { refCnt = '<div class="nAl-RefsEx cf"><div class="right"><div style="width:1px;height:' + (navExps.length - 1 == i ? navRefCnr.clientHeight + 12 : navRefCnr.clientHeight) + 'px"></div></div><div style="float:left;width:' + (refW / 2) + 'px;margin:11px 0 6px 0;"><ul class="linkList6">' + MsgNavExpEx(navExps[i], c, 2, rPC, refIS) + '</ul></div><div style="float:left;width:' + (refW / 2 - 1) + 'px;margin:11px 0 6px 0;"><ul class="linkList6">' + MsgNavExpEx(navExps[i], c, 3, rPC, refIS) + '</ul></div></div>'; } } } if (navExps[i][1] == '') { if (navExps.length - 1 == i) { refCnt += '<div style="width:133px;height:2px;position:absolute;left:-133px;"><img src="/Images/NavA/msgBx-blk-RbrBex.gif" width="133" height="2" border="0" /></div>'; } navExps[i][1] = refCnt; var objTempCsCnt = document.createElement('div'); objTempCsCnt.id = 'RefExCnt' + i; objTempCsCnt.style.position = 'absolute'; objTempCsCnt.style.top = '0'; objTempCsCnt.style.visibility = 'hidden'; objTempCsCnt.style.width = refW; objTempCsCnt.innerHTML = refCnt; db().appendChild(objTempCsCnt); if (refY + objTempCsCnt.clientHeight + (navExps.length - 1 == i ? 0 : 30) > ElPos(refC).y + refC.clientHeight) { navExps[i][2] = ElPos(refC).y + refC.clientHeight - objTempCsCnt.clientHeight - (navExps.length - 1 == i ? 0 : 30); if (parseInt(navExps[i][2]) < ElPos(refC).y) { navExps[i][2] = ElPos(refC).y } } db().removeChild(objTempCsCnt); objTempCsCnt = null; } if (navExps[i][2] != '') { refY = parseInt(navExps[i][2]); } VitacostMsgBoxRightAttached('RefMsgBox', refW, refX, refY, f, f, f, navExps[i][1], 'BackgroundStyle=#F3F4F8;', 'blk', null, 'MsgNavRefMO(event,' + i + ');'); } } }
function MsgNavRefCol(e, i, o) { de('navRefCnr' + i).innerHTML = navExp[1]; navExp[0] = -1; navExp[1] = ''; if (de('RefMsgBox')) { VitacostMsgBoxRemove('RefMsgBox'); MsgNavRefCss(i, f); } }
function MsgNavRefMO(e, i, to) { MsgTOC(MsgTONavRef); if (de('RefMsgBox') && !to) { var e2 = new ObjC(e); MsgTONavRef = setTimeout(function() { MsgNavRefMO(e2, i, t) }, MsgOffTOD); return; } if (VitacostMsgBoxRemoveOnMouseOut(e, 'RefMsgBox', 'navDimCnr' + i, f)) { if (parseInt(navExp[0]) == i && navExp[1] != '') { de('navRefCnr' + i).innerHTML = navExp[1]; navExp[0] = -1; navExp[1] = ''; } MsgNavRefCss(i, f); } }
function MsgNavDimMO(e, i, to) { if (navExp[0] == i && !MouseOutToContains(e, 'navDimCnr' + i + ',RefMsgBox')) { de('navRefCnr' + i).innerHTML = navExp[1]; navExp[0] = -1; navExp[1] = ''; if (de('RefMsgBox')) { VitacostMsgBoxRemove('RefMsgBox'); MsgNavRefCss(i, f); } } }
function MsgNavRefCss(i, f) { if (navExps.length - 1 == i) { if (f) { de('A_LN_REFS_BXC').className = 'cf'; } else { de('A_LN_REFS_BXC').className = 'nAl-BxCRB cf'; } } }
function MsgNavExpEx(nEs, c, C, rPC, refIS) { var navExpEx = ''; C--; for (j = C * rPC; j < C * rPC + rPC; j++) { navExpEx += '<li><a href="' + navExpRefHref.replace('[eneN]', nEs[j * 3 + refIS + 1]) + '">' + nEs[j * 3 + refIS] + '</a> (' + nEs[j * 3 + refIS + 2] + ')</li>'; if (j == c - 1) { break; } } return navExpEx; }
function MsgCart(coLnk, to) { if (!loaded) { return; } if (MsgCartClk) { return; } MsgTOC(MsgTOCart); if (!de('CartMsgBox')) { if (!to) { MsgTOCart = setTimeout(function() { MsgCart(coLnk, t) }, MsgOnTOD); return; } if (fcO.MsgBxC != 'CartMsgBox') { fcO.fcC(); } fcO.fcC = function fcC() { VitacostMsgBoxRemove('CartMsgBox') }; fcO.MsgBxC = 'CartMsgBox'; var nAt = de('A_TN'); var nAtin = de('A_TN_S2B'); var cW = 405; if (typeof (mCIs) != u && parseInt(mCIs[1]) > mCIsmc) { cW = 442; } var cX = ElPos(nAt).x + nAt.clientWidth - (cW + 3); var cY = ElPos(nAt).y + nAt.clientHeight; var cBtn = de('A_TN_BtnCart'); var sBtn = de('A_TN_BtnSearch'); var CartCnt = '<div style="position:absolute;left:' + (ElPos(sBtn).x + sBtn.clientWidth - cX - 3) + 'px;top:' + (ElPos(cBtn).y + 10 - cY) + 'px;width:' + (ElPos(cBtn).x - ElPos(sBtn).x - sBtn.clientWidth + 3) + ';height:' + (cBtn.clientHeight - 10) + 'px;"><div></div></div><div style="position:absolute;left:' + parseInt(cW / 3) + 'px;top:' + (ElPos(cBtn).y + cBtn.clientHeight - cY) + 'px;width:' + ((cW + 10) - parseInt(cW / 3)) + 'px;height:' + (cY - ElPos(cBtn).y - cBtn.clientHeight) + 'px;"><div></div></div><div style="position:absolute;left:1px;top:' + (ElPos(nAtin).y + nAtin.clientHeight - cY) + 'px;width:' + (cW + 2) + 'px;height:' + (cY - (ElPos(nAtin).y + nAtin.clientHeight)) + 'px;background-color:#FFFFFF;"><div></div></div>'; var BackgroundStyle = 'url(/Images/NavA/crt-bg.gif) right;'; if (typeof (mCIs) != u && parseInt(mCIs[2]) > 0) { CartCnt += '<div class="cf" style="padding:0 0 5px 10px;"><div style="float:right;width:122px;"><div class="txtC" style="margin-right:10px;"><div class="txtB">' + mCIs[2] + ' item' + (parseInt(mCIs[2]) > 1 ? 's' : '') + ' in cart</div><div class="sepH" style="margin:5px 0 5px 0;"></div>Subtotal: ' + mCIs[3] + (mCIs[4] == '$0.00' ? '' : '<br>Savings: ' + mCIs[4]) + '<a href="' + coLnk + '"' + ESCMoc + '><img src="/Images/NavA/Checkout.gif" width="109" height="32" border="0" alt="Checkout" style="margin-top:10px;" /></a></div></div>'; if (parseInt(mCIs[1]) > mCIsmc) { var iH = 260; CartCnt += '<div style="float:left;width:' + (cW - 150) + 'px;margin-right:9px;background-color:#000000;"><div style="margin:1px 1px 1px 1px;background-color:#FFFFFF;" class="cf"><div style="position:absolute;width:230px;height:7px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/crt-iShT.png\');' : 'background:url(/Images/NavA/crt-iShT.png) no-repeat;') + '"><div></div></div><div style="position:absolute;top:8px;width:8px;height:' + (iH - 12) + 'px; ' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/crt-iShL.png\');' : 'background:url(/Images/NavA/crt-iShL.png) repeat-y;') + '"><div></div></div><div style="position:absolute;top:' + (iH - 4) + 'px;width:230px;height:5px; ' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/crt-iShB.png\');' : 'background:url(/Images/NavA/crt-iShB.png) no-repeat;') + '"><div></div></div><div style="height:' + iH + 'px;overflow:auto;" class="cf"><div style="padding:8px 9px 6px 9px;">' + mCIs[0] + '</div></div></div></div>'; } else { CartCnt += '<div style="float:left;width:' + (cW - 150) + 'px;">' + mCIs[0] + '</div>'; } CartCnt += '</div>'; } else { CartCnt += '<div class="txtC txtB" style="padding:15px 0 20px 0;">Your Shopping Cart is empty.</div>'; BackgroundStyle = '#FFFFFF;'; } VitacostMsgBoxBottomAttached('CartMsgBox', cW, cX, cY, f, f, f, CartCnt, 'BackgroundStyle=' + BackgroundStyle, 'red', 'MsgTOC(MsgTOCart);', 'MsgCartMO(event);'); } }
function MsgCartMO(e, to) { MsgCartClk = f; MsgTOC(MsgTOCart); if (de('CartMsgBox') && !to) { var e2 = new ObjC(e); MsgTOCart = setTimeout(function() { MsgCartMO(e2, t) }, MsgOffTOD); return; } VitacostMsgBoxRemoveOnMouseOut(e, 'CartMsgBox', 'A_TN_BtnCart'); }
function MsgDeals(dLnk, to) { if (!loaded) { return; } if (MsgDealsClk) { return; } MsgTOC(MsgTODeals); if (!de('DealsMsgBox') && typeof (dealsItems) != u) { if (!to) { MsgTODeals = setTimeout(function() { MsgDeals(dLnk, t) }, MsgOnTOD); return; } MsgFC('DealsMsgBox'); MsgFCFnc('DealsMsgBox'); var dIcn = de('A_TN_S2BDI'); var bbgImg = db().currentStyle ? db().currentStyle.backgroundImage : getComputedStyle(db(), '').getPropertyValue('background-image'); var dW = 341; var dLIcnW = 64; var dX = (ElPos(dIcn).x + parseInt(dIcn.clientWidth / 2)) - parseInt(dW / 2); var dY = ElPos(dIcn).y - 1; var DealsCnt = '<div class="cf"><div class="left txtB txtR fs2" style="width:' + (dW / 2 - dLIcnW / 2 - 8) + ';"><div style="padding:22px 5px 0 0;">New Deals.</div></div><div class="left"><a href="' + dLnk + '"><img src="/Images/NavA/New-Deals-Chest.gif" width="63" height="70" border="0" /></a></div><div class="left txtB fs2" style="width:' + (dW / 2 - dLIcnW / 2 + 8) + ';"><div style="padding:22px 0 0 4px;">More Savings.</div></div></div>' + dealsItems + '<div style="margin-bottom:10px;" class="txtC"><a href="' + dLnk + '"' + ESCMoc + ' class="link7">Show all</a></div>'; VitacostMsgBoxBottomAttached('DealsMsgBox', dW, dX, dY, f, f, f, DealsCnt, 'BackgroundStyle=#FFFFFF' + (bbgImg == 'none' ? '' : ' ' + bbgImg.replace(/"/g, '') + ' -' + (dX + 2) + 'px -' + (dY) + 'px repeat-x;'), 'red', 'MsgTOC(MsgTODeals);', 'MsgDealsMO(event);'); } }
function MsgDealsMO(e, to) { MsgDealsClk = f; MsgTOC(MsgTODeals); if (de('DealsMsgBox') && !to) { var e2 = new ObjC(e); MsgTODeals = setTimeout(function() { MsgDealsMO(e2, t) }, MsgOffTOD); return; } if (VitacostMsgBoxRemoveOnMouseOut(e, 'DealsMsgBox', null)) { fcO.fcC = function fcC() { } }; }
function MsgCs(e, i, o, to) { if (!loaded) { return; } if (MsgCsClk) { return; } if (!to) { MsgTOC(MsgTOCs); MsgTOCs = setTimeout(function() { MsgCs(e, i, o, t) }, MsgOnTOD); return; } if (!de('SubCsMsgBox')) { fcO.fcC(); } fcO.fcC = function fcC() { VitacostMsgBoxRemove('SubCsMsgBox') }; if (de('SubCsMsgBox')) { MsgCsMO(null); } if (typeof (subCs) != u) { cCo = o; var cs = parseInt(subCs[i][4]); var csCW = 171; var cfpCW = 175; var csW = 0; var subCsPC = parseInt(subCsMax / 2) == subCsMax / 2 ? subCsMax / 2 : parseInt(subCsMax / 2) + 1; if (subCs[i][subCs[i].length - 1] != '') { csW += cfpCW; } if (cs > 0) { csW += csCW; } if (cs > subCsPC + 2) { csW += csCW; } if (csW > 0) { csW += 15; var csC = de('A_LN_C'); var csX = ElPos(csC).x + csC.clientWidth; var csY = ElPos(o).y - 12; var CsCnt; if (subCs[i][0] == '') { var cspC1 = cs; var cspC2 = 0; if (cs > subCsPC && cs < subCsPC + 3) { cspC1 = cs; } else if (cs > subCsPC + 2) { cspC1 = cs < subCsMax ? parseInt(cs / 2) == cs / 2 ? cs / 2 : parseInt(cs / 2) + 1 : subCsPC; cspC2 = cs < subCsMax ? cs - cspC1 : subCsMax - cspC1; } CsCnt = (i == 0 ? '<img src="/Images/NavA/t-cmBrTShR.gif" width="54" height="15" style="position:absolute;left:0px;top:2px;" />' : '') + '<div style="background:url(/Images/NavA/l-cArw-Dts.gif) ' + (ElPos(csC).x + csC.clientWidth - ElPos(o).x - 7) + 'px ' + (o.clientHeight + 6) + 'px no-repeat;position:absolute;left:' + (ElPos(o).x - (ElPos(csC).x + csC.clientWidth)) + 'px;top:{CLNK}px;width:' + (ElPos(csC).x + csC.clientWidth - ElPos(o).x + 10) + 'px;height:' + (o.clientHeight + 19) + 'px;"><a href="' + o.href + '"' + ESCMoc + '><img src="/Images/clear.gif" border="0" style="width:' + (ElPos(csC).x + csC.clientWidth - ElPos(o).x + 10) + 'px;height:' + (o.clientHeight + 19) + 'px;" onmouseout="MsgCsMO(event);" /></a></div><div class="cf" style="margin-left:15px;"><div style="width:' + csCW + 'px" class="nAl-SCc"><ul class="linkList6">'; for (j = 0; j < cspC1 + cspC2; j++) { if (cs > subCsPC * 2 && j == cspC1 + cspC2 - 1) { CsCnt += '<li><a href="' + PPDNS + '/Categories#' + subCs[i][3] + '"' + ESCMoc + '><b>More...</b></a></li>'; } else { CsCnt += '<li><a href="' + PPDNS + '/' + subCs[i][j * 2 + 6] + '"' + ESCMoc + '>' + subCs[i][j * 2 + 5] + '</a></li>'; } if (j < cspC1 + cspC2 - 1 && j == cspC1 - 1) { CsCnt += '</ul></div><div style="width:' + csCW + 'px" class="nAl-SCc"><ul class="linkList6">'; } } CsCnt += '</ul></div>'; if (subCs[i][subCs[i].length - 1] != '') { CsCnt += '<div style="float:left; width:' + cfpCW + 'px">' + subCs[i][subCs[i].length - 1] + '</div>'; } CsCnt += '</div>'; subCs[i][0] = CsCnt; var objTempCsCnt = document.createElement('div'); objTempCsCnt.id = 'CsCnt' + i; objTempCsCnt.style.position = 'absolute'; objTempCsCnt.style.top = '0'; objTempCsCnt.style.visibility = 'hidden'; objTempCsCnt.style.width = csW; objTempCsCnt.innerHTML = CsCnt; db().appendChild(objTempCsCnt); if (csY + objTempCsCnt.clientHeight + 2 > ElPos(csC).y + csC.clientHeight) { subCs[i][1] = ElPos(csC).y + csC.clientHeight - objTempCsCnt.clientHeight - 2; subCs[i][0] = subCs[i][0].replace('{CLNK}', (ElPos(o).y - subCs[i][1] - 10)); } db().removeChild(objTempCsCnt); objTempCsCnt = null; } if (subCs[i][1] != '') { csY = parseInt(subCs[i][1]); de('A_LN_CshBc').style.visibility = 'visible'; } VitacostMsgBoxRightAttached('SubCsMsgBox', csW, csX, csY, f, f, f, subCs[i][0], 'BackgroundStyle=#FDFDEA;', 'red', 'MsgTOC(MsgTOCs);', 'MsgCsMO(event);'); o.className = 'nAl-SCinH'; } } }
function MsgCsMO(e, to) { MsgCsClk = f; MsgTOC(MsgTOCs); var Removed = f; if (e != null) { if (de('SubCsMsgBox') && !to) { var e2 = new ObjC(e); MsgTOCs = setTimeout(function() { MsgCsMO(e2, t) }, MsgOffTOD); return; } if (VitacostMsgBoxRemoveOnMouseOut(e, 'SubCsMsgBox', null)) { if (de('A_LN_CM')) { var MouseOutTo = e.toElement ? e.toElement : e.relatedTarget ? e.relatedTarget : null; if (MouseOutTo == null || !ElementContains(de('A_LN_CM'), MouseOutTo)) { MsgCsEHide(t); } } Removed = t; } } else { VitacostMsgBoxRemove('SubCsMsgBox'); Removed = t; } if (Removed) { if (cCo != null) { cCo.className = null; } de('A_LN_CshBc').style.visibility = 'hidden'; } }
function MsgCsMOC() { MsgTOC(MsgTOCs); }
function MsgCsE(e, o, to) { if (!loaded) { return; } if (MsgCsEClk) { return; } MsgTOC(MsgTOCsE); var CsM = de('A_LN_CM'); if (CsM && CsM.style.visibility != 'visible') { if (!to) { MsgTOCsE = setTimeout(function() { MsgCsE(e, o, t) }, MsgOnTOD); return; } de('A_TN_SCMT').className = 'nAt-cmBrTe'; de('A_TN_SCMTSH').className = 'nAt-cmBrTShe'; CsM.style.left = ElPos(o).x - 6; CsM.style.visibility = 'visible'; DDsHide('A_LN_CM'); } }
function MsgCsEMO(e, to) { MsgCsEClk = f; MsgTOC(MsgTOCsE); if (de('A_LN_CM')) { if (!to) { var e2 = new ObjC(e); MsgTOCsE = setTimeout(function() { MsgCsEMO(e2, t) }, MsgOffTOD); return; } if (VitacostMsgBoxRemoveOnMouseOut(e, 'A_LN_CM', 'SubCsMsgBox', t)) { if (de('SubCsMsgBox')) { MsgCsMO(null); } MsgCsEHide(f); } } }
function MsgCsEHide(Hide) { DDsRestore('A_LN_CM'); if (Hide) { de('A_LN_CM').style.visibility = 'hidden'; } de('A_TN_SCMT').className = 'nAt-cmBrTc'; de('A_TN_SCMTSH').className = 'nAt-cmBrTShc'; }
function trim(txt) { return Trim(txt); }
function Trim(txt) { return txt.replace(/^\s*|\s*$/g, ''); }
function SearchOnSubmit(txt, eid) { txt = txt.replace(/\**/g, ''); txt = txt.replace(/\%*/g, ''); txt = Trim(txt); if (txt == SearchTextDefault || txt == '') { return f; } de(eid).value = txt; return t; }
function SearchOnFocus(eid) { de(eid).hasFocus = t; if (Trim(de(eid).value) == SearchTextDefault) { de(eid).value = ''; } MsgSrch(eid); }
function SearchOnBlur(eid) { de(eid).hasFocus = f; if (Trim(de(eid).value) == '') { de(eid).value = SearchTextDefault; } if (de('SrchMsgBox') && !de('SrchMsgBox').isHovered) { VitacostMsgBoxRemove('SrchMsgBox'); } }
function VitacostMsgBox(BoxID, BoxWidth, BoxX, BoxY, BoxXCenter, BoxFit, BoxToggle, BoxMsg, BoxParameters) { CreateVitacostMsgBox(BoxID, BoxWidth, BoxX, BoxY, BoxXCenter, BoxFit, BoxToggle, BoxMsg, BoxParameters, '<table style="position:inherit;visibility:hidden;z-index:1;" id="VitacostMsgBoxx" width="200" height="1" cellpadding="0" cellspacing="0" border="0"><tr><td id="VitacostMsgBoxxBorder" colspan="2" style="background-color:#000000;"><div id="VitacostMsgBoxxBorderWidth" style="padding:1px;"><div id="VitacostMsgBoxxContents" style="background-color:#FFFFFF;"></div></div></td><td style="width:10px;"><table style="width:10px;height:100%;" cellpadding="0" cellspacing="0" border="0"><tr><td style="height:10px;' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/msgBx-str.png\');background:url(/Images/msgBx-str.png) 0px 0px no-repeat !important;background-image:none;"><div></div></td></tr><tr><td style="' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/msgBx-sr.png\');background:url(/Images/msgBx-sr.png) 0px 0px repeat !important;background-image:none;"><div></div></td></tr></table></td></tr><tr><td style="width:10px;height:10px;' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/msgBx-sbl.png\');background:url(/Images/msgBx-sbl.png) 0px 0px repeat !important;background-image:none;"><div></div></td><td style="width:' + (parseInt(BoxWidth) - 20) + 'px;height:10px;' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/msgBx-sb.png\');background:url(/Images/msgBx-sb.png) 0px 0px repeat !important;background-image:none;"><div></div></td><td style="width:10px;height:10px;' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/msgBx-sbr.png\');background:url(/Images/msgBx-sbr.png) 0px 0px repeat !important;background-image:none;"><div></div></td></tr></table>'); }
function VitacostMsgBoxBottomAttached(BoxID, BoxWidth, BoxX, BoxY, BoxXCenter, BoxFit, BoxToggle, BoxMsg, BoxParameters, BoxBorderColorID, BoxOnMouseOver, BoxOnMouseOut) { var BackgroundStyle = 'background:#FFFFFF;'; var TestBackground = GetParamVal(BoxParameters, 'BackgroundStyle'); if (TestBackground != null) { BackgroundStyle = 'background:' + TestBackground + ';'; } var ValidBoxBorderColorIDs = 'blk,blu,red'; var BBCID = 'blk'; if (ValidBoxBorderColorIDs.indexOf(BoxBorderColorID) > -1) { BBCID = BoxBorderColorID; } var BoxHTML = '<div style="position:inherit;visibility:hidden;z-index:1;width:' + (BoxWidth + 12) + 'px;" id="VitacostMsgBoxx"' + (BoxOnMouseOver != null && BoxOnMouseOver != '' ? ('onMouseOver="' + BoxOnMouseOver + '"') : '') + (BoxOnMouseOut != null && BoxOnMouseOut != '' ? ('onMouseOut="' + BoxOnMouseOut + '"') : '') + '><table cellpadding="0" cellspacing="0" border="0" style="width:' + (BoxWidth + 12) + 'px;"><tr><td style="width:2px;height:100%;"><table cellpadding="0" cellspacing="0" border="0" style="width:2px;height:100%;">' + (fltr ? '<tr><td style="' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-BbrL.png\');"></td></tr>' : '<tr><td><img src="/Images/NavA/msgBx-' + BBCID + '-BbrL.png" width="2" height="100%" border="0" /></td></tr>') + '<tr><td style="height:3px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-BbrLB.png\');' : '') + '">' + (fltr ? '' : '<img src="/Images/NavA/msgBx-' + BBCID + '-BbrLB.png" width="2" height="3" border="0" />') + '</td></tr></table></td><td style="width:' + BoxWidth + 'px;' + BackgroundStyle + '"><div style="float:left;width:' + BoxWidth + 'px;' + BackgroundStyle + '"><div id="VitacostMsgBoxxContents"></div><div class="cf">' + (fltr ? '<div style="float:right;width:3px;height:3px;' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-BbrRin.png\');"><div></div></div><div style="float:left;width:3px;height:3px;' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-BbrLin.png\');"><div></div></div>' : '<div style="float:right;"><img src="/Images/NavA/msgBx-' + BBCID + '-BbrRin.png" width="3" height="3" border="0" /></div><div style="float:left;"><img src="/Images/NavA/msgBx-' + BBCID + '-BbrLin.png" width="3" height="3" border="0" /></div>') + '</div></div></td><td style="width:2px;height:100%;"><table cellpadding="0" cellspacing="0" border="0" style="width:2px;height:100%;">' + (fltr ? '<tr><td style="' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-BbrR.png\');"></td></tr>' : '<tr><td><img src="/Images/NavA/msgBx-' + BBCID + '-BbrR.png" width="2" height="100%" border="0" /></td></tr>') + '<tr><td style="height:3px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-BbrRB.png\');' : '') + '">' + (fltr ? '' : '<img src="/Images/NavA/msgBx-' + BBCID + '-BbrRB.png" width="2" height="3" border="0" />') + '</td></tr></table></td><td style="width:8px;height:100%;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-BshR.png\');' : '') + '">' + (fltr ? '' : '<img src="/Images/NavA/msgBx-BshR.png" width="8" height="100%" border="0" />') + '</td></tr></table><div class="cf">' + (fltr ? '<div style="float:left;width:5px;height:2px;' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-BbrBL.png\');"><div></div></div>' : '<div style="float:left;"><img src="/Images/NavA/msgBx-' + BBCID + '-BbrBL.png" width="5" height="2" border="0" /></div>') + '<div style="float:left;"><img src="/Images/NavA/msgBx-' + BBCID + '-BbrB.png" width="' + (BoxWidth - 6) + '" height="2" border="0" /></div>' + (fltr ? '<div style="float:left;width:5px;height:2px;' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-BbrBR.png\');"><div></div></div><div style="float:left;width:8px;height:2px;' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-BshRB.png\');"><div></div></div>' : '<div style="float:left;"><img src="/Images/NavA/msgBx-' + BBCID + '-BbrBR.png" width="5" height="2" border="0" /></div><div style="float:left;"><img src="/Images/NavA/msgBx-BshRB.png" width="8" height="2" border="0" /></div>') + '</div><div class="cf">' + (fltr ? '<div style="float:left;width:9px;height:9px;' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-BshBL.png\');"><div></div></div><div style="float:left;width:' + (BoxWidth - 6) + 'px;height:9px;' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-BshB.png\');"><div></div></div><div style="float:left;width:9px;height:9px;' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-BshBR.png\');"><div></div></div>' : '<div style="float:left;"><img src="/Images/NavA/msgBx-BshBL.png" width="9" height="9" border="0" /></div><div style="float:left;"><img src="/Images/NavA/msgBx-BshB.png" width="' + (BoxWidth - 6) + '" height="9" border="0" /></div><div style="float:left;"><img src="/Images/NavA/msgBx-BshBR.png" width="9" height="9" border="0" /></div>') + '</div></div>'; CreateVitacostMsgBox(BoxID, BoxWidth + 12, BoxX, BoxY, BoxXCenter, BoxFit, BoxToggle, BoxMsg, BoxParameters, BoxHTML); }
function VitacostMsgBoxRightAttached(BoxID, BoxWidth, BoxX, BoxY, BoxXCenter, BoxFit, BoxToggle, BoxMsg, BoxParameters, BoxBorderColorID, BoxOnMouseOver, BoxOnMouseOut) { var BackgroundStyle = 'background:#FFFFFF;'; var TestBackground = GetParamVal(BoxParameters, 'BackgroundStyle'); if (TestBackground != null) { BackgroundStyle = 'background:' + TestBackground + ';'; } var ValidBoxBorderColorIDs = 'blk,blu,red'; var BBCID = 'blk'; if (ValidBoxBorderColorIDs.indexOf(BoxBorderColorID) > -1) { BBCID = BoxBorderColorID; } var BoxHTML = '<div style="position:inherit;visibility:hidden;z-index:1;width:' + (BoxWidth + 14) + 'px;" id="VitacostMsgBoxx"' + (BoxOnMouseOver != null && BoxOnMouseOver != '' ? ('onMouseOver="' + BoxOnMouseOver + '"') : '') + (BoxOnMouseOut != null && BoxOnMouseOut != '' ? ('onMouseOut="' + BoxOnMouseOut + '"') : '') + '><table cellpadding="0" cellspacing="0" border="0" style="width:' + (BoxWidth + 14) + 'px;height:100%;"><tr><td style="width:' + (BoxWidth + 3) + 'px;"><table cellpadding="0" cellspacing="0" border="0" style="width:' + (BoxWidth + 3) + 'px;height:100%;"><tr><td style="height:2px;"><div style="float:left;width:' + BoxWidth + 'px;height:2px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-RbrT.png\');' : '') + '">' + (fltr ? '<div></div>' : '<img src="/Images/NavA/msgBx-' + BBCID + '-RbrT.png" width="' + BoxWidth + '" height="2" border="0" />') + '</div><div style="float:left;width:3px;height:2px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-RbrTR.png\');' : '') + '">' + (fltr ? '<div></div>' : '<img src="/Images/NavA/msgBx-' + BBCID + '-RbrTR.png" width="3" height="2" border="0" />') + '</div></td></tr><tr><td style="' + BackgroundStyle + '"><table cellpadding="0" cellspacing="0" border="0" style="width:' + (BoxWidth + 3) + 'px;height:100%;"><tr><td style="width:' + BoxWidth + 'px;"><div id="VitacostMsgBoxxContents"></div></td><td style="width:3px;"><table cellpadding="0" cellspacing="0" border="0" style="width:3px;height:100%;"><tr><td style="height:3px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-RbrTRin.png\');' : '') + '">' + (fltr ? '' : '<img src="/Images/NavA/msgBx-' + BBCID + '-RbrTRin.png" width="3" height="3" border="0" />') + '</td></tr><tr><td></td></tr><tr><td style="height:3px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-RbrBRin.png\');' : '') + '">' + (fltr ? '' : '<img src="/Images/NavA/msgBx-' + BBCID + '-RbrBRin.png" width="3" height="3" border="0" />') + '</td></tr></table></td></tr></table></td></tr><tr><td style="height:2px;"><div style="float:left;width:' + BoxWidth + 'px;height:2px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-RbrB.png\');' : '') + '">' + (fltr ? '<div></div>' : '<img src="/Images/NavA/msgBx-' + BBCID + '-RbrB.png" width="' + BoxWidth + '" height="2" border="0" />') + '</div><div style="float:left;width:3px;height:2px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-RbrBR.png\');' : '') + '">' + (fltr ? '<div></div>' : '<img src="/Images/NavA/msgBx-' + BBCID + '-RbrBR.png" width="3" height="2" border="0" />') + '</div></td></tr><tr><td style="height:8px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-RshB.png\');' : '') + '">' + (fltr ? '' : '<img src="/Images/NavA/msgBx-RshB.png" width="' + (BoxWidth + 3) + '" height="8" border="0" />') + '</td></tr></table></td><td style="width:2px;"><table cellpadding="0" cellspacing="0" border="0" style="width:2px;height:100%;"><tr><td style="height:5px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-RbrRT.png\');' : '') + '">' + (fltr ? '' : '<img src="/Images/NavA/msgBx-' + BBCID + '-RbrRT.png" width="2" height="5" border="0" />') + '</td></tr><tr><td><img src="/Images/NavA/msgBx-' + BBCID + '-RbrR.png" width="2" height="100%" border="0" /></td></tr><tr><td style="height:5px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-' + BBCID + '-RbrRB.png\');' : '') + '">' + (fltr ? '' : '<img src="/Images/NavA/msgBx-' + BBCID + '-RbrRB.png" width="2" height="5" border="0" />') + '</td></tr><tr><td style="height:8px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-RshBR.png\');' : '') + '">' + (fltr ? '' : '<img src="/Images/NavA/msgBx-RshBR.png" width="2" height="8" border="0" />') + '</td></tr></table></td><td style="width:9px;"><table cellpadding="0" cellspacing="0" border="0" style="width:9px;height:100%;"><tr><td style="height:9px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-RshRT.png\');' : '') + '">' + (fltr ? '' : '<img src="/Images/NavA/msgBx-RshRT.png" width="9" height="9" border="0" />') + '</td></tr><tr><td' + (fltr ? ' style="' + fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-RshR.png\');"' : '') + '>' + (fltr ? '' : '<img src="/Images/NavA/msgBx-RshR.png" width="9" height="100%" border="0" />') + '</td></tr><tr><td style="height:9px;' + (fltr ? fltrv + '(enabled=true, sizingMethod=scale src=\'/Images/NavA/msgBx-RshRB.png\');' : '') + '">' + (fltr ? '' : '<img src="/Images/NavA/msgBx-RshRB.png" width="9" height="9" border="0" />') + '</td></tr></table></td></tr></table></div>'; CreateVitacostMsgBox(BoxID, BoxWidth + 12, BoxX, BoxY, BoxXCenter, BoxFit, BoxToggle, BoxMsg, BoxParameters, BoxHTML); }
function CreateVitacostMsgBox(BoxID, BoxWidth, BoxX, BoxY, BoxXCenter, BoxFit, BoxToggle, BoxMsg, BoxParameters, BoxHTML) { var MsgBoxHTML = BoxHTML; if (de(BoxID)) { if (BoxToggle) { VitacostMsgBoxRemove(BoxID); } return f; } var objMsgBox = document.createElement('div'); objMsgBox.id = BoxID; objMsgBox.style.position = 'absolute'; objMsgBox.innerHTML = MsgBoxHTML; db().appendChild(objMsgBox); de('VitacostMsgBoxx').id = BoxID + 'HTML'; de('VitacostMsgBoxxContents').id = BoxID + 'Contents'; if (de('VitacostMsgBoxxBorder')) { de('VitacostMsgBoxxBorder').id = BoxID + 'Border'; } if (de('VitacostMsgBoxxBorderWidth')) { de('VitacostMsgBoxxBorderWidth').id = BoxID + 'BorderWidth'; } if (BoxParameters != null) { var tbc = GetParamVal(BoxParameters, 'BackgroundColor'); var tpg = GetParamVal(BoxParameters, 'Padding'); var tcl = GetParamVal(BoxParameters, 'ShowCloseLink'); var tcva = GetParamVal(BoxParameters, 'CloseLinkVAlign'); var tca = GetParamVal(BoxParameters, 'CloseLinkAlign'); if (tbc != null) { de(BoxID + 'Contents').style.backgroundColor = tbc; } if (de(BoxID + 'Border')) { var TestBorderColor = GetParamVal(BoxParameters, 'BorderColor'); if (TestBorderColor != null) { de(BoxID + 'Border').style.backgroundColor = TestBorderColor; } } if (de(BoxID + 'BorderWidth')) { var tbw = GetParamVal(BoxParameters, 'BorderWidth'); if (tbw != null) { if (tbw.indexOf('px') == -1) { tbw += 'px'; } de(BoxID + 'BorderWidth').style.padding = tbw; } } if (tpg != null) { if (tpg.indexOf('px') == -1) { tpg += 'px'; } de(BoxID + 'Contents').style.padding = tpg; } if (tcl != null && tcl) { var BoxCloseLinkHTML = '<div id="' + BoxID + 'CloseLink" style="text-align:center;"><a href="javascript:;" onClick="VitacostMsgBoxRemove(\'' + BoxID + '\')" class="link4">Close</a></div>'; if (tca != null && (tca == 'Left' || tca == 'Right')) { BoxCloseLinkHTML = BoxCloseLinkHTML.replace('text-align:center;', 'text-align:' + tca + ';'); } if (tcva != null && tcva == 'Top') { BoxMsg = BoxCloseLinkHTML + BoxMsg; } else { BoxMsg += BoxCloseLinkHTML; } } } de(BoxID).style.width = BoxWidth; de(BoxID + 'HTML').width = BoxWidth; de(BoxID + 'Contents').innerHTML = BoxMsg; if (BoxXCenter) { BoxX = BoxX - parseInt(de(BoxID + 'HTML').clientWidth / 2); if (BoxX < 0) { BoxX = 0; } } var sx = db().scrollLeft; var sy = db().scrollTop; var bw = db().clientWidth + sx; var bh = db().clientHeight + sy; var mbw = de(BoxID + 'HTML').clientWidth; var mbh = de(BoxID + 'HTML').clientHeight; var shx = 0; var shy = 0; if (BoxFit) { if (BoxX + mbw > bw) { shx = BoxX + mbw - bw; if (BoxX - shx < -1) { BoxX = 0; shx = 0; } } if (BoxY + mbh > bh) { shy = BoxY + mbh - bh; if (BoxY - shy < -1) { BoxY = 0; shy = 0; } } } de(BoxID).style.left = BoxX - shx; de(BoxID).style.top = BoxY - shy; DDsHide(BoxID); de(BoxID + 'HTML').style.visibility = "visible"; }
function VitacostMsgBoxRemove(eid) { if (de(eid)) { db().removeChild(de(eid)); } DDsRestore(eid); }
function MouseOutToContains(e, eids) { var MouseOutTo = MouseOutToTarget(e); if (MouseOutTo == null) { return f; } var eidsArray = eids.split(','); for (i = 0; i < eidsArray.length; i++) { if (ElementContains(de(eidsArray[i]), MouseOutTo)) { return t; } } return f; }
function VitacostMsgBoxRemoveOnMouseOut(e, MouseOutElementID, NoMouseOutElementIDs, Hide) { if (!de(MouseOutElementID)) { return t; } var MouseOutTo = MouseOutToTarget(e); if (MouseOutTo == null) { if (Hide != null && Hide == t) { de(MouseOutElementID).style.visibility = 'hidden'; } else { VitacostMsgBoxRemove(MouseOutElementID); } return t; } if (NoMouseOutElementIDs != null) { var NoMouseOutElementIDsArray = NoMouseOutElementIDs.split(','); for (i = 0; i < NoMouseOutElementIDsArray.length; i++) { if (ElementContains(de(NoMouseOutElementIDsArray[i]), MouseOutTo)) { return f; } } } if (ElementContains(de(MouseOutElementID), MouseOutTo)) { return f; } if (Hide != null && Hide == t) { de(MouseOutElementID).style.visibility = 'hidden'; } else { VitacostMsgBoxRemove(MouseOutElementID); } return t; }
function MouseOutToTarget(e) { return e.toElement ? e.toElement : e.relatedTarget ? e.relatedTarget : null; }
function ObjC(o) { for (oi in o) { this[oi] = o[oi]; } }
function DDsHide(eid) { if (IsOlderIE) { var IdSet = f; for (fi = 0; fi > -1; fi++) { if (document.forms[fi]) { for (i = 0; i < document.forms[fi].elements.length; i++) { var fE = document.forms[fi].elements[i]; if (fE.nodeName == 'SELECT') { if (fE.id == '') { fE.id = 'fE_S_' + fi + '_' + i; } if (DetectCollision(fE.id, eid)) { if (!IdSet) { HDDs += (HDDs == '' ? '' : ';') + eid; IdSet = t; } HDDs += ',' + fE.id; fE.style.visibility = 'hidden'; } else if (fE.id.indexOf('fE_S_') == 0 && fE.style.visibility == 'visible') { fE.id = ''; } } } } else { break; } } } }
function DDsRestore(eid) { var lHDDs = HDDs; if (IsOlderIE && lHDDs != '') { var arrHDDs = lHDDs.split(';'); var EIDi = -1; for (i = 0; i < arrHDDs.length; i++) { if (arrHDDs[i].split(',')[0] == eid) { EIDi = i; break; } } if (EIDi > -1) { var DDIDs = arrHDDs[EIDi].split(','); var temp0 = DDIDs.shift(); var temp1 = arrHDDs.splice(EIDi, 1); if (arrHDDs.length > 0) { HDDs = arrHDDs.join(';'); } else { HDDs = ''; } var temp2 = ',' + arrHDDs.join(',') + ','; for (i = 0; i < DDIDs.length; i++) { if (de(DDIDs[i]) && temp2.indexOf(',' + DDIDs[i] + ',') == -1) { de(DDIDs[i]).style.visibility = 'visible'; if (DDIDs[i].indexOf('fE_S_') == 0) { de(DDIDs[i]).id = ''; } } } } } }
function ElementContains(Container, Containee) { while (Containee.parentNode) { if (Containee == Container) { return t; } Containee = Containee.parentNode; } return f; }
function GetParamVal(ParamsString, ParamName) { var ReturnVal = null; if (ParamsString != null && Trim(ParamsString).length > 0) { var arrParams = ParamsString.split(';'); for (i = 0; i < arrParams.length; i++) { if (arrParams[i].indexOf(ParamName + '=') == 0) { ReturnVal = (arrParams[i].split('='))[1]; break; } } } return ReturnVal; }
function MousePosition(e, ShiftRight, ShiftDown) { var mx = 0; var my = 0; if (e.pageX || e.pageY) { mx = e.pageX; my = e.pageY; } else if (e.clientX || e.clientY) { mx = e.clientX + db().scrollLeft; my = e.clientY + db().scrollTop; } if (ShiftRight) { mx += 15; } if (ShiftDown) { my += 24; } var xy = new Array(); xy.x = mx; xy.y = my; return xy; }
function ScreenCenter(TargetWidth, TargetApproxHeight) { var sx = db().scrollLeft; var sy = db().scrollTop; var BodyWidth = db().clientWidth + sx; var BodyHeight = db().clientHeight + sy; var xy = new Array(); xy.x = (BodyWidth / 2) - (TargetWidth / 2) + (sx / 2); xy.y = (BodyHeight / 2) - (TargetApproxHeight / 2) + (sy / 2); return xy; }
function ElPos(el) { var xy = new Array(); xy.x = 0; xy.y = 0; while (el.offsetParent) { xy.x += el.offsetLeft; xy.y += el.offsetTop; el = el.offsetParent; } return xy; }
function DetectCollision(id1, id2) { var el1 = de(id1); var el2 = de(id2); if (el1 && el2) { var ael1 = new Array(); var ael2 = new Array(); ael1.L = ElPos(el1).x; ael1.R = ael1.L + el1.offsetWidth; ael1.T = ElPos(el1).y; ael1.B = ael1.T + el1.offsetHeight; ael2.L = ElPos(el2).x; ael2.R = ael2.L + el2.offsetWidth; ael2.T = ElPos(el2).y; ael2.B = ael2.T + el2.offsetHeight; if (ael1.L > ael2.R || ael2.L > ael1.R || ael1.T > ael2.B || ael2.T > ael1.B) { return f; } else { return t; } } else { return f; } return f; }
function URLEncode(StrToEncode) { return (escape(Trim(StrToEncode)).replace(/%20/g, '+')); }
function Log(txt) { if (!de('LogBox')) { VitacostMsgBox('LogBox', 300, db().clientWidth + db().scrollLeft - 320, 10, f, f, f, 'JS Output:<br>', 'BackgroundColor=FDFDEA;Padding=5;ShowCloseLink=True;CloseLinkAlign=Right;CloseLinkVAlign=Top'); } de('LogBoxContents').innerHTML += txt + '<br>'; }

function TranslatePage(Lang) {
    if (Lang == "" || !(Lang == "es" || Lang == "fr" || Lang == "ja" || Lang == "zh" || Lang == "pt" || Lang == "ar")) {
        return;
    }
    if (typeof (ExitingSite) != u) { ExitingSite = f; }
    document.location.href = "http://www.systranlinks.com/trans?lp=en_" + Lang + "&url=http%3A%2F%2Fwww.vitacost.com%2F";
}
function redirect(linkid) {
    self.close;
    location.href = linkid
}