﻿function popUp(url, options, windowW, windowH, center) { day = new Date(); id = day.getTime(); if (center == "on") { var windowX = (screen.width / 2) - (windowW / 2); var windowY = (screen.height / 2) - (windowH / 2); eval("page" + id + " = window.open('" + url + "', " + id + ", '" + options + ",height=" + windowH + ",width=" + windowW + ",left=" + windowX + ",top=" + windowY + "');") } else { eval("page" + id + " = window.open('" + url + "', " + id + ", '" + options + ",height=" + windowH + ",width=" + windowW + "');") } } var hChildCatalogWindow = null; function openCatalog(thisPage) { var str = "left=0,screenX=0,top=0,screenY=0"; if (window.screen) { var ah = screen.availHeight - 30; var aw = screen.availWidth - 10; str += ",height=" + ah; str += ",innerHeight=" + ah; str += ",width=" + aw; str += ",innerWidth=" + aw } else { str += ",resizable" } if (hChildCatalogWindow != null) { if (thisPage != "1") { window.open(thisPage, 'Catalog', str + ',scrollbars=yes') } hChildCatalogWindow.focus() } else { if (thisPage == "1") { window.open('catalog_select.asp?pop_catalog=1', 'Catalog', str + ',scrollbars=yes') } else { window.open(thisPage, 'Catalog', str + ',scrollbars=yes') } } } function vExpressMod(theForm) { if (clearSpaces(theForm.pfid.value) == "") { alert('Item number cannot be blank.'); return false } else { return true } } function clearSpaces(a) { return a.replace(/^\s+/, '').replace(/\s+$/, '') } function postThis(action, ref_uid, ref_sid, uid_name, uid_value, target) { var len = document.frmStandardHeader.length; var i = 0; document.frmStandardHeader.action = action; document.frmStandardHeader.ref_uid.value = ref_uid; document.frmStandardHeader.ref_sid.value = ref_sid; if (String(action).substring(0, 6) == 'https:') { target = '_top' } if (target.length > 0) { document.frmStandardHeader.target = target } for (i = 0; i < len; i++) { if (document.frmStandardHeader.elements[i].name == uid_name) { document.frmStandardHeader.elements[i].value = uid_value } } document.frmStandardHeader.submit() } function CreateBookmarkLink() { var title = document.title; var url = self.location.href; if (window.sidebar) { window.sidebar.addPanel(title, url, "") } else if (document.all) { window.external.AddFavorite(url, title) } else if (window.opera && window.print) { alert('Please press Ctrl+D (or Command+D on Macs) to bookmark this page') } else if (window.chrome) { alert('Please press Ctrl+D (or Command+D on Macs) to bookmark this page') } } function fbs_click(u, t) { var targetUrl = 'http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&amp;t=' + encodeURIComponent(t); window.open(targetUrl, 'sharer', 'resizable=1,scrollbars=1,toolbar=0,status=0,width=626,height=436'); return false } function digg_click(u, t, c) { var targetUrl = 'http://digg.com/submit?url=' + encodeURIComponent(u) + '&amp;title=' + encodeURIComponent(t) + '&amp;bodytext=' + encodeURIComponent(c) + '&amp;media=news&amp;topic=people'; window.open(targetUrl, 'sharer', 'scrollbars=1,resizable=1,toolbar=0,status=0,width=800,height=600'); return false } function ms_click(u, t, c, s, i) { var strStoreURL = u.replace(s, ""); var storeimage = "<br /><img src='" + strStoreURL + i + "' />"; c += storeimage; var targetUrl = 'http://www.myspace.com/index.cfm?fuseaction=postto&amp;t=' + encodeURIComponent(t) + '&amp;c=' + encodeURIComponent(c) + '&amp;u=' + encodeURIComponent(u) + '&amp;l=2'; window.open(targetUrl, 'sharer', 'resizable=1,scrollbars=1,toolbar=0,status=0,width=626,height=436'); return false } function delicious_click(u, t, c) { var targetUrl = 'http://delicious.com/save?url=' + encodeURIComponent(u) + '&amp;title=' + encodeURIComponent(t) + '&amp;notes=' + encodeURIComponent(c) + '&amp;share=yes&amp;jump=yes'; window.open(targetUrl, 'sharer', 'resizable=1,scrollbars=1,toolbar=0,status=0,width=626,height=436'); return false } function stumbleupon_click(u, t, c) { var targetUrl = 'http://www.stumbleupon.com/submit?url=' + encodeURIComponent(u) + '&amp;title=' + encodeURIComponent(t); window.open(targetUrl, 'sharer', 'resizable=1,scrollbars=1,toolbar=0,status=0,width=626,height=436'); return false } function twitter_click(u, t, c) { var targetUrl = 'http://twitter.com/home?status=' + encodeURIComponent(u); window.open(targetUrl, 'sharer', 'resizable=1,scrollbars=1,toolbar=0,status=0,width=626,height=436'); return false } function buzz_click(u, t, c) { var targetUrl = 'http://www.google.com/buzz/post?url=' + encodeURIComponent(u); window.open(targetUrl, 'sharer', 'resizable=1,scrollbars=1,toolbar=0,status=0,width=626,height=436'); return false } function buyMeNow(pfid) { document.buynowform.pfid.value = pfid; document.buynowform.submit() } function wishMeNow(pfid) { document.wishform.pfid.value = pfid; document.wishform.submit() } function buyMeNowAcc(pfid, elemn_id) { var txtBoxAcc = document.getElementById(elemn_id); var qtyVal = txtBoxAcc.value; if (/^[0-9]+$/.test(qtyVal)) { if (qtyVal > 0) { document.buynowform.pfid.value = pfid; document.buynowform.quantity.value = qtyVal; document.buynowform.submit() } else { alert('Quantity must be a number between 1 and 99999') } } else { alert('Quantity must be a number between 1 and 99999') } } function wishMeNowAcc(pfid) { document.wishform.pfid.value = pfid; document.wishform.submit() } function validateSearchForm(theForm) { if ((theForm.searchString.value.length > 30) || (theForm.searchString.value.length == 0)) { alert('Search Item must be 30 characters or less'); return false } else { theForm.str.value = theForm.searchString.value; return true } } function displayLiveChatTools(oLink, evt) { var oElem = oLink; var osHeight = oElem.offsetHeight; var osLeft = oElem.offsetLeft; var osTop = oElem.offsetTop; while (oElem = oElem.offsetParent) { osLeft += oElem.offsetLeft; osTop += oElem.offsetTop } var divLiveChatTools = document.getElementById("liveChatTools"); divLiveChatTools.style.top = osTop + osHeight + "px"; divLiveChatTools.style.left = osLeft + "px"; if (divLiveChatTools.style.display == "block") { divLiveChatTools.style.display = "none" } else { divLiveChatTools.style.display = "block" } var e = (evt) ? evt : window.event; if (window.event) { e.cancelBubble = true } else { e.stopPropagation() } } function hideLiveChatTools() { var divLiveChatTools = document.getElementById("liveChatTools"); divLiveChatTools.style.display = "none" } function returnBack() { var returnUrl = document.getElementById("hidReturnUrl").value; window.location.href = returnUrl } function doPost() { var lblErrorMsg = document.getElementById("lblErrorMsg"); lblErrorMsg.innerHTML = ""; if (document.getElementById("txtQuestion").value == "") { lblErrorMsg.innerHTML = "Question cannot be blank. Please try again."; document.getElementById("txtQuestion").focus(); return false } if (document.getElementById("txtValidate").value == "") { var spCodeError = document.getElementById("spCodeError"); spCodeError.style.display = ""; return false } if (!document.getElementById("cboxAnonymous").checked) { if (document.getElementById("txtEmail").value == "") { lblErrorMsg.innerHTML = "Email Address cannot be blank! Please try again."; document.getElementById("txtEmail").focus(); return false } var reg = /^\s*([A-Za-z0-9_\-]+(\.\w+)*@(\w+\.)+\w{2,3})\s*$/; if (!reg.test(document.getElementById("txtEmail").value)) { lblErrorMsg.innerHTML = "Invalid Email Address! Please try again."; document.getElementById("txtEmail").focus(); return false } } var formAddQuestion = document.getElementById("formAddQuestion"); return true } function reSet() { var lblErrorMsg = document.getElementById("lblErrorMsg"); lblErrorMsg.innerHTML = ""; formAddQuestion.reset() } function showAddQuestion(olink) { olink.style.display = "none"; var otable = document.getElementById("askQuestion"); otable.style.display = "" } function cancel() { var btnShowAdd = document.getElementById("btnShowAddQ"); btnShowAdd.style.display = ""; var otable = document.getElementById("askQuestion"); otable.style.display = "none" } function chkQTxtMail() { if (document.getElementById("txtEmail").value != "") { document.getElementById("cboxAnonymous").checked = false } } function chkQEmail(val) { if (val.checked) { document.getElementById("txtEmail").value = "" } } function zoomImage(imgName) { if (document.frmProduct.captureClick.value != '0') { imgName = imgName + document.frmProduct.mimg_path.value } reWin = window.open(imgName, 'prodImg', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=700,height=520,top=20,left=50'); if (window.focus) { reWin.focus() } } function sort_onchange(dropdown, URL) { var myindex = dropdown.selectedIndex; var SelValue = dropdown.options[myindex].value; URL = URL.replace("lbSortVal", SelValue); window.location.href = URL } function openCatalogChk(imgName) { if (parent.frames.length != 0) { window.parent.catalogFocus() } else { window.location.href = 'catalog_select.asp' } } function backtostore(imgName) { if (self.opener != null) { window.opener.focus(); window.close() } else { window.location.href = imgName } } var clicTxt; function objClick(obj) { clicTxt = obj.options[obj.selectedIndex].text } var previousObject; function CompareDisplay() { var cprStr; var attr0 = document.getElementById("attr0"); if (attr0 != null) { attr0 = attr0.options[attr0.selectedIndex].text } else { attr0 = "" } var attr1 = document.getElementById("attr1"); if (attr1 != null) { attr1 = attr1.options[attr1.selectedIndex].text } else { attr1 = "" } var attr2 = document.getElementById("attr2"); if (attr2 != null) { attr2 = attr2.options[attr2.selectedIndex].text } else { attr2 = "" } var attr3 = document.getElementById("attr3"); if (attr3 != null) { attr3 = attr3.options[attr3.selectedIndex].text } else { attr3 = "" } var attr4 = document.getElementById("attr4"); if (attr4 != null) { attr4 = attr4.options[attr4.selectedIndex].text } else { attr4 = "" } cprStr = attr0.Trim() + attr1.Trim() + attr2.Trim() + attr3.Trim() + attr4.Trim(); var trNullNote = document.getElementById("trNullNote"); var AttList = document.getElementById(cprStr); if (AttList != null) { AttList = AttList.parentNode; while (AttList.nodeName != "TABLE") { AttList = AttList.parentNode } AttList.style.display = ""; if (trNullNote != null) { trNullNote.style.display = "none" } if (previousObject != null) { if (AttList.id != previousObject.id) { ProcessPrevious() } } else { ProcessPrevious() } previousObject = AttList } else { if (trNullNote != null) { trNullNote.style.display = "" } ProcessPrevious() } } function ProcessPrevious() { if (previousObject != null) { previousObject.style.display = "none" } else { previousObject = document.getElementById("attListFirst"); if (previousObject != null) { previousObject.style.display = "none" } else { var previous = document.getElementById(clicTxt); if (previous != null) { previous = previous.parentNode; while (previous.nodeName != "TABLE") { previous = previous.parentNode } previous.style.display = "none" } } } } function trim(a) { return a.replace(/^\s+/, '').replace(/\s+$/, '') } function trim_dollar(a) { return a.replace(/\$/, '') } function ValidateRange() { var min_price = trim_dollar(trim(document.search.min_price_range.value)); var max_price = trim_dollar(trim(document.search.max_price_range.value)); var dept_id = document.search.dept.value; if (isNaN(min_price) && (min_price.length > 0)) { alert('Minimum Price must be numeric.'); document.search.min_price_range.focus(); document.search.min_price_range.select(); return false } else if (isNaN(max_price) && (max_price.length > 0)) { alert('Maximum Price must be numeric.'); document.search.max_price_range.focus(); document.search.max_price_range.select(); return false } else if ((trim(document.search.str.value).length == 0) && (min_price.length == 0) && (max_price.length == 0) && (dept_id < 0)) { alert('Please specify search criteria.'); document.search.str.focus(); document.search.str.select(); return false } else if ((min_price.length > 0) && (max_price.length > 0) && (parseInt(max_price) < parseInt(min_price))) { alert('Maximum price must be greater than minimum price.'); document.search.max_price_range.focus(); document.search.max_price_range.select(); return false } else if (min_price > 20999999.99) { alert('Minimum Price should be less than 20999999.99.'); document.search.min_price_range.focus(); document.search.min_price_range.select(); return false } else if (max_price > 20999999.99) { alert('Maximum Price should be less than 20999999.99.'); document.search.max_price_range.focus(); document.search.max_price_range.select(); return false } else return true } String.prototype.Trim = function() { return this.replace(/(^\s*)|(\s*$)/g, "") }
