/*Function to get window dimensions by support rather than browser */ 		function getWinDims() {			var result=new Array();			if(window.innerWidth) {				result[0]=window.innerWidth; result[1]=window.innerHeight;				return result;				}			if(document.documentElement && document.documentElement.clientWidth) {				if(document.clientWidth) {					result[0]=document.clientWidth; result[1]=document.clientHeight;					} else {					result[0]=document.documentElement.clientWidth; result[1]=document.documentElement.clientHeight;					}				return result;				}			if(document.body) {				result[0]=document.body.clientWidth; result[1]=document.body.clientHeight;				return result;				}} function Is() {	var agent  = navigator.userAgent.toLowerCase();	var plat  = navigator.platform.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.ns7    = (this.ns && (this.major     >=    7));    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.cam   = (agent.indexOf('camino')     !=   -1);    this.opera = (agent.indexOf('opera')      !=   -1);    this.saf   = (agent.indexOf('safari')     !=   -1);    this.ff    = (agent.indexOf('firefox')    !=   -1);    this.kong  = (agent.indexOf('konqueror')  !=   -1);    this.linux = (plat.indexOf('linux')       !=   -1);    this.w32   = (plat.indexOf('win32')       !=   -1);    this.mcp   = (plat.indexOf('macppc')      !=   -1);    this.m68   = (plat.indexOf('mac68k')      !=   -1);    this.mac   = (this.mcp || this.m68);}function signOf(n) { return n>=0; } //true if n is 0 or greater, false if negativefunction toggleBool(tf) { return !tf } //returns true if arg=false and viceversafunction rndInRange(lower,upper) {	return (lower+Math.floor(Math.random()*(++upper-lower))); } //returns a random integer in the range	lower to upper. Either or both may be negative/*function posneg() {return -1+2*Math.floor(Math.random()+.5)} // returns 1 or -1 at random. 															 //useful for eg, reversing direction 															 //of a moving object at random*/function hideshow() { //args in pairs ("div1",true,"div2",false..) true to show, false to hide. Note quotes	var a=arguments,vh,div;	for(var loop=0;loop<a.length;loop+=2) {		if(a[loop]) { 			div=a[loop].name;			a[loop+1] ? vh="visible" : vh="hidden";			changeObjectVisibility(div,vh);			a[loop].showing = vh=='visible'; //set the item's 'showing' property to the appropriate true or false		}}}function showhide() { //args in pairs ("div1",true,"div2",false..) true to show, false to hide. Note quotes	var a=arguments,vh;	for(var loop=0;loop<a.length;loop+=2) {		a[loop+1] ? vh="visible" : vh="hidden";		changeObjectVisibility(a[loop],vh);		}}	function cap(s) { //cap initial letter of s	var i=s.charAt(0);	return i.toUpperCase()+s.substr(1);	}			function percentageOf(total,portion) {return 100/total*portion }	//what percentage of total is portion?	eg percentageOf(200,50) returns 25		function percent(total,portion) {return total/100*portion }	//what is portion percent of total?	eg percent(200,50) returns 100		function new_visit() {	var url_pattern=/(\w+):\/\/([\w.]+)\/(\S*)/;	var r1,r2;	if(document.referrer) {		var docref=document.referrer;		var docloc=document.URL; 		r1=docref.match(url_pattern);//if(!r1) r1=new Array(" "," ","2");		r2=docloc.match(url_pattern);		return r1[2]!=r2[2];	} else {return true;}	}	function getFileName() {	var docloc, url_pattern=/(\w+):\/\/([\w.]+)\/(\S*)/;	var r1,slash,pt,r2;		if(document.URL) {			docloc=document.URL; pt=-1;			while(pt==-1) {				pt=docloc.lastIndexOf('.html');				if(pt==-1) pt=docloc.lastIndexOf('.php');				if(pt==-1) { docloc += 'index.html';}				}			pt--; slash=docloc.lastIndexOf('/');			return docloc.substr(slash+1,pt-slash);		} else {return 'index';}		}	function assign_page_order() {			for(var loop=0;loop<arguments.length;loop++) eval(arguments[loop]+'='+loop);			}function getObject(objectId) {    // cross-browser function to get an object's style object given its id    if(document.getElementById && document.getElementById(objectId)) {	// W3C DOM	return document.getElementById(objectId);    } else if (document.all && document.all(objectId)) {	// MSIE 4 DOM	return document.all(objectId);    } else if (document.layers && document.layers[objectId]) {	// NN 4 DOM.. note: this won't find nested layers	return document.layers[objectId];    } else {	return false;    }} // getObjectfunction getStyleObject(objectId) {    // cross-browser function to get an object's style object given its id    if(document.getElementById && document.getElementById(objectId)) {	// W3C DOM	return document.getElementById(objectId).style;    } else if (document.all && document.all(objectId)) {	// MSIE 4 DOM	return document.all(objectId).style;    } else if (document.layers && document.layers[objectId]) {	// NN 4 DOM.. note: this won't find nested layers	return document.layers[objectId];    } else {	return false;    }} // getStyleObjectfunction getObjectPosition(objectId) {	var xy=new Array();    // cross-browser function to get an object's xy coords given its id    if(document.getElementById && document.getElementById(objectId)) {	// W3C DOM	xy[0] = document.getElementById(objectId).style.top;	xy[1] = document.getElementById(objectId).style.left;alert('dom');	return xy;    } else if (document.all && document.all(objectId)) {	// MSIE 4 DOM	xy[0] = document.all(objectId).style.top;	xy[1] = document.all(objectId).style.left;alert('ie');	return xy;    } else if (document.layers && document.layers[objectId]) {	// NN 4 DOM.. note: this won't find nested layers	xy[0] = document.layers[objectId].top;	xy[1] = document.layers[objectId].left;alert('lay');	return xy;    } else {	return false;    }} // getStyleObjectfunction changeObjectVisibility(objectId, newVisibility) {    // get a reference to the cross-browser style object and make sure the object exists    var styleObject = getStyleObject(objectId);    if(styleObject) {	styleObject.visibility = newVisibility;	return true;    } else {	// we couldn't find the object, so we can't change its visibility	return false;    }} // changeObjectVisibilityfunction Globals() {	this.newvisit = new_visit();	this.nv = this.newvisit ? 1 : 0;	}	var G = new Globals(); G.intID=null;G.str1="showhide('welcome1',false,'inback',true,'lilmary',true,'banner',true,'menu',true,'main',true);";G.cameopath="furniture\/cameos\/";G.colourindex=0;    var plat=new Is();function rollcolours(d,tf){	var colourArray = new Array("#ff0000","#daa520","#fff011","#008000","#0000ff","#4b0082","#ee82ee");//red,orange,yellow,green,blue,indigo,violet	var bg=getStyleObject(d);	var c='#000066';	if(bg) if(tf) { bg.backgroundColor=colourArray[G.colourindex]; G.colourindex++; if(G.colourindex>6) G.colourindex=0; }		else bg.backgroundColor=c;	else ;	}		function clearDecks(tf) {	var xystr;	if(G.is.ie) {		xystr = 'width: '+(G.wh[0]-112)+'px; height: '+(G.wh[1]-52)+'px;';	} else {		xystr = 'right: 0; bottom: 0;';	}	document.write('<div id="inback" style="'+xystr);	if(tf) {document.write('">');}	else {document.write(' visibility:hidden">');} 	document.write('<\/div>');	}	//submenuitems: these are popups implemented in javascript; noscript browsers get the popup items as part of the main menu (hopefully...)function popupdiv(n,v) {	this.name = n;	this.data = v;	this.showing = false;	this.content = popContent;	}	function popContent() {	var loop,bluegold, result='';	for(loop=0; loop<this.data.length; loop++) {		if(this.data[loop].name==currentfile || (this.data[loop].name=='histry' && currentfile=='company')) bluegold='" class="goldface">'; else bluegold='" class="deepblue">';		result+='<div id="'+this.data[loop].div+bluegold;		result+='<a href="'+this.data[loop].action+'" onmouseover="return handleit('+this.data[loop].index+',\'mi\')" onmouseout="return handleit('+this.data[loop].index+',\'mo\')" onclick="return handleit('+this.data[loop].index+',\'cl\')">';		result+=this.data[loop].label+'<\/a><\/div>';		}	return result;	}	function submenuitem(i,nom,dname,owner,txt,action) {	this.index = i;	this.name = nom;	this.div = dname;	this.owner = owner;	this.label=txt;	this.action = action;	this.file=getFileName();	this.ismypage = (this.name==this.file);	this.stile=this.ismypage || this.name=='histry' ? 'goldface' : 'deepblue';	}new submenuitem(0,0,0,0,0);				function shopwindow() {	var result=new Array();	result[1] = 900; result[0]=1080; //650 pic max + 75 at top +100 for views + 40-odd for titlebar; 750 pic max + 30 right + 300 left	if(result[0]>screen.availWidth*92/100) result[0] = Math.floor(screen.availWidth*90/100);	if(result[1]>screen.availHeight*92/100) result[1] = Math.floor(screen.availHeight*90/100);	return result;	}	function opwin(q,y) {	var wdims=shopwindow();	var u='pichandler.php?year=mm'+y+'\&item='+q+'\&view=0';		var wh=wdims[1]; //Math.floor(screen.height*100/100); 	var ww=wdims[0]; //Math.floor(screen.width*100/100);	var wy=0; //Math.floor(screen.height*10/100);	var wx=0; //Math.floor(screen.width*5/100);	var feats='width='+ww+',height='+wh+',left='+wx+',screenX='+wx+',top='+wy+',screenY='+wy+',location=no,menubar=no,resizable,status=no,scrollbars=no,toolbar=no';	return window.open(u,'mm',feats);	}	function mmopen(i,n) {	var wdims=shopwindow();	var u='picdb.php?i='+i+'\&n='+n;		var wh=wdims[1]; //Math.floor(screen.height*100/100); 	var ww=wdims[0]; //Math.floor(screen.width*100/100);	var wy=0; //Math.floor(screen.height*10/100);	var wx=0; //Math.floor(screen.width*5/100);	var feats='width='+ww+',height='+wh+',left='+wx+',screenX='+wx+',top='+wy+',screenY='+wy+',location=no,menubar=no,resizable,status=no,scrollbars=no,toolbar=no';	return window.open(u,'mm',feats);	}	function handleit(dv,e) {	var flip;	var dvn=jsmenu[dv].name;	var dvd=jsmenu[dv].div;	var o=getObject(dvd);	switch(e) {		case 'mi':   //mouseover (mousein)			clearTimeout(G.intID); 			rollcolours(dvd,o.className=='deepblue');			switch(dvn) {				case 'office' : hideshow(compop,false,offpop,true); break;				case 'address' : case 'info' : case 'webbo' : case 'mlist' : case 'join' : case 'booking' : case 'poster' : case 'richarray' :					break;				case 'company' : hideshow(offpop,false,compop,true); break;				case 'histry' : case 'brian' : break;					break;				default : hideshow(offpop,false,compop,false);				}			return false;		case 'mo':  //mouseout			rollcolours(dvd,false);			switch(dvn) {				case 'office' : case 'address' : case 'info' : case 'webbo' : case 'mlist' : case 'join' : case 'booking' : case 'poster' : case 'richarray' :					G.intID=setTimeout("hideshow(offpop,false);",400);					break;				case 'company' : case 'histry' : case 'brian' : 					G.intID=setTimeout("hideshow(compop,false);",400);					break;				default : hideshow(offpop,false,compop,false);				}			return false;		case 'cl':   // click			rollcolours(dvd,false);			switch(dvn) {						case 'office' : if(offpop) hideshow(offpop,offpop.showing==false); return o.className=='deepblue';						case 'company' : if(compop) hideshow(compop,compop.showing==false); return o.className=='deepblue';						case 'histry' : case 'brian' : return o.className=='deepblue';						default: return true;						}			} 	return false;	}function dinner(str,tagid) {	var d=getObject(tagid);	if(d) d.innerHTML=str;	}/* these are picdata objects used by all picture archives/years */function picData(s,n,vox,q,v) {	this.scene=s;	this.name=n;	this.heading=n;	this.voice=vox;	this.quote=q;	this.views=v;	}function picView(f,cap,cred,w,h) {	this.file=f;	this.caption=cap;	this.credit=cred;	this.width=w;	this.height=h;	}	G.path='archive\/'+getFileName()+'\/';	G.thumpath=G.path+'thumbnails\/';	G.copy='&copy;THE PLAYERS OF ST PETER';G.jason='&copy;JASON HENRY';function sceneCount() {	var count=0,result=new Array(),loop;	for(loop=0; loop<scenes.length; loop++) result[loop]=0;	for(loop=0; loop<thePix.length; loop++) result[thePix[loop].scene]++;	return result;	}			function showPicIndex(yr) {	var firstinline,loop,loop1,result='<p style="text-indent:0">',count=0,max,maxplus;	var maxarray=sceneCount(); 		result+='<strong>Production photographs<\/strong>&nbsp;&nbsp;&nbsp;<a href="#" onclick="dinner(showCast(),\'displayit\'); return false">Cast &amp; crew<\/a><\/p>';	result+='<p>&nbsp;<\/p><p style="text-indent:0">';	result+='<span class="thead">Images of '+yr+', play by play<\/span><\/p>';		for(loop=0; loop<scenes.length; loop++) {		maxplus=maxarray[loop]+1;		firstinline="true";count=0;max=8;rows=Math.floor(maxplus/(max+(maxplus<=max)))+1;		max=Math.ceil(maxplus/rows); 		result+='<p style="margin-bottom:1em"><span style="line-height:3em">'+scenes[loop]+'<\/span><br \/>';		for (loop1=0; loop1<thePix.length; loop1++) {			if(thePix[loop1].scene==loop) {				result+='<a href="'+G.path+thePix[loop1].views[0].file+'.jpg" onclick="opwin('+loop1+'); return false">';				result+='<img src="'+G.thumpath+thePix[loop1].views[0].file+'_sm.jpg" alt="Thumbnail photo" title="'+thePix[loop1].name+'" style="width:70px; height:100px; padding-bottom:0.5em; padding-left:';				if(firstinline) {result+='1.5em" />'; firstinline=false;}				else result+='0.5em" />';				result+='<\/a>';				count++; if(count==max) {firstinline=true; count=0; result+='<br />';}			}}		result+='<a href="#top" onmouseover="getObject(\'totop'+loop+'\').src=\'furniture\/buttons\/topofpage1.gif\'" onmouseout="getObject(\'totop'+loop+'\').src=\'furniture\/buttons\/topofpage2.gif\'"><img name="totop'+loop+'" id="totop'+loop+'" src="furniture\/buttons\/topofpage2.gif" style="width:70px; height:100px; padding-bottom:0.5em; padding-left:0.5em" alt="Link to top" title="Click to return to the top of the page" \/><\/a><\/p>';		}	return result;	}									