﻿var Rank = -1; var MaxRank = -1; var Custfailed = false; var CustPrice = 0; var PlotArray = new Array(); function RestrictShipPopup(a) { window.open(a, null, "height=300, width=500, status=yes, toolbar=no, menubar=no, location=no, scrollbars=yes"); void ("") } function Toggle(b) { var a = b.getElementsByTagName("img"); switch (b.id) { case "proddesc": element = document.getElementById("divproddesc").style; break; case "specification": element = document.getElementById("divspecification").style; break; case "resources": element = document.getElementById("divresources").style; break; case "manufacturerinfo": element = document.getElementById("divmanufacturerinfo").style; break; case "similaritems": element = document.getElementById("divsimilaritems").style; break; case "customerdiscussion": element = document.getElementById("divcustomerdiscussion").style; break; case "engravingitems": element = document.getElementById("divengravingitems").style; break } if (element.display == "block") { element.display = "none"; a[0].src = "Images/expand.jpg"; a[0].alt = "Expand" } else { element.display = "block"; a[0].src = "Images/collapse.jpg"; a[0].alt = "Collapse" } } function ToggleCheck(a) { if (a.value == 0) { a.checked = true; a.value = 1 } else { if (a.value == 1) { a.checked = false; a.value = 0 } } } function ToggleCustDiscussionDesc(a) { elementshort = document.getElementById("divdescshort" + a.id).style; elementfull = document.getElementById("divdescfull" + a.id).style; if (elementfull.display == "block") { elementfull.display = "none"; elementshort.display = "block"; a.alt = "Expand" } else { elementfull.display = "block"; elementshort.display = "none"; a.alt = "Collapse" } } function ValidateQty(c, a, d, b) { if (c.value == "") { return } if (c.value < b) { if (a == 0) { c.value = b; document.getElementById("divQtyMin").style.display = "block" } else { c.value = b; document.getElementById("gcdivminqty" + a).style.display = "block" } } else { if (c.value > d && d != -1) { if (a == 0) { document.getElementById("divCartLimit").style.display = "block" } else { document.getElementById("gcdivcartlimit" + a).style.display = "block" } } else { if (a == 0) { document.getElementById("divQtyMin").style.display = "none"; document.getElementById("divCartLimit").style.display = "none" } else { document.getElementById("gcdivcartlimit" + a).style.display = "none"; document.getElementById("gcdivminqty" + a).style.display = "none" } } } } function Popup(a) { if (a.id.substring(0, 1) == "T") { var b = "DT" + a.id.substring(1); ToolTip_Show(a, document.getElementById(b).innerHTML, "") } else { if (a.id.substring(0, 1) == "R") { b = "DR" + a.id.substring(1); ToolTip_Show(a, document.getElementById(b).innerHTML, "") } } } function ToolTip_Show(a, c, d) { intIndexOfMatch = 0; var b; if (c != "" || d != "") { while (intIndexOfMatch != -1) { c = c.replace("¿", "'"); intIndexOfMatch = c.indexOf("¿") } if (d == "") { b = "<table><tr><td>" + c + "</td></tr></table>" } else { b = "<table><tr valign='top'><td><img alt='' src='" + d + "'/></td><td>" + c + "</td></tr></table>" } a.tt = new zxcOOPToolTip(a, b); clearTimeout(a.tt.to); a.tt.setTimeOut("show()", 0) } } function zxcOOPToolTip(b, d) { var e = document.getElementById("divtooltip"); e.innerHTML = "<div style='text-align:right;'><img src='Images/close.gif' alt='' onclick='Tooltip_Hide()' /></div>" + d; var c = (Tooltip_getLeftPos(b) + b.offsetWidth); var a = Tooltip_getTopPos(b); e.style.left = c + "px"; e.style.top = a + "px"; this.tt = e; this.ref = "zxcooptt"; window[this.ref] = this; this.to = null } zxcOOPToolTip.prototype.show = function() { this.tt.style.display = "block" }; zxcOOPToolTip.prototype.hide = function() { this.tt.style.display = "none" }; zxcOOPToolTip.prototype.setTimeOut = function(a, b) { this.to = setTimeout("window." + this.ref + "." + a, b) }; function Tooltip_getTopPos(b) { var a = b.offsetTop; while ((b = b.offsetParent) != null) { if (b.tagName != "HTML") { a += b.offsetTop } } return a } function Tooltip_getLeftPos(b) { var a = b.offsetLeft; while ((b = b.offsetParent) != null) { if (b.tagName != "HTML") { a += b.offsetLeft } } return a } function Tooltip_Hide() { if (document.getElementById("divtooltip") != null) { document.getElementById("divtooltip").style.display = "none" } } function CustDiscussionOnClick(a, b) { MC.ENET.ItemService.GetCustDiscussion(a, b, OnCustDiscussionSucceeded, OnCustDiscussionFailed); return false } function OnCustDiscussionFailed() { } function OnCustDiscussionSucceeded(a) { ele = document.getElementById("divcustomerdiscussion"); ele.innerHTML = a } function DropDownListCompSelected(a, e, g) { var d = false; var c = 0; var f = e.options[e.selectedIndex].value; var h = e.options[e.selectedIndex].title; var b = h.indexOf("¿", 0); if (b >= 0) { d = h.substring(0, b); c = h.substring(b + 1) } for (row = document.getElementById("tblListComp").rows[0]; row != null; row = row.nextSibling) { if (row.nodeType == 1) { for (cell = row.firstChild; cell != null; cell = cell.nextSibling) { if (cell.nodeType == 1) { for (ctl = cell.firstChild; ctl != null; ctl = ctl.nextSibling) { if (ctl.name == "crdcomp") { if (ctl.value == f) { ctl.checked = true; break } } } } } } } ListCompSelectionChange(a, f, g, d, c) } function RadioListCompSelected(a, e, g, c, b) { var f = e.value; var d = document.getElementById("ddlistcomp").options; for (i = 0; i < d.length; i++) { if (d[i].value == f) { d[i].selected = true } } ListCompSelectionChange(a, f, g, c, b) } function ListCompSelectionChange(a, d, e, c, b) { MC.ENET.ItemService.GetSelectedListComp(a, d, e, c, b, OnListCompSelectionChangeSucceeded, OnListCompSelectionChangeFailed); return false } function OnListCompSelectionChangeFailed() { } function OnListCompSelectionChangeSucceeded(a) { if (a != null) { for (row = document.getElementById("tblitem").rows[0]; row != null; row = row.nextSibling) { if (row.nodeType == 1) { for (cell = row.firstChild; cell != null; cell = cell.nextSibling) { if (cell.nodeType == 1) { for (ctl = cell.firstChild; ctl != null; ctl = ctl.nextSibling) { if (ctl.id != null && ctl.id != "") { if (ctl.id.indexOf("segshortdesc", 0) != -1) { ctl.innerHTML = a[0] } else { if (ctl.id.indexOf("segresourcepromo", 0) != -1) { if (a[1] != null && a[1] != "") { ctl.innerHTML = a[1]; ctl.style.display = "block" } else { ctl.style.display = "none" } } else { if (ctl.id.indexOf("segimage", 0) != -1) { ctl.innerHTML = a[2] } else { if (ctl.id.indexOf("segranking", 0) != -1) { ctl.innerHTML = a[3] } else { if (ctl.id.indexOf("segresources", 0) != -1) { if (a[4] != null && a[4] != "") { ctl.innerHTML = a[4]; ctl.style.display = "block" } else { ctl.style.display = "none" } } else { if (ctl.id.indexOf("segmanfinfo", 0) != -1) { if (a[5] != null && a[5] != "") { ctl.innerHTML = a[5]; ctl.style.display = "block" } else { ctl.style.display = "none" } } else { if (ctl.id.indexOf("segqty", 0) != -1) { ctl.innerHTML = a[6] } else { if (ctl.id.indexOf("segcustomization", 0) != -1) { if (a[7] != null && a[7] != "") { ctl.innerHTML = a[7]; ctl.style.display = "block" } else { ctl.innerHTML = ""; ctl.style.display = "none" } } } } } } } } } } } } } } } } } function VKitSelectionChange(a, d, c, e) { var b = ""; for (row = document.getElementById("tbQty").rows[0]; row != null; row = row.nextSibling) { if (row.nodeType == 1) { for (cell = row.firstChild; cell != null; cell = cell.nextSibling) { if (cell.nodeType == 1) { for (ctl = cell.firstChild; ctl != null; ctl = ctl.nextSibling) { if (ctl.name == "ddvkitcomp") { b += "¿" + ctl.options[ctl.selectedIndex].value } } } } } } if (b != "") { MC.ENET.ItemService.GetVKitCompPriceandAvail(a, b, d, c, e, OnVKitSelectionChangeSucceeded, OnVKitSelectionChangeFailed); return false } } function OnVKitSelectionChangeFailed() { } function OnVKitSelectionChangeSucceeded(a) { for (row = document.getElementById("tblitem").rows[0]; row != null; row = row.nextSibling) { if (row.nodeType == 1) { for (cell = row.firstChild; cell != null; cell = cell.nextSibling) { if (cell.nodeType == 1) { for (ctl = cell.firstChild; ctl != null; ctl = ctl.nextSibling) { if (ctl.id != null && ctl.id != "") { if (ctl.id.indexOf("segprice", 0) != -1) { ctl.innerHTML = a; setPostBackPrice() } } } } } } } } function StyleSelectionChange(a, d, e, f) { var c = ""; var b = ""; for (row = document.getElementById("tbQty").rows[0]; row != null; row = row.nextSibling) { if (row.nodeType == 1) { for (cell = row.firstChild; cell != null; cell = cell.nextSibling) { if (cell.nodeType == 1) { for (ctl = cell.firstChild; ctl != null; ctl = ctl.nextSibling) { if (ctl.name == "ddstyles") { c += "¿" + ctl.options[ctl.selectedIndex].value; b += " " + ctl.options[ctl.selectedIndex].title } } } } } } if (c != "") { MC.ENET.ItemService.GetSelectedStyleComp(a, c, b, d, e, f, 0, 0, OnStyleSelectionChangeSucceeded, OnStyleSelectionChangeFailed); return false } } function IntStyleSelectionChange(f, b, g, e, h) { var c = ""; var l = ""; for (row = document.getElementById("tbintstyle").rows[0]; row != null; row = row.nextSibling) { if (row.nodeType == 1) { for (cell = row.firstChild; cell != null; cell = cell.nextSibling) { if (cell.nodeType == 1) { for (ctl = cell.firstChild; ctl != null; ctl = ctl.nextSibling) { if (ctl.name == "ddstyles") { c += "¿" + ctl.options[ctl.selectedIndex].value; l += " " + ctl.options[ctl.selectedIndex].title } else { if (ctl.nodeName == "UL") { if (h > 0) { for (i = 0; i < ctl.childNodes.length; i++) { child = ctl.childNodes.item(i); if (child.id == h) { c += "¿" + child.id; child.childNodes[0].style.borderWidth = "3px" } else { child.childNodes[0].style.borderWidth = "1px" } } } else { for (i = 0; i < ctl.childNodes.length; i++) { child = ctl.childNodes.item(i); if (child.childNodes[0].style.borderWidth.indexOf("3px", 0) != -1) { c += "¿" + child.id; break } } } } } } } } } } var d = 0; var a = 0; list = document.getElementById("topfilter"); for (i = 0; i < list.childNodes.length; i++) { child = list.childNodes.item(i); if (child.innerHTML.indexOf("_on", 0) > 0) { d = child.id.substring(1); break } } list = document.getElementById("leftfilter"); for (i = 0; i < list.childNodes.length; i++) { child = list.childNodes.item(i); if (child.innerHTML.indexOf("_on", 0) > 0) { a = child.id.substring(1); break } } if (c != "") { MC.ENET.ItemService.GetSelectedStyleComp(f, c, l, b, g, e, d, a, OnStyleSelectionChangeSucceeded, OnStyleSelectionChangeFailed); return false } } function OnStyleSelectionChangeFailed() { } function OnStyleSelectionChangeSucceeded(a) { if (a.length == 1) { if (document.getElementById("ctl00_ContentPlaceHolder1_segintstyles").innerHTML != "") { err = document.getElementById("segstyleerr2") } else { err = document.getElementById("segstyleerr1") } err.innerHTML = a[0]; err.style.display = "block"; err.style.background = "ivory"; err.style.color = "red" } else { document.getElementById("segstyleerr1").style.display = "none"; document.getElementById("segstyleerr2").style.display = "none"; for (row = document.getElementById("tblitem").rows[0]; row != null; row = row.nextSibling) { if (row.nodeType == 1) { for (cell = row.firstChild; cell != null; cell = cell.nextSibling) { if (cell.nodeType == 1) { for (ctl = cell.firstChild; ctl != null; ctl = ctl.nextSibling) { if (ctl.id != null && ctl.id != "") { if (ctl.id.indexOf("segshortdesc", 0) != -1) { ctl.innerHTML = a[0] } else { if (ctl.id.indexOf("segimage", 0) != -1) { ctl.innerHTML = a[1] } else { if (ctl.id.indexOf("segranking", 0) != -1) { ctl.innerHTML = a[2] } else { if (ctl.id.indexOf("segprice", 0) != -1) { ctl.innerHTML = a[3]; setPostBackPrice() } else { if (ctl.id.indexOf("segqty", 0) != -1) { ctl.innerHTML = a[4] } else { if (ctl.id.indexOf("segcustomization", 0) != -1) { if (a[5] != null && a[5] != "") { ctl.innerHTML = a[5]; ctl.style.display = "block"; if (currencydisplay) { var b = document.getElementById("custpriceperchar"); if (b != null) { b.innerHTML = getInitPriceSaving(b.innerHTML) } b = document.getElementById("custprice"); if (b != null) { b.innerHTML = getInitPriceSaving(b.innerHTML) } } } else { ctl.innerHTML = ""; ctl.style.display = "none" } } else { if (ctl.id.indexOf("segintstyles", 0) != -1) { if (a[6] != "" && a[6] != null) { ctl.innerHTML = a[6]; ctl.style.display = "block" } else { ctl.style.display = "none" } } else { if (ctl.id.indexOf("seggrpitems", 0) != -1) { if (a[7] != "" && a[7] != null) { ctl.innerHTML = a[7]; ctl.style.display = "block"; SetDraggables() } else { ctl.style.display = "none" } } } } } } } } } } } } } } } if (document.getElementById("ctl00_ContentPlaceHolder1_seggrpitems").innerHTML != "") { SetDroppables(); SetPreloadedIcons(); CalIntItemPrice() } } } function EngSelectionChange(a) { var b = 0; for (row = document.getElementById("tbEngraving").rows[0]; row != null; row = row.nextSibling) { if (row.nodeType == 1) { for (cell = row.firstChild; cell != null; cell = cell.nextSibling) { if (cell.nodeType == 1) { for (ctl = cell.firstChild; ctl != null; ctl = ctl.nextSibling) { if (ctl.name == "ddengvkitcomp") { b += ctl.options[ctl.selectedIndex].title } } } } } } MC.ENET.ItemService.EngItemPriceFormat(b, OnEngPriceFormatSucceeded, OnEngPriceFormatFailed); return false } function OnEngPriceFormatFailed() { } function OnEngPriceFormatSucceeded(a) { var b = document.getElementById("divengprice"); b.innerHTML = "<label class='ourprice4'>" + a + "</label>" } function OnGetNoAttachmentErrFailed() { } function OnGetNoAttachmentErrSucceeded(a) { var b = document.getElementById("segstyleerr1"); b.innerHTML = a; b.style.display = "block" } function AddToButtonClick(y, u, r, C) { var m; var b; var D; var B = ""; var q = ""; var s = ""; var c = 0; var e = 0; var a = false; var x = 0; var l = 0; var F = 0; var n = ""; var t = ""; var w = ""; var E = 1; var f = 1; var h = ""; var A = ""; var o = false; var d = new Array(); var v = false; var g = new RegExp("[1-9]"); var p = ""; if (document.getElementById("divimg") != null) { for (z = 0; z < PlotArray.length; z++) { if (PlotArray[z][2] != "") { v = true; break } } if (!v) { MC.ENET.ItemService.GetNoAttachmentErr(OnGetNoAttachmentErrSucceeded, OnGetNoAttachmentErrFailed); return false } } v = false; if (document.getElementById("tblCust") != null) { CalculateCustPrice(); if (Custfailed) { return } } if (u == "CART" || u == "WISHLIST") { B = document.getElementById("itemno").title; q = document.getElementById("txtQuantity").value } if (u == "EKITCART") { B = r; q = C } if (u == "CART" || u == "GRIDCART" || u == "EKITCART") { if (document.getElementById("tblRecItems") != null) { for (m = document.getElementById("tblRecItems").rows[0]; m != null; m = m.nextSibling) { if (m.nodeType == 1) { for (b = m.firstChild; b != null; b = b.nextSibling) { if (b.nodeType == 1) { for (D = b.firstChild; D != null; D = D.nextSibling) { if (D.name == "ckaddrectoorder") { if (D.value == 1) { s += "¿" + D.id } } } } } } } } if (document.getElementById("tblTopSelling") != null) { for (m = document.getElementById("tblTopSelling").rows[0]; m != null; m = m.nextSibling) { if (m.nodeType == 1) { for (b = m.firstChild; b != null; b = b.nextSibling) { if (b.nodeType == 1) { for (D = b.firstChild; D != null; D = D.nextSibling) { if (D.name == "ckaddtoptoorder") { if (D.value == 1) { s += "¿" + D.id } } } } } } } } } if (u == "CART" || u == "WISHLIST") { if (document.getElementById("tblListComp") != null) { for (m = document.getElementById("tblListComp").rows[0]; m != null; m = m.nextSibling) { if (m.nodeType == 1) { for (b = m.firstChild; b != null; b = b.nextSibling) { if (b.nodeType == 1) { for (D = b.firstChild; D != null; D = D.nextSibling) { if (D.name == "crdcomp") { if (D.checked == true) { v = true } } else { if (D.id != null && D.id != "") { if (D.id.indexOf("cwebprice", 0) != -1) { if (v == true) { c = (D.innerText || D.textContent).trim() } } else { if (D.id.indexOf("cexclvatprice", 0) != -1) { if (v == true) { c = (D.innerText || D.textContent).trim() } } else { if (D.id.indexOf("csurchrg", 0) != -1) { if (v == true) { e = (D.innerText || D.textContent).trim() } } else { if (D.id.indexOf("cexclvatsurchrg", 0) != -1) { if (v == true) { e = (D.innerText || D.textContent).trim() } } else { if (D.id.indexOf("cpriceoverride", 0) != -1) { if (v == true) { x = 1; l = D.value.trim(); if (!g.test(l)) { D.style.color = "red"; D.focus(); return } } } else { if (D.id.indexOf("cpricematch", 0) != -1) { if (v == true) { x = 2; l = (D.innerText || D.textContent).trim() } } } } } } } } else { if (D.name == "cpricematchid") { if (v == true) { F = D.value } } else { if (D.name == "cavail") { if (v == true) { a = D.value; v = false } } } } } } } } } } } else { for (m = document.getElementById("tbprice").rows[0]; m != null; m = m.nextSibling) { if (m.nodeType == 1) { for (b = m.firstChild; b != null; b = b.nextSibling) { if (b.nodeType == 1) { for (D = b.firstChild; D != null; D = D.nextSibling) { if (D.id == "webprice") { c = (D.innerText || D.textContent).trim() } else { if (D.id == "exclvatprice") { c = (D.innerText || D.textContent).trim() } else { if (D.id == "surchrg") { e = (D.innerText || D.textContent).trim() } else { if (D.id == "exclvatsurchrg") { e = (D.innerText || D.textContent).trim() } else { if (D.id == "avail") { a = D.value } else { if (D.id == "priceoverride") { x = 1; l = D.value.trim(); if (!g.test(l)) { D.style.color = "red"; D.focus(); return } } else { if (D.id == "pricematch") { x = 2; l = (D.innerText || D.textContent).trim() } else { if (D.id == "pricematchid") { F = D.value } } } } } } } } } } } } } } } if (u == "CART") { if (document.getElementById("tblCust") != null) { for (m = document.getElementById("tblCust").rows[0]; m != null; m = m.nextSibling) { if (m.nodeType == 1) { for (b = m.firstChild; b != null; b = b.nextSibling) { if (b.nodeType == 1) { for (D = b.firstChild; D != null; D = D.nextSibling) { if (D.name == "txtCustReq") { n += "¿" + D.value } else { if (D.name == "txtCustOpt") { n += "¿" + D.value } else { if (D.id == "custdisptxt") { p = D.value } } } } } } } } } if (document.getElementById("tbQty") != null) { for (m = document.getElementById("tbQty").rows[0]; m != null; m = m.nextSibling) { if (m.nodeType == 1) { for (b = m.firstChild; b != null; b = b.nextSibling) { if (b.nodeType == 1) { for (D = b.firstChild; D != null; D = D.nextSibling) { if (D.name == "ddvkitcomp") { if (D.options[D.selectedIndex].value != 0) { t += "¿" + D.options[D.selectedIndex].value } } } } } } } } if (document.getElementById("divimg") != null) { for (z = 0; z < PlotArray.length; z++) { if (PlotArray[z][2] != "") { t += "¿" + PlotArray[z][2] + "|" + PlotArray[z][1] } } } if (document.getElementById("tbEngraving") != null) { for (m = document.getElementById("tbEngraving").rows[0]; m != null; m = m.nextSibling) { if (m.nodeType == 1) { for (b = m.firstChild; b != null; b = b.nextSibling) { if (b.nodeType == 1) { for (D = b.firstChild; D != null; D = D.nextSibling) { if (D.id == "ckengraving") { if (D.value == 1) { o = true } } else { if (D.id == "eitemno") { if (o == true) { w = D.value } } else { if (D.id == "eitemtype") { if (o == true) { f = D.value } } else { if (D.name == "txtCustParam") { if (o == true) { h += "¿" + D.value } } else { if (D.name == "ddengvkitcomp") { if (o == true) { A += "¿" + D.options[D.selectedIndex].value } } } } } } } } } } } } } if (u == "GRIDCART" || u == "GRIDWISHLIST") { var z = 0; $("#tbgridcomp:td *").each(function() { var G = $(this).attr("id"); var H = $(this).attr("name"); if (G != null && G != "") { if (G.indexOf("gcitemno", 0) != -1) { B = $(this).attr("title") } else { if (G.indexOf("gcpricematch", 0) != -1) { x = 2; l = $(this).html().trim() } else { if (G.indexOf("gcpriceoverride", 0) != -1) { x = 1; l = $(this).val().trim(); if (!g.test(l)) { $(this).css("color", "red"); $(this).focus(); return } } else { if (G.indexOf("gcwebprice", 0) != -1) { c = $(this).html().trim() } else { if (G.indexOf("gcexclvatprice", 0) != -1) { c = $(this).html().trim() } else { if (G.indexOf("gcsurchrg", 0) != -1) { e = $(this).html().trim() } else { if (G.indexOf("gcexclvatsurchrg", 0) != -1) { e = $(this).html().trim() } else { if (G.indexOf("gctxtQuantity", 0) != -1) { q = $(this).val(); if (q > 0) { d[z] = new Array(10); d[z][0] = B; d[z][1] = y; d[z][2] = q; d[z][3] = x; d[z][4] = l; d[z][5] = F; d[z][6] = c; d[z][7] = a; d[z][8] = e; d[z][9] = t; z++ } t = "" } } } } } } } } } else { if (H == "gcitemtype") { y = $(this).val() } else { if (H == "gcpricematchid") { F = $(this).val() } else { if (H == "gcavail") { a = $(this).val() } else { if (H == "ddvkitcomp") { if ($(this).val() != "0") { t += "¿" + $(this).val() } } } } } } }) } if (u == "CART" || u == "EKITCART") { MC.ENET.ItemService.AddItemToCart(B, y, q, s, x, F, l, n, t, w, E, f, h, A, CustPrice, p, OnAddToCartSucceeded, OnAddToCartFailed) } else { if (u == "GRIDCART") { MC.ENET.ItemService.AddItemsToCart(d, s, OnAddToCartSucceeded, OnAddToCartFailed) } else { if (u == "WISHLIST") { MC.ENET.ItemService.AddItemToWishList(B, y, q, c, e, a, l, CustPrice, OnAddToWishListSucceeded, OnAddToWishListFailed) } else { if (u == "GRIDWISHLIST") { MC.ENET.ItemService.AddItemsToWishList(d, OnAddToWishListSucceeded, OnAddToWishListFailed) } } } } return false } function OnAddToCartFailed() { } function OnAddToCartSucceeded(a) { if (a != null || a.length > 0) { window.location.href = "CartPage" + a } else { window.location.href = "CartPage.aspx" } } function OnAddToWishListFailed() { } function OnAddToWishListSucceeded(a) { window.location.href = "Members/WishListUpdate.aspx" } function ToggleRateIt(b) { var c = b.options[b.selectedIndex].value; Rank = c; MaxRank = b.length - 1; var e = document.getElementById("divcustrating"); var a; if (e != null) { for (a = 0; a < e.childNodes.length; a++) { var d = e.childNodes.item(a); if (d.nodeName == "IMG") { if (c == -1) { d.style.visibility = "hidden" } else { d.style.visibility = "visible" } break } } } } function RateItOnClick(a) { MC.ENET.ItemService.InsertItemOverallRanking(a, Rank, MaxRank, OnRateItSucceeded, OnRateItFailed); return false } function OnRateItFailed() { } function OnRateItSucceeded(a) { window.location.href = a } function CalculateCustPrice() { PricePerChar = 0; PricePerCharThld = 0; FlatFee = 0; defCurSymbol = ""; customization = ""; Custfailed = false; ctlreq = null; if (document.getElementById("tblCust") != null) { for (row = document.getElementById("tblCust").rows[0]; row != null; row = row.nextSibling) { if (row.nodeType == 1) { for (cell = row.firstChild; cell != null; cell = cell.nextSibling) { if (cell.nodeType == 1) { for (ctl = cell.firstChild; ctl != null; ctl = ctl.nextSibling) { if (ctl.name == "txtCustReq") { if (ctl.value != null) { if (trim(ctl.value).length == 0) { ctl.value = ""; ctl.focus(); Custfailed = true; ctlreq.style.color = "Red"; ctlreq = null; return -1 } else { ctlreq.style.color = "Black"; ctlreq = null; customization += trim(ctl.value) } } else { return } } else { if (ctl.name == "txtCustOpt") { if (ctl.value != null) { customization += trim(ctl.value) } } else { if (ctl.nodeName == "LABEL" && ctl.className == "custreq") { ctlreq = ctl } else { if (ctl.id == "PricePerChar") { PricePerChar = new Number(ctl.value) } else { if (ctl.id == "PricePerCharThld") { PricePerCharThld = new Number(ctl.value) } else { if (ctl.id == "FlatFee") { FlatFee = new Number(ctl.value) } else { if (ctl.id == "defSymbol") { defCurSymbol = ctl.value } } } } } } } } } } } } } CustPrice = FlatFee; if (customization.length > 0 && (PricePerChar > 0 || FlatFee > 0)) { j = 0; temp = new Array(); for (i = 0; i < customization.length; i++) { if (customization[i] != " ") { temp[j] = customization[i]; j++ } } if (temp.length > PricePerCharThld) { CustPrice = ((temp.length - PricePerCharThld) * PricePerChar) + FlatFee } CustPrice = removeHTMLEntities(setCustCalPrice(defCurSymbol + CustPrice.toFixed(2))); var a = document.getElementById("custprice"); if (a != null) { a.innerHTML = CustPrice } } } function GridVKitSelectionChange(e, a, d, c, f, g) { var b = ""; for (row = document.getElementById("tbgridcomp").rows[0]; row != null; row = row.nextSibling) { if (row.nodeType == 1 && row.rowIndex == g) { for (cell = row.firstChild; cell != null; cell = cell.nextSibling) { if (cell.nodeType == 1) { for (ctl = cell.firstChild; ctl != null; ctl = ctl.nextSibling) { if (ctl.name == "ddvkitcomp") { b += "¿" + ctl.options[ctl.selectedIndex].value } } } } } } if (b != "") { MC.ENET.ItemService.GridVKitSelectionChange(e, a, b, d, c, f, g, OnGridVKitSelectionChangeSucceeded, OnGridVKitSelectionChangeFailed); return false } } function OnGridVKitSelectionChangeFailed() { } function OnGridVKitSelectionChangeSucceeded(a) { for (row = document.getElementById("tbgridcomp").rows[0]; row != null; row = row.nextSibling) { if (row.nodeType == 1 && row.rowIndex == a[0]) { for (cell = row.firstChild; cell != null; cell = cell.nextSibling) { if (cell.nodeType == 1) { if (cell.innerHTML.indexOf("gcavail", 0) > 0) { cell.innerHTML = a[1] } else { if (cell.innerHTML.indexOf("tdprice", 0) > 0) { cell.innerHTML = a[2] } else { if (cell.innerHTML.indexOf("gctxtQuantity", 0) > 0) { cell.innerHTML = a[3] } } } } } } } } function TopFilterChange(d, c) { InteractiveImgID = 0; if (document.getElementById("intimgid") != null) { InteractiveImgID = document.getElementById("intimgid").value } var e = document.getElementById("topfilter"); var a = 0; var b = 0; for (i = 0; i < e.childNodes.length; i++) { var f = e.childNodes.item(i); if (f == d) { f.innerHTML = f.innerHTML.replace("_off", "_on") || f.innerHTML.replace("_Off", "_on"); a = f.id.substring(1) } else { f.innerHTML = f.innerHTML.replace("_on", "_off") || f.innerHTML.replace("_On", "_off") } } e = document.getElementById("leftfilter"); for (i = 0; i < e.childNodes.length; i++) { f = e.childNodes.item(i); if (f.innerHTML.indexOf("_on", 0) > 0 || f.innerHTML.indexOf("_On", 0) > 0) { b = f.id.substring(1); break } } MC.ENET.ItemService.GetGroupItems(c, a, b, InteractiveImgID, OnGetGroupItemsSucceeded, OnGetGroupItemsFailed); return false } function LeftFilterChange(d, c) { InteractiveImgID = 0; if (document.getElementById("intimgid") != null) { InteractiveImgID = document.getElementById("intimgid").value } var e = document.getElementById("leftfilter"); var a = 0; var b = 0; for (i = 0; i < e.childNodes.length; i++) { var f = e.childNodes.item(i); if (f == d) { f.innerHTML = f.innerHTML.replace("_off", "_on") || f.innerHTML.replace("_Off", "_on"); b = f.id.substring(1) } else { f.innerHTML = f.innerHTML.replace("_on", "_off") || f.innerHTML.replace("_On", "_off") } } e = document.getElementById("topfilter"); for (i = 0; i < e.childNodes.length; i++) { f = e.childNodes.item(i); if (f.innerHTML.indexOf("_on", 0) > 0 || f.innerHTML.indexOf("_On", 0) > 0) { a = f.id.substring(1); break } } MC.ENET.ItemService.GetGroupItems(c, a, b, InteractiveImgID, OnGetGroupItemsSucceeded, OnGetGroupItemsFailed); return false } function OnGetGroupItemsFailed() { } function OnGetGroupItemsSucceeded(a) { if (a != null) { var b = document.getElementById("ctl00_ContentPlaceHolder1_seggrpitems"); if (b != null) { b.innerHTML = ""; b.innerHTML = a; SetDraggables() } } } function GetAlternativeImgView(a, g, f, e, c) { var b = 0; var d = 0; list = document.getElementById("topfilter"); for (i = 0; i < list.childNodes.length; i++) { child = list.childNodes.item(i); if (child.innerHTML.indexOf("_on", 0) > 0) { b = child.id.substring(1); break } } list = document.getElementById("leftfilter"); for (i = 0; i < list.childNodes.length; i++) { child = list.childNodes.item(i); if (child.innerHTML.indexOf("_on", 0) > 0) { d = child.id.substring(1); break } } MC.ENET.ItemService.GetAlternativeImgView(a, g, f, e, c, b, d, OnGetAlternativeImgViewSucceeded, OnGetAlternativeImgViewFailed); return false } function OnGetAlternativeImgViewFailed() { } function OnGetAlternativeImgViewSucceeded(a) { if (a != null) { if (a[0] != null || a[0] != "") { div = document.getElementById("ctl00_ContentPlaceHolder1_segimage"); if (div != null) { div.innerHTML = ""; div.innerHTML = a[0]; SetDroppables(); SetPreloadedIcons(); CalIntItemPrice() } } if (a[1] != null || a[1] != "") { div = document.getElementById("ctl00_ContentPlaceHolder1_seggrpitems"); if (div != null) { div.innerHTML = ""; div.innerHTML = a[1]; SetDraggables() } } } } function SetDroppables() { $(document).ready(function() { $("#divimg > div").droppable({ accept: "#draggables:td img", drop: function(b, c) { var d = false; $(this).html(""); $(this).css("backgroundColor", "transparent"); c.draggable.attr("title", "Double click to remove the icons"); c.draggable.attr("ondblclick", "javascript:RemoveImage(this);"); c.draggable.ondblclick = function() { RemoveImage(this) }; $(this).append(c.draggable.clone().css("width", $(this).css("width")).css("height", $(this).css("height"))).fadeIn(); var a = document.getElementById("segstyleerr1"); a.innerHTML = ""; a.style.display = "none"; for (j = 0; j < PlotArray.length; j++) { if (PlotArray[j] != null) { if (PlotArray[j][0] == $(this).attr("id")) { PlotArray[j][1] = $(this).attr("title"); PlotArray[j][2] = c.draggable.attr("id"); PlotArray[j][3] = c.draggable.attr("src"); PlotArray[j][4] = c.draggable.attr("alt"); d = true; break } } } if (!d) { k = PlotArray.length; PlotArray[k] = new Array(5); PlotArray[k][0] = $(this).attr("id"); PlotArray[k][1] = $(this).attr("title"); PlotArray[k][2] = c.draggable.attr("id"); PlotArray[k][3] = c.draggable.attr("src"); PlotArray[k][4] = c.draggable.attr("alt") } CalIntItemPrice() } }) }) } function CalIntItemPrice() { attachItemIDs = ""; for (i = 0; i < PlotArray.length; i++) { if (PlotArray[i][2] != "") { attachItemIDs += "¿" + PlotArray[i][2] } } if (attachItemIDs != "") { MC.ENET.ItemService.CalIntItemPrice(document.getElementById("itemno").title, attachItemIDs, document.getElementById("source").value, CalIntItemPriceSucceeded, CalIntItemPriceFailed); return false } } function CalIntItemPriceFailed() { } function CalIntItemPriceSucceeded(a) { if (a != null) { var b = document.getElementById("ctl00_ContentPlaceHolder1_segprice"); if (b != null) { b.innerHTML = ""; b.innerHTML = a } } } function SetDraggables() { $(document).ready(function() { $("#draggables:td img").draggable({ revert: "valid", cursor: "move", helper: "clone" }) }) } function SetPreloadedIcons() { var b = document.getElementById("divimg"); if (b != null) { for (i = 0; i < b.childNodes.length; i++) { child = b.childNodes.item(i); if (child.id.indexOf("plot", 0) != -1) { for (j = 0; j < PlotArray.length; j++) { if (PlotArray[j] != null) { if (PlotArray[j][0] == child.id) { if (PlotArray[j][2] != "") { var a = document.createElement("IMG"); a.setAttribute("id", PlotArray[j][2]); a.setAttribute("src", PlotArray[j][3]); a.setAttribute("alt", PlotArray[j][4]); a.setAttribute("width", child.style.width); a.setAttribute("height", child.style.height); a.setAttribute("title", "Double click to remove the icons"); a.setAttribute("ondblclick", "javascript:RemoveImage(this);"); a.ondblclick = function() { RemoveImage(this) }; child.style.backgroundColor = "transparent"; child.appendChild(a); a.style.width = child.style.width; a.style.height = child.style.height } } } } } } } } function RemoveImage(a) { id = a.parentNode.id; a.parentNode.style.backgroundColor = "transparent"; a.parentNode.innerHTML = ""; for (i = 0; i < PlotArray.length; i++) { if (id == PlotArray[i][0]) { PlotArray[i][2] = ""; PlotArray[i][3] = ""; PlotArray[i][4] = "" } } attachItemIDs = ""; for (i = 0; i < PlotArray.length; i++) { if (PlotArray[i][2] != "") { attachItemIDs += "¿" + PlotArray[i][2] } } MC.ENET.ItemService.CalIntItemPrice(document.getElementById("itemno").title, attachItemIDs, document.getElementById("source").value, CalIntItemPriceSucceeded, CalIntItemPriceFailed); return false } function LTrim(b) { var a = /\s*((\S+\s*)*)/; return b.replace(a, "$1") } function RTrim(b) { var a = /((\s*\S+)*)\s*/; return b.replace(a, "$1") } function trim(a) { return LTrim(RTrim(a)) };
