var $filename = new Array();
var $header = new Array();
var $caption = new Array();
var $aspect = new Array();
var $option = new Array();
var $choice=0;
$i=0;
$filename[$i]='empty.jpg';
$header[$i]='';
$caption[$i]='';
$aspect[$i]=3168/4752;
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;
function backward()
{
if ($choice>1)
{
$choice--
}
else
{
$choice=$numberoffiles
}
insertpicture($choice)
}
function forward()
{
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 if (navigator.userAgent.indexOf("Safari") != -1) k=e.which; // key's ASCII code (Safari)
else k=event.keyCode; // key's ASCII code (IE and Opera)
//alert(k);
if (k==11) backward(); // page up Netscape 4
if (k==12) forward(); // page down Netscape 4
if (k==13) forward(); // return
if (k==27) history.back(); // esc
if (k==28) backward(); // arrow left Netscape 4
if (k==29) forward(); // arrow right Netscape 4
if (k==30) backward(); // arrow up Netscape 4
if (k==31) forward(); // arrow down Netscape 4
//if (k==32) forward(); // space
if (k==33) backward(); // page up
if (k==34) forward(); // page down
if (k==37) backward(); // arrow left
if (k==38) backward(); // arrow up
if (k==39) forward(); // arrow right
if (k==40) forward(); // arrow down
if (k==44) backward(); //, lower case < Netscape 4
if (k==46) forward(); //. lower case > Netscape 4
if (k==188) backward(); //, lower case <
if (k==190) forward(); //. lower case >
//return false; // cancel event otherwise
}
function insertpicture(n)
{
// scroll(0,0); //scroll back to top of page
if (n>$numberoffiles) {n=$numberoffiles}
$choice=n; //remember selected file
// 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($header[n]) {$y=$y-24;} //leave space for header
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+'