var xmlHttp = getHttpObject();; function getHttpObject(){ try { // Firefox, Opera 8.0+, Safari xmlHttp = new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } return xmlHttp; } function addToBasket(id) { showAddToBasket(); xmlHttp.onreadystatechange= function() { if (xmlHttp.readyState == 4){ setTimeout("hideAddToBasket()", 2000); } } var url = "http://www.feeks.nl/lib/add_to_cart.php?id="+ id + "&amount=1"; xmlHttp.open ("GET", url , true); xmlHttp.send (null); } var showAddToBasket = function() { //dijit.byId('addDialog').show(); alert("het product wordt toegevoegd aan uw winkelwagen"); } var hideAddToBasket = function() { // dijit.byId('addDialog').hide(); } function remove_from_cart(id, base_url) { xmlHttp.onreadystatechange= function() { if (xmlHttp.readyState == 4){ alert("Het product is verwijderd uit uw winkelwagen"); document.location = base_url +"/winkelwagen"; } } var url = base_url + "/lib/remove_from_cart.php?id="+ id; xmlHttp.open ("GET", url , true); xmlHttp.send (null); } function toggleClass(contentid, classOn, classOff) { if (document.getElementById(contentid).className == classOn) { document.getElementById(contentid).className = classOff; } else { document.getElementById(contentid).className = classOn; } } function toggleVisibility( contentid ) { if(document.getElementById(contentid).style.display == 'block') { document.getElementById(contentid).style.display = 'none'; } else { document.getElementById(contentid).style.display = 'block'; } } function showMenu(contentid, posX, posY) { document.getElementById(contentid).style.left = posX+'px'; document.getElementById(contentid).style.top = posY+'px'; document.getElementById(contentid).style.display = 'block'; } function checkField(id, msg) { if(document.getElementById( id ).value.length == 0) { document.getElementById( id ).style.background = "#FF0000"; document.getElementById( id ).style.color = "#FFFFFF"; alert('Voer een waarde in'); return false; } else { alert( msg ); return true; } } function checkLength() { var field_length = document.getElementById('phrase').value.length; if(field_length >= 3) { document.searchform.submit(); } else { alert('U moet minstens 3 tekens invoeren'); return false; } } function addPakketToBasket( id ) { showAddToBasket(); xmlHttp.onreadystatechange= function() { if (xmlHttp.readyState == 4){ setTimeout("hideAddToBasket()", 2500); } } var url = "http://www.feeks.nl/lib/add_package_to_cart.php?id="+ id; xmlHttp.open ("GET", url , true); xmlHttp.send (null); } function changeSuggestion() { xmlHttp.onreadystatechange= function() { if (xmlHttp.readyState == 4){ if(xmlHttp.responseText.length > 0) { document.getElementById('boekentip').innerHTML = xmlHttp.responseText; } } } var url = "http://www.feeks.nl/lib/display_suggestion.php"; xmlHttp.open ("POST", url , true); xmlHttp.send (null); } function subscribe() { var email = document.getElementById('email_nieuwsbrief').value; if (xmlHttp.readyState == 4){ alert('U bent aangemeld voor de nieuwsbrief'); } var url = "http://www.feeks.nl/lib/newsletter_signup.php?email="+email; xmlHttp.open ("POST", url , true); xmlHttp.send (null); } function increase(id, prod_type) { xmlHttp.onreadystatechange= function() { if (xmlHttp.readyState == 4){ eval(xmlHttp.responseText); } } var url = "http://www.feeks.nl/lib/increase_items.php?id="+ id + "&type="+prod_type; xmlHttp.open ("GET", url , true); xmlHttp.send (null); } function decrease(id, prod_type) { xmlHttp.onreadystatechange= function() { if (xmlHttp.readyState == 4){ alert(xmlHttp.responseText); } } var url = "http://www.feeks.nl/lib/decrease_items.php?id="+ id + "&type="+prod_type; xmlHttp.open ("GET", url , true); xmlHttp.send (null); }