//---- eMail String ----
eMailStr = "Wati" + "@" + "WatiDesi" + "gn.com";

function p(x) { document.writeln(x); }

function LayoutMid(cols, rows, imgArray, popupWidth, popupHeight, direction)
{
	if(cols < 1) cols = 1;
	if(rows < 1) rows = 1;

	var colWidth = Math.round(620/cols) - 8;
	var rowHeight = Math.round(400/rows) - 8;
	var imgCount = imgArray.length;

	if(direction == null) { iImgStart = 0; iImgIncr = 1; }
	else { iImgStart = imgCount - 1; iImgIncr = -1; }

	var iCol;
	var iRow;
	var iImg = iImgStart;
	p("<DIV ALIGN=center VALIGN=middle>");
	p("<TABLE COLS=" + cols + " ROWS=" + rows + " CELLSPACING=2 CELLPADDING=2>");
	for(iRow = 0; iRow < rows; iRow++)
	{
		p("	<TR height=" + rowHeight + ">");
		for(iCol = 0; iCol < cols; iCol++)
		{
			p("		<TD ALIGN=center VALIGN=middle width=" + colWidth + ">");
			if(iImg < imgCount && iImg >= 0)
			{
				var src = imgArray[iImg][0];
				var imgWidth = imgArray[iImg][1];
				var imgHeight = imgArray[iImg][2];
				var imgPopup = imgArray[iImg][3];

				iImg = iImg + iImgIncr;	// Image names are Image1, Image2, ...

				var shrink = 1.0;
				var shrinkWidth = colWidth/imgWidth;
				var shrinkHeight = rowHeight/imgHeight;
				if (shrinkWidth < shrink) shrink = shrinkWidth;
				if (shrinkHeight < shrink) shrink = shrinkHeight;

				imgWidth = Math.round(imgWidth * shrink);
				imgHeight = Math.round(imgHeight * shrink);

				var winName = "\'TempWin\'";
				if(imgPopup.indexOf("html") > 0) winName = "\'TempWinX\'";

				var Msg = "<IMG NAME=ImageName"+iImg+" SRC="+src+" WIDTH="+imgWidth+" HEIGHT="+imgHeight+">";
				var Header = "<A HREF="+imgPopup+" onClick=\"return popup(this,"+winName+","+popupWidth+","+popupHeight+")\">";
				var Trailer = "</A>";
				if(imgPopup) Msg = Header + Msg + Trailer;
				p(Msg);
			}
			p("		</TD>");
		}
		p("	</TR>");
	}
	p("</TABLE>");
	p("</DIV>");

alert(BigStr);

}

function popup(mylink, windowname, popupWidth, popupHeight)
{
	if (! window.focus) return true;

	var href;
	if (typeof(mylink) == 'string') { href=mylink; } else { href=mylink.href; }

	if(href.indexOf("Dummy") > 0)	// Scrolling images have href= Dummy1 or Dummy2
	{
		href = href.replace("Dummy1",Dummy1);
		href = href.replace("Dummy2",Dummy2);
	}

	if(href.indexOf("\.jpg") > 0)	// .jpg as opposed to html
	{
		newWindow = window.open(href, windowname,
			"width="+popupWidth+",height="+popupHeight+",scrollbars=no,resizable=no,toolbar=no,directories=no,status=no,menubar=no");
	}

	else					// .html as opposed to jpg
	{
		newWindow = window.open(href, windowname,
			"width="+popupWidth+",height="+popupHeight+",scrollbars=yes,resizable=yes,toolbar=no,directories=no,status=no,menubar=no");
	}

	newWindow.focus();
	return false;
}
