﻿var includeCaption = 1; var zoomTime = 5; var zoomSteps = 15; var fade = 1; var minBorder = 90; var zoomImageURI = "/images-global/zoom/"; var myWidth = 0, myHeight = 0, myScroll = 0; myScrollWidth = 0; myScrollHeight = 0; var zoomOpen = false, preloadFrame = 1, preloadActive = false, preloadTime = 0, imgPreload = new Image(); var zoomActive = new Array(); var zoomTimer = new Array(); var zoomOrigW = new Array(); var zoomOrigH = new Array(); var zoomOrigX = new Array(); var zoomOrigY = new Array(); var zoomID = "ZoomBox"; var theID = "ZoomImage"; var theCap = "ZoomCaption"; var theCapDiv = "ZoomCapDiv"; function setupZoom() { prepZooms(); insertZoomHTML(); zoomdiv = document.getElementById(zoomID); zoomimg = document.getElementById(theID) } function prepZooms() { if (!document.getElementsByTagName) { return } var a = document.getElementsByTagName("a"); for (i = 0; i < a.length; i++) { if (a[i].getAttribute("href") && (a[i].getAttribute("rel"))) { if (a[i].getAttribute("rel").indexOf("zoom:") == 0) { a[i].onclick = function() { zoomClick(this); return false }; a[i].onmouseover = function() { zoomPreload(this) } } } } } function zoomPreload(b) { var a = b.getAttribute("href"); if (imgPreload.src.indexOf(b.getAttribute("href").substr(b.getAttribute("href").lastIndexOf("/"))) == -1) { preloadActive = true; imgPreload = new Image(); imgPreload.onload = function() { preloadActive = false }; imgPreload.src = a } } function preloadAnimStart() { preloadTime = new Date(); document.getElementById("ZoomSpin").style.left = (myWidth / 2) + "px"; document.getElementById("ZoomSpin").style.top = ((myHeight / 2) + myScroll) + "px"; document.getElementById("ZoomSpin").style.visibility = "visible"; preloadFrame = 1; document.getElementById("SpinImage").src = zoomImageURI + "zoom-spin-" + preloadFrame + ".png"; preloadAnimTimer = setInterval("preloadAnim()", 100) } function preloadAnim(a) { if (preloadActive != false) { document.getElementById("SpinImage").src = zoomImageURI + "zoom-spin-" + preloadFrame + ".png"; preloadFrame++; if (preloadFrame > 12) { preloadFrame = 1 } } else { document.getElementById("ZoomSpin").style.visibility = "hidden"; clearInterval(preloadAnimTimer); zoomIn(preloadFrom) } } function zoomClick(a) { getSize(); if (preloadActive == true) { preloadFrom = a; preloadAnimStart() } else { zoomIn(a) } } function zoomIn(a) { zoomimg.src = a.getAttribute("href"); if (a.childNodes[0].width) { startW = a.childNodes[0].width; startH = a.childNodes[0].height; startPos = findElementPos(a.childNodes[0]) } else { startW = 50; startH = 12; startPos = findElementPos(a) } hostX = startPos[0]; hostY = startPos[1]; if (document.getElementById("scroller")) { hostX = hostX - document.getElementById("scroller").scrollLeft } endW = imgPreload.width; endH = imgPreload.height; if (zoomActive[theID] != true) { document.getElementById("ShadowBox").style.visibility = "hidden"; document.getElementById("ZoomClose").style.visibility = "hidden"; if (includeCaption == 1) { zoomcap = document.getElementById(theCap); zoomcapd = document.getElementById(theCapDiv); if (a.getAttribute("title") && includeCaption == 1) { zoomcapd.style.display = "block"; zoomcap.innerHTML = a.getAttribute("title") } else { zoomcapd.style.display = "none" } } zoomOrigW[theID] = startW; zoomOrigH[theID] = startH; zoomOrigX[theID] = hostX; zoomOrigY[theID] = hostY; zoomimg.style.width = startW + "px"; zoomimg.style.height = startH + "px"; zoomdiv.style.left = hostX + "px"; zoomdiv.style.top = hostY + "px"; if (fade == 1) { setOpacity(0, zoomID) } zoomdiv.style.visibility = "visible"; sizeRatio = endW / endH; if (endW > myWidth - minBorder) { endW = myWidth - minBorder; endH = endW / sizeRatio } if (endH > myHeight - minBorder) { endH = myHeight - minBorder; endW = endH * sizeRatio } zoomChangeX = ((myWidth / 2) - (endW / 2) - hostX); zoomChangeY = (((myHeight / 2) - (endH / 2) - hostY) + myScroll); zoomChangeW = (endW - startW); zoomChangeH = (endH - startH); zoomCurrent = 0; if (fade == 1) { fadeCurrent = 0; fadeAmount = (0 - 100) / zoomSteps } else { fadeAmount = 0 } zoomTimer[theID] = setInterval("zoomElement('" + zoomID + "', '" + theID + "', " + zoomCurrent + ", " + startW + ", " + zoomChangeW + ", " + startH + ", " + zoomChangeH + ", " + hostX + ", " + zoomChangeX + ", " + hostY + ", " + zoomChangeY + ", " + zoomSteps + ", " + fade + ", " + fadeAmount + ", 'zoomDoneIn(zoomID)')", zoomTime); zoomActive[theID] = true } } function zoomOut() { if (zoomActive[theID] != true) { document.getElementById("ShadowBox").style.visibility = "hidden"; document.getElementById("ZoomClose").style.visibility = "hidden"; startX = parseInt(zoomdiv.style.left); startY = parseInt(zoomdiv.style.top); startW = zoomimg.width; startH = zoomimg.height; zoomChangeX = zoomOrigX[theID] - startX; zoomChangeY = zoomOrigY[theID] - startY; zoomChangeW = zoomOrigW[theID] - startW; zoomChangeH = zoomOrigH[theID] - startH; zoomCurrent = 0; if (fade == 1) { fadeCurrent = 0; fadeAmount = (100 - 0) / zoomSteps } else { fadeAmount = 0 } zoomTimer[theID] = setInterval("zoomElement('" + zoomID + "', '" + theID + "', " + zoomCurrent + ", " + startW + ", " + zoomChangeW + ", " + startH + ", " + zoomChangeH + ", " + startX + ", " + zoomChangeX + ", " + startY + ", " + zoomChangeY + ", " + zoomSteps + ", " + fade + ", " + fadeAmount + ", 'zoomDone(zoomID, theID)')", zoomTime); zoomActive[theID] = true } } function zoomDoneIn(a, b) { zoomOpen = true; setOpacity(0, "ShadowBox"); setOpacity(0, "ZoomClose"); a = document.getElementById(a); shadowdiv = document.getElementById("ShadowBox"); shadowLeft = parseInt(a.style.left) - 13; shadowTop = parseInt(a.style.top) - 8; shadowWidth = a.offsetWidth + 26; shadowHeight = a.offsetHeight + 26; shadowdiv.style.width = shadowWidth + "px"; shadowdiv.style.height = shadowHeight + "px"; shadowdiv.style.left = shadowLeft + "px"; shadowdiv.style.top = shadowTop + "px"; document.getElementById("ShadowBox").style.visibility = "visible"; fadeElementSetup("ShadowBox", 0, 100, 5); document.getElementById("ZoomClose").style.visibility = "visible"; fadeElementSetup("ZoomClose", 0, 100, 5) } function zoomDone(a, b) { zoomOpen = false; zoomOrigH[b] = ""; zoomOrigW[b] = ""; document.getElementById(a).style.visibility = "hidden"; zoomActive[b] == false } function zoomElement(zoomdiv, theID, zoomCurrent, zoomStartW, zoomChangeW, zoomStartH, zoomChangeH, zoomStartX, zoomChangeX, zoomStartY, zoomChangeY, zoomSteps, fade, fadeAmount, execWhenDone) { if (zoomCurrent == (zoomSteps + 1)) { zoomActive[theID] = false; clearInterval(zoomTimer[theID]); if (execWhenDone != "") { eval(execWhenDone) } } else { if (fade != 0) { if (fadeAmount < 0) { setOpacity(Math.abs(zoomCurrent * fadeAmount), zoomdiv) } else { setOpacity(100 - (zoomCurrent * fadeAmount), zoomdiv) } } moveW = cubicInOut(zoomCurrent, zoomStartW, zoomChangeW, zoomSteps); moveH = cubicInOut(zoomCurrent, zoomStartH, zoomChangeH, zoomSteps); moveX = cubicInOut(zoomCurrent, zoomStartX, zoomChangeX, zoomSteps); moveY = cubicInOut(zoomCurrent, zoomStartY, zoomChangeY, zoomSteps); document.getElementById(zoomdiv).style.left = moveX + "px"; document.getElementById(zoomdiv).style.top = moveY + "px"; zoomimg.style.width = moveW + "px"; zoomimg.style.height = moveH + "px"; zoomCurrent++; clearInterval(zoomTimer[theID]); zoomTimer[theID] = setInterval("zoomElement('" + zoomdiv + "', '" + theID + "', " + zoomCurrent + ", " + zoomStartW + ", " + zoomChangeW + ", " + zoomStartH + ", " + zoomChangeH + ", " + zoomStartX + ", " + zoomChangeX + ", " + zoomStartY + ", " + zoomChangeY + ", " + zoomSteps + ", " + fade + ", " + fadeAmount + ", '" + execWhenDone + "')", zoomTime) } } function zoomMouseOver() { } function zoomMouseOut() { } function fadeOut(a) { if (a.id) { fadeElementSetup(a.id, 100, 0, 10) } } function fadeIn(a) { if (a.id) { fadeElementSetup(a.id, 0, 100, 10) } } var fadeActive = new Array(); var fadeQueue = new Array(); var fadeTimer = new Array(); var fadeClose = new Array(); function fadeElementSetup(c, e, b, a, d) { if (fadeActive[c] == true) { fadeQueue[c] = new Array(c, e, b, a) } else { fadeSteps = a; fadeCurrent = 0; fadeAmount = (e - b) / fadeSteps; fadeTimer[c] = setInterval("fadeElement('" + c + "', '" + fadeCurrent + "', '" + fadeAmount + "', '" + fadeSteps + "')", 15); fadeActive[c] = true; if (d == 1) { fadeClose[c] = true } else { fadeClose[c] = false } } } function fadeElement(b, d, a, c) { if (d == c) { clearInterval(fadeTimer[b]); fadeActive[b] = false; if (fadeClose[b] == true) { document.getElementById(b).style.visibility = "hidden" } if (fadeQueue[b] && fadeQueue[b] != false) { fadeElementSetup(fadeQueue[b][0], fadeQueue[b][1], fadeQueue[b][2], fadeQueue[b][3]); fadeQueue[b] = false } } else { d++; if (a < 0) { setOpacity(Math.abs(d * a), b) } else { setOpacity(100 - (d * a), b) } clearInterval(fadeTimer[b]); fadeTimer[b] = setInterval("fadeElement('" + b + "', '" + d + "', '" + a + "', '" + c + "')", 15) } } function setOpacity(c, a) { var b = document.getElementById(a).style; if (navigator.userAgent.indexOf("Firefox") != -1) { if (c == 100) { c = 99.9999 } } b.filter = "alpha(opacity=" + c + ")"; b.opacity = (c / 100) } function linear(e, a, g, f) { return g * e / f + a } function sineInOut(e, a, g, f) { return -g / 2 * (Math.cos(Math.PI * e / f) - 1) + a } function cubicIn(e, a, g, f) { return g * (e /= f) * e * e + a } function cubicOut(e, a, g, f) { return g * ((e = e / f - 1) * e * e + 1) + a } function cubicInOut(e, a, g, f) { if ((e /= f / 2) < 1) { return g / 2 * e * e * e + a } return g / 2 * ((e -= 2) * e * e + 2) + a } function bounceOut(e, a, g, f) { if ((e /= f) < (1 / 2.75)) { return g * (7.5625 * e * e) + a } else { if (e < (2 / 2.75)) { return g * (7.5625 * (e -= (1.5 / 2.75)) * e + 0.75) + a } else { if (e < (2.5 / 2.75)) { return g * (7.5625 * (e -= (2.25 / 2.75)) * e + 0.9375) + a } else { return g * (7.5625 * (e -= (2.625 / 2.75)) * e + 0.984375) + a } } } } function getSize() { if (document.all) { myWidth = (document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.clientWidth; myHeight = (document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight; myScroll = (document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop } else { myWidth = window.innerWidth; myHeight = window.innerHeight; myScroll = window.pageYOffset } if (window.innerHeight && window.scrollMaxY) { myScrollWidth = document.body.scrollWidth; myScrollHeight = window.innerHeight + window.scrollMaxY } else { if (document.body.scrollHeight > document.body.offsetHeight) { myScrollWidth = document.body.scrollWidth; myScrollHeight = document.body.scrollHeight } else { myScrollWidth = document.body.offsetWidth; myScrollHeight = document.body.offsetHeight } } } function findElementPos(a) { var c = 0; var b = 0; do { c += a.offsetLeft; b += a.offsetTop } while (a = a.offsetParent); return Array(c, b) } function insertZoomHTML() { var n = document.getElementsByTagName("body").item(0); var H = document.createElement("div"); H.setAttribute("id", "ZoomSpin"); H.style.position = "absolute"; H.style.left = "10px"; H.style.top = "10px"; H.style.visibility = "hidden"; H.style.zIndex = "5000"; n.insertBefore(H, n.firstChild); var t = document.createElement("img"); t.setAttribute("id", "SpinImage"); t.setAttribute("src", zoomImageURI + "zoom-spin-1.png"); H.appendChild(t); var m = document.createElement("div"); m.setAttribute("id", "ZoomBox"); m.style.position = "absolute"; m.style.left = "10px"; m.style.top = "10px"; m.style.visibility = "hidden"; m.style.zIndex = "499"; n.insertBefore(m, H.nextSibling); var j = document.createElement("a"); j.setAttribute("href", "javascript:zoomOut();"); m.appendChild(j); var u = document.createElement("img"); u.setAttribute("src", zoomImageURI + "spacer.gif"); u.setAttribute("id", "ZoomImage"); u.setAttribute("border", "0"); u.setAttribute("onMouseOver", "zoomMouseOver();"); u.setAttribute("onMouseOut", "zoomMouseOut();"); u.style.display = "block"; u.style.width = "10px"; u.style.height = "10px"; j.appendChild(u); var q = document.createElement("div"); q.setAttribute("id", "ZoomClose"); q.style.position = "absolute"; q.style.left = "-15px"; q.style.top = "-15px"; q.style.filter = "alpha(opacity=0)"; q.style.MozOpacity = "0"; q.style.opacity = "0"; q.style.visibility = "hidden"; m.appendChild(q); var h = document.createElement("a"); h.setAttribute("href", "javascript:zoomOut(1);"); q.appendChild(h); var s = document.createElement("img"); s.setAttribute("src", zoomImageURI + "closebox.png"); s.setAttribute("width", "30"); s.setAttribute("height", "30"); s.setAttribute("border", "0"); h.appendChild(s); var r = document.createElement("div"); r.setAttribute("id", "ShadowBox"); r.style.position = "absolute"; r.style.left = "50px"; r.style.top = "50px"; r.style.width = "100px"; r.style.height = "100px"; r.style.visibility = "hidden"; r.style.zIndex = "45"; n.insertBefore(r, m.nextSibling); var k = document.createElement("table"); k.setAttribute("border", "0"); k.setAttribute("width", "100%"); k.setAttribute("height", "100%"); k.setAttribute("cellpadding", "0"); k.setAttribute("cellspacing", "0"); r.appendChild(k); var p = document.createElement("tr"); p.style.height = "25px"; k.appendChild(p); var L = document.createElement("td"); L.style.width = "27px"; p.appendChild(L); var E = document.createElement("img"); E.setAttribute("src", zoomImageURI + "zoom-shadow1.png"); E.setAttribute("width", "27"); E.setAttribute("height", "25"); E.style.display = "block"; L.appendChild(E); var K = document.createElement("td"); K.setAttribute("background", zoomImageURI + "zoom-shadow2.png"); p.appendChild(K); var c = document.createElement("img"); c.setAttribute("src", zoomImageURI + "spacer.gif"); c.setAttribute("height", "1"); c.setAttribute("width", "1"); c.style.display = "block"; K.appendChild(c); var J = document.createElement("td"); J.style.width = "27px"; p.appendChild(J); var B = document.createElement("img"); B.setAttribute("src", zoomImageURI + "zoom-shadow3.png"); B.setAttribute("width", "27"); B.setAttribute("height", "25"); B.style.display = "block"; J.appendChild(B); inRow2 = document.createElement("tr"); k.appendChild(inRow2); var I = document.createElement("td"); I.setAttribute("background", zoomImageURI + "zoom-shadow4.png"); inRow2.appendChild(I); var b = document.createElement("img"); b.setAttribute("src", zoomImageURI + "spacer.gif"); b.setAttribute("height", "1"); b.setAttribute("width", "1"); b.style.display = "block"; I.appendChild(b); var G = document.createElement("td"); G.setAttribute("bgcolor", "#ffffff"); inRow2.appendChild(G); var a = document.createElement("img"); a.setAttribute("src", zoomImageURI + "spacer.gif"); a.setAttribute("height", "1"); a.setAttribute("width", "1"); a.style.display = "block"; G.appendChild(a); var F = document.createElement("td"); F.setAttribute("background", zoomImageURI + "zoom-shadow5.png"); inRow2.appendChild(F); var N = document.createElement("img"); N.setAttribute("src", zoomImageURI + "spacer.gif"); N.setAttribute("height", "1"); N.setAttribute("width", "1"); N.style.display = "block"; F.appendChild(N); var o = document.createElement("tr"); o.style.height = "26px"; k.appendChild(o); var D = document.createElement("td"); D.style.width = "27px"; o.appendChild(D); var z = document.createElement("img"); z.setAttribute("src", zoomImageURI + "zoom-shadow6.png"); z.setAttribute("width", "27"); z.setAttribute("height", "26"); z.style.display = "block"; D.appendChild(z); var C = document.createElement("td"); C.setAttribute("background", zoomImageURI + "zoom-shadow7.png"); o.appendChild(C); var M = document.createElement("img"); M.setAttribute("src", zoomImageURI + "spacer.gif"); M.setAttribute("height", "1"); M.setAttribute("width", "1"); M.style.display = "block"; C.appendChild(M); var A = document.createElement("td"); A.style.width = "27px"; o.appendChild(A); var y = document.createElement("img"); y.setAttribute("src", zoomImageURI + "zoom-shadow8.png"); y.setAttribute("width", "27"); y.setAttribute("height", "26"); y.style.display = "block"; A.appendChild(y); if (includeCaption == 1) { var e = document.createElement("div"); e.setAttribute("id", "ZoomCapDiv"); e.style.display = "none"; e.style.marginLeft = "13px"; e.style.marginRight = "13px"; r.appendChild(e); var g = document.createElement("table"); g.setAttribute("border", "0"); g.setAttribute("cellpadding", "0"); g.setAttribute("cellspacing", "0"); g.setAttribute("align", "center"); e.appendChild(g); var l = document.createElement("tr"); g.appendChild(l); var x = document.createElement("td"); l.appendChild(x); var f = document.createElement("img"); f.setAttribute("src", zoomImageURI + "zoom-caption-l.png"); f.setAttribute("width", "13"); f.setAttribute("height", "26"); f.style.display = "block"; x.appendChild(f); var w = document.createElement("td"); w.setAttribute("background", zoomImageURI + "zoom-caption-fill.png"); w.setAttribute("id", "ZoomCaption"); w.setAttribute("valign", "middle"); w.style.fontSize = "14px"; w.style.fontFamily = "Helvetica"; w.style.fontWeight = "bold"; w.style.color = "#ffffff"; w.style.textShadow = "0px 2px 4px #000000"; w.style.whiteSpace = "nowrap"; l.appendChild(w); var v = document.createElement("td"); l.appendChild(v); var d = document.createElement("img"); d.setAttribute("src", zoomImageURI + "zoom-caption-r.png"); d.setAttribute("width", "13"); d.setAttribute("height", "26"); d.style.display = "block"; v.appendChild(d) } } var currentSection = "section1-pane"; var tabTag = "-tab"; var paneTag = "-pane"; function ScrollSection(a, b, c) { if (currentSection == a) { return } lastSection = currentSection; currentSection = a; sectionTab = currentSection.split("-")[0] + tabTag; document.getElementById(sectionTab).className = "active"; if (lastSection) { lastTab = lastSection.split("-")[0] + tabTag; document.getElementById(lastTab).className = "inactive" } theScroll = document.getElementById(b); position = findElementPos(document.getElementById(a)); if (c != "") { offsetPos = findElementPos(document.getElementById(c)); position[0] = position[0] - offsetPos[0] } scrollStart(theScroll, theScroll.scrollLeft, position[0], "horiz") } function ScrollArrow(e, c, d, f) { toolbarElem = document.getElementById(c); toolbarNames = new Array(); if (toolbarElem.hasChildNodes()) { var b = toolbarElem.childNodes; for (var a = 0; a < b.length; a++) { if (toolbarElem.childNodes[a].tagName == "LI") { toolbarNames.push(toolbarElem.childNodes[a].id.split("-")[0]) } } } for (var a = 0; a < toolbarNames.length; a++) { if (toolbarNames[a] == currentSection.split("-")[0]) { if (e == "left") { if (a - 1 < 0) { gotoTab = toolbarNames[toolbarNames.length - 1] } else { gotoTab = toolbarNames[a - 1] } } else { if ((a + 1) > (toolbarNames.length - 1)) { gotoTab = toolbarNames[0] } else { gotoTab = toolbarNames[a + 1] } } } } ScrollSection(gotoTab + paneTag, d, f) } var scrollanim = { time: 0, begin: 0, change: 0, duration: 0, element: null, timer: null }; function scrollStart(b, d, a, c) { if (scrollanim.timer != null) { clearInterval(scrollanim.timer); scrollanim.timer = null } scrollanim.time = 0; scrollanim.begin = d; scrollanim.change = a - d; scrollanim.duration = 18; scrollanim.element = b; if (c == "horiz") { scrollanim.timer = setInterval("scrollHorizAnim();", 15) } else { scrollanim.timer = setInterval("scrollVertAnim();", 15) } } function scrollVertAnim() { if (scrollanim.time > scrollanim.duration) { clearInterval(scrollanim.timer); scrollanim.timer = null } else { move = sineInOut(scrollanim.time, scrollanim.begin, scrollanim.change, scrollanim.duration); scrollanim.element.scrollTop = move; scrollanim.time++ } } function scrollHorizAnim() { if (scrollanim.time > scrollanim.duration) { clearInterval(scrollanim.timer); scrollanim.timer = null } else { move = sineInOut(scrollanim.time, scrollanim.begin, scrollanim.change, scrollanim.duration); scrollanim.element.scrollLeft = move; scrollanim.time++ } } function showLargePopup(b) { var a = document.getElementById("fullscreen"); var c = document.getElementById("largepopup"); document.getElementById("start-download").className = "show"; getSize(); a.style.height = myScrollHeight + "px"; a.style.display = "block"; c.style.left = ((myWidth - c.offsetWidth) / 2) + "px"; c.style.top = (((myHeight - c.offsetHeight) / 2) + myScroll) + "px"; c.style.visibility = "visible"; refreshTimer = setTimeout("setLocation('" + b.getAttribute("href") + "')", 1500) } function setLocation(a) { window.location = a } function hideLargePopup() { var a = document.getElementById("fullscreen"); var b = document.getElementById("largepopup"); b.style.visibility = "hidden"; a.style.display = "none" } var dpopTimer = ""; function showDownloadPopup(c) { var a = document.getElementById("dpop"); var b = document.getElementById("download"); if (moveanim.timer != null) { clearInterval(moveanim.timer); moveanim.timer = null } position = findElementPos(b); a.style.top = (position[1] - (a.offsetHeight - 40)) + "px"; a.style.left = "5px"; if (dpopTimer != "") { clearTimeout(dpopTimer); dpopTimer = "" } else { setOpacity(0, "dpop"); a.style.visibility = "visible"; moveStart(a, parseInt(a.style.left), parseInt(a.style.left), parseInt(a.style.top) + 10, parseInt(a.style.top), 15); fadeElementSetup("dpop", 0, 100, 13) } } function hideDownloadPopup() { dpopTimer = setTimeout("actuallyHide()", 500) } function actuallyHide() { var a = document.getElementById("dpop"); if (dpopTimer != "") { dpopTimer = ""; moveStart(a, parseInt(a.style.left), parseInt(a.style.left), parseInt(a.style.top), parseInt(a.style.top) - 10, 15); fadeElementSetup("dpop", 100, 0, 13, 1) } } var moveanim = { time: 0, beginX: 0, changeX: 0, beginY: 0, changeY: 0, duration: 0, element: null, timer: null }; function moveStart(e, b, d, a, c, f) { if (moveanim.timer != null) { clearInterval(moveanim.timer); moveanim.timer = null } moveanim.time = 0; moveanim.beginX = b; moveanim.changeX = d - b; moveanim.beginY = a; moveanim.changeY = c - a; moveanim.duration = f; moveanim.element = e; moveanim.timer = setInterval("moveAnimDo();", 15) } function moveAnimDo() { if (moveanim.time > moveanim.duration) { clearInterval(moveanim.timer); moveanim.timer = null } else { moveX = cubicOut(moveanim.time, moveanim.beginX, moveanim.changeX, moveanim.duration); moveY = cubicOut(moveanim.time, moveanim.beginY, moveanim.changeY, moveanim.duration); moveanim.element.style.left = moveX + "px"; moveanim.element.style.top = moveY + "px"; moveanim.time++ } };
