
var artist_list = new Array();
var artists_per_line = 3;

function tc_artist(artist_type) {
	var actr;
	var tc;

	initialize_artists(artist_type);
	tc = "";
	//tc += "<div align=\"center\" class=\"wideColumn\">\n";

	tc += "<div class=\"fixer\"></div>\n";
	tc += "<br />\n";
	tc += "<table cellspacing=\"0\" cellpadding=\"0\" align=\"Center\" VerticalAlign=\"Middle\" border=\"0\" style=\"border-width:0px;border-style:Solid;border-collapse:collapse;\">\n";
//window.alert("length="+artist_list.length);
	for (actr = 0; actr < artist_list.length; actr++) {
		if (actr % artists_per_line == 0)
			tc += "<tr>\n";
		tc += "<td align=\"center\">\n";
		tc += "<div class=\"artistContainer\">";
		tc += "<img src=\"images/artists/" + artist_list[actr].photo + "\"";
		tc += " alt=\"" + artist_list[actr].name + "\"";
		tc += " title=\"" + artist_list[actr].name + "\"";
		tc += " style=\"margin-bottom: 5px;\"";
		tc += " border=1 /><br />\n";
		tc += "<strong>" + artist_list[actr].name + "</strong><br />\n";
		if (artist_list[actr].phone != "")
			tc += artist_list[actr].phone + "<br />\n";
		if (artist_list[actr].email != "")
			tc += "<a href=\"mailto:" + artist_list[actr].email + "\">" + artist_list[actr].email + "</a><br />";
		if (artist_list[actr].website != "")
			tc += "<a href=\"http://" + artist_list[actr].website + "\" target=\"_blank\">" + artist_list[actr].website + "</a>";
		tc += "</div>\n";
		tc += "</td>\n";
		if (actr % artists_per_line == eval(artists_per_line - 1))
			tc += "</tr>\n";
	}
	if (actr % artists_per_line != eval(artists_per_line - 1))
		tc += "</tr>\n";
	tc += "</table>\n";
	tc += "<div class=\"fixer\"></div>\n";
	//tc += "</div>\n";

	document.write(tc);
//window.alert(tc);
}

function initialize_artists(artist_type) {
	var ctr = 0;

	artist_list.splice(0, artist_list.length);
//window.alert("length="+artist_type.length);
	for (ctr = 0; ctr < artist_type.length; ctr++) {
		artist_list[ctr] = new make_artist(artist_type[ctr]);
	}
}

function make_artist(artist_type) {
	if (artist_type.length != 5) {
		window.alert("Invalid argument to make_artist");
		return;
	}
	this.name = artist_type[0];
	this.photo = artist_type[1];
	this.phone = artist_type[2];
	this.website = artist_type[3];
	this.email = artist_type[4];
}


