// marche avec ColorBox v1.2.0 uniquement
// marche avec ColorBox v1.2.0 uniquement

$(document).ready(function() {
	
	
	$(".affvideo").colorbox({width:"60%", height:"60%", iframe:true});
	
	//Examples of how to assign the ColorBox event to elements.
	// popup zoom
	$(".slideshow, .imgnews").colorbox
	(
		{
			slideshow:true, 
			transition:"fade", 
			slideshowSpeed:6000, 
			speed:800, 
			iframe:true, 
			opacity:0.6,
			preloading:true,
			width:"684px", 
			height:"550px", 
			
			previous : "précédent",
			next : "suivant",
			close : "fermer",
			slideshowStart: "démarrer le diaporama",
			slideshowStop: "arrêter le diaporama",
			current : "image {current} sur {total}"
		},
		// taille iframe auto colobox
		function () 
		{
			$('#cboxIframe').ready(function() 
			{ 			
				
				
				
				var w = $('#cboxIframe').contents().find('#imgzoompopup, #flashzoompopup').width();
				var h = $('#cboxIframe').contents().find('#imgzoompopup, #flashzoompopup').height();

				if ((!h) || (!w))
					return true;
				// taille iframe auto colobox
				$(' #colorbox, #cboxContent, #cboxWrapper, #cboxLoadedContent').width(w + 16);
				$(' #colorbox, #cboxContent, #cboxWrapper, #cboxLoadedContent').height(h + 48);
				
				$('#colorbox').css('left', ($(document).width() - $('#cboxContent').width()) / 2 + 'px');
				//$('#colorbox').css('top', ($(document).height() - $('#cboxContent').height()) / 2 + 'px');
			});
		}	
	);
	
	
});


