			// Changes made by soren@araneum.dk 20011009 to "storyGrid" generater and the "heighlightImg" function, so that cols can be removed.

			// image preload

			var cubeOnRow = new Image();
   			cubeOnRow.src = "cube_on_row.gif";

			var cubeOff = new Image();
			cubeOff.src = "cube_off.gif"

			var cubeOnCube = new Image();
			cubeOnCube.src = "cube_on_cube.gif"



			// Create story grid layout

			var storyGrid;
			var storyTitle;
			var stroyURL
			var stroyString



			storyGrid = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"252\">";


			storyGrid += "<tr valign= \"top\">";
			storyGrid += "<td width=\"46\"><img src=\"clear.gif\" width=\"46\" height=\"28\" border=\"0\"></td>";
			storyGrid += "<td width=\"96\"><img src=\"titlebg.gif\" width=\"96\" height=\"28\" border=\"0\" name=\"textServicePos\"></td>";

			storyGrid += "<td colspan=\"2\" width=\"110\"><img src=\"Farrow0.gif\" width=\"110\" height=\"28\" border=\"0\" name=\"Farrow\"></td>";

			storyGrid += "</tr>";


			storyGrid += "<tr valign= \"top\">";
			storyGrid += "<td width=\"46\"><br></td>";
			storyGrid += "<td width=\"96\">";
			storyGrid += "<img src=\"r0.gif\" width=\"96\" height=\"55\" border=\"0\" name=\"areapics\"><br>";

			storyGrid += "<img src=\"clear.gif\" width=\"1\" height=\"1\" border=\"0\" name=\"textAreaPos\">";
	
			storyGrid += "</td>";
			storyGrid += "<td width=\"5\"><img src=\"clear.gif\" width=\"5\" height=\"5\" border=\"0\"></td>";
			storyGrid += "<td width=\"105\">";
			storyGrid += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\">";

			for (var i=0; i < 7; i++) { // loop through grid
				storyGrid += "<tr valign=\"top\">"

				colCount = 0;
				
				for (var n=0; n < (GridCols.length-1); n++) { // loop through cols

					storyArray = eval("GridCol"+(n+1));

					if (storyArray.length > 1) {
						colCount = colCount + 1;

						if (storyArray[i] && storyArray[i] != "Empty") {

							stroyString = storyArray[i].split("$$@@$$");

							storyTitle = stroyString[0];

							storyURL = stroyString[1];

							if (!ns4) {

								storyGrid += "<td width=\"15\" height=\"15\" id=\"c" + (n+1) + "r" + (i+1) + "\" class=\"storyBox\">";
								storyGrid += "<a href=\"#\" onMouseOver=\"heighlightImg(" + (n+1) + "," + (i+1) + ",'" + storyTitle + "','" + GridCols[n] + "'," + colCount + ");\" onMouseOut=\"unheighlight(" + (n+1) + ");\" onClick=\"flashopenpopwin('" + storyURL + "','Flash','590','403');\">";
								storyGrid += "<img src=\"clear.gif\" name=\"Imgc" + (n+1) + "r" + (i+1) + "\" width=\"15\" height=\"15\" border=\"0\">";
								storyGrid += "</a>";
								storyGrid += "</td>";

							}
							else {

								storyGrid += "<td width=\"17\" height=\"17\">";
								storyGrid += "<a href=\"#\" onMouseOver=\"heighlightImg(" + (n+1) + "," + (i+1) + ",'" + storyTitle + "','" + GridCols[n] + "'," + colCount + ");\" onMouseOut=\"unheighlight(" + (n+1) + ");\" onClick=\"flashopenpopwin('" + storyURL + "','Flash','590','403');\">";
								storyGrid += "<img src=\"cube_off.gif\" width=\"17\" height=\"17\" border=\"0\" name=\"c" + (n+1) + "r" + (i+1) + "\">";
								storyGrid += "</a>";
								storyGrid += "</td>";

							}

						}
						else {

							storyGrid += "<td></td>";
						}
					}


				}

				storyGrid += "</tr>"
			}

			storyGrid += "</table>";
			storyGrid += "</td>";
			storyGrid += "</tr>";
			storyGrid += "</table>";



			// Story grid control function

			var lastR = 0;
			var lastC = 0;
			var imgObj;
			var startunheighlight;
			
			var GridPosY = 0; //top pos of grid
			var GridPosX = 0; //left pos of grid
			



			function findGridPos() {


				if (!ns6) {
					GridPosY = document.images["gridTop"].offsetTop + document.images["gridTop"].offsetParent.offsetTop + document.images["gridTop"].offsetParent.offsetParent.offsetTop + document.images["gridTop"].offsetParent.offsetParent.offsetParent.offsetTop + document.images["gridTop"].offsetParent.offsetParent.offsetParent.offsetParent.offsetTop + document.images["gridTop"].offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetTop + document.images["gridTop"].offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetTop;
					GridPosX = document.images["gridTop"].offsetLeft + document.images["gridTop"].offsetParent.offsetLeft + document.images["gridTop"].offsetParent.offsetParent.offsetLeft + document.images["gridTop"].offsetParent.offsetParent.offsetParent.offsetLeft + document.images["gridTop"].offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft + document.images["gridTop"].offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft + document.images["gridTop"].offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft;
				}

				else {
					gridObj = findObj("gridTop");

					GridPosY = gridObj.offsetTop-8;
					GridPosX = gridObj.offsetLeft+2;

				}

				if (IeMac) GridPosX += 5

				if (IeNot5) {
					GridPosX += 5;
					GridPosY += 8

				}

				GridPosX += 46;

			}


			function unheighlightImg(c) {

				// un-heighlight col



					for (var i=0; i < 7; i++) { 

						if (!ns4) {

							Obj = findObj("c" + c + "r" + (i+1));

							if (Obj) {

								Obj.style.borderColor = "rgb(204,102,0)";
								Obj.style.backgroundColor = "white";

							}


							imgObj = document.images["Imgc" + c + "r" + (i+1)];

							if (imgObj) imgObj.src = "clear.gif";
						}
						else {
							imgObj = document.images["c" + c + "r" + (i+1)];

							if (imgObj) imgObj.src = cubeOff.src;
						}
					}
					
					imgObj = document.images["Farrow"];
					if (imgObj) imgObj.src = "Farrow0.gif";


					imgObj = document.images["areapics"];
					if (imgObj) imgObj.src = "r0.gif";


				if (!ns4) {

	
					if (GridPosY == 0) findGridPos();


					if (!ns6) {

						document.all["textAreaInfo"].style.top = (GridPosY+84);
						document.all["textServiceInfo"].style.top = GridPosY;
						document.all["textAreaInfo"].style.left = GridPosX;
						document.all["textServiceInfo"].style.left = GridPosX;

						document.all["textAreaInfo"].innerHTML = AreaIntro;
						document.all["textServiceInfo"].innerHTML = "<table width=\"96\" height=\"28\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\"><tr><td align=\"right\" class=\"ServiceInfo\">" + serviceIntro + "</td></tr></table>\n";

					}
					else {

						objService = findObj("textServiceInfo");
						objArea = findObj("textAreaInfo");

						objArea.style.top = (GridPosY+84);
						objService.style.top = GridPosY;
						objArea.style.left = GridPosX;
						objService.style.left = GridPosX;

						objArea.innerHTML = AreaIntro;
						objService.innerHTML = "<table width=\"96\" height=\"28\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\"><tr><td align=\"right\" class=\"ServiceInfo\">" + serviceIntro + "</td></tr></table>\n";

					}

				}
				else {
	


					document["textAreaInfo"].document.open();
					document["textAreaInfo"].document.writeln("<table width='96' cellpadding='0' cellspacing='0'><tr><td><font face='verdana' size='1'>" + AreaIntro + "</font></td></tr></table>");
					document["textAreaInfo"].document.close();


					document["textServiceInfo"].document.open();
					document["textServiceInfo"].document.writeln("<table width='95' height='28' cellpadding='0' cellspacing='0'><tr><td align='right'><font face='verdana' size='1'>" +serviceIntro + "</font></td></tr></table>");
					document["textServiceInfo"].document.close();

					if (lastR == 0) {

						document["textAreaInfo"].left = document.images["textAreaPos"].x;	
						document["textAreaInfo"].top = document.images["textAreaPos"].y;

						document["textAreaInfo"].visibility = "show";


						document["textServiceInfo"].left = document.images["textServicePos"].x;	
						document["textServiceInfo"].top = document.images["textServicePos"].y;

						document["textServiceInfo"].visibility = "show";
					}


				}


				lastR = 0;
				lastC = 0;	


	
			}


			function unheighlight(c) {

				startunheighlight = setTimeout('unheighlightImg(' + c + ')',500);

			}



			function heighlightImg(c,r,theStoryTitle,theServiceTitle,FarrowNum) {

				if ( startunheighlight || startunheighlight == 0 )  clearTimeout(startunheighlight);

				if (c != lastC) {
					// heighlight  col


					for (var i=0; i < 7; i++) { 



						if (!ns4) {


							imgObj = findObj("c" + c + "r" + (i+1));

							if (imgObj) {
								imgObj.style.borderColor = "rgb(204,102,0)";
								imgObj.style.backgroundColor = "rgb(255,204,102)";
							}


							imgObj = findObj("c" + lastC + "r" + (i+1));

							if (imgObj) {
								imgObj.style.borderColor =  "rgb(204,102,0)";
								imgObj.style.backgroundColor = "white";
							}

						}

						else {

							imgObj = document.images["c" + c + "r" + (i+1)];

							if (imgObj) imgObj.src = cubeOnRow.src;


							imgObj = document.images["c" + lastC + "r" + (i+1)];

							if (imgObj) imgObj.src = cubeOff.src;

						}


					}

					// set area pic and text

					imgObj = document.images["areapics"];
					imgObj.src = "r" + c + ".gif";


					imgObj = document.images["Farrow"];
					if (imgObj) imgObj.src = "Farrow" + FarrowNum + ".gif";
				}

				// heighlight or un-heighlight square


				if (!ns4) {

					imgObj = document.images["Imgc" + c + "r" + r];

					imgObj.src = "cube_on_ie.gif";

					Obj = findObj("c" + c + "r" + r);


					Obj.style.borderColor = "rgb(239,243,247)";
					Obj.style.backgroundColor = "rgb(226,207,187)";

					if (lastC != 0 && lastR != 0) {


						imgObj = document.images["Imgc" + lastC + "r" + lastR];
	
						imgObj.src = "clear.gif";

						ObjL = findObj("c" + lastC + "r" + lastR);

						if (c == lastC)	{
							ObjL.style.borderColor = "rgb(204,102,0)";
							ObjL.style.backgroundColor = "rgb(255,204,102)"			
						}
						else {
							ObjL.style.borderColor =  "rgb(204,102,0)";
							ObjL.style.backgroundColor = "white";
						}	
			
					}

				}
				else {

					imgObj = document.images["c" + c + "r" + r];
	
					imgObj.src = cubeOnCube.src;

					if (lastC != 0 && lastR != 0) {

						imgObj = document.images["c" + lastC + "r" + lastR];

						if (c == lastC)	imgObj.src = cubeOnRow.src;

						else imgObj.src = cubeOff.src;						
					}


				}


				lastR = r;
				lastC = c;	


				if (!ns4) {

					if (GridPosY == 0) findGridPos();


					if (!ns6) {


						document.all["textAreaInfo"].style.top = (GridPosY+84);
						document.all["textServiceInfo"].style.top = GridPosY;
						document.all["textAreaInfo"].style.left = GridPosX;
						document.all["textServiceInfo"].style.left = GridPosX;

						if (r != 1) document.all["textAreaInfo"].innerHTML = theStoryTitle;
						else document.all["textAreaInfo"].innerHTML = "<br>";

						document.all["textServiceInfo"].innerHTML = "<table width=\"96\" height=\"28\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\"><tr><td align=\"right\" class=\"ServiceInfo\">" + theServiceTitle + "</td></tr></table>\n";

					}
					else {



						objService = findObj("textServiceInfo");
						objArea = findObj("textAreaInfo");


						objArea.style.top = (GridPosY+84);
						objService.style.top = GridPosY;
						objArea.style.left = GridPosX;
						objService.style.left = GridPosX;

						if (r != 1) objArea.innerHTML = theStoryTitle;
						else objArea.innerHTML = "<br>";

						objService.innerHTML = "<table width=\"96\" height=\"28\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\"><tr><td align=\"right\" class=\"ServiceInfo\">" + theServiceTitle + "</td></tr></table>\n";



					}

				}
				else {
	


					document["textAreaInfo"].document.open();
					if (r != 1) document["textAreaInfo"].document.writeln("<table width='96' cellpadding='0' cellspacing='0'><tr><td><font face='verdana' size='1'>" + theStoryTitle + "</font></td></tr></table>");
					else document["textAreaInfo"].document.writeln("&nbsp;");
					document["textAreaInfo"].document.close();


					document["textServiceInfo"].document.open();
					document["textServiceInfo"].document.writeln("<table width='95' height='28' cellpadding='0' cellspacing='0'><tr><td align='right'><font face='verdana' size='1'>" + theServiceTitle + "</font></td></tr></table>");
					document["textServiceInfo"].document.close();



					document["textAreaInfo"].left = document.images["textAreaPos"].x;	
					document["textAreaInfo"].top = document.images["textAreaPos"].y;

					document["textAreaInfo"].visibility = "show";


					document["textServiceInfo"].left = document.images["textServicePos"].x;	
					document["textServiceInfo"].top = document.images["textServicePos"].y;

					document["textServiceInfo"].visibility = "show";


				}


			}
