
function showpic(src, w, h, alt, aln, pw, ph, bw, bh) {
if (src == null) return;
var iw, ih; // Set inner width and height
if (window.innerWidth == null) {
iw = document.body.clientWidth;
ih=document.body.clientHeight; 
}
else {
iw = window.innerWidth;
ih = window.innerHeight;
}

if (ih>80) ih = ih - 50; // Space for nav arrows
 

if (w == null) w = iw;
if(h == null)  h = ih;
if(alt == null) alt = "Picture";
if(aln == null) aln = "middle";
if(pw == null) pw = 100;
if(ph == null) ph = 100;
if(bw == null) bw = 24;
if(bh == null) bh = 24;
var sw = Math.round((iw - bw) * pw / 100);
var sh = Math.round((ih - bh) * ph / 100);
if ((w * sh) / (h * sw) < 1) sw = Math.round(w * sh / h);
else sh = Math.round(h * sw / w);
if (sh > h || sw > w) {sh = h; sw = w;};
var qs = window.location.search;
if (qs.indexOf("size=scale") < 0)  {sh = h; sw = w;};
document.write('<img src="'+src+'" alt="'+alt+'" width="'+sw+'" height="'+sh+'" align="'+aln+'">');
}

function Is() {
agent = navigator.userAgent.toLowerCase();
this.major = parseInt(navigator.appVersion);
this.minor = parseFloat(navigator.appVersion);
this.ns = ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer')
== -1)
     && (agent.indexOf('compatible') ==  -1)));
this.ns2 = (this.ns && (this.major == 3));
this.ns3 = (this.ns && (this.major == 3));
this.ns4b = (this.ns && (this.major == 4) && (this.minor <= 4.03));
this.ns4 = (this.ns && (this.major == 4));
this.ns6 = (this.ns && (this.major >= 5));
this.ie = (agent.indexOf("msie") != -1);
this.ie3 = (this.ie && (this.major < 4));
this.ie4 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0")
 == -1));
this.ie5 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0")
 != -1));
this.ie55 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.5")
 != -1));
this.ie6 = (this.ie && (agent.indexOf("msie 6.0")!=-1) );
this.aol = (agent.indexOf("aol") != -1);
this.aol3 = (this.aol && this.ie3);
this.aol4 = (this.aol && this.ie4);
this.aol5 = (this.aol && this.ie5);
}
var is = new Is();

function winResize() {
var qs = window.location.search;
if (qs.indexOf("size=full") > -1) return;
if(is.ns4 ||is.ns6||is.ie4||is.ie5||is.ie55||is.ie6) history.go(0);
}

window.onerror=doerror;
function doerror(){return true;}

function keydown(event) {
	switch (event.keyCode){
		case 37:
			DoPrev(); 
			break;
		case 38:
			DoUp();
			break;
		case 39:
			DoNext(); 
			break;
		default:
	}
	event.returnValue = false;
}

function DoNext() {
if (nextpage==".htm" || nextpage=="") return;
var qs = window.location.search;
if (qs.indexOf("size=scale") >-1) {document.location=nextpage + "?size=scale";} else {document.location=nextpage;}
}
function DoPrev() {
if (prevpage==".htm" || prevpage=="") return;
var qs = window.location.search;
if (qs.indexOf("size=scale") >-1)  {document.location=prevpage + "?size=scale";} else {document.location=prevpage;}
}
function DoUp() {
document.location=uppage;
}
