var DispMap=null
function mapdisplay(LocationNo,MapSize)
	{
	if (MapSize==null)MapSize=3;
//	---WINDOW-------------------------------------------------------------------------------------------------------------
	scrbars="no"
	mapwidth=MapSize*200
	mapheight=MapSize*132
	if (MapSize>=10){MapRows=10; mapheight=1320} else {MapRows=MapSize}
	if (mapwidth >= screen.width){
		scrbars="yes";
		windowwidth=screen.width-30;
		windowheight=screen.height-90
		}
	else{
		windowwidth=mapwidth;
		windowheight=mapheight
		}
	WindowProperties='height='+windowheight+',width='+windowwidth+',top=20,left=10,scrollbars='+scrbars+',status=no'
//	---MAP-------------------------------------------------------------------------------------------------------------
	Row=new Array
	Column=new Array
	LocationNo=LocationNo.toString();
	ColumnNr=+LocationNo.substring(2,4).valueOf()
	MapLeft=ColumnNr-Math.ceil(MapSize/2-0.5)
	MapRight=ColumnNr+Math.ceil(MapSize/2-0.5)
	if (MapLeft<1)MapLeft=1
	if (MapRight>18)MapLeft=19-MapSize
	MapLetterASCII=+LocationNo.substring(0,2)
	MapTop=MapLetterASCII-Math.ceil(MapSize/2+0,5)
	if (MapSize==2)MapTop=MapTop-1 
	MapBottom=MapLetterASCII+Math.ceil(MapSize/2+0,5)
	if (MapTop<65)MapTop=64
	if (MapBottom>74)MapTop=74-MapRows
	for (i=0; i<(MapSize); i++){
		Column[i]=MapLeft+i;
		Row[i]=String.fromCharCode(MapTop+i+1);
		}
//	---MAP WRITE---------------------------------------------------------------------------------------------------------
	{
	if(DispMap!=null&&DispMap.closed==false)
		DispMap.close();
		DispMap=window.open("", "mapwindow", WindowProperties);
		DispMap.document.open();
		DispMap.document.write("<html>");
		DispMap.document.write("<head>");
		DispMap.document.write("<title>GN 1949 System Map - Great Northern Empire</title>");
		DispMap.document.write("<style type='text/css'> body {margin:0pt} </style>");
		DispMap.document.write("</head>");
		DispMap.document.write("<body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 bgcolor='#FFFFFF'>");
		DispMap.document.write("<table border='0' cellspacing='0' cellpadding='0'>");
		for (y=0; y<MapRows; y++){
			DispMap.document.write("<tr>");
				for (x=0; x<MapSize; x++){
					MapSrc="maps/GN49"+Row[y]+Column[x]+".JPG";
					DispMap.document.write("<td width=200><a href='javascript: window.close()'><img border='0' src='"+MapSrc+"' width='200' height='132' alt='Click to close map'></a></td>");
	 			}
				DispMap.document.write("</tr>");
		}
		DispMap.document.write("</table>");
		DispMap.document.write("</html>");
		DispMap.document.close();
		DispMap.focus();
	}
}

