function init() { var b = document.getElementById("top"); if (b) { console.log("[7] top ",b.tagName); addEvent({obj:b,evt:"click",fkt:back,ctrl:false}); } else { console.log("[12] no top"); } sailing(); } function back() { window.history.back(); } function sailing(t) { if (typeof(t) == "undefined") { var way = document.createElement("div"); way.id = "way"; var ship = document.createElement("div"); ship.id = "ship"; way.appendChild(ship); var first = document.body.firstChild; document.body.insertBefore(way,first); var w = window.getComputedStyle(way).width; console.log(w); var width = parseInt(w) - 100; ship.style.left = width+"px"; window.setTimeout("sailing(1)",100); way.title = "Home"; if (typeof(goHome) == "undefined") { way.onclick = new Function("window.history.back()"); } else { way.onclick = new Function("goHome()"); } } else { ship = document.getElementById("ship"); ship.style.transitionProperty= "left"; ship.style.transitionTimingFunction= "cubic-bezier(0,0,0,1)"; ship.style.transitionDuration= "500s"; ship.style.left="200px"; } }