function findObject(objectId) { if(window.document.getElementById && window.document.getElementById(objectId)) return window.document.getElementById(objectId); else if (window.document.all && window.document.all(objectId)) return window.document.all(objectId); else if (window.document.layers && window.document.layers[objectId]) return window.document.layers[objectId]; else return null; } function selectInput(item) { try { if (item != null && item.value != '') { item.select(); item.focus(); } } catch(e) {} } function checkCookies() { try { var today = new Date(); var expire = new Date(); expire.setTime(today.getTime() + 3600000*24); document.cookie = 'acceptcookie=true;expires='+expire.toGMTString(); var theCookie=''+document.cookie; var ind=theCookie.indexOf('acceptcookie'); return ind != -1; } catch(e) { return false; } } function allowShop() { if (checkCookies()) { return true; } else { alert('Om gebruik te kunnen maken van deze webwinkel is het vereist dat uw browser cookies accepteert.'); return false; } } function checkTerms() { if (!allowShop()) return false; var obj = findObject('terms'); if (obj != null && obj.checked) { scroll(0,0); return true; } else if (obj != null) { alert('U kunt de bestelling niet bevestigen als u niet akkoord gaat met de algemene verkoopvoorwaarden'); return false; } return false; } function startSearch() { var obj = findObject('SearchString'); if (obj != null && obj.value != '') { window.location.href = './Search.aspx?searchstring=' + escape(obj.value); } } function deleteProduct(id) { if (confirm('Weet u zeker dat u dit product uit het winkelmandje wilt verwijderen?')) { PageMethods.DeleteProduct(id, replaceContent); } return false; } function changeCount(id, obj) { if (obj != null && obj.value != '') { PageMethods.ChangeCount(id, obj.value, replaceContent); } } function refreshList() { PageMethods.RefreshData(replaceContent); } function addToBasket(id) { var iValue = 1; var oSKU = findObject('SKU'); if (oSKU != null && oSKU.value != '') { iValue = parseInt(oSKU.value); if (iValue == 'NaN' || iValue <= 0) iValue = 1; } PageMethods.AddToBasket(id, iValue, function(response) { window.location.href = './Webshop.aspx'; }); return false; } function replaceContent(val) { if (val == null || val == '') return; var _div = findObject('WebShopData'); if (_div != null) _div.innerHTML = val; }