var RELEASE_STATUS_OUT = 0;
var RELEASE_STATUS_PRESALE = 1;
var RELEASE_COMING_SOON = 2;
var RELEASE_EXCLUSIVE = 3;

function sideNavigationItem(title, content, contentIsStatic){
	this.title = title;
	this.content = content;
	this.contentIsStatic = contentIsStatic;
	this.active = 0;
	this.getContent = function() {
		if(this.contentIsStatic){
			return this.content;
		} else {
			return this.content();
		}
	}
}

function priceInfo(p320, pW, pID320, pIDW){
	this.p320 = p320; // 320 kbps
	this.pW = pW; // wave
	this.pID320 = pID320;
	this.pIDW = pIDW;
}

function trackInfo(name, duration, sampleLink, price){
	this.name = name;
	this.duration = duration;
	this.sampleLink = sampleLink;
	this.price = price;
}

function headerInfo(title, cata, description, img, imgCD, artistLine){
	this.title = title;
	this.description = description;
	this.cata = cata;
	this.img = img;
	this.imgCD = imgCD;
	this.artistLine = artistLine;
}

function forthcomingInfo(title, cata, date, tracks){
	this.title = title;
	this.cata = cata;
	this.date = date;
	this.tracks = tracks;
}

function releaseInfo(title, cata, description, tracks, link, imgBig, imgSml, imgCD, price, status, stream, artistLine){
	this.header = new headerInfo(title, cata, description, imgBig, imgCD, artistLine);
	this.tracks = tracks;
	this.link = link;
	this.imgSml = imgSml;	
	this.price = price;
	this.status = status;
	this.stream = stream;
	this.genContent = function() {
		var str = "<div class=\"trackInfo\">";
			switch(this.status){
				case RELEASE_STATUS_OUT:
					str += "[Free Download: <a href=\"" + this.link + "\">256kbps MP3 Release</a>]<p>[Buy: <a href=\"#null\" onClick=\"setSelectedNavItemFacny('" + nav320 + "')\">320kbps MP3 or WAV</a>]</p>";
					break;
				case RELEASE_STATUS_PRESALE:
					if(this.tracks.length <= 4)
						str += "[Coming Nov 09: Free 256kbps Download]<p>[Buy on Presale: <a href=\"#null\" onClick=\"setSelectedNavItemFacny('" + nav320 + "')\">320kbps MP3 or WAV</a>]</p>";
					else
						str += "[Coming Aug 09: Free 256kbps Download]<p>[Buy on Presale: <a href=\"#null\" onClick=\"setSelectedNavItemFacny('" + nav320 + "')\">320kbps MP3 or WAV</a>]</p>";
					break;
				case RELEASE_COMING_SOON:
					str += "<b>COMING SOON...</b><br>";
					break;
				case RELEASE_EXCLUSIVE:
					str += "[<a href=\"#null\" onClick=\"setSelectedNavItemFacny('" + nav320 + "')\">Exclusive Tracks</a>]"
					break;
			}
			if(stream != 0){
				str += "<p>[<a href=\"" + this.stream + "\">Stream Samples</a>]</p>";
			}
			//str += "<br/>";					
		str += "<ul class=\"trackInfo\">";
			for(i = 0; i < tracks.length; i++){
				str += "<li>" + this.tracks[i].name + " (" + this.tracks[i].duration + ") : [";
				str += "<a href=\"" + tracks[i].sampleLink + "\">sample</a>]</li>";
			}
			// [<a target=\"_blank\" href=\"http://creativecommons.org/licenses/by-nc-nd/3.0/\">Some rights reserved</a>]		
		str += "</ul>";		
		str += this.header.description;
		str += "<p>All rights reserved. Tracks mastered by [<a target=\"_blank\" href=\"mailto:macc.mu" + "sic@gmail.com\">Macc</a>].</p>";
		str += "<p>";		
		str += "<br>";
		str += "</p></div>";
		return str;
	}
}

function djMixInfo(title, description, link, img, trackList){
	this.header = new headerInfo(title, '[DJ MIX]', description, img, 0, 0);
	this.link = link;
	this.trackList = trackList;
	this.genContent = function() {
		var str = "<div class=\"trackInfo\">";
			str += this.header.description;
			str += "<br><br>[<a href=\"" + this.link + "\">Download Mix</a>]";
			str += "<div><br>";
			str += this.trackList;
		str += "</div></div>";
		return str;
	}
}
