	function stripSpace(theStr) {// Strip leading and trailing white-space		return theStr.replace(/^\s*|\s*$/g, "");}	function getStringNum(theNum) {// returns a string that contains a leading 0 if necessary eg "01", "02"....		newNum = (theNum<10?"0":"") + theNum;		return newNum}function getANumberThisMinute(whichInSequence,whichFormatTotal) {		//whichInSequence parameter, won't be needed				theNow = new Date();		theMinute = theNow.getMinutes();				theNum = whichInSequence + theMinute;  //add minute, so colour changes on the minute		theNum = (theNum % whichFormatTotal)  +1; //modulo result so we get a number 1 to whichFormatTotal (the number of images in any given format folder)				return theNum;		}function getANumberThisDay() {				theNow = new Date();		theMinute = theNow.getDay();				theNum = theMinute;  //add day, so num changes each day		theNum = (theNum % 2) ; //modulo result so we get a number 0 or 1				return theNum;}function setCookieNum(newNum) {		var when= new Date();	when.setMonth(when.getMonth()+20);	var newDate = when.toGMTString();		newNum = Math.max(0,newNum);//so we don't get a -ve num	newNum = newNum % 7;	document.cookie = 'stuartsCookie='+newNum+'; expires='+newDate;	//alert('stuartsCookie='+newNum+';expires='+newDate);	//}function getCookieNum() {		var cookieValue = 0;	if (document.cookie != "") { //we have cookies			theCookies = (document.cookie).toString();		//alert(theCookies);		theCookiesList = theCookies.split(';');		 		for(i=0;i<theCookiesList.length;i++) {			//if (theCookiesList.length > 1) {				theCookiesBitsList = theCookiesList[i].split('=');				if (theCookiesBitsList[0] == 'stuartsCookie') cookieValue = theCookiesBitsList[1];			//} else {				//	if (theCookiesList[0] == 'stuartsCookie') cookieValue = theCookiesList[1];			//}						}			} else { //no cookie					// cookieValue = 0;		setCookieNum(cookieValue);			}	//alert(cookieValue);	return cookieValue;} /////end cookiesfunction giveWindowSize(whichDimension) {  var myWidth = 0, myHeight = 0;    if( typeof( window.innerWidth ) == 'number' ) {    //Non-IE    myWidth = window.innerWidth;    myHeight = window.innerHeight;  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {    //IE 6+ in 'standards compliant mode'    myWidth = document.documentElement.clientWidth;    myHeight = document.documentElement.clientHeight;  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {    //IE 4 compatible    myWidth = document.body.clientWidth;    myHeight = document.body.clientHeight;  }    if (whichDimension == 'width') {  	return myWidth;  } else {  	return myHeight;  }  }function openTearsheetWindow(tearheetType) {	theURL = 'tearsheets/'+tearheetType+'.htm';	var tearsheetWindow = window.open(theURL,'tearsheetWindow','toolbar=no,status=yes,width=770,height=450,resizable=yes,scrollbars=yes,left=10');	tearsheetWindow.focus();}function switchPhoto(direction) {  //swicthes the big Photo on this page		MM_showHideLayers('captionLayer','','hide');	MM_showHideLayers('folioLayer','','hide');		newPhotoNumber = (photoNumber + direction);	if (newPhotoNumber<1) newPhotoNumber=photosTotal;	photoNumber = ((newPhotoNumber-1) % photosTotal) + 1 ;		document.images['thePhoto'].src = "photos/" + getStringNum(photoNumber) + ".jpg";	if (direction>0) loadMorePhotos(newPhotoNumber);	//document.getElementById('theDimensions').innerHTML = "width is " + document.images['thePhoto'].width + " and the height is " + document.images['thePhoto'].height;}function loadPhotos() {  //loads all the photos for this images page		lastOneToLoad = Math.min(5,photosTotal);		 for (photoNum=2;photoNum<=lastOneToLoad;photoNum++) {		var thePhoto = ("photos/" + getStringNum(photoNum) + ".jpg");		MM_preloadImages(thePhoto);	}}function loadMorePhotos(startNum) {  //loads some more photos for this images page		lastOneToLoad = Math.min((startNum+5),photosTotal);		 for (photoNum=startNum;photoNum<=lastOneToLoad;photoNum++) {		var thePhoto = ("photos/" + getStringNum(photoNum) + ".jpg");		MM_preloadImages(thePhoto);	}}function getBlurbArray(photosTotal) {  	//loads in all the blurbs for this page into the blurb array	//these blurbs are listed in the editMe.js files			var blurbArray = new Array();	for (blurbNum=0;blurbNum<photosTotal;blurbNum++) {			thisBlurb = eval("blurb"+(blurbNum+1));		blurbArray[blurbNum] = thisBlurb;		}		return blurbArray;}function sortOutLayout() {  //swicthes the big Photo on this page and re-arranges layout accordingly	//document.getElementById('theDimensions').innerHTML = "width is " + document.images['thePhoto'].width + " and the height is " + document.images['thePhoto'].height;	if (document.images['thePhoto'].width > (3.2 * (document.images['thePhoto'].height))) { //wide (letterbox style) triptych images		if (document.getElementById('theFolioSide') != null) document.getElementById('theFolioSide').innerHTML = "";		if (document.getElementById('theFolioBottom') != null) document.getElementById('theFolioBottom').innerHTML = "<img src='../../graphics/clearSpot.gif' name='spacer' border='0' width='10' height='18'>image " + photoNumber+ " of " + photosTotal;		document.getElementById('captionLayer').style.left = 250;		document.getElementById('captionLayer').style.top = 280;		document.getElementById('captionLayer').style.width = 400;		document.getElementById('blurbLayer').style.width = 400;	} else if (document.images['thePhoto'].width > (2.1 * (document.images['thePhoto'].height))) { //wide diptych images		if (document.getElementById('theFolioSide') != null) document.getElementById('theFolioSide').innerHTML = "";		if (document.getElementById('theFolioBottom') != null) document.getElementById('theFolioBottom').innerHTML = "<img src='../../graphics/clearSpot.gif' name='spacer' border='0' width='10' height='18'>image " + photoNumber+ " of " + photosTotal;		document.getElementById('captionLayer').style.left = 250;		document.getElementById('captionLayer').style.top = 345;		document.getElementById('captionLayer').style.width = 400;		document.getElementById('blurbLayer').style.width = 400;			} else if (document.images['thePhoto'].width > (1.9 * (document.images['thePhoto'].height))) { //narrow diptych/triptych images		if (document.getElementById('theFolioSide') != null) document.getElementById('theFolioSide').innerHTML = "";		if (document.getElementById('theFolioBottom') != null) document.getElementById('theFolioBottom').innerHTML = "<img src='../../graphics/clearSpot.gif' name='spacer' border='0' width='10' height='18'>image " + photoNumber+ " of " + photosTotal;		document.getElementById('captionLayer').style.left = 250;		document.getElementById('captionLayer').style.top = (document.images['thePhoto'].height + 61);		document.getElementById('captionLayer').style.width = 315;		document.getElementById('blurbLayer').style.width = 425;			} else if (document.images['thePhoto'].width >= document.images['thePhoto'].height) { //landscape or square image		if (document.getElementById('theFolioSide') != null) document.getElementById('theFolioSide').innerHTML = "";		if (document.getElementById('theFolioBottom') != null) document.getElementById('theFolioBottom').innerHTML = "<img src='../../graphics/clearSpot.gif' name='spacer' border='0' width='10' height='18'>image " + photoNumber+ " of " + photosTotal;		document.getElementById('captionLayer').style.left = 250;		document.getElementById('captionLayer').style.top = (document.images['thePhoto'].height + 61);		document.getElementById('captionLayer').style.width = 315;		document.getElementById('blurbLayer').style.width = 425;	} else {//portrait pictures		if (document.getElementById('theFolioSide') != null) document.getElementById('theFolioSide').innerHTML = "image " + photoNumber+ " of " + photosTotal;		if (document.getElementById('theFolioBottom') != null) document.getElementById('theFolioBottom').innerHTML = "";		document.getElementById('folioLayer').style.left = (document.images['thePhoto'].width+261);		document.getElementById('folioLayer').style.top = 230;		document.getElementById('captionLayer').style.left = (document.images['thePhoto'].width+261);		document.getElementById('captionLayer').style.top = 275;				document.getElementById('captionLayer').style.width = 290;		document.getElementById('blurbLayer').style.width = 290;	}	document.getElementById('theBlurb').innerHTML = blurbArray[photoNumber-1];	MM_showHideLayers('folioLayer','','show');	MM_showHideLayers('captionLayer','','show');}// QueryString            ////////////////////////////////////            //            //          var qs = new queryString() // Get QS from page            //          (or)            //          var qs = new queryString("name1=value1&name2=value2")            //            //          Individual values can be retreived by name using get(). If the name was not found in the querystring, get() returns null or a provided default value.             //            //          var v1 = qs.get("name1")            //          var v3 = qs.get("name3", "default value")            //            ////////////////////////////////////            function queryString(qs) // optionally pass a querystring to parse            {                        this.params = new Object();                        this.get=queryString_get;                        if (qs == null) qs=location.search.substring(1,location.search.length);                        if (qs.length == 0) return;                        qs = qs.replace(/\+/g, ' ');                        var args = qs.split('&');                        for (var i=0;i<args.length;i++)                        {                                    var pair = args[i].split('=');                                    name = unescape(pair[0]);                                    var value;                                    if (pair.length == 2)         value = unescape(pair[1]);                                    else                                                      value = name;                                    this.params[name] = value;                        }            }            function queryString_get(key, default_)             {                        default_="";                        if (default_ == null) default_ = "";// changes UNDEFINED to NULL                        var value=this.params[key];                        if (value==null){value=default_;}                        return value;            }