document.write('
'); (function(){ var height = $(window).height(); var width = $(window).width(); var Hoffset = $('#flying').height(); var Woffset = $('#flying').width(); var xPos = (width-Woffset)/2; var yPos = (height-Hoffset)/2; var step = 1; var delay = 30; var yon = 0; var xon = 0; var pause = true; var interval; var interval = setInterval(changePos, delay); $('#flying').hover(function(){ clearInterval(interval); },function(){ interval = setInterval(changePos, delay);}); function changePos() { $('#flying').css({left:xPos+$(window).scrollLeft(),top:yPos+$(window).scrollTop()}); if (yon) {yPos = yPos + step; } else {yPos = yPos - step; } if (yPos < 0) { yon = 1;yPos = 0; } if (yPos >= (height - Hoffset)) { yon = 0;yPos = (height - Hoffset);} if (xon) {xPos = xPos + step; } else {xPos = xPos - step; } if (xPos < 0) { xon = 1;xPos = 0; } if (xPos >= (width - Woffset-20)) { xon = 0;xPos = (width - Woffset-20); } } })()