/*global JsonML, Example */

/* namespace window.Example */
if ("undefined" === typeof window.Example) {
	window.Example = {};
}

Example.bandTable = JsonML.BST(
[
	"div",
	{
		"class": "Band"
	},
	" ",
	[
		"h3",
		" ",
		[
			"a",
			{
				"class": "ExtLink",
				"href": 
					function() {
				return  "http://en.wikipedia.org/wiki/" + this.data.wiki ;
			},
				"onclick": "window.open(this.href);return false;"
			},
			function() {
				return  this.data.name ;
			}
		],
		" "
	],
	" ",
	[
		"table",
		{
			"class": "Members"
		},
		" ",
		[
			"tr",
			{
				"style": "background-color:#666666"
			},
			" ",
			[
				"th",
				{
					"class": "NameCol FirstNameCol"
				},
				[
					"a",
					{
						"href": "#firstName",
						"onclick": "Example.display(null,null,'firstName');return false;"
					},
					"First Name"
				]
			],
			" ",
			[
				"th",
				{
					"class": "NameCol"
				},
				[
					"a",
					{
						"href": "#lastName",
						"onclick": "Example.display(null,null,'lastName');return false;"
					},
					"Last Name"
				]
			],
			" ",
			[
				"th",
				{
					"class": "DateCol"
				},
				[
					"a",
					{
						"href": "#start",
						"onclick": "Example.display(null,null,'start');return false;"
					},
					"Active"
				]
			],
			" ",
			[
				"th",
				{
					"class": "DateCol"
				},
				[
					"a",
					{
						"href": "#end",
						"onclick": "Example.display(null,null,'end');return false;"
					},
					"Until"
				]
			],
			" ",
			[
				"th",
				{
					"class": "TextCol"
				},
				[
					"a",
					{
						"href": "#type",
						"onclick": "Example.display(null,null,'type');return false;"
					},
					"Instrument"
				]
			],
			" "
		],
		" ",
		function() {
				return  Example.memberRow.dataBind(this.data.members) ;
			},
		" "
	],
	" ",
	[
		"p",
		{
			"style": "color:white;padding:0.5em 0.5em 0 0.5em"
		},
		[
			"strong",
			"Genre:"
		],
		" ",
		function() {
				return  (this.data.genre && this.data.genre.join(", ")) || "unknown" ;
			}
	],
	" ",
	[
		"p",
		{
			"style": "color:white;padding:0.5em 0.5em 0 0.5em"
		},
		[
			"strong",
			"Active:"
		],
		" ",
		function() {
				return  this.data.start ;
			},
		" - ",
		function() {
				return  this.data.end || "Present" ;
			}
	],
	" "
]);

