/* author: jheadric@msn.com */
/* code copyright by Judy Headrick */
/* Creation date: 3/24/2007 */
function buildTilePage(numberOfTiles, startingTileNumber, baseThumbnailName, baseFileName) {


/* Build the tile selection form (selectionForm)*/
/* Instructions section */
	selectionForm = "<table border='1' align='center' bgcolor='#FFCCFF' width='600'><tr>";
	selectionForm += "<td colspan='2' ><div align='center'><h3>Printable Tea Bag Tile Page Generator</h3>";
	selectionForm += "<b><i>*** NOTE: You must allow pop-ups to generate your tile page! ***</i></b></div></td></tr><tr><td>";
	selectionForm += "<b>INSTRUCTIONS:</b><ul><li>Find a tile you want to print and copy the entire URL for the <b>image</b> (not the page)";
	selectionForm += "<br><i><b>For example:</b> http://www.handcraftedgreetings.com/images/teabagtiles/th_square_tile9.jpg</i>";
	selectionForm += "<br><b>NOTE:</b> to find an image url, right click the image then click properties on the context menu.</li>";
	selectionForm += "<li>Select whether you want seams</li>";
	selectionForm += "<li>Enter the URL for each image you want to print in the Tile URL boxes.</li>";
	selectionForm += "<li>Select a size for each tile design</li><li>Select the number of rows for each tile design</li>";
	selectionForm += "<li>Click the Display Tile Page button</li><li>Print your tiles using your browser's print function</li></ul></td></tr>";

/* Start the table for the tile selection */
	selectionForm += "<form name='form1'>";	

/* Select general options applied to all tiles */
	selectionForm += "<td><table border='0' bgcolor='#FFCCFF'><tr><td colspan='2'><b>Do you want seams between the tiles? </b>";
	selectionForm += "<select NAME='cuttingLines'>";
	selectionForm += "<option VALUE=1 SELECTED>Yes";
	selectionForm += "<option VALUE=0>No";
	selectionForm += "</select><br>(Seams make it easier to see where to cut)</td></tr>";


/*Build the tile size option selection list */
	sizeSelectionList = "<option VALUE= 0 SELECTED>...";
	sizeSelectionList += "<option VALUE= 75>75 (8 per row)";
	sizeSelectionList += "<option VALUE= 100>100 (6 per row)";
	sizeSelectionList += "<option VALUE= 125>125 (5 per row)";
	sizeSelectionList += "<option VALUE= 150>150 (4 per row)";
	sizeSelectionList += "<option VALUE= 175>175 (3 per row)";
	sizeSelectionList += "<option VALUE= 200>200 (3 per row)";
	sizeSelectionList += "<option VALUE= 225>225 (2 per row)";
	sizeSelectionList += "</select>" 

/*Build the tile row option selection list */
	rowSelectionList = "<option VALUE = 0 SELECTED>...";
	for (z = 1; z <= 12; z++){
		rowSelectionList += "<option VALUE = " + z + ">" + z;
	}
	rowSelectionList += "</select>"


/* Add the tile name size and number of rows to the form */
	selectionForm += "<tr><td align=right><b>First Tile URL: </b></td><td>";
	selectionForm += "<input type=text NAME='tileSelection1' size=50></td></tr>";
	selectionForm += "<tr><td align=right> <b>Size:</b></td>";
	selectionForm += "<td><select NAME='tileSize1'>";
	selectionForm += sizeSelectionList
	selectionForm += " <b>Rows:</b> ";
	selectionForm += "<select NAME='tableRows1'>";
	selectionForm += rowSelectionList;
	
	selectionForm += "<tr><td colspan=2>&nbsp</td></tr>";
	selectionForm += "<tr><td align=right><b>Second Tile URL: </b></td><td>";
	selectionForm += "<input type=text NAME='tileSelection2' size=50></td></tr>";
	selectionForm += " <tr><td align=right><b>Size:</b></td> ";
	selectionForm += "<td><select NAME='tileSize2'>";
	selectionForm += sizeSelectionList
	selectionForm += " <b>Rows:</b> ";
	selectionForm += "<select NAME='tableRows2'>";
	selectionForm += rowSelectionList;
	
	selectionForm += "<tr><td colspan=2>&nbsp</td></tr>" ;
	selectionForm += "<tr><td align=right><b>Third Tile URL: </b></td><td>";
	selectionForm += "<input type=text NAME='tileSelection3' size=50></td></tr>";
	selectionForm += " <tr><td align=right><b>Size:</b></td> ";
	selectionForm += "<td><select NAME='tileSize3'>";
	selectionForm += sizeSelectionList
	selectionForm += " <b>Rows:</b> ";
	selectionForm += "<select NAME='tableRows3'>";
	selectionForm += rowSelectionList;
	selectionForm += "<tr><td colspan=2>&nbsp</td></tr>";





	selectionForm += "</table></td></tr>";
/* Form Buttons and close form */
	selectionForm += "<tr><td colspan='2' align='center'>";
	selectionForm += "<input TYPE='BUTTON' VALUE='Display Tile Page' onClick='display(0);'> ";
	selectionForm += "<input TYPE='RESET' VALUE='Reset Form'><br><i>Dynamic Tile Page Generator ©2007 by Judy Headrick</i></td>";
	selectionForm += "</tr></table></td></tr></table></form>";
	selectionForm += "</table><p></p>";

/*Write everything to the document*/
	document.write(selectionForm);
	document.close();
}
