document.write(""); function popupWin(URL, name, windowWidth, windowHeight, params) { if (params == '') params = ",scrollbars=yes,resizable=yes"; else if (params[0] != ',') params = ','+params; newWindow = window.open(URL,name,"width="+windowWidth+",height="+windowHeight+params); if(newWindow) newWindow.focus(); } function openWin(URL, name, windowWidth, windowHeight) { popupWin(URL, name, windowWidth, windowHeight, ''); } function openLinkAndCloseWindow( URL, name, windowWidth, windowHeight, params) { popupWin(URL,name,windowWidth,windowHeight, params); window.close(); } function ResizeWindow(setWidth, setHeight) { if (parseInt(navigator.appVersion)>3) { if (navigator.appName=="Netscape") { winW = window.innerWidth; winH = window.innerHeight; } if (navigator.appName.indexOf("Microsoft")!=-1) { winW = document.body.offsetWidth; winH = document.body.offsetHeight; } } if ( winW < setWidth) window.resizeTo(setWidth,setHeight); } function OpenAndAddProduct(url, prId, zip) { // Create the XMLHttpRequest object. c = CreateHTMLRequestor(); // if the XMLHttpRequest object is in any state other than 0 (unitialized), then stop the current request. if (c && c.readyState!=0) { c.abort(); } // Set the function that handles changes in state. c.onreadystatechange = function() { if (c.readyState == 4) { if (c.status == 200) { redirectLink = c.responseText.replace( /&/g, "_ampersand"); var openResult = window.open(url+'&redirectUrl=' + redirectLink,'p2l2s',"width=620,height=640"); if ( !openResult ) { WindowRedirect('/cart/cart.htm'); CloseWindows(); } c.abort(); } } } if ( zip ) var setZipStr = '&setZip=' + zip; // Send the request. c.open("GET", "/cart/cart.htm?prId=" + prId+ setZipStr +'&buynow=1&ajaxGetRedirect=1&indexAdd=0&noCache=' + Math.random(), true); c.send(null); return false; } function RemoveProduct(prId) { // Create the XMLHttpRequest object. c = CreateHTMLRequestor(); // if the XMLHttpRequest object is in any state other than 0 (unitialized), then stop the current request. if (c && c.readyState!=0) { c.abort(); } // Set the function that handles changes in state. c.onreadystatechange = function(){}; // Send the request. c.open("GET", '/cart/cart.htm?ajaxRemovePrId=' + prId + '&removeLast=1&ajaxGetRedirect=1&noCache=' + Math.random(), true); c.send(null); } function CloseWindows() { if ( window.opener && window.opener.frames.name == 'phoneresults' ) { var currentparent = window.opener.parent; } else if (window.opener.opener) { var grandparent = window.opener.opener; if ( window.opener.opener.opener) var greatgrandparent = window.opener.opener.opener; } var currentparent = window.opener; if ( greatgrandparent ) { window.opener.opener.close(); window.opener.close(); window.close(); } if(grandparent) { window.opener.close(); window.close(); } else if(currentparent) { window.close(); } } function WindowRedirect(redirect) { if (window.opener) { if ( window.opener.frames.name =='phoneresults' ) var grandparent = window.opener.parent; if ( window.opener.opener ) { var grandparent = window.opener.opener; if ( window.opener.opener.frames.name =='phoneresults' ) var greatgrandparent = window.opener.opener.parent; if ( window.opener.opener.opener ) { if (window.opener.opener.opener.frames.name =='phoneresults') var greatgreatgrandparent = window.opener.opener.opener.parent; else var greatgreatgrandparent = window.opener.opener.opener; } } } var currentparent = window.opener; if ( greatgreatgrandparent ) { greatgreatgrandparent.location = redirect; } else if (greatgrandparent) { greatgrandparent.location = redirect; } else if(grandparent) grandparent.location = redirect; else if(currentparent) currentparent.location = redirect; else window.location = redirect; } var termsPopupPopped = new Array(); function TermsPopupOpen(formName, inputCheckboxName, url, displayAsOverlay) { if ( typeof(termsPopupPopped[inputCheckboxName]) != "undefined" && termsPopupPopped[inputCheckboxName]) return; f = document.forms[formName]; if (f.elements[inputCheckboxName].checked) { if (displayAsOverlay) CreateIFrame(event, this, url); else popupWin(url,'popup','600','550',''); } termsPopupPopped[inputCheckboxName] = true; }