
var win=0;				// window open ID
var ShipName;			// Name of the card to display
var thumbsPerLine=5;		// change this number for thumbnails per line
var win=0;				// window open ID
var ShipName;			// Name of the card to display
var wide,high,adj;		// for loop code


function CreateTable(ship)
{
//   document.open();					// Open the webpage
	      
	 document.write("<table>");				// write out the table tag
 
   for(var i=0;i<ship.length;)			// for all entries in the table
   {
      document.write("<tr>");				// create a table row

      for(var j=0;j<thumbsPerLine;j++)		// do this many table data sets per row
      {
 	       if(ship[i+1]=="0")				// next ship name
         {
		         document.write("<\/tr><\/table><tr><td align=left>"+ship[i]+"<\/td><\/tr><table><tr>");
	           i+=2;						// point to next name
	           if(i>=ship.length)			// if done with the array
		              break;

		         j= -1;					// preset inner loop counter
		         continue;					// get out of the table data loop
	       }

         var name = ship[i++];			// keep local copy of name
         var alttext = ship[i++];			// and local copy of text

         if(name.indexOf("v",2) == -1)		// see if hrizontal format
         {
            wide = 110					// change it accordingly
	          high = 60;					// like this
		        adj = 10;					// picture frame adjustment
	       }
	       else						// else vertical
	       {
            wide = 60;					// preset for horizontal format
	          high = 110;					// like this
		        adj = 0;					// no adjustment needed
	       }

         document.write("<td align=center valign=top width="+wide+" height="+high+">");
         document.write("<a href=javascript:void(0) onClick=DisplayWin('"+name+"');>");
         document.write("<img src=thumbs/"+name+".jpg width="+(wide-adj)+" height="+high+
               			" border=1 alt="+alttext+"><br>"+name+"<\/a><br>&nbsp;<\/td>");

	       if(i>=ship.length)				// if done with the array
	           break;
      }
      document.write("<\/tr>");			// write end of row
   }
   document.write("<\/tr><\/table>");			// write end of table
	 document.write("<center><font size=-2 color=magenta>");		 // take care of copyright notice
	 document.write("Copyright Tiemen Spits 1999-2005</font></center>");
   document.close();					// end close the document
};
