(function () { var chBoat = undefined; function boatAnimReset() { chBoat.removeEventListener("transitionend", boatAnimReset); chBoat.removeEventListener("webkitTransitionEnd", boatAnimReset); chBoat.addEventListener("transitionend", boatAnim); chBoat.addEventListener("webkitTransitionEnd", boatAnim); boat.className = ""; } function boatAnimE() { chBoat.removeEventListener("transitionend", boatAnimE); chBoat.removeEventListener("webkitTransitionEnd", boatAnimE); chBoat.addEventListener("transitionend", boatAnimReset); chBoat.addEventListener("webkitTransitionEnd", boatAnimReset); boat.className = "e"; } function boatAnimD() { chBoat.removeEventListener("transitionend", boatAnimD); chBoat.removeEventListener("webkitTransitionEnd", boatAnimD); chBoat.addEventListener("transitionend", boatAnimE); chBoat.addEventListener("webkitTransitionEnd", boatAnimE); boat.className = "d"; } function boatAnimC() { chBoat.removeEventListener("transitionend", boatAnimC); chBoat.removeEventListener("webkitTransitionEnd", boatAnimC); chBoat.addEventListener("transitionend", boatAnimD); chBoat.addEventListener("webkitTransitionEnd", boatAnimD); boat.className = "c"; } function boatAnimB() { chBoat.removeEventListener("transitionend", boatAnimB); chBoat.removeEventListener("webkitTransitionEnd", boatAnimB); chBoat.addEventListener("transitionend", boatAnimC); chBoat.addEventListener("webkitTransitionEnd", boatAnimC); boat.className = "b"; } function boatAnim() { if (!chBoat) chBoat = document.getElementById("boat"); if (!chBoat) return; chBoat.removeEventListener("transitionend", boatAnim); chBoat.removeEventListener("webkitTransitionEnd", boatAnim); chBoat.addEventListener("transitionend", boatAnimB); chBoat.addEventListener("webkitTransitionEnd", boatAnimB); boat.className = "a"; } onWindowLoad(function () { boatAnim(); }); })();