var detailSetCount = 0;// var mainvisualCount = 0;var mainvisualsArray;function init() {	var args = init.arguments;	var filePath = 'Images/' + args[0] + '/';		// Initialise main visuals	if (document.images) {		mainvisualsArray = new Array(args.length);		for (i = 1; i < args.length; i++) {			mainvisualsArray[i] = new Image;			mainvisualsArray[i].src = filePath + args[i];					}	}	// Count the total number of detail sets	var j = 1	var currentDetailSet	for ( ; ; ) {		currentDetailSet = document.getElementById('detailset' + j);		if(!currentDetailSet) {			break;		} else {			detailSetCount++;		}		j++	}		initDetails();}function swapImage(imgField,newImg) {	if (document.images) {		document[imgField].src=eval(newImg + ".src");	}}function swapMainImage(newImg) {		if (document.images) {		document['mainvisualspace'].src = mainvisualsArray[newImg].src;	}}	function initDetails() {	for(var i = 1; i <= detailSetCount; i++) {				var j = 2;		var thisElementID;		for( ; ; ) {			thisElement = document.getElementById('detail' + i + '_' + j);			if(!thisElement) {				break;			} else {				setDisplay('detail' + i + '_' + j, 'hidden');				j++;			}		}				if(i > 1) {			setVisible('detailset' + i, 'false');		}	}}function initMainvisuals(visibleElement) {	swapMainImage(visibleElement);}function showDetailSet(visibleSet) {		for(var i = 1; i <= detailSetCount; i++) {				if(i != visibleSet) {			setVisible('detailset' + i, 'false');		} else {			 setVisible('detailset' + i, 'true');		}	} }function showDetailInfo(detailset,detail) {		var j = 1;		var thisElementID;		for( ; ; ) {			thisElement = document.getElementById('detail' + detailset + '_' + j);			if(!thisElement) {				break;			} else {				if (j != detail) {					setDisplay('detail' + detailset + '_' + j, 'hidden');				} else {					setDisplay('detail' + detailset + '_' + j, 'inline');				}				 			}			j++;					}}function setDisplay(elementID, display) {	var thisElement;	var styleObj;	thisElement = document.getElementById(elementID);	if (!thisElement) {		// alert('Element not found: ' + elementID);	} else {		styleObj = new xbStyle(thisElement);		if (display == 'inline') {			styleObj.setDisplay('inline');		} else {			styleObj.setDisplay('none');		}	}	return;}function setVisible(detailToShowID, visible) {	var detailID;	var styleObj;	detailID = document.getElementById(detailToShowID);	if (!detailID) {		// alert('Element not found');	} else {		styleObj = new xbStyle(detailID);		if (visible == 'true') {			styleObj.setVisibility('visible');		} else {			styleObj.setVisibility('hidden');		}	}}function setStatus(message) {	window.status = message;}function displayNote(noteid) {	var styleObj;	var thisElement = document.getElementById('note' + noteid);	if (!thisElement) {		// alert('Note not found: note' + noteid);	} else {		styleObj = new xbStyle(thisElement);		if (styleObj.getDisplay() != 'inline') {			styleObj.setDisplay('inline');		} else {			styleObj.setDisplay('none');		}	}	}// Functions for mapfunction openMap(url) {		mapWindow = window.open(url, 'mapWin', 'toolbar=no, location=no, scrollbars=no, width=400, height=553, resize=no');		mapWindow.focus();}function popWin(url, width, height) {		mapWindow = window.open(url, 'newWin', 'toolbar=no, location=no, scrollbars=no, width='+width+', height='+height+', resize=no');		mapWindow.focus();}function initMap() {	var args = init.arguments;	var filePath = '../Images/WhereAmI/';	if (document.images) {		var imageArray = new Array(args.length);		for (i = 0; i < args.length; i++) {			imageArray[i] = new Image;			imageArray[i].src = filePath + args[i];		}	}}function updateParent(url) {	url = '../'+url;	opener.document.location = url;	opener.focus();}