
$(function() { $(".fancybox").fancybox({'titlePosition'  : 'over','padding' : 0, 'transitionIn'	:'elastic','transitionOut':'elastic','speedIn':600,'speedOut':	200,'overlayShow'	:	true,'overlayColor'		: '#000', 'centerOnScroll'	: true });

	$('a.match,a.birthday,a.event,a.dispomatch').fancybox({
			'width'				: '75%',
			'height'			: '75%',
			'autoScale'     	: false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'				: 'iframe',
			'overlayColor'		: '#000',
			'centerOnScroll'	: true

	/*'hideOnContentClick': true,'width': 500,
		'height': 480, 'autoScale': false */
		 });

			



	$('a[href*="youtu"],a[href*="vimeo"],a[href*="daily"]').not('#textbox a').each(function(){$(this).after("<iframe class='youtube_player' type='text/html'  src='"+$(this).attr("href")+"' frameborder='0' allowfullscreen></iframe><br />")}).remove();

$('a[href*=".avi"],a[href*=".flv"]').not('#textbox a').each(

	function(){
		//if( $(this).attr('href').match("team-u2") ){
		
			$(this).after("<div id='player' style='width:425px;height:300px'></div><div id='info' class='box info'>You have Flash version 9.115 or above. Enjoy high quality video! </div> ");

			flowplayer("player", {

	// our Flash component
				src: "http://www.team-u2.fr/js/flowplayer-3.2.7.swf",

				// we need at least this Flash version
				version: [9, 115],

				// older versions will see a custom message
				onFail: function()  {
					document.getElementById("info").innerHTML =
						"You need the latest Flash version to see MP4 movies. " +
						"Your version is " + this.getVersion()
					;
				}

				// here is our third argument which is the Flowplayer configuration
			}, {
				clip: $(this).attr('href')
			});

		
		}
	
	
	//}


)

//,#textbox a[href*="vimeo"],#textbox a[href*="dayl"]
	$('#textbox a[href*="youtu"]').each(
		function(index, value) {
		$(value).fancybox({  
			'padding' : 0,   
				'autoScale' : false,  
				'title' : this.title, 
				'transitionIn'	:'elastic',
				'transitionOut':'elastic',
				'speedIn':600,
				'speedOut':	200,   
				'overlayColor'		: '#000',
				'centerOnScroll'	: true,
				'href' : value.href.replace(new RegExp("watch\\?v=", "i"), 'v/'), 
				'type' : 'swf',     
				'swf' : {         
					'wmode': 'transparent',   
					'allowfullscreen': 'false'   
				} 
		});
		
	});
	$('#textbox a[href*="vimeo"],#textbox a[href*="daily"]').each(
		function(index, value) {
		$(value).fancybox({  
			'padding' : 0,   
				'autoScale' : false,  
				'title' : this.title, 
				'transitionIn'	:'elastic',
				'transitionOut':'elastic',
				'speedIn':600,
				'speedOut':	200,   
				'overlayColor'		: '#000',
				'centerOnScroll'	: true,
				'type' : 'iframe'     
		
		});
		
	});
	
				

$('#textbox a[href*=".jpg"],#textbox a[href*=".png"],#textbox a[href*=".gif"]').fancybox({  
				'overlayColor'		: '#000',
				'transitionIn'	:'elastic',
				'transitionOut':'elastic',
				'centerOnScroll' : true
		});




	$('.tin').tinyTips('title');

$('body').append("<div id='infobulle'></div>");

	var tText;
		
	$('.tinwar').mouseenter(
	function(){
		tText = $(this).attr('title');
		$(this).attr('title', '');

		tb=tText.split("*||*");

		var   contenu="<table width='175px' style='border:1px groove #000;' cellspacing='0' cellpadding='0'><tr style='border:1px groove #fff;background:url(images/fd_topic.png) repeat-x; background-position:center center;color:#fff;'><td>&nbsp;<b>"+tb[0].replace(/\\\'/g,"'").replace(/\\\"/g,'"')+"</b></td></tr><tr style='background: #666666;'><td valign='top'><table width='100%' style='background:#ffffff;' cellpadding='3' cellspacing='0' border='0'><tr><td>"+tb[1].replace(/\\\'/g,"'").replace(/\\\"/g,'"')+"</td></tr></table></td></tr></table>&nbsp;";
		var position=$(this).position();
			$('#infobulle').css('left',position.left).css('top',position.top+20).html(contenu).fadeIn(200);
	
	}	
	
	);

	$('.tinwar').mouseleave(
		function(){
			$(this).attr('title', tText);
			$('#infobulle').fadeOut(200);
	
	}	
	
	);
$('.datewar').datepicker({ dateFormat: 'dd/mm/yy',showOn: "button",
			buttonImage: "images/calendar.gif",
			buttonImageOnly: false,
			showAnim: 'fold'  ,
			dayNamesShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
			dayNamesMin: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'],
			dayNames: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],
			monthNames:['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
			onSelect: function( selectedDate ) {
					tb_date=selectedDate.split("/");
				
					$("#jour").val(tb_date[0]);
					$("#mois").val(tb_date[1]);
					$("#annee").val(tb_date[2]);
				
			}

});


$(".subutton").button();
});



