|
|
| Last Update: | Movie prepared by HELIO |
|
'); d.close(); win.focus(); } return true; } /////////////////////////////////////////////////////////////////////////// function load_img() { // asynchronously load all images into cache for (i=0; i < imax ; i++) { id[i]=setTimeout("load_src()",0); } return; } ///////////////////////////////////////////////////////////////////////////// function load_src() { // load individual images into cache if (index < imax) { if (iwidth && iheight) { images[index] = new Image(iwidth,iheight); } else { images[index] = new Image(); } images[index].onload=count_images; images[index].src = urls[index]; index++; } return; } ///////////////////////////////////////////////////////////////////////////// function clear_ids() { // clear asynchronous id's for (i=0; i < imax ; i++) {clearTimeout(id[i]);} return; } ///////////////////////////////////////////////////////////////////////////// function count_images() // count images as they are loaded into cache { if (++num_loaded_images == imax) { show_speed(); clear_ids(); animate(); } else { document.animation.src=images[num_loaded_images-1].src; document.form.frame.value="Loading "+num_loaded_images+" of "+imax; } } /////////////////////////////////////////////////////////////////////////// function reset_display() // update display/settings after range change { var j; frame=rstart; j=frame+1; if (images[frame].complete) { document.animation.src=images[frame].src; document.form.frame.value="Displaying "+j+" of "+imax; } playing=0; } /////////////////////////////////////////////////////////////////////////// function clear_range() // clear subrange { rstart=0; frame=-1; rstop=imax-1; dir=1; playing=0; document.form.start_frame.value=rstart+1; document.form.stop_frame.value=rstop+1; document.form.direction.value="Reverse"; bname="Reverse"; reset_display(); } /////////////////////////////////////////////////////////////////////////// function cur2start() // set current frame to start range { playing=0; rstart=frame; document.form.start_frame.value=rstart+1; if (rstart >= rstop) { rstop=imax-1; document.form.stop_frame.value=rstop+1; } } /////////////////////////////////////////////////////////////////////////// function cur2stop() // set current frame to stop range { playing=0; rstop=frame; document.form.stop_frame.value=rstop+1; if (rstart >= rstop) { rstart=0; document.form.start_frame.value=rstart+1; } } /////////////////////////////////////////////////////////////////////////// function image_abort() // abort loading images { imax=num_loaded_images; if (!images[num_loaded_images].complete) imax=imax-1; alert("Aborting"); if (imax > -1) animate(); } /////////////////////////////////////////////////////////////////////////// function image_error(message) // abort loading images { alert(message); } /////////////////////////////////////////////////////////////////////////// function start_play() // start movie { if (playing == 0) { if (timeout_id == null && num_loaded_images==imax) animate(); } } /////////////////////////////////////////////////////////////////////////// function stop_play() // stop movie { if (timeout_id) clearTimeout(timeout_id); timeout_id=null; playing = 0; } /////////////////////////////////////////////////////////////////////////// function swing_mode() // set swing mode { if (swingon) { swingon=0; document.form.swing.value="OFF"; } else { swingon=1; document.form.swing.value="ON"; } } /////////////////////////////////////////////////////////////////////////// function animate() // control movie loop { var j; frame=(frame+dir+imax)%imax; j=frame+1; if (images[frame].complete) { document.animation.src=images[frame].src; document.form.frame.value="Displaying "+j+" of "+imax; if (swingon && (j == imax || frame == 0)) reverse(); timeout_id=setTimeout("animate()",delay); playing=1; } } /////////////////////////////////////////////////////////////////////////// function step() // step frames { var j; if (timeout_id) clearTimeout(timeout_id); timeout_id=null; frame=(frame+dir+imax)%imax; j=frame+1; if (images[frame].complete) { document.animation.src=images[frame].src; document.form.frame.value="Displaying "+j+" of "+imax; playing=0; } } /////////////////////////////////////////////////////////////////////////// function reverse() // reverse direction { dir=-dir; if (dir > 0) document.form.direction.value="Reverse"; bname="Reverse"; if (dir < 0) document.form.direction.value="Forward"; bname="Forward"; } /////////////////////////////////////////////////////////////////////////// function show_speed() // show speed { document.form.rate.value=Math.round(speed); delay = 1000.0/speed; } /////////////////////////////////////////////////////////////////////////// function next_frame() // increment frame logic (TODO - work through equivilent "mod" logic.... { frame=frame+dir; if (frame < rstart) { frame=rstop; if (swingon) frame=rstart; } else { if (frame > rstop) { frame=rstart; if (swingon) frame=rstop; } } } /////////////////////////////////////////////////////////////////////////// function rewind() // rewind frames { var j; if (timeout_id) clearTimeout(timeout_id); timeout_id=null; playing=0; frame=rstart; j=frame+1; if (images[frame].complete) { document.animation.src=images[frame].src; document.form.frame.value="Displaying "+j+" of "+imax; } } /////////////////////////////////////////////////////////////////////////// function next() // next frames { var j; if (timeout_id) clearTimeout(timeout_id); timeout_id=null; playing=0; dir=1; next_frame(); j=frame+1; if (images[frame].complete) { document.animation.src=images[frame].src; document.form.frame.value="Displaying "+j+" of "+imax; } } /////////////////////////////////////////////////////////////////////////// function prev() // prev frames { var j; if (timeout_id) clearTimeout(timeout_id); timeout_id=null; playing=0; dir=-1; next_frame(); j=frame+1; if (images[frame].complete) { document.animation.src=images[frame].src; document.form.frame.value="Displaying "+j+" of "+imax; } } /////////////////////////////////////////////////////////////////////////// function p10() // plus 10 frames { var j; if (timeout_id) clearTimeout(timeout_id); timeout_id=null; playing=0; dir=10; next_frame(); dir=1; j=frame+1; if (images[frame].complete) { document.animation.src=images[frame].src; document.form.frame.value="Displaying "+j+" of "+imax; } } /////////////////////////////////////////////////////////////////////////// function m10() // minus 10 frames { var j; if (timeout_id) clearTimeout(timeout_id); timeout_id=null; playing=0; dir=-10; next_frame(); dir=-1; j=frame+1; if (images[frame].complete) { document.animation.src=images[frame].src; document.form.frame.value="Displaying "+j+" of "+imax; } } /////////////////////////////////////////////////////////////////////////// function keycntl1(event) // Keybord Control { if (event.keyCode != 0) { if (event.keyCode == 37) prev(); // <-- if (event.keyCode == 66) prev(); // b if (event.keyCode == 80) prev(); // p if (event.keyCode == 39) next(); // --> if (event.keyCode == 70) next(); // f if (event.keyCode == 78) next(); // n if (event.keyCode == 40) rewind(); // if (event.keyCode == 82) rewind(); // } else { if (event.charCode == 37) prev(); // <-- if (event.charCode == 66) prev(); // b if (event.charCode == 80) prev(); // p if (event.charCode == 39) next(); // --> if (event.charCode == 70) next(); // f if (event.charCode == 78) next(); // n if (event.charCode == 40) rewind(); // if (event.charCode == 82) rewind(); // } } /////////////////////////////////////////////////////////////////////////// // actual image loading is done here show_speed(); images = new Array(imax); urls= new Array(imax); id= new Array(imax); urls[0]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150305_0000.jpg"; urls[1]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150305_0600.jpg"; urls[2]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150305_1200.jpg"; urls[3]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150305_1800.jpg"; urls[4]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150306_0000.jpg"; urls[5]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150306_0600.jpg"; urls[6]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150306_1200.jpg"; urls[7]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150306_1800.jpg"; urls[8]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150307_0000.jpg"; urls[9]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150307_0600.jpg"; urls[10]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150307_1200.jpg"; urls[11]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150307_1800.jpg"; urls[12]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150308_0000.jpg"; urls[13]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150308_0600.jpg"; urls[14]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150308_1200.jpg"; urls[15]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150308_1800.jpg"; urls[16]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150309_0000.jpg"; urls[17]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150309_0600.jpg"; urls[18]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150309_1200.jpg"; urls[19]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150309_1800.jpg"; urls[20]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150310_0000.jpg"; urls[21]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150310_0600.jpg"; urls[22]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150310_1200.jpg"; urls[23]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150310_1800.jpg"; urls[24]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150311_0000.jpg"; urls[25]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150311_0600.jpg"; urls[26]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150311_1200.jpg"; urls[27]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150311_1800.jpg"; urls[28]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150312_0000.jpg"; urls[29]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150312_0600.jpg"; urls[30]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150312_1200.jpg"; urls[31]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150312_1800.jpg"; urls[32]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150313_0000.jpg"; urls[33]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150313_0600.jpg"; urls[34]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150313_1200.jpg"; urls[35]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150313_1800.jpg"; urls[36]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150314_0000.jpg"; urls[37]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150314_0600.jpg"; urls[38]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150314_1200.jpg"; urls[39]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150314_1800.jpg"; urls[40]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150315_0000.jpg"; urls[41]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150315_0600.jpg"; urls[42]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150315_1200.jpg"; urls[43]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150315_1800.jpg"; urls[44]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150316_0000.jpg"; urls[45]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150316_0600.jpg"; urls[46]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150316_1200.jpg"; urls[47]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150316_1800.jpg"; urls[48]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150317_0000.jpg"; urls[49]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150317_0600.jpg"; urls[50]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150317_1200.jpg"; urls[51]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150317_1800.jpg"; urls[52]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150318_0000.jpg"; urls[53]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150318_0600.jpg"; urls[54]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150318_1200.jpg"; urls[55]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150318_1800.jpg"; urls[56]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150319_0000.jpg"; urls[57]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150319_0600.jpg"; urls[58]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150319_1200.jpg"; urls[59]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150319_1800.jpg"; urls[60]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150320_0000.jpg"; urls[61]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150320_0600.jpg"; urls[62]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150320_1200.jpg"; urls[63]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150320_1800.jpg"; urls[64]=url_path+"/12297_shmi_maglc_170615/12297_shmi_maglc_150321_0000.jpg"; load_img(); // -->