(function () { var height_13 = $(window).height(); var width_13 = $(window).width(); var Hoffset_13 = $('#flying_13').height(); var Woffset_13 = $('#flying_13').width(); var xPos_13 = (width_13 - Woffset_13) / 2; var yPos_13 = (height_13 - Hoffset_13) / 2; var step_13 = 1; var delay_13 = 30; var yon_13 = 0; var xon_13 = 0; var pause_13 = true; var interval_13; var interval_13 = setInterval(changePos_13, delay_13); $('#flying_13').hover(function () { clearInterval(interval_13); }, function () { interval_13 = setInterval(changePos_13, delay_13); }); function changePos_13() { $('#flying_13').css({ left: xPos_13 + $(window).scrollLeft(), top: yPos_13 + $(window).scrollTop() }); if (yon_13) { yPos_13 = yPos_13 + step_13; } else { yPos_13 = yPos_13 - step_13; } if (yPos_13 < 0) { yon_13 = 1; yPos_13 = 0; } if (yPos_13 >= (height_13 - Hoffset_13)) { yon_13 = 0; yPos_13 = (height_13 - Hoffset_13); } if (xon_13) { xPos_13 = xPos_13 + step_13; } else { xPos_13 = xPos_13 - step_13; } if (xPos_13 < 0) { xon_13 = 1; xPos_13 = 0; } if (xPos_13 >= (width_13 - Woffset_13 - 20)) { xon_13 = 0; xPos_13 = (width_13 - Woffset_13 - 20); } } })()