function rubrique(id,nom)
{
	this.id = id;
	this.nom = nom;
	this.sujets = new Array();
	this.HTML = buildRub;
}
function sujet(id,titre,classe,casting,duree,intro,pres,hasVideo,type,rub)
{
	this.id = id;
	this.titre = titre;
	this.classe = classe;
	this.casting = casting;
	this.duree = duree;
	this.intro = intro;
	this.pres = pres;
	this.hasVideo = hasVideo;
	this.type = type;
	this.rub = rub;
	this.photos = new Array();
	this.buildSuj = buildSuj;
}
function photo(id,pres,classe,titre,casting,hasVideo,prev,next)
{
	this.id = id;
	this.pres = pres;
	this.classe = classe;
	this.titre = titre;
	this.casting = casting;
	this.hasVideo = hasVideo;
	this.buildDiapo = buildDiapo;
	this.idPrev = prev;
	this.idNext = next;
}

function buildSuj(el)
{
	iHTML = "";
	iHTML += "<table cellpadding=10 cellspacing=0 class=rubSuj align=center style='border-top:1px solid #666'><tr><td style='font-size:16px;padding-left:35px;'><b><a href='rubriqueuk.php?rub="+this.rub+"' class=navSuj><<</a></b><br>&nbsp;</td><td>"+((this.hasVideo) ? "<table class=downloadSuj align=right><tr><td><a href='javascript:video(\"s"+this.id+"\")'>"+((this.pres == 0) ? "See the Movie" : "See the Trailer")+"</a></td></tr></table>" : "" )+"</td></tr></table><table cellpadding=0 cellspacing=0 class=rubSuj align=center>				<tr><td class=classSuj width=230 align=center valign=top style='padding-bottom:15px'><b style='font-size:14px'>"+this.classe+"</b>"+((this.type != "") ? "<br>"+this.type : "")+"<br><br><img src='photos/class"+this.id+".jpg'></td><td valign=top style='padding-bottom:15px;padding-left:15px;padding-right:20px'><span style='font-size:14px; font-weight:bold'>";
	if (this.pres == 0) 
	{
		iHTML += this.titre + ((this.duree != "") ? " - Duration "+this.duree : "") + "<br>" + this.casting;
	} 
	else
	{
		iHTML += this.casting + "<br>\"" + this.titre + "\" " + ((this.duree != "") ? " - Duration "+this.duree : "");
	}
	iHTML += "</span><br><br>"+this.intro+"</td></tr></table><table cellpadding=0 cellspacing=0 class=rubSuj align=center><tr>";
	i = 0;
	nb = 0;
	while (i < this.photos.length) 
	{
		nb++;
		iHTML += "<td width=230 valign=top align=center height=180><a href='javascript:diaporama("+this.id+","+this.photos[i].id+")'><img src='photos/medium"+this.photos[i].id+".jpg' style='border:1px solid #666666'></a></td>";
		if (nb%3 == 0) iHTML += "</td></tr>";
		i++;
	}
	iHTML += "</tr></table><table cellpadding=0 cellspacing=0 class=rubSuj2 align=center><tr><td style='border-top:1px solid #666'>&nbsp;</td></tr></table>";
	el.innerHTML = iHTML;
}

function buildDiapo(el)
{
	iHTML = "";
	iHTML += "<table cellpadding=0 cellspacing=0 class=rubDiapo align=center style='border-top:1px solid #666'><td align=center><table cellpadding=10 cellspacing=0><tr><td valign=top><a href='sujetJSUK.php?rub="+oSujet.rub+"&sujet="+oSujet.id+"' target=navFrame class=navDiapo><<</a></td><td align=center><div style='width:530px; padding:20px; background-color:#111'><img src='photos/p"+this.id+".jpg' style='border:1px solid #666;'><br><br>";
	if (this.pres == 0) 
	{
		iHTML += "<span class=menuONDiapo>"+this.classe+"</span><br><span class=menuDiapo>\""+this.titre+"\"</span><br><span class=castingDiapo>"+this.casting+"</span>";
	} 
	else 
	{
		iHTML += "<span class=menuONDiapo>"+this.classe+"</span><br><span class=menuDiapo>"+this.casting+"</span><br><span class=castingDiapo>\""+this.titre+"\"</span>";
	}
	iHTML += "</div></td><td align=right valign=top><span style='color:#666; font-size:16px; font-weight:bold'>";
	if (this.idPrev != 0) 
	{
		iHTML += "<a target=navFrame href='diapoJSUK.php?sujet="+oSujet.id+"&idPhoto="+this.idPrev+"&rub="+oSujet.rub+"' class=navDiapo>";
	}
	iHTML += "&lt;";
	if (this.idPrev != 0) iHTML += "</a>";
	iHTML += "&nbsp;&nbsp;|&nbsp;&nbsp;";
	if (this.idNext != 0) iHTML += "<a target=navFrame href='diapoJSUK.php?sujet="+oSujet.id+"&idPhoto="+this.idNext+"&rub="+oSujet.rub+"' class=navDiapo>";
	iHTML += "&gt;";
	if (this.idNext != 0) iHTML += "</a>";
	iHTML += "</span></td></tr></table></td></tr></table><table cellpadding=0 cellspacing=0 class=rub2Diapo align=center><tr><td style='border-top:1px solid #666'>&nbsp;</td></tr></table>";
	el.innerHTML = iHTML;
}