/**
* Tommy Brière
* Productions Vic Pelletiers
* Page de visionnement des artistes, code
**/
var artisteMedia;
var artisteId;
var flashConnectionId=0;
function artisteMedia(){}

function showFullScreen(path){
window.open(path);}

function imageOverlay(url, copyright){
var a= document.createElement("a");
if(copyright != undefined && copyright !="undefined" && copyright.length> 3){
a.setAttribute("title", copyright);} else{
a.setAttribute("title"," " );}
a.setAttribute("rel","lightbox" );
a.setAttribute("href", url);
myLightbox.start(a);}

artisteMedia.prototype.set= function(id, path, description, titre, type, copyright){
if(this.path==path){
return;}
this.id= id;
this.path= path;
this.description= description;
this.titre= titre;
this.type=type;
this.copyright= copyright;
var html="";
if(titre&&titre.length>0&&titre!="null"){
html+="<strong><em>"+ titre+"</em></strong>";}
if(description&&description.length>0&&description!="null"){
html+="<p>"+ description+"</p>";}
htmlM="";
if(hasFlash()){
if(type=="i"){
var pathphoto= encodeURIComponent( _URL_IMAGE(path, 1000, 480) );
path="/swf/bordure_photo?pathphoto="+pathphoto+"&cid="+flashConnectionId;
path+="&langue="+ressourcesTextes.getLangue();
htmlM+= AC_FL_GetContentCode("src"
, path,"width"
, 540,"height"
, 305,"wmode"
,"transparent" 
);} else if(type=="o"){
var pathphoto= encodeURIComponent( _URL_IMAGE(path, 1000, 480) );
path="/swf/bordure_photo?pathphoto="+ pathphoto;
path+="&langue="+ressourcesTextes.getLangue();
path+="&titlephoto="+encodeURIComponent(copyright);
path+="&cid="+flashConnectionId;
htmlM+= AC_FL_GetContentCode("src"
, path,"width"
, 540,"height"
, 305,"wmode"
,"transparent" 
);} else if(type=="v"){
var rpath= path;
path="/swf/playerFLV2?pathflv=/medias/"+path+"&cid="+flashConnectionId;
path+="&langue="+ressourcesTextes.getLangue();
path+="&pathpimage="+ encodeURIComponent( _URL_IMAGE(rpath, 542, 305) );
htmlM+= AC_FL_GetContentCode("src"
, path,"width"
, 540,"height"
, 305,"bgcolor"
,"#E7BE6D" 
);} else{}
try{
bfTracker._trackPageview('/'+((type=="v")?"videos":"medias")+'/'+ encodeURIComponent(this.path));} catch(e){}} else{}
$("description_texte").innerHTML= html;
var artisteMedia= $("artiste_media");
artisteMedia.innerHTML= htmlM;}
artisteMedia.prototype.getCurStateCode= function(){
return this.id+";"+this.path+";"+this.description+";"+this.titre+";"+this.type;}

artisteMedia.prototype.readUrlParams= function(){
}

artisteMedia.prototype.afficherPImage= function(){
var sUrl="/plugin.php";
var callback={
success: this.afficherPImageR,
argument:[this]};
var postData="&plugin=artiste&action=getPhotos&artisteid="+artisteId+"&langueId="+ressourcesTextes.getLangue();
if(this.langue=="fr" ) YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);}
artisteMedia.prototype.afficherPImageR= function(o){
var me= o.argument[0];
if(o.responseXML){
var root= o.responseXML.documentElement;
var i1= root.childNodes[0];
var id= i1.getAttribute("id");
var path= i1.getAttribute("path");
var description= i1.getAttribute("description");
var titre= i1.getAttribute("titre");
var type= i1.getAttribute("type");
var copyright= i1.getAttribute("copyright");
if(copyright != null && copyright != undefined){
me.set(id, path, description, titre, type, copyright);} else{
me.set(id, path, description, titre, type, copyright);}}}
artisteMedia= new artisteMedia();
