function readtrack (tid) {
				switch (tid) {
					case 1: 
						title	= "Dj Tymers - Mix La Villa";
						song	= "http://www.lavilla-club.com/sons/DjTymers-MixLaVilla.mp3";
						ecoute	= "A l'écoute: ";
						
						break;
					
					case 4:
						title	= "Le lecteur est en pause.<br />Choisis un mix à écouter.";
						song	= "";
						ecoute	= "";
						break;
					case 5:
						title	= "Le lecteur est arrêté.<br />Choisis un mix à écouter.";
						song	= "";
						ecoute	= "";
						break;
					default:
						title	= "Dj Tymers - Mix La Villa";
						song	= "http://www.lavilla-club.com/sons/DjTymers-MixLaVilla.mp3";
						ecoute	= "A l'écoute: ";
						break;
						
// mettez autant de titre que vous voulez : case 3; case 4 ...
				}
				content  = '<span id="titre_en_cours" class="T10 blanc italic">'+ecoute+title+'</span>';
				content += '<object type="application/x-shockwave-flash" data="http://www.lavilla-club.com/dewplayer/dewplayer-mini.swf" width="1" height="1" id="dewplayer" name="dewplayer">';
				content += '<param name="wmode" value="transparent" />';
				content += '<param name="movie" value="http://www.lavilla-club.com/dewplayer/dewplayer-mini.swf" />';
				content += '<param name="flashvars" value="javascript=on&autostart=1&mp3='+song+'" />';
				content += '</object>';
				content += '<p></p>';
				document.getElementById('player').innerHTML = content;
}

function OuvrirBoiteWithAjax(params, popunder,boite,taille, action_id)
{
	
	$(popunder).fade({ duration: 1.0, from: 0, to: 1 });
	$(popunder).style.visibility = 'visible';
	$(popunder).style.display = 'block';
	$(boite).style.width = taille;
	AjaxGeneral(popunder, action_id, null, params, null);
}


function OuvrirBoite(popunder,boite,taille)
{
	$(popunder).fade({ duration: 1.0, from: 0, to: 1 });
	$(popunder).style.visibility = 'visible';
	$(popunder).style.display = 'block';
	$(boite).style.width = taille;
}
function FermerBoite(popunder,boite)
{
	$(popunder).fade({ duration: 1.0, from: 1, to: 0 });
	$(popunder).style.visibility = 'hidden';
	$(popunder).style.display = 'none';
	$(boite).style.width = '0px';
}

function play() {
  var dewp = document.getElementById("dewplayer");
  if(dewp!=null) dewp.dewplay();
}
function stop() {
  var dewp = document.getElementById("dewplayer");
  if(dewp!=null) dewp.dewstop();
}
function pause() {
  var dewp = document.getElementById("dewplayer");
  if(dewp!=null) dewp.dewpause();
}
function next() {
  var dewp = document.getElementById("dewplayer");
  if(dewp!=null) dewp.dewnext();
}
function prev() {
  var dewp = document.getElementById("dewplayer");
  if(dewp!=null) dewp.dewprev();
}
function set(file) {
  var dewp = document.getElementById("dewplayer");
  if(dewp!=null) {
	dewp.dewset(file);
  }
}
function go(index) {
  var dewp = document.getElementById("dewplayer");
  if(dewp!=null) {
	dewp.dewgo(index);
  }
}
function setpos(ms) {
  var dewp = document.getElementById("dewplayer");
  if(dewp!=null) {
	dewp.dewsetpos(ms);
  }
}
function getpos() {
  var dewp = document.getElementById("dewplayer");
  if(dewp!=null) {
	alert(dewp.dewgetpos());
  }
}
function volume(val) {
  var dewp = document.getElementById("dewplayer");
  if(dewp!=null) {
	alert(dewp.dewvolume(val));
  }
}

new Event.observe(window, 'load', play);

function initialize() {
    var myLatlng = new google.maps.LatLng(-21.070172,55.222888);
    var myOptions = {
      zoom: 16,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.HYBRID
	
    }
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	//image1 = 'http://dev.oifix.re/images/logo_plan.png';
    var marker = new google.maps.Marker({
        position: myLatlng, 
        map: map,
		//icon: image1,
        title:"La Villa Club"
    });   
  }

function AjaxGeneral(cible,action_id,maj,variables,formulairelie,action_uri)
	{

		// annuler aux setTimeout
		if (typeof timeoutID=="undefined")
		{

		}
		else
		{
			window.clearTimeout(timeoutID);
		}

		if (formulairelie)
		{
			var	varformlie = Form.serialize(formulairelie);
			if(varformlie)var autre = '&'+varformlie;
		}


		// Ajax et MAJ
		objdate = new Date;

		var url = '/ajax.V2.php?time='+objdate.getTime()+'&uri='+action_uri;
		var params = 'action_id='+action_id+'&';
		if (variables)params=params+'&'+variables;
		if (autre)params=params+'&'+autre;




		new Ajax.Request(url, {
		  method: 'post',
	      postBody: params,

		  evalScripts:true,
		  onSuccess: function(transport) {


		    if (transport.responseText)
			{		
				var myTextField = document.getElementById(cible);
				
				//myTextField.innerHTML = transport.responseText;
				
				$(cible).update(transport.responseText);

				//$(cible).html(transport.responseText);

				if (maj)
				{

					timeoutID	= setTimeout(function() {AjaxGeneral(cible,action_id,maj,variables,formulairelie,action_uri);}, maj);

				}

			}	

		}
		});

		// END

	}

	function AjaxChangeModule(module,action,autre,formulairelie,ressource,jenesaispas) {
		AjaxGeneral('gauche', action, null, null, formulairelie);
	}
	
	function FinUploadMedia(media_id,i)
	{

		//$("medias_"+i).update(media_id);

		var box = $("medias["+i+"]");

		Element.writeAttribute(box, 'value', media_id);

	}
	
	// MAIN DE L'APPLICATION


	function diaporamaChange() {
		var tabLi = $("bandeauajax").childElements();

		$$(".actif").each(function(el) {
			el.hide('appear');
			el.removeClassName('actif');
			for(var i=0; i < tabLi.length; i++) if (el == tabLi[i]) if (i + 1 < tabLi.length ) tabLi[i+1].addClassName('actif'); else tabLi[0].addClassName('actif');
			$$(".actif").each(function(el2) { new Effect.toggle(el2, 'appear'); });
		});
	}
	
