var active_obj = null; var scrollmandje = null; var mandjecontainer = null; var scrollcategorie = null; var categoriecontainer = null; var mandjeoffset_y = null; var popwidth = 710; var popheight = 300; function findXPos(obj) { var curleft =0;// curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft while (obj = obj.offsetParent) { curleft += obj.offsetLeft } } return curleft; } function findYPos(obj) { var curtop =0;// curtop = 0; if (obj.offsetParent) { curtop = obj.offsetTop while (obj = obj.offsetParent) { curtop += obj.offsetTop } } return curtop; } function getElementSize(elm) { return {'x' :elm.offsetWidth, 'y': elm.offsetHeight} } function scrollMandjeCategorie() { if (scrollmandje==null) { scrollmandje = document.layers ? document.layers['basketscroll'] : document.getElementById ? document.getElementById('basketscroll').style : document.all['basketscroll'].style; scrollcategorie = document.layers ? document.layers['voorkeurmenu'] : document.getElementById ? document.getElementById('voorkeurmenu').style : document.all['voorkeurmenu'].style; categoriecontainer = document.getElementById('links'); categorieoffset_y = findYPos(categoriecontainer); mandjecontainer = document.getElementById('voorkeurmenuadv'); mandjeoffset_y = findYPos(mandjecontainer); } var offset_y = mandjeoffset_y; if (scrollmandje.setProperty) { //Mozilla var scrollxpos = window.pageXOffset; var scrollypos = window.pageYOffset; var windowwidth = window.innerWidth; var windowheight = window.innerHeight; var newy = scrollypos + offset_y; scrollmandje.setProperty('left',findXPos(mandjecontainer),null); scrollcategorie.setProperty('left',findXPos(categoriecontainer),null); var elm = document.getElementById('basketscroll'); var esize = getElementSize(elm); if((esize.y + 80) > windowheight) { if((scrollypos - (esize.y - windowheight)) < 80){ elm.style.top = 80 + 'px'; } else { elm.style.top = (scrollypos - (esize.y - windowheight)) + 'px'; } if (scrollypos > offset_y ) { scrollcategorie.setProperty('top',scrollypos+10,null); } else { scrollcategorie.setProperty('top',offset_y,null); } } else { if (scrollypos > offset_y ) { scrollmandje.setProperty('top',scrollypos+10,null); scrollcategorie.setProperty('top',scrollypos+10,null); } else { scrollmandje.setProperty('top',offset_y,null); scrollcategorie.setProperty('top',offset_y,null); } } } else { //IE var windowwidth = document.body.offsetWidth; var windowheight = document.body.offsetHeight; var scrollxpos = document.body.scrollLeft; var scrollypos = document.body.scrollTop; var windowheight = document.body.offsetHeight; var scrollypos = document.body.scrollTop; scrollmandje.left = findXPos(mandjecontainer); scrollcategorie.left = findXPos(categoriecontainer); var newy = scrollypos + offset_y; var elm = document.getElementById('basketscroll'); var esize = getElementSize(elm); if((esize.y + 80) > windowheight) { if((scrollypos - (esize.y - windowheight)) < 80){ scrollmandje.top = 80 ; } else { scrollmandje.top = (scrollypos - (esize.y - windowheight)) - 10 ; } if (scrollypos > offset_y ) { scrollcategorie.top = scrollypos+10; } else { scrollcategorie.top = offset_y; } } else { //alert('mandje normaal'); if (scrollypos > offset_y ) { scrollmandje.top = scrollypos+10; scrollcategorie.top = scrollypos+10; } else { scrollmandje.top = offset_y; scrollcategorie.top = offset_y; } } } } function relocatePopup() { // alert(active_obj); if (active_obj) setPopupLocation(active_obj); //scrollMandje(); } function setPopupLocation(obj) { var offset_y = 80; if (obj.setProperty) { //Mozilla var scrollxpos = window.pageXOffset; var scrollypos = window.pageYOffset; var windowwidth = window.innerWidth; var windowheight = window.innerHeight; var newy = scrollypos + (windowheight/2) - (popheight / 2); if (newy < 80) obj.setProperty('top',80,null); else obj.setProperty('top',newy,null); obj.setProperty('left',(windowwidth / 2) - (popwidth /2),null); } else { //IE var windowwidth = document.body.offsetWidth; var windowheight = document.body.offsetHeight; var scrollxpos = document.body.scrollLeft; var scrollypos = document.body.scrollTop; obj.left = (windowwidth/2) - (popwidth / 2); var newy = scrollypos + (windowheight/2) - (popheight / 2); if (newy < 80) obj.top = 80; else obj.top = newy; } } function togglePopup(szDivID, iState) // 1 visible, 0 hidden { var obj = document.layers ? document.layers[szDivID] : document.getElementById ? document.getElementById(szDivID).style : document.all[szDivID].style; if (iState==1) { if (szDivID=="popupdivPizza") { popwidth = 710; popheight = 240; } else { popwidth = 710; popheight = 240; } } setPopupLocation(obj); obj.visibility = document.layers ? (iState ? "show" : "hide") : (iState ? "visible" : "hidden"); if (iState==1) { active_obj = obj; if (obj.setProperty) { //Mozilla if (szDivID=="popupdivPizza") { obj.setProperty('width',710,null); obj.setProperty('height',240,null); } else { obj.setProperty('width',710,null); obj.setProperty('height',240,null); } } else { //IE if (szDivID=="popupdivPizza") { obj.width = 710; obj.height = 240; } else { obj.width = 710; obj.height = 240; } } } else { //window.onresize=""; if (obj.setProperty) { //Mozilla obj.setProperty('width',1,null); obj.setProperty('height',1,null); } else { //IE obj.width = 1; obj.height = 1; } } } function togglePopupLrge(szDivID, iState) // 1 visible, 0 hidden { var obj = document.layers ? document.layers[szDivID] : document.getElementById ? document.getElementById(szDivID).style : document.all[szDivID].style; if (iState==1) { if (szDivID=="popupdivPizza") { popwidth = 780; popheight = 850; } else { popwidth = 780; popheight = 850; } } setPopupLocation(obj); obj.visibility = document.layers ? (iState ? "show" : "hide") : (iState ? "visible" : "hidden"); if (iState==1) { if (obj.setProperty) { //Mozilla if (szDivID=="popupdivPizza") { obj.setProperty('width',780,null); obj.setProperty('height',850,null); } else { obj.setProperty('width',780,null); obj.setProperty('height',850,null); } } else { //IE if (szDivID=="popupdivPizza") { obj.width = 780; obj.height = 850; } else { obj.width = 780; obj.height = 850; } } } else { //window.onresize=""; if (obj.setProperty) { //Mozilla obj.setProperty('width',1,null); obj.setProperty('height',1,null); } else { //IE obj.width = 1; obj.height = 1; } } } function makeOrderLink(formvar, product){ var returnlink = '/mandje.php'; returnlink += '?a=1&id=5660695&pid='; returnlink += product; var i; var teststr; var keuzecomp1 = 'keuzcheckbox'; var keuzecomp2 = 'keuze'; for (i=0; i