var t = true; var f = false; var loaded = f; var u = 'undefined'; function de(id) { return document.getElementById(id); } function den(elementName) { return document.getElementsByName(elementName); } function db() { return document.body; } function dw(txt) { document.write(txt); } 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 MsgRevCard(e) { var RevCardMsg = '<div style="margin-bottom:14px;"><div>As an additional security measure for the RevolutionCard, please enter your four-digit PIN in this field.  Your RevolutionCard PIN is the four-digit number you registered with your card. </div></div>'; VitacostMsgBox('RevCardMsg', 335, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, RevCardMsg, '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) { return 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) { 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.style.zIndex = 9999; 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) { if (tbc.indexOf('#') == -1) { tbc = '#' + tbc};  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) + 'px'; de(BoxID).style.top = (BoxY - shy) + 'px'; 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 VitacostMsgBoxReFit(eid) { if (de(eid)) { var bx = de(eid + 'HTML'); if (bx) { DDsRestore(eid); var bxxy = ElPos(bx); var bxx = bxxy.x; var bxy = bxxy.y; var sx = db().scrollLeft; var sy = db().scrollTop; var bw = db().clientWidth + sx; var bh = db().clientHeight + sy; var mbw = bx.clientWidth; var mbh = bx.clientHeight; var shx = 0; var shy = 0; if (bxx + mbw > bw) { shx = bxx + mbw - bw; if (bxx - shx < -1) { bxx = 0; shx = 0; } } if (bxy + mbh > bh) { shy = bxy + mbh - bh; if (bxy - shy < -1) { bxy = 0; shy = 0; } } de(eid).style.left = bxx - shx; de(eid).style.top = bxy - shy; DDsHide(eid); } } }
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 MoveNodes(FromContainer, ToContainer) { if (FromContainer && ToContainer && FromContainer.childNodes.length > 0) { for (ni = 0; ni < FromContainer.childNodes.length; i++) { ToContainer.appendChild(FromContainer.childNodes[ni]); } } }
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
}
function MsgDecm(e, linkID, lang) {
	var boxID = 'decmBox';
	var desmTxt = '<div class="cf"><div class="fA fs3 txtB txtC col1">Foreign Language Notice:</div><div></br></div><div>Translation of this website is made through an automated/computerized service provided by SysTran. Vitacost cannot guarantee or be held accountable for the accuracy, reliability or timeliness of this service. Please read our Terms and Conditions below.</div><div></div></br><div class="txtB">Terms and Conditions of Translation:</div><div style="width:500px;height:150px;overflow-x:hidden;overflow-y:auto;border-width:thin;border-style:solid;"></br><b>Warning:</b> Translation may be imprecise and inaccurate in whole or in part. The vitacost.com website and its webpages are intended to be read in English. Any translation of the vitacost.com website and its webpages may be imprecise and inaccurate in whole or in part. The translation process used on this website is an automated/computerized service provided by <u>SysTran</u> and is provided as a convenience to the users of vitacost.com.<div></br></div>You assume all risk, liability, and responsibility for any translation. While reasonable efforts are made to provide a reasonable translation, no liability and no responsibility are assumed by either vitacost.com or SysTran for any errors, omissions, or ambiguities in the translations or other information provided by the translation of this website. In no event is either vitacost.com or SysTran, their owners, advertisers, affiliates, and associated parties, liable for any damages whatsoever arising out of your use of the translation of the vitacost.com website or the content thereof, including direct, indirect, incidental, consequential or punitive damages.<div></br></div>Without limiting any of the foregoing, the content of the SysTran Translation of the website is provided <b>"AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.</b> Certain jurisdictions do not permit the exclusion of implied warranties and the foregoing exclusions of implied warranties may not apply to you. </br></div><div></div></br><div style="text-align:center;"><a href="javascript:;" onClick=acceptDescm("' + linkID + '");>I Accept</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" onClick="VitacostMsgBoxRemove(\'' + boxID + '\')" class="">I Decline</a></div></div><div></br></div>';
	VitacostMsgBox(boxID, 500, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, desmTxt, 'BackgroundColor=FDFDEA;Padding=15;ShowCloseLink=True');
	return false;
}
function acceptDescm(linkID) {
	self.close;
	location.href = linkID;
}
function declineDescm() {
	self.close;
}
function MsgHazmat(e) {
    var boxID = 'hazmatBox';
    var hazmatTxt = '<div class="cf"><div class="fA fs3 txtB col1">Notice: DOT restrictions on air shipping</div><br><div>Most of our packages are delivered by a combination of air and ground transport. The U.S. Department of Transportation (DOT) restricts air shipment of certain items, which it believes could contribute to an onboard fire or other mishap. Restricted items typically fall into one of two categories:</br></br>1. Aerosol-type products in pressurized spray cans, such as hairspray and shaving cream.</br></br>2. Products that contain flammable, volatile, or corrosive chemicals, such as nail polish and nail polish remover.</br></br>We\'re committed to getting your order to you as quickly as possible, but we also want to do it safely and responsibly, in compliance with DOT rules. That\'s why we require ground-only delivery, at our standard shipping rate, for orders that contain DOT-restricted products.</div></br></div>';
    VitacostMsgBoxRemove('refrigItemBox')
    VitacostMsgBox(boxID, 500, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, hazmatTxt, 'BackgroundColor=FDFDEA;Padding=15;ShowCloseLink=True');
    return false;
}
// [TAG:RefrigeratedItem]
// Frank Gonzalez 2011.08.11
function MsgRefrigItem(e) {
    var boxID = 'refrigItemBox';
    var refrigItemTxt = '<div class="cf"><br><div>This product is highly perishable, and is kept refrigerated to ensure its maximum freshness. Vitacost ships this item in an iced Styrofoam package; however, a small portion of its potency may be lost while in transit. Therefore, we recommend using an expedited shipping method.  For expedited shipping, orders must be placed by 1:30pm EST for same day shipping. Orders shipped via expedited shipping methods are delivered Monday through Friday. Orders placed on weekends will be held and shipped out on Monday. If that is a problem, you might consider purchasing a stabilized form instead.  </br></br></div><div class="fA fs3 txtB col1">Notice to International Customers</div><br><div>Vitacost is unable to ship this product in an iced, insulated package for destinations outside of the United States. Thus, we strongly recommend that you purchase a stabilized form as a substitute. </div></br></div>';
    VitacostMsgBoxRemove('hazmatBox')
    VitacostMsgBox(boxID, 500, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, refrigItemTxt, 'BackgroundColor=FDFDEA;Padding=15;ShowCloseLink=True');
    return false;
}
// [TAG:RefrigeratedItem]
// Frank Gonzalez 2011.08.11
function MsgRefrigItemSumPage(e) {
    var boxID = 'refrigItemSumPageBox';
    var refrigItemTxt = '<div class="cf"><br><div>This product is highly perishable, and is kept refrigerated to ensure its maximum freshness. Vitacost ships this item in an iced Styrofoam package; however, a small portion of its potency may be lost while in transit. Therefore, we recommend using an expedited shipping method.  For expedited shipping, orders must be placed by 1:30pm EST for same day shipping. Orders shipped via expedited shipping methods are delivered Monday through Friday. Orders placed on weekends will be held and shipped out on Monday. If that is a problem, you might consider purchasing a stabilized form instead.  </br></br></div><div class="fA fs3 txtB col1">Notice to International Customers</div><br><div>Vitacost is unable to ship this product in an iced, insulated package for destinations outside of the United States. Thus, we strongly recommend that you purchase a stabilized form as a substitute. </div></br></div>';
    VitacostMsgBoxRemove('hazmatSumPageBox')
    VitacostMsgBox(boxID, 500, MousePosition(e, f, t).x, MousePosition(e, f, t).y, f, t, t, refrigItemTxt, 'BackgroundColor=FDFDEA;Padding=15;ShowCloseLink=True');
    return false;
}
function MsgHazmatSumPage(e) {
	var boxID = 'hazmatSumPageBox';
	var hazmatTxt = '<div class="cf"><div class="fA fs3 txtB col1">Notice: DOT restrictions on air shipping</div><br><div>Most of our packages are delivered by a combination of air and ground transport. The U.S. Department of Transportation (DOT) restricts air shipment of certain items, which it believes could contribute to an onboard fire or other mishap. Restricted items typically fall into one of two categories:</br></br>1. Aerosol-type products in pressurized spray cans, such as hairspray and shaving cream.</br></br>2. Products that contain flammable, volatile, or corrosive chemicals, such as nail polish and nail polish remover.</br></br>We\'re committed to getting your order to you as quickly as possible, but we also want to do it safely and responsibly, in compliance with DOT rules. That\'s why we require ground-only delivery, at our standard shipping rate, for orders that contain DOT-restricted products.</br></br>For faster delivery, use the remove button to remove restricted items from your order and allow for air shipping.</div></br></div>';
	VitacostMsgBoxRemove('refrigItemSumPageBox')
	VitacostMsgBox(boxID, 500, MousePosition(e, f, t).x, MousePosition(e, f, t).y, f, t, t, hazmatTxt, 'BackgroundColor=FDFDEA;Padding=15;ShowCloseLink=True');
	return false;
}
function MsgNotifyMe(e, pid, pn) {
	var did = 'MsgNotifyMe';
	var HTML = '<div class="notifyme"><span class="notifymetitle">NOTIFY ME!</span><br />\
				<form name="fyhSignUpFrm" method="post">\
				<input type="hidden" name="fromFYHpop" value="yes">\
				<input type="hidden" name="NotifyMePID" value="' + pid + '">\
				<input type="hidden" name="NotifyMePN" value="' + pn + '">\
				<br /> Just enter your email address below and we\'ll let you know when the product becomes available!<br /><br />\
				YOUR EMAIL:<label><input type="text" name="NotifyMeEmail" id="NotifyMeEmail" /></label><br /><br /><label>\
				<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12%" valign="top">\
				<input type="checkbox" name="chkNotifyMeBrand" id="chkNotifyMeBrand" /></td><td width="88%" class="notifymecheck"> Yes! Please notify me whenever you add new products from this brand.</td></tr></table><br /><div align="right">\
				</form>\
				<a href="javascript:;" onClick="VitacostMsgBoxRemove(\'' + did + '\')" ><input name="Cancel" type="image" src="/images/Buttons/btn-cancel.gif"/></a>\
				<a href="javascript:;" onClick="return MsgNotifyMeChk();"><input name="Notify Me" type="image" src="/images/Buttons/btn-notify-me.gif"/></a></div><br />\
				<strong>NOTE:</strong> Due to their popularity, some products may not be available anymore from the manufacturer. However, we will do our best to restock this item and notify you if it comes in. </div><br/>';
	VitacostMsgBox(did, 260, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, HTML, 'BackgroundColor=FDFDEA;Padding=5;');
}

function MsgNotifyMeChk() {
	if (!checkEmail(document.fyhSignUpFrm.NotifyMeEmail.value)) { return false; }
	//var mqs = "nmeml=" + document.fyhSignUpFrm.NotifyMeEmail.value + "&nmbrd=" + ((document.fyhSignUpFrm.chkNotifyMeBrand.checked) ? 1 : 0);
	//sHref = location.href;
	//if (sHref.indexOf("?") > 0) sHref += "&" + mqs; else sHref += "?" + mqs;
	//document.fyhSignUpFrm.action = location.href;
	document.fyhSignUpFrm.submit();
}
function MsgNotifyMeCfm(e, eml, pnm) {
	var HTML = '<div class="notifyme"><span class="notifymetitle">NOTIFY ME!</span><br /><br />	<span class="notifymethankyou">Thank You!</span><br />We\'ll send you an email at ' + eml + ' if the following product becomes available:<br /><br /><span class="notifymeprodttl">Product: </span><br />' + pnm + '<br /><br /><div align="center"><a href="javascript:;" onClick="VitacostMsgBoxRemove(\'MsgNotifyMeCfm\')"><input name="Close" type="image" src="/images/Buttons/btn-close.gif"/></a></div></div>';
	VitacostMsgBox('MsgNotifyMeCfm', 260, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, t, HTML, 'BackgroundColor=FDFDEA;Padding=5;');
}

function checkEmail(email) {
	var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (!filter.test(email)) { alert("Please enter a valid email address!"); return false; }
	else return true;
}

var dropDown;
var countryDropDown;
var stateDropDown;
var table;
var streetTxt;
var cityTxt;
var statetxt;
var ziptxt;
var country;
var refresh;
var costLbl;
var divCollapse;
var loaded = false;
var divCollapseDisplay = false;
var shippingIndex;
var shippingID;
var isCalculate = false;
var isZipRequired = null;
var countryval;

function MoveNodes(FromContainer, ToContainer) {
	if (FromContainer && ToContainer && FromContainer.childNodes.length > 0) {
		for (ni = 0; ni < FromContainer.childNodes.length; i++) {
			ToContainer.appendChild(FromContainer.childNodes[ni]);
		}
	}
}
// Changed by Radhika(Pop - up to work in Mozilla / Chrome)

function ShipCalc(e) {
	try {
		var shipCalcWidth = 470;
		var ShipCalcHTML = '<div class="cf" id="ShipCalcPopUpContainer"></div>';

		VitacostMsgBox('ShipCalcMsgBox', shipCalcWidth, MousePosition(e, f, t).x, MousePosition(e, f, t).y, t, t, f, ShipCalcHTML, 'BackgroundColor=FDFDEA;Padding=0;BorderColor=AC3939;BorderWidth=3px;');
		var docform = null;
		if (e.target == null) {
			docform = e.srcElement.document.forms[0];
		} else if ((typeof e.target == 'object') && (typeof typeof e.target != 'string')) {
			docform = e.target.form;
		} else {
			docform = document.forms[0];
		}
		docform.appendChild(de('ShipCalcMsgBox'));
		MoveNodes(de('ShipCalcFormContainer'), de('ShipCalcPopUpContainer'));
		VitacostMsgBoxReFit('ShipCalcMsgBox');

		loadControls();
	} catch (ex) {
		alert(ex.message);
	}
}

function ShipCalcClose() {
	MoveNodes(de('ShipCalcPopUpContainer'), de('ShipCalcFormContainer'));
	db().appendChild(de('ShipCalcMsgBox'));
	if (loaded) {
		clearDropDown(dropDown);
		loaded = false;
	}
	shippingIndex = 0;
	clearControls();
	VitacostMsgBoxRemove('ShipCalcMsgBox');

}

function GetCountry() {
	var index;
	PageMethods.GetCountry(OnGetCountrySuccess, OnGetCountryFailure);
	loaded = true;
}

function OnGetCountrySuccess(result, userContext, methodName) {
	var myOption;
	var x;
	var countryCode;
	table.getElementsByTagName('SELECT')[0].options.length = 0;
	countryDropDown = table.getElementsByTagName('SELECT')[0];

	for (x in result) {
		try {
			if (isNaN(x) == false) {
				var str = result[x];

				var val = str.split(",");

				var countryID = val[0];
				var countryName = val[1];
				var countryPostReqrd = val[2];

				myOption = document.createElement("OPTION");
				if (countryID == 228)
					countryCode = countryID + "," + countryPostReqrd;
				myOption.setAttribute('value', countryID + "," + countryPostReqrd);
				var txt = document.createTextNode(countryName);
				myOption.appendChild(txt);
				countryDropDown.appendChild(myOption);

			}
			else
				break;
		} catch (e) {
			alert(e.message);
		}
	}

	countryDropDown.value = countryCode;
	GetMessage();
	//Commented By Radhika
	//countryDropDown.style.width = "280px";
	refresh = false;
}

function OnGetCountryFailure(error, userContext, methodName) {

}

function GetMessage() {
	var index;
	var countryIndex = null;
	var countryID = null;
	var isZipProvided = true;

	ziptxt.value = ziptxt.value.replace(/^\s+|\s+$/g, "");
	var ziptext = table.getElementsByTagName('INPUT')[0].value
	var countryddl = table.getElementsByTagName('SELECT')[0];
	countryIndex = countryddl.selectedIndex;
	countryval = countryddl.item(countryIndex).value.split(",");
	countryID = countryval[0];
	isZipRequired = countryval[1];

	if (isCalculate == false) {
		if ((countryID == 228) || (countryID == 38))
			validateText();

		if ((countryID == 228) && ((ziptext == '') || (loaded == false))) {
			ziptxt.value = '11111'; //to have US shipping methods to be seen in the pop - up
			isZipProvided = false;
			loaded = true;
			setValidation();
		}
		else if ((countryID == 38) && ((ziptext == '') || (loaded == false))) {
			ziptxt.value = 'M4B 1B3'; //to have Canada shipping methods to be seen in the pop - up
			isZipProvided = false;
			loaded = true;
			setValidation();
		}
		else {
			loaded = true;
			setValidation();
		}
	}

	if (loaded == true) {
		PageMethods.Message('', '', '', ziptxt.value, countryID, OnGetMessageSuccess, OnGetMessageFailure);
	}

	if ((isZipProvided == false) && (ziptext == ''))
		ziptxt.value = '';
	else
		ziptxt.value = ziptext;
	divCollapse.style.display = "none";

}

function ResetZipCode() {
	table.getElementsByTagName('INPUT')[0].value = '';
}

function OnGetMessageSuccess(result, userContext, methodName) {
	var myOption;
	var x;

	clearDropDown(dropDown)

	//Adding Empty Option
	dropDown = table.getElementsByTagName('SELECT')[1];

	myOption = document.createElement("OPTION");

	try {
		myOption.setAttribute('value', 0);
	} catch (e) {
		alert(e.message);
	}

	var txt = document.createTextNode('<Please Select a Shipping Method>');
	myOption.appendChild(txt);
	dropDown.appendChild(myOption);

	for (x in result) {
		try {
			if (isNaN(x) == false) {
				var str = result[x];
				var val = str.split(",");
				var desc = val[0];
				var cost = val[1];

				myOption = document.createElement("OPTION");

				myOption.setAttribute('value', cost);
				var txt = document.createTextNode(desc);
				myOption.appendChild(txt);
				dropDown.appendChild(myOption);
			}
			else
				break;
		} catch (e) {
			alert(e.message);
		}
	}

	if (isCalculate == true) {
		if (table.getElementsByTagName('SELECT')[1].options.length > 1) {
			table.getElementsByTagName('SELECT')[1].options[shippingIndex].selected = true;
			updateLabel();
		}
		isCalculate = false;
	}
	refresh = false;
}

function OnGetMessageFailure(error, userContext, methodName) {
	alert(error.get_message());
}

function loadControls() {
	var IE = /*@cc_on!@*/false;

	if (IE) {
		table = de('ShipCalcPopUpContainer').childNodes.item(6).childNodes.item(0).childNodes.item(0);
		divCollapse = de('ShipCalcPopUpContainer').childNodes.item(7);
		costLbl = de('ShipCalcPopUpContainer').childNodes.item(7).childNodes.item(0).childNodes.item(1);
	} else {
		table = de('ShipCalcPopUpContainer').childNodes.item(13).childNodes.item(1).childNodes.item(1);
		divCollapse = de('ShipCalcPopUpContainer').childNodes.item(15);
		costLbl = de('ShipCalcPopUpContainer').childNodes.item(15).childNodes.item(1).childNodes.item(1);
	}
	var inputCtls = table.getElementsByTagName('INPUT');
	var selectCtls = table.getElementsByTagName('SELECT');
	ziptxt = inputCtls[0];
	country = selectCtls[0];
	index = country.selectedIndex;
	dropDown = selectCtls[1];
	var crl = de('ShipCalcMsgBox');

	GetCountry();

	setValidation();

}
function setValidation() {
	table.getElementsByTagName('SPAN')[0].style.display = "none";
	table.getElementsByTagName('SPAN')[1].style.display = "none";
	table.getElementsByTagName('SPAN')[2].style.display = "none";
}
function validateText() {
	var countryID = null;
	var ziptxt = table.getElementsByTagName('INPUT')[0];
	var IE = /*@cc_on!@*/false;
	var objRegExp = /(^\d{5}$)|(^\d{5}-\d{4}$)/;
	var objCanadaRegExp = /^[ABCEGHJKLMNPRSTVXYabceghjklmnprstvxy]{1}\d{1}[A-Za-z]{1} *\d{1}[A-Za-z]{1}\d{1}$/;
	var strTemp = ziptxt.value;
	strTemp = strTemp.replace(/^\s+|\s+$/g, "");

	var countryddl = table.getElementsByTagName('SELECT')[0];
	var countryIndex = countryddl.selectedIndex;
	countryval = countryddl.item(countryIndex).value.split(",");
	countryID = countryval[0];
	isZipRequired = countryval[1];



	if (isZipRequired == "1") {
		if ((table.getElementsByTagName('INPUT')[0].value == '') || ((countryID == 228) && (ziptxt.value.length < 5)) || (strTemp.length == 0)) {
			table.getElementsByTagName('SPAN')[0].style.display = "inline";
			table.getElementsByTagName('SPAN')[1].style.display = "none";
			loaded = false;
		}
		else {
			table.getElementsByTagName('SPAN')[0].style.display = "none";
			if (countryID == 228) {
				if ((ziptxt.value.length < 5) || (objRegExp.test(ziptxt.value) == false) || (ziptxt.value.length > 10)) {
					table.getElementsByTagName('SPAN')[1].style.display = "inline";
					if (IE)
						table.getElementsByTagName('SPAN')[1].innerText = "Please enter valid Postal Code for United States.";
					else
						table.getElementsByTagName('SPAN')[1].textContent = "Please enter valid Postal Code for United States.";

					loaded = false;
				}
				else {
					table.getElementsByTagName('SPAN')[1].style.display = "none";
					loaded = true;
				}
			}
			else if (countryID == 38) {
				if (objCanadaRegExp.test(ziptxt.value) == false) {
					table.getElementsByTagName('SPAN')[1].style.display = "inline";
					if (IE)
						table.getElementsByTagName('SPAN')[1].innerText = "Please enter valid Postal Code for Canada.";
					else
						table.getElementsByTagName('SPAN')[1].textContent = "Please enter valid Postal Code for Canada.";
					loaded = false;
				}
				else {
					table.getElementsByTagName('SPAN')[1].style.display = "none";
					loaded = true;
				}
			}
			else {
				table.getElementsByTagName('SPAN')[1].style.display = "none";
				loaded = true;
			}
		}
	}
	else
		loaded = true;
}

function toggleVisibility() {
	var IE = /*@cc_on!@*/false;

	if (divCollapseDisplay) {
		if (divCollapse.style.display == "none") {
			divCollapse.style.display = "";
			if (IE)
				divCollapse.style.paddingTop = "0px";
			else
				divCollapse.style.paddingTop = "138px";
		}
	}
}


function clearDropDown(dropDown) {
	if (dropDown.length > 0) {
		dropDown.options.length = 0;
	}
}

function clearControls() {
	ziptxt.value = "";
	costLbl.innerText = "";
	divCollapse.style.display = "none";
}
function calculateShippingCost() {

	ziptxt.value = ziptxt.value.replace(/^\s+|\s+$/g, "");
	setValidation();

	validateText();
	validateShippingMethod();

	if (loaded == true) {
		isCalculate = true;
		GetMessage();
	}
}

function validateShippingMethod() {
	var IE = /*@cc_on!@*/false;
	var strShippingMethod;
	var shippingddl = table.getElementsByTagName('SELECT')[1];
	shippingIndex = shippingddl.selectedIndex;
	shippingID = shippingddl.item(shippingIndex).value;

	if (IE) {
		strShippingMethod = shippingddl.item(shippingIndex).innerText;
	} else {
		strShippingMethod = shippingddl.item(shippingIndex).textContent;
	}
	if (strShippingMethod == '<Please Select a Shipping Method>') {
		loaded = false;
		divCollapse.style.display = "none";
		table.getElementsByTagName('SPAN')[2].style.display = "inline";
	}
	else
		table.getElementsByTagName('SPAN')[2].style.display = "none";
}

function updateLabel() {
	dropDown;
	divCollapseDisplay = true;
	toggleVisibility();

	var op;
	var j;
	var IE = /*@cc_on!@*/false;

	for (op = 0; op < dropDown.length; op++) {
		if (dropDown[op].selected) {
			if (IE) {
				costLbl.innerText = '$' + dropDown[op].value;
			} else {
				costLbl.textContent = '$' + dropDown[op].value;
			}
		}
	}

}

function getSearchTypeFromSelect(searchTypeControlId) {
	if (!searchTypeControlId) { return ''; }
	var searchTypeObj = de(searchTypeControlId);
	if (!searchTypeObj) { return ''; }
	if (searchTypeObj.type == 'select-one') {
		switch (searchTypeObj.options[searchTypeObj.selectedIndex].value) {
			case 'products':
				return '1';
			case 'articles':
				return '2';
		}
	}
	return '';
}
function getSearchTypeFromRadio(searchTypeControlName) {
	if (!searchTypeControlName) { return ''; }
	var searchTypeObj = den(searchTypeControlName);
	if (!searchTypeObj) { return ''; }
	if (searchTypeObj[0].type == 'radio') {
		for (var i = 0; i < searchTypeObj.length; i++) {
			if (searchTypeObj[i].checked) {
				switch (searchTypeObj[i].value) {
					case 'products':
						return '1';
					case 'articles':
						return '2';
				}
			}
		}
	}
	return '';
}

// MBOX BEGIN
var mboxCopyright = "Copyright 1996-2011. Adobe Systems Incorporated. All rights reserved.";mboxUrlBuilder = function(a, b) { this.a = a; this.b = b; this.c = new Array(); this.d = function(e) { return e; }; this.f = null;};mboxUrlBuilder.prototype.addParameter = function(g, h) { var i = new RegExp('(\'|")'); if (i.exec(g)) { throw "Parameter '" + g + "' contains invalid characters"; } for (var j = 0; j < this.c.length; j++) { var k = this.c[j]; if (k.name == g) { k.value = h; return this; } } var l = new Object(); l.name = g; l.value = h; this.c[this.c.length] = l; return this;};mboxUrlBuilder.prototype.addParameters = function(c) { if (!c) { return this; } for (var j = 0; j < c.length; j++) { var m = c[j].indexOf('='); if (m == -1 || m == 0) { continue; } this.addParameter(c[j].substring(0, m), c[j].substring(m + 1, c[j].length)); } return this;};mboxUrlBuilder.prototype.setServerType = function(n) { this.o = n;};mboxUrlBuilder.prototype.setBasePath = function(f) { this.f = f;};mboxUrlBuilder.prototype.setUrlProcessAction = function(p) { this.d = p;};mboxUrlBuilder.prototype.buildUrl = function() { var q = this.f ? this.f : '/m2/' + this.b + '/mbox/' + this.o; var r = document.location.protocol == 'file:' ? 'http:' : document.location.protocol; var e = r + "//" + this.a + q; var s = e.indexOf('?') != -1 ? '&' : '?'; for (var j = 0; j < this.c.length; j++) { var k = this.c[j]; e += s + encodeURIComponent(k.name) + '=' + encodeURIComponent(k.value); s = '&'; } return this.t(this.d(e));};mboxUrlBuilder.prototype.getParameters = function() { return this.c;};mboxUrlBuilder.prototype.setParameters = function(c) { this.c = c;};mboxUrlBuilder.prototype.clone = function() { var u = new mboxUrlBuilder(this.a, this.b); u.setServerType(this.o); u.setBasePath(this.f); u.setUrlProcessAction(this.d); for (var j = 0; j < this.c.length; j++) { u.addParameter(this.c[j].name, this.c[j].value); } return u;};mboxUrlBuilder.prototype.t = function(v) { return v.replace(/\"/g, '&quot;').replace(/>/g, '&gt;');};mboxStandardFetcher = function() { };mboxStandardFetcher.prototype.getType = function() { return 'standard';};mboxStandardFetcher.prototype.fetch = function(w) { w.setServerType(this.getType()); document.write('<' + 'scr' + 'ipt src="' + w.buildUrl() + '" language="JavaScript"><' + '\/scr' + 'ipt>');};mboxStandardFetcher.prototype.cancel = function() { };mboxAjaxFetcher = function() { };mboxAjaxFetcher.prototype.getType = function() { return 'ajax';};mboxAjaxFetcher.prototype.fetch = function(w) { w.setServerType(this.getType()); var e = w.buildUrl(); this.x = document.createElement('script'); this.x.src = e; document.body.appendChild(this.x);};mboxAjaxFetcher.prototype.cancel = function() { };mboxMap = function() { this.y = new Object(); this.z = new Array();};mboxMap.prototype.put = function(A, h) { if (!this.y[A]) { this.z[this.z.length] = A; } this.y[A] = h;};mboxMap.prototype.get = function(A) { return this.y[A];};mboxMap.prototype.remove = function(A) { this.y[A] = undefined;};mboxMap.prototype.each = function(p) { for (var j = 0; j < this.z.length; j++ ) { var A = this.z[j]; var h = this.y[A]; if (h) { var B = p(A, h); if (B === false) { break; } } }};mboxFactory = function(C, b, D) { this.E = false; this.C = C; this.D = D; this.F = new mboxList(); mboxFactories.put(D, this); this.G = typeof document.createElement('div').replaceChild != 'undefined' && (function() { return true; })() && typeof document.getElementById != 'undefined' && typeof (window.attachEvent || document.addEventListener || window.addEventListener) != 'undefined' && typeof encodeURIComponent != 'undefined'; this.H = this.G && mboxGetPageParameter('mboxDisable') == null; var I = D == 'default'; this.J = new mboxCookieManager( 'mbox' + (I ? '' : ('-' + D)), (function() { return mboxCookiePageDomain(); })()); this.H = this.H && this.J.isEnabled() && (this.J.getCookie('disable') == null); if (this.isAdmin()) { this.enable(); } this.K(); this.L = mboxGenerateId(); this.M = mboxScreenHeight(); this.N = mboxScreenWidth(); this.O = mboxBrowserWidth(); this.P = mboxBrowserHeight(); this.Q = mboxScreenColorDepth(); this.R = mboxBrowserTimeOffset(); this.S = new mboxSession(this.L, 'mboxSession', 'session', 31 * 60, this.J); this.T = new mboxPC('PC', 1209600, this.J); this.w = new mboxUrlBuilder(C, b); this.U(this.w, I); this.V = new Date().getTime(); this.W = this.V; var X = this; this.addOnLoad(function() { X.W = new Date().getTime(); }); if (this.G) { this.addOnLoad(function() { X.E = true; X.getMboxes().each(function(Y) { Y.setFetcher(new mboxAjaxFetcher()); Y.finalize(); }); }); this.limitTraffic(100, 10368000); if (this.H) { this.Z(); this._ = new mboxSignaler(function(ab, c) { return X.create(ab, c); }, this.J); } }};mboxFactory.prototype.isEnabled = function() { return this.H;};mboxFactory.prototype.getDisableReason = function() { return this.J.getCookie('disable');};mboxFactory.prototype.isSupported = function() { return this.G;};mboxFactory.prototype.disable = function(bb, cb) { if (typeof bb == 'undefined') { bb = 60 * 60; } if (typeof cb == 'undefined') { cb = 'unspecified'; } if (!this.isAdmin()) { this.H = false; this.J.setCookie('disable', cb, bb); }};mboxFactory.prototype.enable = function() { this.H = true; this.J.deleteCookie('disable');};mboxFactory.prototype.isAdmin = function() { return document.location.href.indexOf('mboxEnv') != -1;};mboxFactory.prototype.limitTraffic = function(db, bb) {};mboxFactory.prototype.addOnLoad = function(eb) { if (this.isDomLoaded()) { eb(); } else { var fb = false; var gb = function() { if (fb) { return; } fb = true; eb(); }; this.hb.push(gb); if (this.isDomLoaded() && !fb) { gb(); } }};mboxFactory.prototype.getEllapsedTime = function() { return this.W - this.V;};mboxFactory.prototype.getEllapsedTimeUntil = function(ib) { return ib - this.V;};mboxFactory.prototype.getMboxes = function() { return this.F;};mboxFactory.prototype.get = function(ab, jb) { return this.F.get(ab).getById(jb || 0);};mboxFactory.prototype.update = function(ab, c) { if (!this.isEnabled()) { return; } if (!this.isDomLoaded()) { var X = this; this.addOnLoad(function() { X.update(ab, c); }); return; } if (this.F.get(ab).length() == 0) { throw "Mbox " + ab + " is not defined"; } this.F.get(ab).each(function(Y) { Y.getUrlBuilder() .addParameter('mboxPage', mboxGenerateId()); Y.load(c); });};mboxFactory.prototype.create = function( ab, c, kb) { if (!this.isSupported()) { return null; } var e = this.w.clone(); e.addParameter('mboxCount', this.F.length() + 1); e.addParameters(c); var jb = this.F.get(ab).length(); var lb = this.D + '-' + ab + '-' + jb; var mb; if (kb) { mb = new mboxLocatorNode(kb); } else { if (this.E) { throw 'The page has already been loaded, can\'t write marker'; } mb = new mboxLocatorDefault(lb); } try { var X = this; var nb = 'mboxImported-' + lb; var Y = new mbox(ab, jb, e, mb, nb); if (this.H) { Y.setFetcher( this.E ? new mboxAjaxFetcher() : new mboxStandardFetcher()); } Y.setOnError(function(ob, n) { Y.setMessage(ob); Y.activate(); if (!Y.isActivated()) { X.disable(60 * 60, ob); window.location.reload(false); } }); this.F.add(Y); } catch (pb) { this.disable(); throw 'Failed creating mbox "' + ab + '", the error was: ' + pb; } var qb = new Date(); e.addParameter('mboxTime', qb.getTime() - (qb.getTimezoneOffset() * 60000)); return Y;};mboxFactory.prototype.getCookieManager = function() { return this.J;};mboxFactory.prototype.getPageId = function() { return this.L;};mboxFactory.prototype.getPCId = function() { return this.T;};mboxFactory.prototype.getSessionId = function() { return this.S;};mboxFactory.prototype.getSignaler = function() { return this._;};mboxFactory.prototype.getUrlBuilder = function() { return this.w;};mboxFactory.prototype.U = function(e, I) { e.addParameter('mboxHost', document.location.hostname) .addParameter('mboxSession', this.S.getId()); if (!I) { e.addParameter('mboxFactoryId', this.D); } if (this.T.getId() != null) { e.addParameter('mboxPC', this.T.getId()); } e.addParameter('mboxPage', this.L); e.addParameter('screenHeight', this.M); e.addParameter('screenWidth', this.N); e.addParameter('browserWidth', this.O); e.addParameter('browserHeight', this.P); e.addParameter('browserTimeOffset', this.R); e.addParameter('colorDepth', this.Q); e.setUrlProcessAction(function(e) { e += '&mboxURL=' + encodeURIComponent(document.location); var rb = encodeURIComponent(document.referrer); if (e.length + rb.length < 2000) { e += '&mboxReferrer=' + rb; } e += '&mboxVersion=' + mboxVersion; return e; });};mboxFactory.prototype.sb = function() { return "";};mboxFactory.prototype.Z = function() { document.write('<style>.' + 'mboxDefault' + ' { visibility:hidden; }</style>');};mboxFactory.prototype.isDomLoaded = function() { return this.E;};mboxFactory.prototype.K = function() { if (this.hb != null) { return; } this.hb = new Array(); var X = this; (function() { var tb = document.addEventListener ? "DOMContentLoaded" : "onreadystatechange"; var ub = false; var vb = function() { if (ub) { return; } ub = true; for (var i = 0; i < X.hb.length; ++i) { X.hb[i](); } }; if (document.addEventListener) { document.addEventListener(tb, function() { document.removeEventListener(tb, arguments.callee, false); vb(); }, false); window.addEventListener("load", function(){ document.removeEventListener("load", arguments.callee, false); vb(); }, false); } else if (document.attachEvent) { if (self !== self.top) { document.attachEvent(tb, function() { if (document.readyState === 'complete') { document.detachEvent(tb, arguments.callee); vb(); } }); } else { var wb = function() { try { document.documentElement.doScroll('left'); vb(); } catch (xb) { setTimeout(wb, 13); } }; wb(); } } if (document.readyState === "complete") { vb(); } })();};mboxSignaler = function(yb, J) { this.J = J; var zb = J.getCookieNames('signal-'); for (var j = 0; j < zb.length; j++) { var Ab = zb[j]; var Bb = J.getCookie(Ab).split('&'); var Y = yb(Bb[0], Bb); Y.load(); J.deleteCookie(Ab); }};mboxSignaler.prototype.signal = function(Cb, ab ) { this.J.setCookie('signal-' + Cb, mboxShiftArray(arguments).join('&'), 45 * 60);};mboxList = function() { this.F = new Array();};mboxList.prototype.add = function(Y) { if (Y != null) { this.F[this.F.length] = Y; }};mboxList.prototype.get = function(ab) { var B = new mboxList(); for (var j = 0; j < this.F.length; j++) { var Y = this.F[j]; if (Y.getName() == ab) { B.add(Y); } } return B;};mboxList.prototype.getById = function(Db) { return this.F[Db];};mboxList.prototype.length = function() { return this.F.length;};mboxList.prototype.each = function(p) { if (typeof p != 'function') { throw 'Action must be a function, was: ' + typeof(p); } for (var j = 0; j < this.F.length; j++) { p(this.F[j]); }};mboxLocatorDefault = function(g) { this.g = 'mboxMarker-' + g; document.write('<div id="' + this.g + '" style="visibility:hidden;display:none">&nbsp;</div>');};mboxLocatorDefault.prototype.locate = function() { var Eb = document.getElementById(this.g); while (Eb != null) { if (Eb.nodeType == 1) { if (Eb.className == 'mboxDefault') { return Eb; } } Eb = Eb.previousSibling; } return null;};mboxLocatorDefault.prototype.force = function() { var Fb = document.createElement('div'); Fb.className = 'mboxDefault'; var Gb = document.getElementById(this.g); Gb.parentNode.insertBefore(Fb, Gb); return Fb;};mboxLocatorNode = function(Hb) { this.Eb = Hb;};mboxLocatorNode.prototype.locate = function() { return typeof this.Eb == 'string' ? document.getElementById(this.Eb) : this.Eb;};mboxLocatorNode.prototype.force = function() { return null;};mboxCreate = function(ab ) { var Y = mboxFactoryDefault.create( ab, mboxShiftArray(arguments)); if (Y) { Y.load(); } return Y;};mboxDefine = function(kb, ab ) { var Y = mboxFactoryDefault.create(ab, mboxShiftArray(mboxShiftArray(arguments)), kb); return Y;};mboxUpdate = function(ab ) { mboxFactoryDefault.update(ab, mboxShiftArray(arguments));};mbox = function(g, Ib, w, Jb, nb) { this.Kb = null; this.Lb = 0; this.mb = Jb; this.nb = nb; this.Mb = null; this.Nb = new mboxOfferContent(); this.Fb = null; this.w = w; this.message = ''; this.Ob = new Object(); this.Pb = 0; this.Ib = Ib; this.g = g; this.Qb(); w.addParameter('mbox', g) .addParameter('mboxId', Ib); this.Rb = function() {}; this.Sb = function() {}; this.Tb = null;};mbox.prototype.getId = function() { return this.Ib;};mbox.prototype.Qb = function() { if (this.g.length > 250) { throw "Mbox Name " + this.g + " exceeds max length of " + "250 characters."; } else if (this.g.match(/^\s+|\s+$/g)) { throw "Mbox Name " + this.g + " has leading/trailing whitespace(s)."; }};mbox.prototype.getName = function() { return this.g;};mbox.prototype.getParameters = function() { var c = this.w.getParameters(); var B = new Array(); for (var j = 0; j < c.length; j++) { if (c[j].name.indexOf('mbox') != 0) { B[B.length] = c[j].name + '=' + c[j].value; } } return B;};mbox.prototype.setOnLoad = function(p) { this.Sb = p; return this;};mbox.prototype.setMessage = function(ob) { this.message = ob; return this;};mbox.prototype.setOnError = function(Rb) { this.Rb = Rb; return this;};mbox.prototype.setFetcher = function(Ub) { if (this.Mb) { this.Mb.cancel(); } this.Mb = Ub; return this;};mbox.prototype.getFetcher = function() { return this.Mb;};mbox.prototype.load = function(c) { if (this.Mb == null) { return this; } this.setEventTime("load.start"); this.cancelTimeout(); this.Lb = 0; var w = (c && c.length > 0) ? this.w.clone().addParameters(c) : this.w; this.Mb.fetch(w); var X = this; this.Vb = setTimeout(function() { X.Rb('browser timeout', X.Mb.getType()); }, 15000); this.setEventTime("load.end"); return this;};mbox.prototype.loaded = function() { this.cancelTimeout(); if (!this.activate()) { var X = this; setTimeout(function() { X.loaded(); }, 100); }};mbox.prototype.activate = function() { if (this.Lb) { return this.Lb; } this.setEventTime('activate' + ++this.Pb + '.start'); if (this.show()) { this.cancelTimeout(); this.Lb = 1; } this.setEventTime('activate' + this.Pb + '.end'); return this.Lb;};mbox.prototype.isActivated = function() { return this.Lb;};mbox.prototype.setOffer = function(Nb) { if (Nb && Nb.show && Nb.setOnLoad) { this.Nb = Nb; } else { throw 'Invalid offer'; } return this;};mbox.prototype.getOffer = function() { return this.Nb;};mbox.prototype.show = function() { this.setEventTime('show.start'); var B = this.Nb.show(this); this.setEventTime(B == 1 ? "show.end.ok" : "show.end"); return B;};mbox.prototype.showContent = function(Wb) { if (Wb == null) { return 0; } if (this.Fb == null || !this.Fb.parentNode) { this.Fb = this.getDefaultDiv(); if (this.Fb == null) { return 0; } } if (this.Fb != Wb) { this.Xb(this.Fb); this.Fb.parentNode.replaceChild(Wb, this.Fb); this.Fb = Wb; } this.Yb(Wb); this.Sb(); return 1;};mbox.prototype.hide = function() { this.setEventTime('hide.start'); var B = this.showContent(this.getDefaultDiv()); this.setEventTime(B == 1 ? 'hide.end.ok' : 'hide.end.fail'); return B;};mbox.prototype.finalize = function() { this.setEventTime('finalize.start'); this.cancelTimeout(); if (this.getDefaultDiv() == null) { if (this.mb.force() != null) { this.setMessage('No default content, an empty one has been added'); } else { this.setMessage('Unable to locate mbox'); } } if (!this.activate()) { this.hide(); this.setEventTime('finalize.end.hide'); } this.setEventTime('finalize.end.ok');};mbox.prototype.cancelTimeout = function() { if (this.Vb) { clearTimeout(this.Vb); } if (this.Mb != null) { this.Mb.cancel(); }};mbox.prototype.getDiv = function() { return this.Fb;};mbox.prototype.getDefaultDiv = function() { if (this.Tb == null) { this.Tb = this.mb.locate(); } return this.Tb;};mbox.prototype.setEventTime = function(Zb) { this.Ob[Zb] = (new Date()).getTime();};mbox.prototype.getEventTimes = function() { return this.Ob;};mbox.prototype.getImportName = function() { return this.nb;};mbox.prototype.getURL = function() { return this.w.buildUrl();};mbox.prototype.getUrlBuilder = function() { return this.w;};mbox.prototype._b = function(Fb) { return Fb.style.display != 'none';};mbox.prototype.Yb = function(Fb) { this.ac(Fb, true);};mbox.prototype.Xb = function(Fb) { this.ac(Fb, false);};mbox.prototype.ac = function(Fb, bc) { Fb.style.visibility = bc ? "visible" : "hidden"; Fb.style.display = bc ? "block" : "none";};mboxOfferContent = function() { this.Sb = function() {};};mboxOfferContent.prototype.show = function(Y) { var B = Y.showContent(document.getElementById(Y.getImportName())); if (B == 1) { this.Sb(); } return B;};mboxOfferContent.prototype.setOnLoad = function(Sb) { this.Sb = Sb;};mboxOfferAjax = function(Wb) { this.Wb = Wb; this.Sb = function() {};};mboxOfferAjax.prototype.setOnLoad = function(Sb) { this.Sb = Sb;};mboxOfferAjax.prototype.show = function(Y) { var cc = document.createElement('div'); cc.id = Y.getImportName(); cc.innerHTML = this.Wb; var B = Y.showContent(cc); if (B == 1) { this.Sb(); } return B;};mboxOfferDefault = function() { this.Sb = function() {};};mboxOfferDefault.prototype.setOnLoad = function(Sb) { this.Sb = Sb;};mboxOfferDefault.prototype.show = function(Y) { var B = Y.hide(); if (B == 1) { this.Sb(); } return B;};mboxCookieManager = function mboxCookieManager(g, dc) { this.g = g; this.dc = dc == '' || dc.indexOf('.') == -1 ? '' : '; domain=' + dc; this.ec = new mboxMap(); this.loadCookies();};mboxCookieManager.prototype.isEnabled = function() { this.setCookie('check', 'true', 60); this.loadCookies(); return this.getCookie('check') == 'true';};mboxCookieManager.prototype.setCookie = function(g, h, bb) { if (typeof g != 'undefined' && typeof h != 'undefined' && typeof bb != 'undefined') { var fc = new Object(); fc.name = g; fc.value = escape(h); fc.expireOn = Math.ceil(bb + new Date().getTime() / 1000); this.ec.put(g, fc); this.saveCookies(); }};mboxCookieManager.prototype.getCookie = function(g) { var fc = this.ec.get(g); return fc ? unescape(fc.value) : null;};mboxCookieManager.prototype.deleteCookie = function(g) { this.ec.remove(g); this.saveCookies();};mboxCookieManager.prototype.getCookieNames = function(gc) { var hc = new Array(); this.ec.each(function(g, fc) { if (g.indexOf(gc) == 0) { hc[hc.length] = g; } }); return hc;};mboxCookieManager.prototype.saveCookies = function() { var ic = new Array(); var jc = 0; this.ec.each(function(g, fc) { ic[ic.length] = g + '#' + fc.value + '#' + fc.expireOn; if (jc < fc.expireOn) { jc = fc.expireOn; } }); var kc = new Date(jc * 1000); document.cookie = this.g + '=' + ic.join('|') + '; expires=' + kc.toGMTString() + '; path=/' + this.dc;};mboxCookieManager.prototype.loadCookies = function() { this.ec = new mboxMap(); var lc = document.cookie.indexOf(this.g + '='); if (lc != -1) { var mc = document.cookie.indexOf(';', lc); if (mc == -1) { mc = document.cookie.indexOf(',', lc); if (mc == -1) { mc = document.cookie.length; } } var nc = document.cookie.substring( lc + this.g.length + 1, mc).split('|'); var oc = Math.ceil(new Date().getTime() / 1000); for (var j = 0; j < nc.length; j++) { var fc = nc[j].split('#'); if (oc <= fc[2]) { var pc = new Object(); pc.name = fc[0]; pc.value = fc[1]; pc.expireOn = fc[2]; this.ec.put(pc.name, pc); } } }};mboxSession = function(qc, rc, Ab, sc, J) { this.rc = rc; this.Ab = Ab; this.sc = sc; this.J = J; this.tc = false; this.Ib = typeof mboxForceSessionId != 'undefined' ? mboxForceSessionId : mboxGetPageParameter(this.rc); if (this.Ib == null || this.Ib.length == 0) { this.Ib = J.getCookie(Ab); if (this.Ib == null || this.Ib.length == 0) { this.Ib = qc; this.tc = true; } } J.setCookie(Ab, this.Ib, sc);};mboxSession.prototype.getId = function() { return this.Ib;};mboxSession.prototype.forceId = function(uc) { this.Ib = uc; this.J.setCookie(this.Ab, this.Ib, this.sc);};mboxPC = function(Ab, sc, J) { this.Ab = Ab; this.sc = sc; this.J = J; this.Ib = typeof mboxForcePCId != 'undefined' ? mboxForcePCId : J.getCookie(Ab); if (this.Ib != null) { J.setCookie(Ab, this.Ib, sc); }};mboxPC.prototype.getId = function() { return this.Ib;};mboxPC.prototype.forceId = function(uc) { if (this.Ib != uc) { this.Ib = uc; this.J.setCookie(this.Ab, this.Ib, this.sc); return true; } return false;};mboxGetPageParameter = function(g) { var B = null; var vc = new RegExp(g + "=([^\&]*)"); var wc = vc.exec(document.location); if (wc != null && wc.length >= 2) { B = wc[1]; } return B;};mboxSetCookie = function(g, h, bb) { return mboxFactoryDefault.getCookieManager().setCookie(g, h, bb);};mboxGetCookie = function(g) { return mboxFactoryDefault.getCookieManager().getCookie(g);};mboxCookiePageDomain = function() { var dc = (/([^:]*)(:[0-9]{0,5})?/).exec(document.location.host)[1]; var xc = /[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/; if (!xc.exec(dc)) { var yc = (/([^\.]+\.[^\.]{3}|[^\.]+\.[^\.]+\.[^\.]{2})$/).exec(dc); if (yc) { dc = yc[0]; } } return dc ? dc: "";};mboxShiftArray = function(zc) { var B = new Array(); for (var j = 1; j < zc.length; j++) { B[B.length] = zc[j]; } return B;};mboxGenerateId = function() { return (new Date()).getTime() + "-" + Math.floor(Math.random() * 999999);};mboxScreenHeight = function() { return screen.height;};mboxScreenWidth = function() { return screen.width;};mboxBrowserWidth = function() { return (window.innerWidth) ? window.innerWidth : document.documentElement ? document.documentElement.clientWidth : document.body.clientWidth;};mboxBrowserHeight = function() { return (window.innerHeight) ? window.innerHeight : document.documentElement ? document.documentElement.clientHeight : document.body.clientHeight;};mboxBrowserTimeOffset = function() { return -new Date().getTimezoneOffset();};mboxScreenColorDepth = function() { return screen.pixelDepth;};if (typeof mboxVersion == 'undefined') { var mboxVersion = 40; var mboxFactories = new mboxMap(); var mboxFactoryDefault = new mboxFactory('vitacost.tt.omtrdc.net', 'vitacost', 'default');};if (mboxGetPageParameter("mboxDebug") != null || mboxFactoryDefault.getCookieManager() .getCookie("debug") != null) { setTimeout(function() { if (typeof mboxDebugLoaded == 'undefined') { alert('Could not load the remote debug.\nPlease check your connection' + ' to Test&amp;Target servers'); } }, 60*60); document.write('<' + 'scr' + 'ipt language="Javascript1.2" src=' + '"http://admin6.testandtarget.omniture.com/admin/mbox/mbox_debug.jsp?mboxServerHost=vitacost.tt.omtrdc.net' + '&clientCode=vitacost"><' + '\/scr' + 'ipt>');};
// MBOX END

function moveBtn(selectedItemNum) {

	
	var numTopItems = 2;   //Change to a bigger number to match the number of items on the top menu	
	var divItem, divItem2;

	for ( j = 1; j <= numTopItems; j++)
	{

		if (j == selectedItemNum)
		{
			//divItem = document.getElementById("m"+j+"L");		
			//if (divItem)  divItem.setAttribute("class", "SilverLt");
			divItem = document.getElementById("m"+j+"C");
			if (divItem)  divItem.className="SilverCnt"; //IE7 fix
            //if (divItem)  divItem.setAttribute("class", "SilverCnt");
			//divItem = document.getElementById("m"+j+"R");		
			//if (divItem)  divItem.setAttribute("class", "SilverRt");
			divItem2 = document.getElementById("SubMenu" + j);		
			if (divItem2)  divItem2.style.visibility="visible";
	
		} else {
			//divItem = document.getElementById("m"+j+"L");		
			//if (divItem)  divItem.setAttribute("class", "UnselectedLt");
			divItem = document.getElementById("m"+j+"C");
            if (divItem)  divItem.className="UnselectedCnt"; //IE7 fix
			//if (divItem)  divItem.setAttribute("class", "UnselectedCnt");
			//divItem = document.getElementById("m"+j+"R");		
			//if (divItem)  divItem.setAttribute("class", "UnselectedRt");
			divItem2 = document.getElementById("SubMenu" + j);		
			if (divItem2)  divItem2.style.visibility="hidden";
		}
		
	}
    return true;

	}


function tabSelect(selectedItemNum) {

	alert('selected:'+selectedItemNum);
	var numTopItems = 3;   //Change to a bigger number to match the number of items on the top menu	
	var divItem, divItem2;

	for ( j = 1; j <= numTopItems; j++)
	{
		alert(2);

		if (j == selectedItemNum)
		{
			alert(3);
			divItem2 = document.getElementById("SubMenu" + j);	alert(divItem2	);
			if (divItem2) { divItem2.setAttribute("class", "selected"); alert("Changed " + j + " to class SELECTED"); }
			else alert("No Class Change");
	
		} else {
			alert(4);
			divItem2 = document.getElementById("SubMenu" + j);

			if (divItem2) { divItem2.setAttribute("class", "unselected"); alert("Changed " + j + " to class Unselected"); }
		}
		
	}

}

try
{

var $jq = jQuery.noConflict();

            $jq(document).ready(function ($) {
                $("#nav-one").dropmenu({});
            });




/*!
 * jQuery PLUGIN - for jQuery 1.3+
 * http://www.sitebase.be
 *
 * Copyright 2011, Wim Mostmans (http://www.sitebase.be)
 * You need to buy a license if you want use this script.
 * http://codecanyon.net/wiki/support/legal-terms/licensing-terms/
 *
 * @package Drop Menu
 * @author Sitebase (http://www.sitebase.be)
 * @version 1.1.1
 * @license http://codecanyon.net/wiki/support/legal-terms/licensing-terms/
 * @copyright Copyright (c) 2008-2011 Sitebase (http://www.sitebase.be) 
 * @date: 29-06-2011
 */
$jq.noConflict();
(function($){
	$.fn.dropmenu = function(custom) {
		
		// Default plugin settings
		var defaults = {
		  	openAnimation: "slide",
			closeAnimation: "slide",
			openClick: false,
			openSpeed: 0,
			closeSpeed: 0,
			closeDelay: 300,
			onHide: function(){},
			onHidden: function(){},
			onShow: function(){},
			onShown: function(){},
			zindex: 10000,
			openMenuClass: 'open',
			autoAddArrowElements: true
		};
		
		// Merge default and user settings
		var settings = $.extend({}, defaults, custom);
		
		// Declare vars
		var delayTimer = "";
		var openDelayTimer = null;
		var alreadyOpen = false;
		var menu = $(this);

		// Disable CSS menu opening because Javascript is enabled
		var main_menu_items = menu.find('> li').children('ul, div').css('display', 'none').end().find('ul ul, li > div').css('display', 'none').end();
	
		// Remove CSS hover action
		menu.removeClass('css-only');

		// Add class to all menu items that have children
		var all_menu_items = menu.find('li > ul, li > div').parent().addClass("dropitem");
		
		// Add arrow element to navigation items with children
		if(settings.autoAddArrowElements){
			all_menu_items.find('> a').append('<span class="arrow"></span>');	
		}
		
		// Add hover/leave event handler to all menu items that have children
		$(all_menu_items).hover(function(){
			
			if(settings.closeDelay != 0){
				// Clear close timer
				window.clearInterval(delayTimer);
				
				// Close all the opened menus
				closeAllSiblings($(this));
			}
		
			// Only do hover open when openClick settings is disabled
			if(!settings.openClick && !$(this).is('.' + settings.openMenuClass)){
				// Callback onshow 
				settings.onShow.call($(this));
			
				// Open menu
				if (alreadyOpen){
					openMenu($(this));
				}
				else
				{
					var menu = $(this);
					window.clearInterval(openDelayTimer);
					delayTimer = setInterval(function(){
						window.clearInterval(openDelayTimer);
						alreadyOpen = true;
						openMenu(menu);
					}, 300);
				}
			}

		}, function() {
			
			// Callback onHide 
			settings.onHide.call($(this));
			
			window.clearInterval(openDelayTimer);
			if(settings.closeDelay == 0){
				closeMenu($(this).find('li.' + settings.openMenuClass));
				closeMenu($(this));
			}else{
				var menu = $(this);
				window.clearInterval(delayTimer);
				delayTimer = setInterval(function(){
					window.clearInterval(delayTimer);
					closeMenu($(menu).find('li.' + settings.openMenuClass));
					alreadyOpen = false;
					closeMenu(menu);
				}, settings.closeDelay);
			}
		});
		
		// Bind click menu item if openClick setting is enabled
		if(settings.openClick){
			$(all_menu_items).click(function(){
				// Callback onshow 
				settings.onShow.call($(this));
				
				// Open menu
				openMenu($(this));
			});
		}
		
		
		/**
		 * Function that is triggered to open
		 * a specific item submenu
		 *
		 * @param hovered item
		 * @return void
		 */
		function openMenu(menu_item){
			
			// Get menu box
			var menu_box = menu_item.find('> ul, > div').stop(true, true);
			
			// This will make the selected menu always on top of the
			// non selected menu
			$(menu_item).parent()
						.find("ul, div")
						.css("z-index", settings.zindex);
			menu_box.css("z-index", (settings.zindex+1));

			// If animation is function
			if(typeof settings.openAnimation == 'function'){
				$(menu_item).addClass(settings.openMenuClass)
				settings.openAnimation.call(menu_box);
				return;
			}
			
			if(!$(menu_item).is('.' + settings.openMenuClass)){
				  switch(settings.openAnimation){
					  case 'fade':
						  fadeAnimation(menu_box, true);
						  break;
					  case 'size':
						  sizeAnimation(menu_box, true);
						  break;	
					  default:
						  slideAnimation(menu_box, true);
						  break;
				  }
			}
				
		}
		
		/**
		 * Function that is triggered to close
		 * a specific item submenu
		 *
		 * @param hovered item
		 * @return void
		 */
		function closeMenu(menu_item){

			
			// Get menu box
			var menu_box = menu_item.find('> ul, > div').stop(true, true);
			
			// If animation is function
			if(typeof settings.closeAnimation == 'function'){
				$(menu_item).removeClass(settings.openMenuClass)
				settings.closeAnimation.call(menu_box);
				return;
			}
			
			switch(settings.closeAnimation){
				case 'fade':
					fadeAnimation(menu_box, false);
					break;
				case 'size':
					sizeAnimation(menu_box, false);
					break;
				default:
					slideAnimation(menu_box, false);
					break;
			}
		}
		
		/**
		 * Animation where the menu slides
		 *
		 * @param menu item
		 * @param bool
		 * @return void
		 */
		function slideAnimation(menu_item, do_open){
			if(do_open){
				$(menu_item).parent().addClass(settings.openMenuClass).end().slideDown(settings.openSpeed, function(){cbShown($(menu_item))});	
			}else{
				$(menu_item).slideUp(settings.closeSpeed, 
					function(){
						$(this).parent().removeClass(settings.openMenuClass);
						cbHidden($(menu_item));
					}
				);
			}
		}
		
		/**
		 * Animation where the menu fades
		 *
		 * @param menu item
		 * @param bool
		 * @return void
		 */
		function fadeAnimation(menu_item, do_open){
			if(do_open){
				$(menu_item).parent().addClass(settings.openMenuClass).end().fadeIn(settings.openSpeed, function(){cbShown($(menu_item))});	
			}else{
				$(menu_item).fadeOut(settings.closeSpeed, 
					function(){
						$(this).parent().removeClass(settings.openMenuClass);
						cbHidden($(menu_item));
					}
				);
			}
		}
		
		/**
		 * Animation where the menu size fades
		 *
		 * @param menu item
		 * @param bool
		 * @return void
		 */
		function sizeAnimation(menu_item, do_open){
			if(do_open){
				$(menu_item).parent().addClass(settings.openMenuClass).end().show(settings.openSpeed, function(){cbShown($(menu_item))});	
			}else{
				$(menu_item).hide(settings.closeSpeed, 
					function(){
						$(this).parent().removeClass(settings.openMenuClass);
						cbHidden($(menu_item));
					}
				);
			}
		}
		
		/**
		 * Close all the currently opened menus
		 *
		 * @return void
		 */
		function closeAllSiblings(selected){
			var submenus = selected.siblings('.' + settings.openMenuClass);
			$.each(submenus, function(i, val) {
				var opened_menus = $(submenus[i]).find('li.' + settings.openMenuClass);
				opened_menus.css("z-index", (settings.zindex-1));
				closeMenu(opened_menus);
				closeMenu($(submenus[i]));
			});
		}
		
		/**
		 * Function that triggers the shown callback
		 *
		 * @return void
		 */
		function cbShown(menu_item){
			settings.onShown.call($(menu_item).parent())
		}
		
		/**
		 * Function that triggers the shown callback
		 *
		 * @return void
		 */
		function cbHidden(menu_item){
			settings.onHidden.call($(menu_item).parent())
		}

		// returns the jQuery object to allow for chainability.
		return this;
	}
	
})($jq);
}
catch (err)
{
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function switchTabs(second) {

	var divItem;




	divItem = document.getElementById("brand");
	if (second && divItem) {
		divItem.style.visibility = "hidden";
		divItem.style.height = "0px";
	} else {
		divItem.style.visibility = "visible";
		divItem.style.height = "75px";
	}
	
		
}

window.onerror = function () {
    if (window.vPageType != undefined)
        if (window.vPageType == "product")
            processAfterJSError();
}

// TESTING 
try
{
	
jQuery.cookie = function (key, value, options) {

  // key and at least value given, set cookie...
  if (arguments.length > 1 && String(value) !== "[object Object]") {
      
    options = jQuery.extend({}, options);

    if (value === null || value === undefined) {
      options.expires = -1;
    }

    if (typeof options.expires === 'number') {
      var days = options.expires, t = options.expires = new Date();
      t.setDate(t.getDate() + days);
    }

    value = String(value);

    return (document.cookie = [
      encodeURIComponent(key), '=',
      options.raw ? value : encodeURIComponent(value),
      options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
      options.path ? '; path=' + options.path : '',
      options.domain ? '; domain=' + options.domain : '',
      options.secure ? '; secure' : ''
    ].join(''));
  }

  // key and possibly options given, get cookie...
  options = value || {};
  var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
  return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};
}

catch(err)
{
}
	


function getCookie_VCV2( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );


		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}



function SearchResultBarText()
{

	var SearchById = document.getElementById('EndecaNtt');
	
	
	if(SearchById)
	{
	try
	{
	var SearchValue = SearchById.value;
	SearchValue = SearchValue.toUpperCase();
	
	var BreadCrumbValue =	document.getElementsByTagName('h3');
	var BreadcrumbResult = BreadCrumbValue.item(0).getElementsByTagName("span").item(0).innerHTML;
	BreadcrumbResult= BreadcrumbResult.replace("Search:" ," ");
	document.getElementById('searchResultH2Text').innerHTML = BreadcrumbResult.toUpperCase();
	
	}
	catch(err)
	{
		
	}
	}
}



function getQuerystring(key, default_)
{
  if (default_==null) default_="";
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
}

	



function ToggleText()
{
var compareLength = document.getElementById('compareSave').innerHTML.length;

if(compareLength<50)
{
document.getElementById('recommendedText').innerHTML = "Recommended Items";
}

if(compareLength>50)
{
document.getElementById('recommendedText').innerHTML = "Compare & Save";
}
	
}

function removeShareThisProduct() 
	{
		
var bvSocial = document.getElementById('BVCustomerRatings');
if(bvSocial)
		{
			readReviews_TabOpen();
 		var divs=bvSocial.getElementsByTagName('div')
		for (var i=0;i<divs.length;i++){

		if(divs[i].className == "BVRRSocialBookmarkingLinks")
			{
				divs[i].innerHTML = "";
				break;
			}
		}
		
	}
	
	


}


function removeLastLineHomePageSP()
{
	
	var main_ID = document.getElementById('ContentWrapper');
	if(main_ID)
	{
		var divs = document.getElementsByTagName('div');
		var counter=0;
	
		for(var i=0;i<divs.length;i++)
		{
			if(divs[i].getAttribute("class") == "pltgPL brR") {
			counter=counter+1;
			if(counter==5 || counter==10)
			{
				
				divs[i].setAttribute("class","pltgPL");
				
			}
		  }
		}

   }
}




function processAfterJSError() {
	hideShow();
}


function strip(html)
{
   var tmp = document.createElement("DIV");
   tmp.innerHTML = html; 
   return tmp.textContent||tmp.innerText;
   
}

function strip2(x)
{
		
		
    stripFinal = x.replace(/<LI/gi, "[Bullet]<LI");
	stripFinal = stripFinal.replace(/<BR/gi, "[Break]<BR");  
	stripFinal = stripFinal.replace(/<P/gi, "[Break]<P");
	stripFinal = strip(stripFinal); 
    stripFinal = stripFinal.replace(/\[Bullet\]/gi, "<BR>&bull;&nbsp;");
	stripFinal = stripFinal.replace(/\[Break\]\[Break\]/gi, "\[Break\]");
	stripFinal = stripFinal.replace(/\[Break\]\n\[Break\]/gi, "\[Break\]");
	stripFinal = stripFinal.replace(/\[Break\]/gi, "<br>");
	   
 return stripFinal;  
}


function changeAutoShipText()
{
	if(document.getElementById('autoShipText'))
	{
    	document.getElementById('autoShipText').getElementsByTagName('a').item(0).innerHTML = "Add To AutoShip";
		
		
	
	}
}



function emailFriendOpenTab()
{
	var $tabs = $jq ('#tabs').tabs(); 
	var lastTab=($tabs.tabs("length"))-1;
	
	
	var emailFriendFound = document.getElementById('emailFriend').innerHTML.indexOf('Your message to your friend has been sent');
	
	if(emailFriendFound && emailFriendFound>-1)
	{
		
        switchTabs(lastTab);
		window.location.href="#emailFriend";
	}
	
}


/*ad rotator function */

function trim11(str) {
	str = str.replace(/(^,)|(,$)/g, "")

}



function readReviews_TabOpen()
{
	var readReviews = getQuerystring('pd_section');
	
	if(vSvr == 'SEAWEB01' || vSvr == 'SEAWEB02'|| vSvr == 'SEAWEB03' || vSvr == 'SEAWEB04' || vSvr == 'ATLWEB01' || vSvr == 'ATLWEB02' || vSvr =='VM-FLWDEV01')
	{
		if(readReviews == 'pr')
		{
		switchTabs(0);
		window.location.href="#productReviews";
		}
	}
	
	
}



function hideShow() {
	var $tabs = $jq ('#tabs').tabs(); 

	if (document.getElementById("alsoBought") && document.getElementById("alsoBought").innerHTML.length < 210)
		$tabs.tabs("remove",3);

	/*if (document.getElementById("compareAndSave") && document.getElementById("compareAndSave").innerHTML.length < 40) <!-- 40 is the original number -->
		$tabs.tabs("remove",3); */
		
	

	if (document.getElementById("nutritionFacts") && document.getElementById("nutritionFacts").innerHTML.length < 480)
	{
		$tabs.tabs("remove",2);
		document.getElementById("nutritionLink").style.display = "none";
		document.getElementById("nutritionFactsLink").style.display = "none";
		document.getElementById("productDetailsLink").style.display = "none";
		$tabs.tabs("select",1);
	}

	if (document.getElementById("nutritionFacts") && document.getElementById("nutritionFacts").innerHTML.length > 480)
	{
		
		var searchText = document.getElementById("nutritionFacts").innerHTML;
		
		
		if((searchText.indexOf('Supplement Facts')> -1) || (searchText.indexOf('Nutrition Facts')>-1)|| (searchText.indexOf('Nutrient Facts')>-1))
			$tabs.tabs("select",2);
		else
			{
				$tabs.tabs("select",1);
				document.getElementById("NutritionTab").innerHTML = "Ingredients";
				document.getElementById('nutritionFactsTextInTab').innerHTML = "Ingredients &#62; &#62;";
				
			}
	}
	
	
		
	
	if (document.getElementById("alsoSuggestedBox_Product") && document.getElementById("alsoSuggestedBox_Product").innerHTML.length < 500)
	{
		
		document.getElementById("suggestedPart").style.display = "none";
		/*document.getElementById('advertisement').style.marginTop = "-5px"; */
		
		
	}

	if (document.getElementById("alsoSuggestedBox_Product") && document.getElementById("alsoSuggestedBox_Product").innerHTML.length < 5000 && document.getElementById("alsoSuggestedBox_Product").innerHTML.length > 500)
	{
		document.getElementById("alsoSuggestedBox_Product").style.height = "320px";
		document.getElementById("alsoSuggestedBox_Product").style.overflow = "hidden";
		document.getElementById("suggestedItems").style.marginLeft = "7px";
		
		
		<!-- document.getElementById("ContentLeft_Baynote_Also_Suggested_Scroll_BottomBox").style.top = "367px"; -->
		
	}
	
	if (document.getElementById("alsoSuggestedBox_Product") && document.getElementById("alsoSuggestedBox_Product").innerHTML.length > 5000)
	{
		document.getElementById("alsoSuggestedBox_Product").style.height = "645px";
		document.getElementById("alsoSuggestedBox_Product").style.overflowY = "scroll";
		
		
		<!-- document.getElementById("ContentLeft_Baynote_Also_Suggested_Scroll_BottomBox").style.top = "367px"; -->
		
	}
	

	
if(document.getElementById('stripText'))
document.getElementById('stripText').innerHTML = strip2(document.getElementById('stripText').innerHTML);


if((document.getElementById('compareSave').innerHTML) && (document.getElementById('compareSave').innerHTML.length)>20)
{
document.getElementById('suggestedItems').style.display = "none";
}

function removeRollOverText() {
var yesNoZoom = document.getElementById('productDesc').innerHTML.indexOf('czMnZCnr');
if(yesNoZoom == -1)
{
	document.getElementById('RSTL_TopLine').style.display = "none";
	document.getElementById('RSTL_RightRollText').style.display = "none";
}


}



if(vPageType == 'product')
{


removeRollOverText();

ToggleText();

/* advertisement() */



emailFriendOpenTab();

changeAutoShipText();


window.setTimeout(removeShareThisProduct, 3000);

}


}

