var $filename = new Array(); var $header = new Array(); var $caption = new Array(); var $aspect = new Array(); var $framerate = new Array(); var $options = new Array(); var $choice=0; var $fullwidth=0; var $myFramerate=1; $i=0; $filename[$i]='empty.jpg'; $aspect[$i]=700/1280; $header[$i]=''; $caption[$i]=''; if (location.search.length>1) { $choice = location.search.substring(1) } else { $choice = "0" } if (document.captureEvents) document.captureEvents(Event.KEYDOWN); //KEYPRESS does not see arrows document.onkeydown = processKeypresses; var $opacity=0; //0.1; //See also pageYOffset in insertpicture document.write(''); document.write(''); function backward() { $fullwidth=0; if ($choice>1) { $choice-- } else { $choice=$numberoffiles } insertpicture($choice) } function forward() { $fullwidth=0; if ($choice<$numberoffiles) { $choice++ } else { $choice = "1" } insertpicture($choice) } function processKeypresses(e) { //alert(navigator.appName); if(navigator.appName == "Netscape") k = e.which; // key's ASCII code (Netscape and Mozilla and Safari) else k=event.keyCode; // key's ASCII code (IE and Opera) //alert(k); if (k==13) forward(); // return if (k==27) history.back(); // esc if (k==37) backward(); // arrow left //if (k==33) backward(); // clicker page up //if (k==38) $fullwidth=1; insertpicture($choice); // arrow up CLICK ON PICTURE INSTEAD //if (k==34) forward(); // clicker page down if (k==39) forward(); // arrow right //if (k==40) $fullwidth=0; insertpicture($choice); // arrow down CLICK ON PICTURE INSTEAD if (k==90) window.parent.frames['contents'].focus(); // z to move focus back to upper frame (needed when thumb show is embedded in regular show // movie controls if (k==32) step(0); // space toggles play if (k==188) step(-1); //, below < if (k==190) step(1); //. below > if (k==191) step(0); // below ? toggles play if (k==219) step(-2); // [ if (k==221) step(2); // ] if (k==32) return false; // no further action //if (k==33) return false; // no further action //if (k==34) return false; // no further action } function insertpicture(n) { // window.scrollTo(0,0); //scroll back to top of page $choice=n; //remember selected file if (n>=0) { if (n>$numberoffiles) {n=$numberoffiles} for ($i=1;$i<=$numberoffiles;$i=$i+1) {document.getElementById('thumb'+$i).style.border="";} if (n>0) {document.getElementById('thumb'+$choice).style.border="1px solid blue";} //hilite selected // www.geekpedia.com/code100_Get-window-width-and-height.html var $x=0; var $y=0; if (self.innerHeight) // all except Explorer { $x=self.innerWidth; $y=self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) //Explorer 6 strict mode { $x=document.documentElement.clientWidth; $y=document.documentElement.clientHeight; } else if (document.body) // other Explorers { $x=document.body.clientWidth; $y=document.body.clientHeight; } $width0= $x-0.08*$x-140; // 140 pixel left column plus 4 * 2% margins $y=.98*$y; // if($caption[n]){$y=$y-24*$caption[n].length*5/$y; if($caption[n].match("
")) {$y=$y-24;}} //adjust for text lines if($header[n]) {$y=$y-48;} //leave space for header and caption if ($filename[n].match(".mp4")) {$y=$y-24;} //leave space for control bar if ($filename[n].match(".mov")) {$y=$y-24;} if (!$options[n]) //options not set { $options[n]=""; } if (!$aspect[n]>0) //aspect value not set { $aspect[n]=1; } $width=$width0; if ($width*$aspect[n] > $y ) { $width=$y/$aspect[n]; } $code="" if(typeof(window.pageYOffset) == 'number') { scrolltop = window.pageYOffset; if(scrolltop>0) {$code='
';} $code=$code+''; $code=$code+''; } $code=$code+'
'; if ($header[n]!="") $code=$code+$header[n]+'
'; if ($filename[n].match(".html")) //file is a webpage { $code=$code+''; // alert($code); } else if ($filename[n].match(".mov")==null && $filename[n].match(".mp4")==null) { if ($filename[n]!="" && $filename[n].match("thumbs/")==null) { $code=$code+''; } else { $code=$code+$width+'px height='+ ($width*$aspect[n]+0) +'px onclick="javascript:$fullwidth=1; insertpicture($choice);">'; } } } else //file is a movie { // $code=$code+''; $code=$code+''; } else //or use single step controls for graphs { $code=$code+'>'; $code=$code+'Your browser does not support HTML5 video.'; $code=$code+'
Press left bracket or click me for first image in movie  '; $code=$code+'Use  Press comma or click me to back up one movie frame  or'; $code=$code+'  Press period or click me to advance one movie frame  to change single frames, and'; $code=$code+'  Press spacebar or click me to toggle movie play to play/pause.'; $code=$code+'  Press left bracket or click me for last image in movie
'; } } $code=$code+'
'+ $caption[n]+'
'; // alert($code); document.getElementById('pictureframe').innerHTML=$code; if ($options[n].indexOf("playbackrate=") != -1) { $playbackrate=$options[n].split("playbackrate=")[1]; //portion that follows playbackrate= $playbackrate=$playbackrate.split(" ")[0]; //up to next blank document.querySelector('video').playbackRate = $playbackrate; //0.24 * 25fps = 6fps, 0.04 * 25fps = 1fps } document.getElementById('videobox').play(); } else //filename instead of number, used by conductivity { $myFramerate=1/15; $code='
'+($choice.split('/')[1]).split('_')[0]+'  '; $code=$code+'
Press left bracket or click me for first image in movie  '; $code=$code+'  Use Press spacebar or click me to toggle movie play to play/pause.'; $code=$code+'  Press left bracket or click me for last image in movie
'; $code=$code+'
'; // alert($code); document.getElementById('pictureframe').innerHTML=$code; // document.getElementById('videobox').pause(); //wait for user to play (these movies are short) } } function step(mystep) { myVid=document.getElementById("videobox"); // myVid.loop = false; //loop messes up step by step at ends if(myVid.readyState !== 4) {myVid.play(); myVid.pause();} //load if not loaded, needed because autoplay does not work in iOS if(mystep==-1) { //reverse myVid.pause(); if (myVid.currentTime - $myFramerate < 0){myVid.currentTime=myVid.duration;} else {myVid.currentTime+=-$myFramerate;} } else if(mystep==1) { //forward myVid.pause(); if (myVid.currentTime + $myFramerate > myVid.duration){myVid.currentTime="0";} else {myVid.currentTime+=+$myFramerate;} } else if(mystep==-2) { //beginning myVid.pause(); myVid.currentTime="0"; } else if(mystep==2) { //end myVid.pause(); myVid.currentTime=myVid.duration; } else { //toggle play if(myVid.paused) { myVid.currentTime+=+$myFramerate; //otherwise slow frame rate makes delayed response myVid.play(); } else { myVid.pause(); } } myVid.currentTime=myVid.currentTime.toFixed(6); //extra digits build up //alert(myVid.currentTime+" "+myVid.duration+" "+$myFramerate); }