function $(id) { return document.getelementbyid(id); } function addloadevent(func){ var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function(){ oldonload(); func(); } } } function addbtn() { if(!$('ibanner')||!$('ibanner_pic')) return; var piclist = $('ibanner_pic').getelementsbytagname('a'); if(piclist.length==0) return; var btnbox = document.createelement('div'); btnbox.setattribute('id','ibanner_btn'); var spanbox =''; for(var i=1; i<=piclist.length; i++ ) { var spanlist = ''+i+''; spanbox += spanlist; } btnbox.innerhtml = spanbox; $('ibanner').appendchild(btnbox); $('ibanner_btn').getelementsbytagname('span')[0].classname = 'current'; for (var m=0; m final_x) { var dist = math.ceil((xpos - final_x)/10); xpos = xpos - dist; } if (ypos < final_y) { var dist = math.ceil((final_y - ypos)/10); ypos = ypos + dist; } if (ypos > final_y) { var dist = math.ceil((ypos - final_y)/10); ypos = ypos - dist; } elem.style.left = xpos + "px"; elem.style.top = ypos + "px"; var repeat = "moveelement('"+elementid+"',"+final_x+","+final_y+","+interval+")"; elem.movement = settimeout(repeat,interval); } function classnormal() { var btnlist = $('ibanner_btn').getelementsbytagname('span'); for (var i=0; i