function writePlan() {
	if(plans.length>0) {

		// uses layers to position hotspots with icons on floorplan image
		// browser must support layers

		// show floorplan image
		document.writeln('<div id="large" style="position:relative;">');
		document.writeln('<img NAME="largepic" src="'+escape(activePagePath)+plans[activeFloorplan].planImageURL+'" border="1">');

		// hotspots for jumping from pano to pano
		for(j=0;j<plans[activeFloorplan].hotspots.length;j++) {
			if(plans[activeFloorplan].hotspots[j].points!="") {
				var coords = plans[activeFloorplan].hotspots[j].points.split(/,/);
				var id = plans[activeFloorplan].hotspots[j].action;
				document.writeln('  <div id="HotspotLayer'+id+'" style="position:absolute; left:'+(coords[0]-5)+'px; top:'+(coords[1]-5)+'px; width:'+(coords[2]-coords[0])+'px; height:'+(coords[3]-coords[1])+'px; z-index:'+(id+1)+'">');
				if (plans[activeFloorplan].hotspots[j].type == "pano") { // hotspot links to another room
					if(p.portalPanoOverIcon) {
//						document.write('<a href="javascript:parent.jsLoadRoom('+id+');parent.jsSetAction(\'right\');parent.setSecondaryDescription(\''+rooms[id].panoDescription+'\');">');
						document.write('<a href="javascript:parent.jsLoadRoom('+id+');parent.setSecondaryDescription(\''+rooms[id].panoDescription+'\');">');
						document.write('<img border="0" src="'+activePortal+p.portalPanoOverIcon+'" alt="'+rooms[id].panoTitle+'" title="'+rooms[id].panoTitle+'">');
					}
					else {
//						document.write('<a href="javascript:parent.jsLoadRoom('+id+');parent.jsSetAction(\'right\');parent.setSecondaryDescription(\''+rooms[id].panoDescription+'\');">');
						document.write('<a href="javascript:parent.jsLoadRoom('+id+');parent.setSecondaryDescription(\''+rooms[id].panoDescription+'\');">');
						document.write('<img border="0" src="'+commonResourcesURL+panoImageAni+'" width="24" height="20" alt="'+rooms[id].panoTitle+'" title="'+rooms[id].panoTitle+'">');
					}
				}
				if (plans[activeFloorplan].hotspots[j].type == "still") { // hotspot links to another still
					if(p.portalStillOverIcon) {
						document.write('<a href="javascript:parent.chImage('+id+');parent.setSecondaryDescription(\''+stills[id].stillDescription+'\');">');
						document.write('<img border="0" src="'+activePortal+p.portalStillOverIcon+'" alt="'+stills[id].stillTitle+'" title="'+stills[id].stillTitle+'">');
					}
					else {
						document.write('<a href="javascript:parent.chImage('+id+');parent.setSecondaryDescription(\''+stills[id].stillDescription+'\');">');
						document.write('<img border="0" src="'+commonResourcesURL+iconImage+'" width="24" height="20" alt="'+stills[id].stillTitle+'" title="'+stills[id].stillTitle+'">');
					}
				}
				if (plans[activeFloorplan].hotspots[j].type == "video") { // hotspot links to another animated sequence
					if(p.portalVideoOverIcon) {
						document.write('<a href="javascript:parent.chVideo('+id+');parent.setSecondaryDescription(\''+videos[id].videoDescription+'\');">');
						document.write('<img border="0" src="'+activePortal+p.portalVideoOverIcon+'" alt="'+videos[id].videoTitle+'" title="'+videos[id].videoTitle+'">');
					}
					else {
						document.write('<a href="javascript:parent.chVideo('+id+');parent.setSecondaryDescription(\''+videos[id].videoDescription+'\');">');
						document.write('<img border="0" src="'+commonResourcesURL+videoImage+'" width="24" height="20" alt="'+videos[id].videoTitle+'" title="'+videos[id].videoTitle+'">');
					}
				}
				if (plans[activeFloorplan].hotspots[j].type == "Object3D") { // hotspot links to another 3D object
					if(p.portalObjects3DOverIcon) {
						document.write('<a href="javascript:parent.chObject3D('+id+');parent.setSecondaryDescription(\''+Objects3D[id].object3DDescription+'\');">');
						document.write('<img border="0" src="'+activePortal+p.portalObject3DOverIcon+'" alt="'+Objects3D[id].object3DTitle+'" title="'+Objects3D[id].object3DTitle+'">');
					}
					else {
						document.write('<a href="javascript:parent.chObject3D('+id+');parent.setSecondaryDescription(\''+Objects3D[id].object3DDescription+'\');">');
						document.write('<img border="0" src="'+commonResourcesURL+Object3DImage+'" width="24" height="20" alt="'+Objects3D[id].object3DTitle+'" title="'+Objects3D[id].object3DTitle+'">');
					}
				}
				if (plans[activeFloorplan].hotspots[j].type == "Plan") { // hotspot links to another plan
					if(p.portalPlanOverIcon) {
						document.write('<a href="javascript:parent.chPlan('+id+');">');
						document.write('<img border="0" src="'+activePortal+p.portalPlanOverIcon+'" alt="'+plans[id].planTitle+'" title="'+plans[id].planTitle+'">');
					}
					else {
						document.write('<a href="javascript:parent.chPlan('+id+');">');
						document.write('<img border="0" src="'+commonResourcesURL+planImage+'" width="24" height="20" alt="'+plans[id].planTitle+'" title="'+plans[id].planTitle+'">');
					}
				}
				document.writeln('</a>');
				document.writeln('</div>');
			}
		}

		document.writeln('  </div>');
	}
	else {
		if(parent.pageDescription!="" && parent.pageDescription!=null ) {
			document.write('<h4>'+parent.pageDescription+'</h4>');
		}
	}
}