var homeURL = "http://users.telenet.be/DaveVerbaeten/";

function Gigs()
{
	this.gig = new Array();
	this.toString = toString_Gig;
}
function Gig()
{
	this.affiches = new Affiches();
	this.description = new Description;
	this.details = new Details();
	this.googleMap = new GoogleMap();
	this.id = "";
	this.liveTakes = new LiveTakes();
	this.onStage = new OnStage();
	this.pictures = new Pictures();
	this.playlist = new Playlist();
	this.toString = toString_Gig;
}
function Address()
{
	this.country = "";
	this.id = "";
	this.street = "";
	this.town = "";
	this.toString = toString_Address;
}
function Affiches()
{
	this.picture = new Array();
	this.toString = toString_Affiches;
}
function Band()
{
	this.name = "";
	this.link = new Array();
	this.toString = toString_Band;
}
function Description()
{
	this.text = new Array();
	this.toString = toString_Description;
}
function Details()
{
	this.address = new Address();
	this.date = "";
	this.hour = "";
	this.id = "";
	this.link = new Array();

	this.name = "";
	this.title = "";
	this.toString = toString_Details;
}
function GoogleMap()
{
	this.icon = "";
	this.picture = new Picture();
	this.text = "";
	this.toString = toString_GoogleMap;
}
function Link()
{
	this.id = "";
	this.kind = "";
	this.text = "";
	this.url = new Url();
	this.toString = toString_Link;
}
function LiveTakes()
{
	this.video = new Array();
	this.toString = toString_LiveTakes;
}
function Member()
{
	this.description = "";
	this.functions = new Array();
	this.gear = new Array();
	this.kind = "";
	this.longname = "";
	this.name = "";
	this.pictures = new Pictures();
	this.shortname = "";
	this.toString = toString_Member;
}
function Members()
{
	this.members = new Array();
	this.toString = toString_Members;
}
function OnStage()
{
	this.band = new Array();
	this.toString = toString_OnStage;
}
function Picture()
{
	this.alt = "";
	this.kind = "";
	this.link = "";
	this.text = "";
	this.src = new Src();
	this.size = new Array(0, 0);
	this.toString = toString_Picture;
}
function Pictures()
{
	this.picture = new Array();
	this.toString = toString_Pictures;
}
function Playlist(song)
{
	this.song = new Array();
	this.toString = toString_Playlist;
}
function Song()
{
	this.cd = "";
	this.date = "";
	this.description = "";
	this.kind = "";
	this.liveTakes = new LiveTakes();
	this.lyrics = "";
	this.members = new Array();
	this.picture = new Picture();
	this.played = new Array();
	this.title = "";
	this.toString = toString_Song;
}
function Songs()
{
	this.song = new Array();
	this.toString = toString_Songs;
}
function Src(src, kind)
{
	this.src = src;
	this.kind = kind;
	this.toString = toString_Src;
}
function Url(url)
{
	this.url = url;
	this.toString = toString_Url;
}
function Video()
{
	this.text = "";
	this.url = "";
	this.toString = toString_Video;
}

function toString_Address()
{
	var text = "";
	text = this.street;
	if (text != "" && this.town != "")
		text += ", ";
	text += this.town;
	if (text != "" && this.country != "" && this.country != 'Belgium')
		text += ", ";
	if (this.country != 'Belgium')
		text += this.country;
	if (text != "")
		text = "<p>" + text + "</p>";
	return text;
}
function toString_Affiches()
{
	var text = "";
	for (var i in this)
		if (parseInt((i+1)))
			text += this[i];
	return text;	
}
function toString_Band()
{
	var text = "";
	text += "<li>" + this.name;
	if (this.link.length != 0)
		text += " (" + this.link + ")";
	text += "</li>"
	return text;
}
function toString_Description()
{
	var text = "";
	for (var i in this)
		if (parseInt((i+1)))
			text += "<p>" + this[i] + "</p>";
	return text;
}
function toString_Details()
{
	var text = "";
	text += "Title: " + this.title + "<br>";
	text += "Name: " + this.name + "<br>";
	text += "Date: " + date_To_String(this.date) + "<br>";
	text += "hour: " + this.hour + "<br>";
	text += "Address: " + this.address.toString() + "<br>";
	text += "Link<br>";
	for (var i in this.link)
		text += this.link[i];
	text += (this.date > new Date()) ? "Already passed" :"Yet to come";
	return text;
}
function toString_Gig()
{
	var text = "";
	text += "Id: " + this.id + "<br>";
	text += "Affiches: " + this.affiches + "<br>";
	text += "Description: " + this.description + "<br>";
	text += "Details: " + this.details + "<br>";
	text += "Live Takes: " + this.liveTakes + "<br>";
	text += "On Stage: " + this.onStage + "<br>";
	text += "Pictures: " + this.pictures + "<br>";
	text += "Playlist: " + this.playlist + "<br>";
	return text;
}
function toString_Gigs()
{
	var text = "";
	for (var i in this.gig)
		if (parseInt((i+1)))
			text += this.gig[i];
	return text;
}

function toString_GoogleMap()
{	return this.icon + " " + this.text + " " + this.picture
;	}

function toString_Link()
{	return "<a href=\"http://" + this.url + "\">" + this.text + "</a>";	}
function toString_LiveTakes()
{
	var text = "";
	for (var i in this)
		if (parseInt((i+1)))
			text += "<p>" + this[i] + "</p>";
	return text;
}
function toString_Member()
{
	var text = "";
	text += "Name: " + this.name;
	if (this.functions.length != 0)
		text += "Functions: " + this.functions;
	if (this.gear.length != 0)
		text += "Gear: " + this.gear;
	text += this.description = "";
	text += this.pictures;
	return text;
}
function toString_Members()
{
	var text = "";
	for (var i in this)
		if (parseInt((i+1)))
			text += this[i];
	return text;
}
function toString_OnStage()
{
	var text = "";
	for (var i in this)
		if (parseInt((i+1)))
			text += this[i];
	return text;
}
function toString_Picture()
{
	var text = "";
	text += "<img " + this.src;
	if (this.alt != "")
		text += " alt=\"" + this.alt + "\"";
	if (this.size[0] != 0)
		text += "height=\"" + this.size[0]  + "\"";
	if (this.size[1] != 0)
		text += "width=\"" + this.size[1]  + "\"";
	text += ">";
	if (this.text != "")
		text += this.text;
	text += "</img>";

	if (this.link!= "")
		text = "<p><a href=\"http://" + this.link + '\">' + text + '</a></p>';
	else
		text = "<p>" + text + "</p>";
	return text;
}
function toString_Pictures()
{
	var text = "";
	for (var i in this)
		if (parseInt((i+1)))
			text += this[i];
	return text;
}
function toString_Playlist()
{
	var number = 1;
	var text = "";
	for (var i in this)
		if (parseInt((i+1)))
		{
			text += "<li>"
			if (i < 9)
				text += "0";
			text += number++ + ". " + this[i] + "</li>";
		}
	return text;
}
function toString_Song()
{
	var text = "";
	if (this.kind == 'Cover')
		text += this.title;
	else
		text += "<a href='" + homeURL + "Music.htm?" + this.title + "'target='_self'>" + this.title + "</a>";
	return text;
}
function toString_Songs()
{
	var text = "";
	for (var i in this)
		if (parseInt((i+1)))
			text += this[i];
	return text;
}
function toString_Src()
{	return "src=\"" + homeURL + this.kind + "/" + this.src + "\"";	}
function toString_Url()
{	return "http://" + this.url;	}
function toString_Video()
{
	var text = "";
	if (this.url != "")
	{
	text += "<object width=\"425\" height=\"350\"><param name=\"movie\" value=\"";
	text += this.url;
	text += "\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"";
	text += this.url;
	text += "\"type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></embed></object>"
	text += "<br>" + this.text;
	}
	return text;
}
