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 getFormData(formName) { var _form = null; var _responseBody = ''; var _elm = null; if (typeof(findObject)=='function') { _form = findObject(formName); } else { alert('Form object ' + formName + ' could not be found'); } if (_form == null) return null; for(i=0;i<_form.elements.length;i++) { _elm = _form.elements[i]; switch(_elm.type) { case 'submit' : break; case 'checkbox' : case 'radio' : { if(_elm.checked == true) _responseBody += '&'+ encodeURIComponent(_elm.name)+'='+encodeURIComponent(_elm.value); break; } default : { _responseBody += '&'+ encodeURIComponent(_elm.name)+'='+encodeURIComponent(_elm.value); break; } } } return _responseBody; } function loadPopup(sHref, sWidth, sHeight) { var LeftPosition=(screen.width)?(screen.width-sWidth)/2:100; var TopPosition=(screen.height)?(screen.height-sHeight)/2:100; var settings='width='+sWidth+',height='+sHeight+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'; var theWindow = window.open(sHref, '_blank', settings); if (theWindow != null) theWindow.focus(); return theWindow; } var _sf_startpt=(new Date()).getTime(); window.onload = function() { if (typeof(pngFix) == 'function') { pngFix(); } if (typeof(initLightbox) == 'function') { initLightbox(); } if (typeof(loadChartbeat) == 'function') { loadChartbeat(); } window.setInterval("KeepAlive()", 300000); } function KeepAlive() { try { PageMethods.KeepAlive(function(response){}); } catch(e) { } } function AddToBasket(id) { if (!allowShop()) return false; var _formdata = (arguments[1]) ? getFormData(document.forms[0].id) : null; var _optiondata = (typeof(arguments[2]) != 'undefined') ? 'option=' + arguments[2] : null; var _arguments = (_optiondata != null) ? _optiondata : (_formdata != null) ? _formdata : null; PageMethods.AddToBasket(id, _arguments, _formdata != null, function(response) { if (response < 0) { if (confirm('Dit product is reeds aanwezig in uw winkelmandje. Wilt u dit product nog een keer toevoegen?')) { PageMethods.AddToBasket(id, _arguments, true, function(response) { window.location.href = './Webshop.aspx'; }); } } else { window.location.href = './Webshop.aspx'; } }); return false; } function changeOption(sUrl, oObj) { try { if (typeof(sUrl) != 'undefined' && typeof(oObj) != 'undefined' && typeof(oObj.value) != 'undefined' && !isNaN(parseInt(oObj.value))) { window.location.href = sUrl + '&option=' + oObj.value; } } catch(e) { } } 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; } } var _submitButtonClicked = false; function clickSubmitButton() { if (_submitButtonClicked) { return false; } else if (checkTerms()) { _submitButtonClicked = true; MoveToTop(); return true; } else { return false; } } function socialMediaLink(sType, sTitle, sUrl) { var sHref = ''; var sWidth = '600'; var sHeight = '400'; if (sType == 'facebook') { sHref = 'http://www.facebook.com/sharer.php?u=' + sUrl + '&t=' + sTitle; sWidth = '626'; sHeight = '436'; } else if (sType == 'hyves') { sHref = 'http://www.hyves.nl/hyvesconnect/smartbutton?title=' + sTitle + '&body=' + sUrl.replace(/%20/gi, "_").replace(/\+/g, '_') + '&category=12&type=11'; sWidth = '550'; sHeight = '600'; } if (sHref != '') { if(typeof(pageTracker) != 'undefined') { pageTracker._trackPageview('/socialbookmark/' + sType); } if(typeof(shopTracker) != 'undefined') { shopTracker._trackPageview('/socialbookmark/' + sType); } loadPopup(sHref, sWidth, sHeight); return false; } else { return true; } } function checkTerms() { if (!allowShop()) return false; var obj = findObject('terms'); if (obj != null && obj.checked) { return true; } else if (obj != null) { alert('U kunt de bestelling niet accorderen als u niet akkoord gaat met de algemene verkoopvoorwaarden'); return false; } return false; } function MoveToTop() { window.scroll(0,0); }