var downloads_t; var downloads_tagId; function downloads_moveLeft(){ tbl = document.getElementById(downloads_tagId); x = tbl.style.left; x = x.replace('px',''); w = tbl.style.width; w = w.replace('px',''); if(1 * x <= 700 - w){ clearInterval(downloads_t); return; } x = 1 * (x - 50); tbl.style.left = x + "px"; clearInterval(downloads_t); downloads_t = setInterval("downloads_moveLeft()", (Math.abs(1 * x)%(700) == 0)?500:100); } function downloads_moveRight(){ tbl = document.getElementById(downloads_tagId); x = tbl.style.left; x = x.replace('px',''); w = tbl.style.width; w = w.replace('px',''); if(1 * x >= 0){ clearInterval(downloads_t); return; } x = 1 * x + 50; tbl.style.left = x + "px"; clearInterval(downloads_t); downloads_t = setInterval("downloads_moveRight()", (Math.abs(1 * x)%(700) == 0)?500:100); } function downloads_move(tagId, d){ downloads_tagId = tagId; if(d == -1){ downloads_moveLeft(); }else{ downloads_moveRight(); } }