function toggleEdit(form) { if(form.edit.value==""){ form.edit.value="Y"; }else{ form.edit.value=""; } form.nurl.value = form.rurl.value; form.submit(); } function linkCat(scLevel, scId){ var form = this.document.forms[0]; //alert("linkCat, called for " + form.name + ":" +scLevel+":"+scId) form.action = "/edealinv/servlet/SearchStoreItems"; form.nurl.value = "control/StoreDirectory.vm"; form.eurl.value = "control/SearchStoreItems.vm"; //alert("linkCat, about to set scId "+form.scId) form.scId.value = scId; //alert("linkCat, scId set "+form.scId.value) form.scLevel.value = scLevel; //form.scName.value = scName; //if(scChildren.length==0) // scChildren=-1; //form.scChildren.value = scChildren; //search criteria form.si_sc_id.value = scId; form.si_title.value = ""; form.csku_name.value = ""; form.st_si_price.value = ""; form.end_si_price.value = ""; form.sidx.value="0"; form.method = "get"; form.submit(); } function itemPage(siId){ var form = this.document.forms[0]; form.action = "/edealinv/servlet/ExecMacro"; form.nurl.value = "control/StoreItem.vm"; form.eurl.value = "control/StoreDirectory.vm"; form.siId.value = siId; //form.cskuName.value = cskuName; //form.siTitle.value = siTitle; //form.siPrice.value = siPrice; //form.siQty.value = siQty; //form.siThmbUrl.value = siThmbUrl; form.method = "get"; form.submit(); } function orderBy(col1){ var form = this.document.forms[0]; //Test form.action = "/edealinv/servlet/SearchStoreItems"; form.nurl.value = "control/StoreDirectory.vm"; form.eurl.value = "control/SearchStoreItems.vm"; if(form.orderby.value==col1){ if(form.sortasc.value=="0"){ form.sortasc.value="1"; }else{ form.sortasc.value="0"; } } form.orderby.value = col1; form.submit(); } // TKO: 10/11/2005 // This function should be used on all the pages except for the home page. function buyItem(form, siId, qty) { //validate quantity var num = new Number(parseInt(qty)); if(num.toString()=="NaN"){ alert(qty +" is not a valid quantity. Please double-check the quantity to add to your shopping cart."); return; }//if form.action = "/edealinv/servlet/AddStoreOrderItem"; form.nurl.value = "control/AddOrder.vm"; form.eurl.value = "control/StoreItem.vm"; if (form.ourl) { form.ourl.value = "control/StoreItem.vm"; } form.siId.value = siId; form.siQty.value = qty; form.method = "post"; form.submit(); } // TKO: 10/11/2005 // This function should be used on all cached pages (ie. home page). function buyItemCached(form, siId, qty) { //validate quantity var num = new Number(parseInt(qty)); if(num.toString()=="NaN"){ alert(qty +" is not a valid quantity. Please double-check the quantity to add to your shopping cart."); return; }//if form.action = "/edealinv/servlet/AddStoreOrderItem"; form.nurl.value = "control/AddOrder.vm"; form.eurl.value = "control/StoreItem.vm"; form.siId.value = siId; form.siQty.value = qty; form.method = "get"; form.submit(); } // TKO: 08/10/2006 // This function should be used on all the pages except for the home page, and if the item is coming // from a merchandising area. function buyItemMA(form, siId, qty, maId) { //validate quantity var num = new Number(parseInt(qty)); if(num.toString()=="NaN"){ alert(qty +" is not a valid quantity. Please double-check the quantity to add to your shopping cart."); return; }//if form.action = "/edealinv/servlet/AddStoreOrderItem"; form.nurl.value = "control/AddOrder.vm"; form.eurl.value = "control/StoreItem.vm"; form.siId.value = siId; form.siQty.value = qty; form.maId.value = maId; form.method = "post"; form.submit(); } // TKO: 08/10/2006 // This function should be used on the home page, if it is cached, and if the item is coming // from a merchandising area. function buyItemMACached(form, siId, qty, maId) { //validate quantity var num = new Number(parseInt(qty)); if(num.toString()=="NaN"){ alert(qty +" is not a valid quantity. Please double-check the quantity to add to your shopping cart."); return; }//if form.action = "/edealinv/servlet/AddStoreOrderItem"; form.nurl.value = "control/AddOrder.vm"; form.eurl.value = "control/StoreItem.vm"; form.siId.value = siId; form.siQty.value = qty; form.maId.value = maId; form.method = "get"; form.submit(); } // GIFT REGISTRY Functions function addItemToGiftregistry(form, siId, qty) { //validate quantity var num = new Number(parseInt(qty)); if(num.toString()=="NaN"){ alert(qty +" is not a valid quantity. Please double-check the quantity to add to your wish list."); return; }//if form.action = "/edealinv/servlet/ManageGiftregistry"; form.giftregistryAction.value = "addStoreItem"; form.nurl.value = "control/ViewGiftregistry.vm"; form.eurl.value = "control/ViewGiftregistry.vm"; if (form.ourl) { form.ourl.value = "control/ViewGiftregistry.vm"; } form.siId.value = siId; form.siQty.value = qty; form.method = "post"; form.submit(); } //SL Dec 2006: Add an item to a specific Gift Registry using a dropdown menu to select the registry ID function addItemToSpecificGiftregistry(form, siId, qty) { //validate quantity var num = new Number(parseInt(qty)); if(num.toString()=="NaN"){ alert(qty +" is not a valid quantity. Please double-check the quantity to add to your wish list."); return; }//if form.action = "/edealinv/servlet/ExecMacro"; form.giftregistryAction.value = "addStoreItem"; form.nurl.value = "control/ViewGiftregistry.vm"; form.eurl.value = "control/ViewGiftregistry.vm"; if (form.ourl) { form.ourl.value = "control/ViewGiftregistry.vm"; } form.siId.value = siId; form.siQty.value = qty; form.method = "post"; form.submit(); } // updates the giftregistry function updateGiftregistry(theForm, giftregistryId) { theForm.action = "/edealinv/servlet/ManageGiftregistry"; theForm.nurl.value = "control/ViewGiftregistry.vm"; theForm.eurl.value = "control/ViewGiftregistry.vm"; if (theForm.ourl) { theForm.ourl.value = "control/ViewGiftregistry.vm"; } theForm.giftregistryAction.value = "updateGiftregistry"; theForm.giftregistryId.value = giftregistryId; theForm.method = "post"; theForm.submit(); } // send email invites to view the giftregistry function sendMailInvitesGiftRegistry(theForm, giftregistryId) { theForm.action = "/edealinv/servlet/ManageGiftregistry"; theForm.nurl.value = "control/ViewGiftregistry.vm"; theForm.eurl.value = "control/ViewGiftregistry.vm"; if (theForm.ourl) { theForm.ourl.value = "control/ViewGiftregistry.vm"; } theForm.giftregistryAction.value = "sendMailInvites"; theForm.giftregistryId.value = giftregistryId; theForm.method = "post"; theForm.submit(); } // This function is used to remove an item from the giftregistry function removeItemFromGiftRegistry(theForm, giftregistryId, siId) { theForm.action = "/edealinv/servlet/ManageGiftregistry"; theForm.nurl.value = "control/ViewGiftregistry.vm"; theForm.eurl.value = "control/ViewGiftregistry.vm"; if (theForm.ourl) { theForm.ourl.value = "control/ViewGiftregistry.vm"; } theForm.giftregistryAction.value = "removeStoreItem"; theForm.giftregistryId.value = giftregistryId; theForm.siId.value = siId; theForm.method = "post"; theForm.submit(); } // select the giftregistry function selectGiftregistry(theForm, action) { theForm.action = "/edealinv/servlet/ManageGiftregistry"; theForm.nurl.value = "control/ViewGiftregistry.vm"; theForm.eurl.value = "control/ViewGiftregistry.vm"; if (theForm.ourl) { theForm.ourl.value = "control/ViewGiftregistry.vm"; } theForm.giftregistryAction.value = action; theForm.giftregistryId.value = theForm.giftregistrySelect.value; theForm.siId.value = ""; theForm.siQty.value = ""; theForm.method = "post"; theForm.submit(); } // removes the giftregistry function removeGiftregistry(theForm, giftregistryId) { theForm.action = "/edealinv/servlet/ManageGiftregistry"; theForm.nurl.value = "control/ViewGiftregistry.vm"; theForm.eurl.value = "control/ViewGiftregistry.vm"; if (theForm.ourl) { theForm.ourl.value = "control/ViewGiftregistry.vm"; } theForm.giftregistryAction.value = "removeGiftregistry"; theForm.giftregistryId.value = giftregistryId; theForm.method = "post"; var agree=confirm("Are you sure you want to remove this item?"); if (agree) { theForm.submit(); } else { return false ; } } // creates a giftregistry function createGiftregistry(theForm, newGiftregistryName) { theForm.action = "/edealinv/servlet/ManageGiftregistry"; theForm.nurl.value = "control/ViewGiftregistry.vm"; theForm.eurl.value = "control/ViewGiftregistry.vm"; if (theForm.ourl) { theForm.ourl.value = "control/ViewGiftregistry.vm"; } theForm.giftregistryAction.value = "createGiftregistry"; theForm.giftregistryName.value = newGiftregistryName; theForm.method = "post"; theForm.submit(); } // GIFT REGISTRY Functions // WISH LIST Functions function updateWishlist(theForm, wishlistId) { theForm.action = "/edealinv/servlet/ManageWishlist"; theForm.nurl.value = "control/ViewWishlist.vm"; theForm.eurl.value = "control/ViewWishlist.vm"; if (theForm.ourl) { theForm.ourl.value = "control/ViewWishlist.vm"; } theForm.wishlistAction.value = "updateWishlist"; theForm.wishlistId.value = wishlistId; theForm.method = "post"; theForm.submit(); } function sendMailInvitesWishlist(theForm, wishlistId) { theForm.action = "/edealinv/servlet/ManageWishlist"; theForm.nurl.value = "control/ViewWishlist.vm"; theForm.eurl.value = "control/ViewWishlist.vm"; if (theForm.ourl) { theForm.ourl.value = "control/ViewWishlist.vm"; } theForm.wishlistAction.value = "sendMailInvites"; theForm.wishlistId.value = wishlistId; theForm.method = "post"; theForm.submit(); } //adds an item to the wishlist function addItemToWishlist(theForm, siId, qty) { theForm.action = "/edealinv/servlet/ManageWishlist"; theForm.nurl.value = "control/ViewWishlist.vm"; theForm.eurl.value = "control/ViewWishlist.vm"; if (theForm.ourl) { theForm.ourl.value = "control/ViewWishlist.vm"; } theForm.wishlistAction.value = "addStoreItem"; theForm.siId.value = siId; theForm.siQty.value = qty; theForm.method = "post"; theForm.submit(); } //This function is used to remove an item from the wishlist function removeItemFromWishlist(theForm, wishlistId, siId) { theForm.action = "/edealinv/servlet/ManageWishlist"; theForm.nurl.value = "control/ViewWishlist.vm"; theForm.eurl.value = "control/ViewWishlist.vm"; if (theForm.ourl) { theForm.ourl.value = "control/ViewWishlist.vm"; } theForm.wishlistAction.value = "removeStoreItem"; theForm.wishlistId.value = wishlistId; theForm.siId.value = siId; theForm.method = "post"; var agree=confirm("Are you sure you want to remove this item?"); if (agree) { theForm.submit(); } else { return false ; } } // WISH LIST Functions // This function should be used on all cached pages (ie. home page). function addItemToWishlistCached(form, siId, qty) { //validate quantity var num = new Number(parseInt(qty)); if(num.toString()=="NaN"){ alert(qty +" is not a valid quantity. Please double-check the quantity to add to your wish list."); return; }//if form.action = "/edealinv/servlet/ManageWishlist"; form.wishlistAction.value = "addStoreItem"; form.nurl.value = "control/ViewWishlist.vm"; form.eurl.value = "control/ViewWishlist.vm"; if (form.ourl) { form.ourl.value = "control/ViewWishlist.vm"; } form.siId.value = siId; form.siQty.value = qty; form.method = "get"; form.submit(); } function setMasterAttrValues(f, index) { for(var i=0; i<5; i++){ eval("var attrval = f.attr_val_"+i+"_"+index); if(attrval){ addUpdInput(f, "attr_val_"+i, attrval.value); }//if }//for addUpdInput(f, "csku_master", "Y"); } // setMasterAttrValues function addUpdInput(f, name, value){ eval("var input = f."+name+";") if(input){ input.value = value; }else{ input = document.createElement("INPUT"); input.setAttribute('type', "hidden"); input.setAttribute('name', name); input.setAttribute('value', value); f.appendChild(input); } } // this function should be used mainly for multi-variants with text lists function buyMultiVarItem(theForm) { var si_array = theForm.var_id; var qty_array = theForm.var_qty; var varSize = theForm.varSize.value; var hasQty = false; var si_list = ""; var qty_list = ""; var delim = ""; //alert("variant size: " + varSize); //alert("si_array: " + si_array); //alert("qty_array: " + qty_array); if(varSize == 0) { alert("There are no items available to add to your shopping cart."); return; } // loop through all the items and check the quantity for each else { if(si_array.length > 1) { for(var i=0; i'); //winId.document.write('