var gen_info_t; var gen_info_tagId; function gen_info_moveLeft(){ tbl = document.getElementById(gen_info_tagId); x = tbl.style.left; x = x.replace('px',''); w = tbl.style.width; w = w.replace('px',''); if((1 * x) + (1 * w) <= 735){ clearInterval(gen_info_t); return; } x = 1 * (x - 50); tbl.style.left = x + "px"; clearInterval(gen_info_t); gen_info_t = setInterval("gen_info_moveLeft()", 100); } function gen_info_moveRight(){ tbl = document.getElementById(gen_info_tagId); x = tbl.style.left; x = x.replace('px',''); w = tbl.style.width; w = w.replace('px',''); if(1 * x >= 0){ clearInterval(gen_info_t); return; } x = 1 * x + 50; tbl.style.left = x + "px"; clearInterval(gen_info_t); gen_info_t = setInterval("gen_info_moveRight()", 100); } function gen_info_move(tagId, d){ gen_info_tagId = tagId; if(d == -1){ gen_info_moveLeft(); }else{ gen_info_moveRight(); } }