﻿function numOnly(a) { var b; if (a == null) { a = window.event } b = a.keyCode; if (b == 46 || b == 8) { return true } if (b < 48 || b > 57) { return false } return true } function submitItems() { var a = ""; var d = $get("itemsAdded"); var c = d.rows.length; for (var b = 1; b < c; b++) { a += d.rows[b].cells[0].innerHTML + "^" + d.rows[b].cells[1].title; if (b < c - 1) { a += "|" } } MC.ENET.CatQuickService.Submit(a, OnSubmitSucceeded, OnSubmitFailed); return false } function OnSubmitFailed() { var a = "Sorry, your quick order can not submitted."; alert(a) } function OnSubmitSucceeded(a) { if (a && a * 1 > 0) { var b = "Your quick order of "; if (a * 1 == 1) { b += " 1 item succeeds." } else { b += a * 1 + " items succeeds." } alert(b); $get("itemNoInput").value = ""; $get("qtyInput").value = ""; $get("itemNoInput").focus(); clearTable($get("itemsAdded")) } } function deleteTable(a) { if (confirm("Are you sure you want to delete this item?")) { var b = $get("itemsAdded"); b.deleteRow(a) } } function resetUI() { oIframe.style.display = "inline"; document.body.disabled = true; $get("submit").disabled = true; $get("itemNoInput").disabled = true; $get("qtyInput").disabled = true; $get("find").disabled = true } function addRowToTable(g, h) { var e = $get("itemsAdded"); var d = e.rows.length; var f = e.insertRow(d); var b = f.insertCell(0); var c = f.insertCell(1); b.innerHTML = g; c.innerHTML = "<input id='t" + d + "' name='t" + d + "' value='" + h + "' type='text' class='' onkeydown='return numOnly(event);' />"; c.title = h; var a = f.insertCell(2); a.innerHTML = "<input id='b" + d + "' name='b" + d + "' value='Delete' type='button' class='' onclick='deleteTable(" + d + ");' />"; $get("itemNoInput").value = ""; $get("qtyInput").value = "" } function clearTable(c) { var b = c.rows.length; for (var a = b - 1; a > 0; a--) { c.deleteRow(a) } } function addRowToTabletype3(a) { if (a == "") { alert("Sorry...please try again."); return } addRowToTable(a, qty) } function addRowToTabletype6(a, b) { if (a == "" || b.length == 0) { alert("Sorry...please try again."); return } addRowToTable(a + " -attached:" + b, qty) } function addRowToTabletype7(a) { if (a == "") { alert("Sorry...please try again."); return } addRowToTable(a, qty) } function clearInput() { $get("itemNoInput").value = ""; $get("qtyInput").value = ""; $get("itemNoInput").focus() } function GetBack7() { var b = $get("itemStyles"); var a = b.options[b.selectedIndex].value; if (b.selectedIndex == 0 || a == -1) { alert("Please select an item."); return } else { setUI(); parent.addRowToTabletype7(a) } } function GetBack3() { var d = 0; var c = 0; var b = 0; var a = $get("itemStyles0"); if (a) { d = a.options[a.selectedIndex].value; if (a.selectedIndex == 0 || d * 1 == -1) { alert("Please select a style."); return } } a = $get("itemStyles1"); if (a) { c = a.options[a.selectedIndex].value; if (a.selectedIndex == 0 || c * 1 == -1) { alert("Please select a style."); return } } a = $get("itemStyles2"); if (a) { b = a.options[a.selectedIndex].value; if (a.selectedIndex == 0 || b * 1 == -1) { alert("Please select a style."); return } } MC.ENET.CatQuickService.GetItemNoFromStyleChoice(tItemNo, d, c, b, OnCatsubSucceeded, OnCatsubFailed); return false } function OnCatsubSucceeded(a) { if (a) { setUI(); parent.addRowToTabletype3(a) } } function OnCatsubFailed() { $get("back").style.display = "none"; alert("Sorry..."); setUI() } function setUI() { window.location = "about:blank"; parent.document.body.disabled = false; parent.$get("submit").disabled = false; parent.$get("itemNoInput").disabled = false; parent.$get("qtyInput").disabled = false; parent.$get("find").disabled = false; parent.$get("otherType").style.display = "none"; parent.$get("itemNoInput").value = ""; parent.$get("qtyInput").value = ""; parent.$get("itemNoInput").focus() } function GetBack6() { var d = ""; var e = new Array(vkit.length); for (var c = 0; c < vkit.length; c++) { switch (c) { case 0: e[0] = document.form1.kitItem0; break; case 1: e[1] = document.form1.kitItem1; break; case 2: e[2] = document.form1.kitItem2; break; case 3: e[3] = document.form1.kitItem3; break; case 4: e[4] = document.form1.kitItem4; break; case 5: e[5] = document.form1.kitItem5; break; case 6: e[6] = document.form1.kitItem6; break; case 7: e[7] = document.form1.kitItem7; break; case 8: e[8] = document.form1.kitItem8; break; case 9: e[9] = document.form1.kitItem9; break } } var b = ""; for (var c = 0; c < vkit.length; c++) { b = ""; for (var a = 0; a < e[c].length; a++) { if (e[c][a].checked == true) { b = vkit[c][a]; break } } if (b.length == 0) { alert("please choose an item with radio button from kit" + (c + 1) * 1 + "."); return } d += b; if (c < vkit.length - 1) { d += "," } } setUI(); parent.addRowToTabletype6(tItemNo, d) } function GetBack() { switch (tItemType) { case 3: GetBack3(); break; case 6: GetBack6(); break; case 7: GetBack7(); break } } function OnCatQuickSucceeded(a) { if (a != "undefined") { switch (a) { case 0: alert("The item you chose is not available or valid."); clearInput(); break; case 1: case 4: case 5: var b = $get("itemsAdded"); addRowToTable($get("itemNoInput").value, $get("qtyInput").value); clearInput(); break; case 3: oIframe.src = "CatQuickSub.aspx?itemNo=" + itemNum + "&itemType=3"; resetUI(); break; case 6: oIframe.src = "CatQuickSub.aspx?itemNo=" + itemNum + "&itemType=6"; resetUI(); break; case 7: oIframe.src = "CatQuickSub.aspx?itemNo=" + itemNum + "&itemType=7"; resetUI(); break } } } function OnCatQuickFailed() { alert("Can not get Item type.") } function findType() { itemNum = $get("itemNoInput").value; qty = $get("qtyInput").value; if (itemNum && qty && itemNum.length > 0 && qty.length > 0) { MC.ENET.CatQuickService.GetItemType(itemNum, OnCatQuickSucceeded, OnCatQuickFailed); return false } else { alert("Please enter Item Number and Quantity first.") } } function EasyPayPopup(b) { var a = window.open(b, "EasyPayPopUp", "width=650,height=396,left=100,top=100,scrollbars=1,resizeable=1"); if (window.focus) { a.focus() } self.name = "AMSMain"; return true } function popupPage(a) { window.open(a, null, "height=500, width=300, status=yes, toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=yes"); void ("") } function clickclear(b, a) { if (b.value == a) { b.value = "" } } function setCookie(c, e, a, g, d, f) { var b = c + "=" + escape(e) + ((a) ? "; expires=" + a.toGMTString() : "") + ((g) ? "; path=" + g : "") + ((d) ? "; domain=" + d : "") + ((f) ? "; secure" : ""); document.cookie = b } function ReadCookie(d) { var b = "" + document.cookie; var c = b.indexOf(d); if (c == -1 || d == "") { return "" } var a = b.indexOf(";", c); if (a == -1) { a = b.length } return unescape(b.substring(c + d.length + 1, a)) } function SetPanelCookie(d, a, g, h) { var e = d.id.replace(a, g); var c = $get(e); var b = new Date(); b.setTime(b.getTime() + 365 * 24 * 60 * 60 * 1000); var f = "0"; if (c.style.height == "auto") { f = "1" } else { f = "0" } setCookie(h, f, b) } function Homeinit() { var b; var a; var d = new Array(); d[0] = "FeaturedItems"; d[1] = "FavoriteMenu"; d[2] = "LastPurchased"; d[3] = "mostWished"; d[4] = "NewestProducts"; d[5] = "PopularSearches"; d[6] = "RecentlyViewedItems"; d[7] = "TopBrands"; d[8] = "TopCategories"; d[9] = "TopCategoriesList"; d[10] = "TopWishedItems"; for (var c = 0; c < d.length; c++) { b = $get("hideid" + d[c]); a = $get("ctl00_ContentPlaceHolder1_ctl00_" + d[c]); if (!a) { a = $get(d[c]) } if (a && b) { if (ReadCookie(d[c]) == 1) { a.style.visibility = "hidden"; b.innerHTML = "UnHide" } else { a.style.visibility = "visible"; b.innerHTML = "Hide" } } } } function Toggle(d) { var c = new Date(); c.setTime(c.getTime() + 365 * 24 * 60 * 60 * 1000); var b = $get("hideid" + d); if (b.innerHTML.startsWith("Hide")) { b.innerHTML = "UnHide"; setCookie(d, "1", c) } else { b.innerHTML = "Hide"; setCookie(d, "0", c) } var a = $get("ctl00_ContentPlaceHolder1_ctl00_" + d); if (!a) { a = $get(d) } if (b.innerHTML.startsWith("Hide")) { a.style.visibility = "visible" } else { a.style.visibility = "hidden" } } function OnWizardFailed() { alert("server error!") } function OnWizardSucceeded(a, c) { if (a) { var e = (c.id.substring(c.id.length - 1, c.id.length) * 1 + 1); var b; if (e == 2) { b = $get("select2") } else { if (e == 3) { b = $get("select3") } else { if (e == 4) { b = $get("select4") } else { if (e == 5) { b = $get("select5") } } } } b.options.length = 0; var f; if (e == dropInit.length) { if (dropInit[e - 1].brand == true) { f = new Option(manufacture, "-1"); b.options.add(f, 0) } } for (var d = 0; d < a.length; d++) { f = new Option(a[d].Text, a[d].Value); if (b.options.length > 0) { b.options.add(f, d + 1) } else { b.options.add(f, d) } } b.selectedIndex = 0; if (e < dropInit.length) { b.onchange() } } } function GetSelectedValue(c) { var b = document.getElementById("select5"); if (b != null) { var d = b.options[b.selectedIndex].value; var a = document.getElementById(c); a.value = d; return } b = document.getElementById("select4"); if (b != null) { var d = b.options[b.selectedIndex].value; var a = document.getElementById(c); a.value = d; return } b = document.getElementById("select3"); if (b != null) { var d = b.options[b.selectedIndex].value; var a = document.getElementById(c); a.value = d; return } b = document.getElementById("select2"); if (b != null) { var d = b.options[b.selectedIndex].value; var a = document.getElementById(c); a.value = d; return } } var pageNum = 1; function onEnter(a, b) { if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) { filterResultUrl(); return false } else { return true } } function DropDownonchange(a) { if (a.id == "FileTypeDropDown") { $get("FileTypeDropDownBt").selectedIndex = a.selectedIndex } else { if (a.id == "FileTypeDropDownBt") { $get("FileTypeDropDown").selectedIndex = a.selectedIndex } else { if (a.id == "BrandDropDownBt") { $get("BrandDropDown").selectedIndex = a.selectedIndex } else { if (a.id == "BrandDropDown") { $get("BrandDropDownBt").selectedIndex = a.selectedIndex } else { if (a.id == "txtKeyWord") { $get("txtKeyWordBt").value = a.value } else { if (a.id == "txtKeyWordBt") { $get("txtKeyWord").value = a.value } } } } } } } function filterResultUrl() { var c = $get("FileTypeDropDown"); var a = $get("BrandDropDown"); var b = "ItemFiles"; if (c.options[c.selectedIndex].value != 0) { b = b + "--id-" + c.options[c.selectedIndex].value } if (a.options[a.selectedIndex].value != 0) { b = b + "--b-" + a.options[a.selectedIndex].value } if ($get("txtKeyWord").value.length > 0) { b = b + "--search-" + $get("txtKeyWord").value } if (pageNum > 1) { b = b + "--page-" + pageNum } if (b.endsWith("ItemFiles")) { b = b + ".aspx" } window.location.href = b } function bringBackBlinky() { spe = 500; swi = 1; na = document.getElementsByName("UserNameRequired"); if (swi == 1) { sho = "visible"; swi = 0 } else { sho = "hidden"; swi = 1 } for (i = 0; i < na.length; i++) { na[i].style.visibility = sho } setTimeout("bringBackBlinky(id)", spe) } function trimAll(a) { while (a.substring(0, 1) == " ") { a = a.substring(1, a.length) } while (a.substring(a.length - 1, a.length) == " ") { a = a.substring(0, a.length - 1) } return a } function isEmail(a) { var b = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; if (b.test(a)) { return true } else { return false } } function LoginValidations(e, d, l, c, f, k, a, b) { var h; h = false; document.getElementById(e).innerHTML = ""; var d = document.all ? document.all.Login1 : document.getElementById(d); if (d != null) { d.FailureText = "" } Page_ClientValidate("Login2"); if (Page_ClientValidate("Login2")) { if (!isEmail(trimAll(document.getElementById(l).value))) { document.getElementById(e).innerHTML = c; h = true } var g = trimAll(document.getElementById(f).value); var j = trimAll(document.getElementById(k).value); if (g.length < 5) { h = true; if (document.getElementById(e).innerHTML.length > 0) { document.getElementById(e).innerHTML = document.getElementById(e).innerHTML + "<br/>" + a } else { document.getElementById(e).innerHTML = a } } else { if (g != j) { h = true; if (document.getElementById(e).innerHTML.length > 0) { document.getElementById(e).innerHTML = document.getElementById(e).innerHTML + "<br/>" + b } else { document.getElementById(e).innerHTML = b } } } if (h) { return false } else { return true } } else { return false } } function MediaFitPic() { iWidth = document.images[0].width + 30; iHeight = document.body.clientHeight + 55; window.resizeTo(iWidth, iHeight) } function FitPic() { iWidth = document.images[0].width + 30; iHeight = document.images[0].height + 105; window.resizeTo(iWidth, iHeight) } var RatmaxLength = 1000; function multilineMaxNumber(a) { if (a.value.length > (RatmaxLength - 1)) { return false } } function rest_MaxLengthFromPaste(b) { value = b.value; if (RatmaxLength) { event.returnValue = false; RatmaxLength = parseInt(RatmaxLength); var d = b.document.selection.createRange(); var c = RatmaxLength - value.length + d.text.length; var a = window.clipboardData.getData("Text").substr(0, c); d.text = a } } function txtSearchonkeydown(a) { var b; if (a == null) { a = window.event } if (a.shiftKey) { if (a.keyCode == 188 || a.keyCode == 190) { return false } } } function checkEmpty(a, b) { var c = document.getElementById(a).value; if (b.replace(/\s/g, "") == c.replace(/\s/g, "") || "" == c.replace(/\s/g, "")) { return false } else { return true } } function isNumberKey(b) { var a = (b.which) ? b.which : b.keyCode; if (a > 31 && (a < 48 || a > 57)) { return false } return true } function ToolTip_Show(a) { a.tt = new zxcOOPToolTip(a); clearTimeout(a.tt.to); a.tt.setTimeOut("show()", 0) } function zxcOOPToolTip(b) { var d = document.getElementById("divResult"); var c = 500; var a = 300; var f = parseInt((screen.availWidth / 2) - (c / 2)); var e = parseInt((screen.availHeight / 2) - (a / 2)); d.style.left = f + "px"; d.style.top = e + "px"; this.tt = d; 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_Hide() { if (document.getElementById("divResult") != null) { document.getElementById("divResult").style.display = "none" } } function CheckOnOff(e, a) { var d = document.getElementById(e); var b = document.getElementsByTagName("input"); for (i = 0; i < b.length; i++) { if (b[i].type == "radio" && b[i].id != d.id) { var c = b[i].id.indexOf(a); if (c != -1) { b[i].checked = false } } } d.checked = true };
