// function GetHttpRequest() { // Functie die http_request vult met een XmlHttp object, geeft false terug als er een fout optreedt. var http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari, ... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); // See note below about this line } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Giving up :( Cannot create an XMLHTTP instance'); return false; } return http_request } var specListObj function GetSpecList(obj,articleId,specId,frontEndId,i){ var http_request = GetHttpRequest(); if(!http_request) return false; // Kan geen ajax component aanmaken. var specItemId2 if (document.getElementById("specsItemId_"+i)){ specListObj = document.getElementById("specsItemId_"+i) specItemId2 = specListObj.options[specListObj.selectedIndex].value }else{ specListObj = obj } url = "http://www.shop4fans.com/xml/GetSpecList.xml.asp?frontEndId="+frontEndId+"&articleId="+articleId+"&specId="+specId+"&specItemId="+obj.options[obj.selectedIndex].value+"&specItemId2="+specItemId2 //window.open(url) http_request.onreadystatechange = function() { FillSpecList(http_request); }; http_request.open('GET', url, true); http_request.send(null); } function FillSpecList(http_request){ if (http_request.readyState == 4) { if (http_request.status == 200) { var xmldoc = http_request.responseXML; var specOptionListLength = xmldoc.getElementsByTagName('spec').length var xmlItems = xmldoc.getElementsByTagName('spec') if (specOptionListLength>0){ document.getElementById(specListObj.id).options.length = 0 for (var i=0;i0){ document.getElementById("productImage1").src=xmldoc.getElementsByTagName('prices')[0].getElementsByTagName('image')[0].childNodes[0].nodeValue } if(xmldoc.getElementsByTagName('prices')[0].getElementsByTagName('imageBig')[0].childNodes[0].nodeValue.length>10){ document.getElementById("productImage1_large").value=xmldoc.getElementsByTagName('prices')[0].getElementsByTagName('imageBig')[0].childNodes[0].nodeValue } } } } function GetSpecPrice(articleId,frontEndId,obj1,obj2){ var http_request = GetHttpRequest(); if(!http_request) return false; // Kan geen ajax component aanmaken. var specId_1 if (document.getElementById(obj1)){ specId_1 = document.getElementById(obj1).options[document.getElementById(obj1).selectedIndex].value }else{ specId_1 = "" } var specId_2 if (document.getElementById(obj2)){ specId_2 = document.getElementById(obj2).options[document.getElementById(obj2).selectedIndex].value }else{ specId_2 = "" } if (specId_1==""){ specId_1=specId_2 specId_2="" } url = "http://www.shop4fans.com/xml/GetSpecPrice.xml.asp?frontEndId="+frontEndId+"&articleId="+articleId+"&specId_1="+specId_1+"&specId_2="+specId_2 //window.open(url) http_request.onreadystatechange = function() { FillSpecPrice(http_request); }; http_request.open('GET', url, true); http_request.send(null); } function FillSpecPrice(http_request){ if (http_request.readyState == 4) { if (http_request.status == 200) { var xmldoc = http_request.responseXML; document.getElementById("xml_price").innerHTML=xmldoc.getElementsByTagName('prices')[0].getElementsByTagName('c_price')[0].childNodes[0].nodeValue //document.getElementById("price").value=xmldoc.getElementsByTagName('prices')[0].getElementsByTagName('price')[0].childNodes[0].nodeValue if(xmldoc.getElementsByTagName('prices')[0].getElementsByTagName('image').length>0){ document.getElementById("productImage1").src=xmldoc.getElementsByTagName('prices')[0].getElementsByTagName('image')[0].childNodes[0].nodeValue } if(xmldoc.getElementsByTagName('prices')[0].getElementsByTagName('imageBig')[0].childNodes[0].nodeValue.length>10){ document.getElementById("productImage1_large").value=xmldoc.getElementsByTagName('prices')[0].getElementsByTagName('imageBig')[0].childNodes[0].nodeValue } } } }