|
|
'); 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+"/flareloc/soars_FlareLocations_20220604_1702.gif"; urls[1]=url_path+"/flareloc/soars_FlareLocations_20220604_2302.gif"; urls[2]=url_path+"/flareloc/soars_FlareLocations_20220605_0502.gif"; urls[3]=url_path+"/flareloc/soars_FlareLocations_20220605_1102.gif"; urls[4]=url_path+"/flareloc/soars_FlareLocations_20220605_1702.gif"; urls[5]=url_path+"/flareloc/soars_FlareLocations_20220605_2302.gif"; urls[6]=url_path+"/flareloc/soars_FlareLocations_20220606_0502.gif"; urls[7]=url_path+"/flareloc/soars_FlareLocations_20220606_1102.gif"; urls[8]=url_path+"/flareloc/soars_FlareLocations_20220606_1602.gif"; urls[9]=url_path+"/flareloc/soars_FlareLocations_20220606_2302.gif"; urls[10]=url_path+"/flareloc/soars_FlareLocations_20220607_0502.gif"; urls[11]=url_path+"/flareloc/soars_FlareLocations_20220607_1102.gif"; urls[12]=url_path+"/flareloc/soars_FlareLocations_20220607_1702.gif"; urls[13]=url_path+"/flareloc/soars_FlareLocations_20220607_2302.gif"; urls[14]=url_path+"/flareloc/soars_FlareLocations_20220608_0502.gif"; urls[15]=url_path+"/flareloc/soars_FlareLocations_20220608_1102.gif"; urls[16]=url_path+"/flareloc/soars_FlareLocations_20220608_1702.gif"; urls[17]=url_path+"/flareloc/soars_FlareLocations_20220608_2302.gif"; urls[18]=url_path+"/flareloc/soars_FlareLocations_20220609_0502.gif"; urls[19]=url_path+"/flareloc/soars_FlareLocations_20220609_1102.gif"; urls[20]=url_path+"/flareloc/soars_FlareLocations_20220609_1702.gif"; urls[21]=url_path+"/flareloc/soars_FlareLocations_20220609_2302.gif"; urls[22]=url_path+"/flareloc/soars_FlareLocations_20220610_0502.gif"; urls[23]=url_path+"/flareloc/soars_FlareLocations_20220610_1102.gif"; urls[24]=url_path+"/flareloc/soars_FlareLocations_20220610_1702.gif"; urls[25]=url_path+"/flareloc/soars_FlareLocations_20220610_2302.gif"; urls[26]=url_path+"/flareloc/soars_FlareLocations_20220611_0502.gif"; urls[27]=url_path+"/flareloc/soars_FlareLocations_20220611_1102.gif"; urls[28]=url_path+"/flareloc/soars_FlareLocations_20220611_1702.gif"; urls[29]=url_path+"/flareloc/soars_FlareLocations_20220611_2302.gif"; urls[30]=url_path+"/flareloc/soars_FlareLocations_20220612_0502.gif"; urls[31]=url_path+"/flareloc/soars_FlareLocations_20220612_1102.gif"; urls[32]=url_path+"/flareloc/soars_FlareLocations_20220612_1702.gif"; urls[33]=url_path+"/flareloc/soars_FlareLocations_20220612_2302.gif"; urls[34]=url_path+"/flareloc/soars_FlareLocations_20220613_0502.gif"; urls[35]=url_path+"/flareloc/soars_FlareLocations_20220613_1102.gif"; urls[36]=url_path+"/flareloc/soars_FlareLocations_20220613_1702.gif"; urls[37]=url_path+"/flareloc/soars_FlareLocations_20220613_2302.gif"; urls[38]=url_path+"/flareloc/soars_FlareLocations_20220614_0502.gif"; urls[39]=url_path+"/flareloc/soars_FlareLocations_20220614_1102.gif"; urls[40]=url_path+"/flareloc/soars_FlareLocations_20220614_1702.gif"; urls[41]=url_path+"/flareloc/soars_FlareLocations_20220614_2302.gif"; urls[42]=url_path+"/flareloc/soars_FlareLocations_20220615_0502.gif"; urls[43]=url_path+"/flareloc/soars_FlareLocations_20220615_1102.gif"; urls[44]=url_path+"/flareloc/soars_FlareLocations_20220615_1702.gif"; urls[45]=url_path+"/flareloc/soars_FlareLocations_20220615_2302.gif"; urls[46]=url_path+"/flareloc/soars_FlareLocations_20220616_0502.gif"; urls[47]=url_path+"/flareloc/soars_FlareLocations_20220616_1102.gif"; urls[48]=url_path+"/flareloc/soars_FlareLocations_20220616_1102.gif"; urls[49]=url_path+"/flareloc/soars_FlareLocations_20220616_1102.gif"; load_img(); swing_mode(); step(); step(); // -->