function DoImageRotate() {
	// define list of images to rotate.
		var ImageArray = new Array("Image1.jpg","Image2.jpg","Image3.jpg");

	// get the DOM id of the image tag
		var ImageHolder = document.getElementById('RotatingImage');


	// function to do the work
		function RotateImages(id)
		{
			ImageHolder.src = ImageArray[id];
		}

	// variables to keep track of things
	  //  Number of images
		var numimages = ImageArray.length;

	  // a random number 0 - numimages
		var randnum = Math.floor(Math.random() * numimages)

	// Call the function
		RotateImages(randnum);
}

function StartUpScript() {

  DoImageRotate()
  
 }
 
 

function DbBasedMessage() {
	if(dsqDb=="Catalog") {
		document.write("This page shows the details of your chosen item.<BR><BR>");
		document.write("You can click the highlighted contextref to build the context diagram which will give more details on the context of the item. <BR><BR>");
		document.write("Would you like to see this item? Make a note of the FindingNumber and Title and make an appointment to <A HREF=\"http://www.btplc.com/Thegroup/BTsHistory/BTgrouparchives/Locationandcontactdetails/index.htm\">visit us.</A><BR><BR>");
		document.write("<BR><BR>");

	 } else if(dsqDb=="Persons") {
		document.write("This page shows the details of your chosen person/organisation.<BR><BR>");
		document.write("There is a list of archive items that are linked to this record. To view the catalogue entries for those items please click the <U>Associated catalogue record(s)</U> link.<BR><BR>");

	} else if(dsqDb="Places") {
		document.write("This page shows the details of your chosen country.<BR><BR>");
		document.write("There is a list of archive items that are linked to this record. To view the catalogue entries for those items please click the <U>Associated catalogue record(s)</U> link.<BR><BR>");
	}
	else {
		document.write(dsqDb);
	}
}


function EmailUrl(to) {
	var u = self.location.href;
	if (u.indexOf("?") < 0) {
		u = u + "?dsqApp="+dsqApp+"&dsqDb="+dsqDb+"&dsqCmd="+dsqCmd+"&dsqSearch="+dsqSearch;
	}
	u = u.replace(/'/g, "%27");
	u = u.replace(/\(/g, "%28");
	u = u.replace(/\)/g, "%29");

	u=escape(u);
	document.write("<a href=\"mailto://"+to+"?subject=Your search results from BT Archives' online catalogue&body=The link for your search results from BT Archives' online catalogue is:%0A%0a"+u+"%0A%0A%0APlease copy and paste the complete URL (web address) link into your Internet browser.%0A%0aBT Archives%0AHolborn Telephone Exchange%0A268-270 High Holborn%0ALondon%0AWC1V 7EE%0A%0AHelpdesk: (+44) 020 7440 4220%0AFax: (+44) 020 7242 1967%0AEmail: archives@bt.com\">Email results</a>");
}