// version Treepodia
document.write(unescape("%3Cscript src='" + (document.location.protocol == 'https:' ? 'https:' : 'http:') + "//www.treepodia.com/video/Treepodia.js' type='text/javascript'%3E%3C/script%3E"));
	
var product = new Array();
var videos= new Array();
var trpdArr = new Array(); 
function initTreepodia()
{
    for (i=0;i < trpdArr.length; i++)
	{
		requestVideoInfo(trpdArr[i]);
	}
} 

function requestVideoInfo(Produit_Reference)
{
  product[Produit_Reference] = Treepodia.getProduct('UA-WELLPACK', Produit_Reference);
  var trpdtmp = getFunc(Produit_Reference);
  product[Produit_Reference].requestVideo(trpdtmp);
}

function getFunc(s)
{ 
	return function(vid)
	{ 
		handleVideo(s, vid);
	} 
}

function handleVideo(Produit_Reference, vid)
{ 
	videos[Produit_Reference] = vid; 
    var videobtn = document.getElementById(Produit_Reference);
    
	if(vid.hasVideos())
	{
		if(videobtn != null)
		{
			try
			{
				videobtn.style.display = 'inline';
			} catch (e) {}
		}
	}
}

function registerProductForVideo(Produit_Reference)
{
	trpdArr.push(Produit_Reference);
} 
  
function listing_produit_affiche_video(Reference)
{
	var Produit;
	Produit = Treepodia.getProduct('UA-WELLPACK', Reference);
	Produit.requestVideo(listing_videoHandlerFunc);
}
	
function listing_videoHandlerFunc(videoController)
{ 
	currentProductVideo = videoController;
	currentProductVideo.setAutoplay(true);
	document.getElementById('listing_produit_video_dispo').style.display = 'block';
	document.getElementById('listing_produit_fond').style.display = 'block';
	currentProductVideo.show(document.getElementById('listing_produit_video-player-location'));
}

function listing_produit_supprimer_video()
{
	document.getElementById('listing_produit_video_dispo').style.display = 'none';
	document.getElementById('listing_produit_video-player-location').innerHTML ='';
	document.getElementById('listing_produit_fond').style.display = 'none';
	showingVideoDiv = false;
}
	