
function wishlistCountMaxReached(){if(wishlistCountMini>=999){var errorsDiv=findObj("errorsDiv");while(errorsDiv.hasChildNodes()){errorsDiv.removeChild(errorsDiv.lastChild);}
errorsDiv.setAttribute('class','error');var ulTag=document.createElement("ul");var liTag=document.createElement("li");liTag.innerHTML='Maximum number of items in your wishlist is 999';ulTag.appendChild(liTag);errorsDiv.appendChild(ulTag);return true;}
return false;}
function checkIfEmailWishlistCountMaxReached(){if(wishlistCountMini>=199){var messagesDiv=findObj("messagesDiv");while(messagesDiv.hasChildNodes()){messagesDiv.removeChild(messagesDiv.lastChild);}
messagesDiv.setAttribute('class','error_msg');var ulTag=document.createElement("ul");var liTag=document.createElement("li");liTag.innerHTML='Please Note: The first 199 items were sent via email.';ulTag.appendChild(liTag);messagesDiv.appendChild(ulTag);}
return true;}
function sendToLoginForm(productId,sku){if(wishlistCountMaxReached()){return;}
var cookieURL=wishlistModifyURL+'?';cookieURL+='catEntryId_0='+productId+'&';cookieURL+='sku_0='+sku+'&';cookieURL+='quantity_0=1&';cookieURL+='changeCounter=1&';cookieURL+='login=1&';cookieURL+='requestingPageCriteria=simpleAdd&';cookieURL+='returnURL='+wishlistURL+'&';createCookie('borders.registerReferer',cookieURL,'1');window.location=logonFormURL;}
function sendToLoginForm1(productId,orderItemId,quantity){var cookieURL=BordersInterestItemAddURL+'?';cookieURL+='catEntryId='+productId+'&';cookieURL+='orderItemId='+orderItemId+'&';cookieURL+='quantity='+quantity+'&';cookieURL+='changeCounter=1&';cookieURL+='login=1&';cookieURL+='redirecturl='+orderItemDelete+'&URL=OrderCalculate?';cookieURL+='URL='+continueBrowsingURL;createCookie('borders.shopcartwishlist',cookieURL,'1');createCookie('borders.continueBrowsingURL',continueBrowsingURL,1);window.location=logonFormURL;}
function addToWishlist(productId,sku){if(wishlistCountMaxReached()){return;}
createCookie('borders.continueBrowsingURL',continueBrowsingURL,1);var url='WishlistModify';var pars='returnURL='+escape(wishlistModifyURL)+'&quantity_0=1&changeCounter=1&requestingPageCriteria=simpleAdd&sku_0='+sku+'&catEntryId_0='+productId;var target='popupContent';var myAjax=new Ajax.Updater(target,url,{method:'post',parameters:pars,evalScripts:true});}
function initWishlist(e){dlg0=dojo.widget.byId("dialog0");dlg0.setCloseControl(document.getElementById("hider0_0"));dlg0.setCloseControl(document.getElementById("hider0_3"));if(showDlg0=='true')
dlg0.show();}
function completeWishlist(wishlistCount){dlg0.show();}
function initCartPopUp(e){dlg1=dojo.widget.byId("dialog1");dlg1.setCloseControl(document.getElementById("hider1_0"));dlg1.setCloseControl(document.getElementById("hider1_3"));if(showDlg1=='true')
dlg1.show();}
function completeCartPopUp(wishlistCount){dlg1.show();}