/* Get the request object */ function getHttpRequest() { var httpRequest; // Get the httpRequest object for firefox if (window.XMLHttpRequest) { httpRequest = new XMLHttpRequest(); if (httpRequest.overrideMimeType) { httpRequest.overrideMimeType('text/xml'); } } // Get the httpRequest object for IE else if (window.ActiveXObject) { try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { } } } return httpRequest; } /*Get the next(isNext=true) or previous(isNext=false) rvis*/ function searchonlyused() { try { // if (!isBrowserSupported()) { // throw "browser not supported"; // browser not supported navigate to non-ajax version // } var httpRequest = getHttpRequest(); // Cannot create the httprequest object - return from function if (!httpRequest) { // error - so go to the link location instead return true; } //alert(getMyHTMLElement("INSTOCK").checked) var instock = (getMyHTMLElement("INSTOCK").checked)?"used":""; var resourceToRequest = "index.php?method=instockbox&INSTOCK="+instock; httpRequest.onreadystatechange = function() { //processSearchOnlyUsedResponse(httpRequest); }; httpRequest.open("GET", resourceToRequest, true); httpRequest.send(null); return false; } catch (exception) { return true; } } /* Processes the response from the http request */ function processSearchOnlyUsedResponse(httpRequest) { try { // The response has been received correctly if (httpRequest.readyState==4 || httpRequest.readyState=="complete") { if (httpRequest.status == 200) { // restart the loading animations if IE //if (navigator.appName.indexOf("Internet Explorer") != -1) { // setLoadingIndicatorsForIE(clientIdOfControl); //} return; var response = httpRequest.responseText.replace(/\r|\n|/g,'').split("#"); if(response == '' && refresh){ //alert("Silly, you are tooooooooo slow") sexyBOX(' ','352'); //window.location.reload(); refresh=false; return; } if(response != '')refresh = true; //if(httpRequest typeof 'text/plain') var i; for(i in response){ if(document.getElementById && document.getElementById("item_"+response[i]) != null){ var itemObj = document.getElementById("item_"+response[i]); itemObj.style.backgroundImage = "url('images/titles/warning.gif')"; itemObj.style.backgroundRepeat = "repeat-x"; itemObj.style.zIndex=4; showSingleLevelTable_withtimeout('basketSummaryMenu','shBsketImage',0,0,-83,0); //addEvent(itemObj, 'mouseover', function(){alert(response[i])}, false); //addEvent(itemObj, 'mouseout', rollout, false); itemObj.onmouseover=function(){ roll(this); }; itemObj.onmouseout=function(){ rollout(this); }; itemObj.onclick=function(){ clicklink(this); }; } } } else { throw "Bad response"; } } } catch(exception ) { } }