var xmlObj; function loadXMLDoc(u, id) { // branch for native XMLHttpRequest object if (window.XMLHttpRequest) { xmlObj = new XMLHttpRequest(); xmlObj.onreadystatechange = function(){processReqChange(id)}; xmlObj.open("GET", u, true); xmlObj.send(null); // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { xmlObj = new ActiveXObject("Microsoft.XMLHTTP"); if (xmlObj) { xmlObj.onreadystatechange = function(){processReqChange(id)}; xmlObj.open("GET", u, true); xmlObj.send(); } } } function processReqChange(id) { if (xmlObj.readyState == 4) { //State : Loaded if (xmlObj.status == 200) { //Status : OK document.getElementById(id).innerHTML = xmlObj.responseText; } else { alert('There was a problem retrieving the XML data:\n' + xmlObj.statusText); } } else { document.getElementById(id).innerHTML = 'Loading...'; } } function loadHTML(u, o){ if (xmlObj) { if(xmlObj.readyState != 4){ setTimeout('loadHTML(\''+u+'\', \''+o+'\')', 100); } else { loadXMLDoc(u, o); } } else { loadXMLDoc(u, o); } } function product(id, type){ document.location = 'default.asp?id=15&product='+id+'&type='+type; } function goPage(id){ document.location = 'default.asp?id='+id; } function download(id){ document.location='/download.asp?id='+id; } function openImage(id){ var leftPos = (screen.availWidth-100) / 2; var topPos = (screen.availHeight-100) / 2; window.open('/image-preview.asp?id='+id,'', 'scrollbars=no,resizable=yes,status=no,toolbar=no,width=100,height=100,top=' + topPos + ',left=' + leftPos); } function toggleCart(d){ document.getElementById('cart').style.display = d; } function goCart(){ document.location = '/cart.asp?u='+escape(document.location); } function addToCart(pid){ var aantal = document.getElementById('aantal').value document.location = '/cart.asp?action=add&pid='+pid+'&aantal='+aantal+'&u='+escape(document.location); } function emptyCart(){ if (confirm('Weet u zeker dat u uw winkelwagen wilt legen?')) { document.location = '/cart.asp?action=empty&u='+escape(document.location); } } function login(){ document.location = '/account.asp?action=login'; } function removeFromCart(pid){ if (confirm('Weet u zeker dat u dit artikel uit de winkelwagen wilt verwijderen?')){ window.location = 'cart.asp?action=remove&pid='+pid+'&u='+escape(document.getElementById('u').value); } } function changeNumber(c, id, pid){ min = 1; var aantal = document.getElementById(id); if (isNaN(parseFloat(aantal.value))) { alert('Aantal moet een numerieke waarde zijn.'); } else { newValue = parseFloat(aantal.value) + c; if (newValue < min) { if (confirm('Weet u zeker dat u dit artikel uit de winkelwagen wilt verwijderen?')){ window.location = 'cart.asp?action=remove&pid='+pid+'&u='+escape(document.getElementById('u').value); } else { aantal.value = min; modified = true; } } else if (newValue > 0) { aantal.value = newValue; modified = true; } } } function recalcCart(){ document.cart.order.value = 'false'; document.cart.submit(); } function orderCart(){ if (modified) { document.cart.order.value = 'true'; document.cart.submit(); } else { document.location = 'order.asp'; } } function showImage(img){ var leftPos = (screen.availWidth-100) / 2; var topPos = (screen.availHeight-100) / 2; window.open('/image-preview.asp?img='+escape(img),'', 'scrollbars=no,resizable=yes,status=no,toolbar=no,width=100,height=100,top=' + topPos + ',left=' + leftPos); }