/* *****************************************************************************
 * Dog object
 ******************************************************************************/
function Dog ( name, sex, color, imageURL, note ) {
	this.name = name;
	this.sex = sex;
	this.color = color;
	this.imageURL = imageURL;
	this.note = note;
}

/* *****************************************************************************
 * display a Dog in a td element
 ******************************************************************************/
function dog_bio ( pup, cols ) {

	with ( pup ) {
		return 	"<td width=\"" + Math.round ( 100/cols ) + "%\"><p>" +
			name + "</p>" +
			"<img width=\"80\" height=\"80\" src=\"" +
			imageURL + "\"><b>Sex</b>: " +
			sex + "<br><b>Coloring</b>: " +
			color +	"<br><b>Note</b>: " +
			note + "</td>";
	}
}


/* *****************************************************************************
 * display puppies Array in a table
 ******************************************************************************/
function dog_table ( cols ) {

	document.write ( "<table class=\"bio\" align=\"center\" width=\"100%\"" +
			"cellspacing=\"10\"><tr>" );

	for ( i = 0; i < dogs.length; i++ ) {
		document.write (  dog_bio ( dogs [i], cols ) +
			( ( ( i + 1 ) % cols ) ? "" : "</tr><tr>" ) );
	}

	document.write ( "</tr></table>" );
}