startPos = navigator.appVersion.indexOf('MSIE') + 5 version = navigator.appVersion.substring(startPos, startPos + 1) NS = (document.layers) ? 1 : 0 IE = (document.all) ? 1: 0 isMac = navigator.userAgent.indexOf('Mac') > 0 self.onError=null var menuY = 0, menuX, scrolling = false, showCartContent = false var firstTime = true, firstScroll = true MENUTOP = 0 MENUWIDTH = 75 function getWinWidth() { if (document.layers) return(window.innerWidth); else if (document.all) return(document.body.clientWidth); else return(null); } function smoothscrollMenu() { if(!(IE || NS)) return var sTop = IE? document.body.scrollTop: self.pageYOffset if(IE && !isMac && (version >= 5)) { if(firstScroll) { menuY -= MENUTOP firstScroll = false } } if(sTop != menuY) { scrolling = Math.abs(sTop - menuY) > 2 var move = 0.1 * (sTop - menuY) if(move > 0) { move = Math.ceil(move); if(IE) document.all.greenpeas.style.pixelTop += move; else document.greenpeas.top += move; menuY += move; } else { move = Math.floor(move) var d = IE? document.all.greenpeas.style.pixelTop: document.greenpeas.top if((d + move) > MENUTOP) { if(IE) document.all.greenpeas.style.pixelTop += move; else document.greenpeas.top += move } menuY += move } } else { scrolling = false } } function setXPos() { if(!(IE || NS)) return menuX = getWinWidth() - MENUWIDTH - 1 if(NS) menuX -= 16 if(IE) { document.all.greenpeas.style.pixelLeft = menuX document.all.greenpeas.style.pixelTop = 1 document.all.greenpeas.style.visibility = "visible" } else { document.greenpeas.left = menuX document.greenpeas.top = 1 document.greenpeas.visibility = "show" } if(firstTime) { if(NS || IE) action = window.setInterval("smoothscrollMenu()", 1) firstTime = false } }