
var sendToFlash = {
	urlFile:'',
	testimony:'',
	signature:'',
	init:function(){
			sendToFlash.getData($('.selectList a:eq(0)'));
			sendToFlash.sendData();
		$('.selectList a').click(
		function() {
			if(!$(this).hasClass('selected')){
				$('.selectList a').removeClass('selected');
				$(this).addClass('selected');
			}
			sendToFlash.getData($(this));
			sendToFlash.sendData();
			return false;
		});
	},
	sendData:function(){
		document.getElementById("id_flash").getInfo(sendToFlash.urlFile,sendToFlash.testimony,sendToFlash.signature);
	},
	getData:function(a){
		 var title = $.trim(a.children('span').children('strong').text());
		sendToFlash.signature = $.trim(a.children('span').children('.text1').text());
		var text2 = $.trim(a.children('span').children('.text2').text());
		if(text2 == ''){
			sendToFlash.testimony = title;
		} else {
			sendToFlash.testimony = title+'<br><font color="#000000">'+text2+'</font>';
		}
		var href = a.attr('href');
		sendToFlash.urlFile = href.substring(href.indexOf('urlswf=')+7,href.length);
		//console.log(sendToFlash.testimony+' - '+sendToFlash.signature+' - '+sendToFlash.urlFile);
	}
}

//fonction lancée par le flash player à la fin de son chargement
function playerInit() {
		 sendToFlash.init();
}

box.dom(document).ready(function() {
  box.ui('carousel').create({
    element: '#carousel',
    horizontal: true,
	paginate: true,
    display: 4, 
    duration: 800
  });
  
  $('#carousel').each(function() {
        $('div.councilor:odd', this).addClass('noBorder');
	});
  
  setFlash.init(flashvars);
});


