var focus_id = 1; var focus_time = 0; var focus_bg = ""; var focus_begin = true; var focus_interval; var focus_count; if(navigator.appname=="microsoft internet explorer") { focus_count = document.getelementbyid("focus_img").childnodes.length; }else{ focus_count = document.getelementsbyname("focus_img").length; } function func_focus() { if(focus_id > focus_count) focus_id = 1; if(!focus_begin) clearinterval(focus_interval); focus_interval = setinterval("focus_show(" + focus_id + ")",50); } function focus_show(id) { if(focus_time < 20 && focus_bg != "") { var v = 100 / 20; if(navigator.appname=="microsoft internet explorer") { document.getelementbyid("focus_show").style.filter = "alpha(opacity=" + (v * focus_time) + ")"; }else{ document.getelementbyid("focus_show").style.opacity = v * focus_time / 100; } focus_time ++; }else{ if(!focus_begin) { document.getelementbyid("focus_bg").innerhtml = ""; focus_time = 0; clearinterval(focus_interval); } var val = document.getelementbyid("focus_" + focus_id).innerhtml; var arr = val.split("|"); if(navigator.appname=="microsoft internet explorer") { document.getelementbyid("focus_show").style.filter = "alpha(opacity=0)"; }else{ document.getelementbyid("focus_show").style.opacity = 0; } document.getelementbyid("focus_show").innerhtml = ""; focus_id ++; if(!focus_begin) focus_interval = setinterval("func_focus()",3000); else focus_begin = false; focus_bg = arr[0]; } } func_focus(); //乘风