var liste_mois = new Array("Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre");//Scripts JQuery$(document).ready(function(){	//$('#home_facebook').html('<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2Fedit%2F%3Fid%3D164602373571532%26sk%3Dmarket%23%21%2Fpages%2FEcole-de-plongee-Le-Grand-Bleu%2F164602373571532%3Fv%3Dwall&amp;width=210&amp;colorscheme=light&amp;connections=6&amp;stream=false&amp;header=true&amp;height=330" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:210px; height:330px;" allowTransparency="true"></iframe>');	with(navigator)	{		NavName = appName;		NavVer = appVersion;		NavFullName = userAgent;	}	//Popup animée pour le graphique des visites et divers autres objets	$('#graph_stats').lightBox();	if(((NavName == 'Microsoft Internet Explorer') && ((NavVer.indexOf('MSIE 8.0') != -1) || (NavVer.indexOf('MSIE 9.0') != -1))) || (NavName !== 'Microsoft Internet Explorer'))	{		//Mini-popup sur le calendrier pour avoir un résumé de l'event d'une date précise		//Utilisation de .live() pour le cas d'un rechargement dynamique du calendrier (sélection d'une autre période)		$('.CalDay').live('mouseover', function() {			//On commence par initialiser la popup			$(this).CreateBubblePopup({			position : 'right',			align	 : 'center',			innerHtml: '<img src="./img/loading.gif" style="border:0px; vertical-align:middle; margin-right:10px; display:inline;" />Chargement en cours !<br />',			innerHtmlStyle: {								color:'#000000'							},			themeName: 	'blue',			themePath: 	'./img/Frameworks/jquerybubblepopup-theme'			});			//on traite ensuite l'information liée et on affiche cela dans la popup			var button = $(this);			//la donnée de la date se trouve dans le TITLE du lien pointé			var data_selected = this.children[0].title;			var data_selected_splitted = data_selected.split('/');			var url = './cal_script.php?day='+data_selected_splitted[0]+'&month='+data_selected_splitted[1]+'&year='+data_selected_splitted[2]+'&type=3';			$.get(url, function(data)			{				button.SetBubblePopupInnerHtml(data, false);			});		});		$('.CalDay').live('mouseout', function()		{			if($(this).HasBubblePopup())			{				$(this).RemoveBubblePopup();			};		});	}	//Affichage du mini-calendrier (juste l'effet TOGGLE)	$('div.MiniCalContent').toggle("slow");	$('div.MiniCalContent').html('<br /><br /><br /><br /><br /><br /><br /><br /><br />');	$('a.MiniCal').click(function()		{			$(this).next('div.MiniCalContent').toggle("slow");			return false;		}	);});function getXhr(){    if (window.XMLHttpRequest)	{        return new XMLHttpRequest();	}     if (window.ActiveXObject)    {        var names = [            "Msxml2.XMLHTTP.6.0",            "Msxml2.XMLHTTP.3.0",            "Msxml2.XMLHTTP",            "Microsoft.XMLHTTP"        ];        for(var i in names)        {            try			{				return new ActiveXObject(names[i]);			}            catch(e){}        }    }    window.alert("Votre navigateur ne prend pas en charge l'objet XMLHTTPRequest.");    return null;}var win = null;function NewWindow(page, largeur, hauteur, scroll, retaillable, etat){	gauche = (screen.width) ? ((screen.width - largeur) / 2) : 0;	haut = (screen.height) ? ((screen.height - hauteur) / 2) : 0;	parametres = ("left=" + gauche + ",top=" + haut + ",width=" + largeur + ",height=" + hauteur + ", scrollbars=" + scroll + ",resizable=" + retaillable + ",status=" + etat)	win = window.open(page, "popup", parametres)	if(win.window.focus)	{		win.window.focus();	}}function ViewGraph(){	Dialog.alert({url: "/homes/visites.php", options: {method: 'get'}}, {width:700, height:760, okLabel: "Fermer cette fenêtre", ok:function(win) {debug("validate alert panel"); return true;}});}//affichage du calendrier pour une date précisefunction ViewCalJS(month,year,action){	var month_use = month;	var year_use = year;			if(action == "previous")	{		if(month <= 1)		{			month_use = 12;			year_use = parseInt(year)-1;		}		else		{			month_use = parseInt(month)-1;			year_use = year;		}	}	if(action == "next")	{		if(month >= 12)		{			month_use = 1;			year_use = parseInt(year)+1;		}		else		{			month_use = parseInt(month)+1;			year_use = year;		}	}		var xhr = getXhr();	xhr.onreadystatechange = function()	{		if(xhr.readyState == 4 && xhr.status == 200)		{			document.getElementById('cal_period').innerHTML=liste_mois[month_use-1]+" "+year_use;			document.getElementById('thecal').innerHTML=xhr.responseText;			document.getElementById('cal_desc').innerHTML="";			document.getElementById('month').value=month_use;			document.getElementById('year').value=year_use;		}	}	xhr.open("GET","./cal_script.php?month="+month_use+"&year="+year_use+"&type=1",true);	xhr.send(null);}//récup + affichage de la description d'une date du calendrierfunction CalMajDesc(jour,mois,annee){	var xhr = getXhr();	xhr.onreadystatechange = function()	{		if(xhr.readyState == 4 && xhr.status == 200)		{			document.getElementById('cal_desc').innerHTML="<br /><br /><strong><ins>Informations pour le "+jour+"/"+mois+"/"+annee+" :</ins></strong><br /><br />"+xhr.responseText;		}	}	xhr.open("GET","./cal_script.php?day="+jour+"&month="+mois+"&year="+annee+"&type=2",true);	xhr.send(null);}//affichage du mini-calendrierfunction ViewMiniCalJS(month,year,div_minical,div_input,action,initdate){	var xhr = getXhr();	xhr.onreadystatechange = function()	{		if(xhr.readyState == 4 && xhr.status == 200)		{			document.getElementById(div_minical).innerHTML=xhr.responseText;		}	}	xhr.open("GET","./mini_cal_script.php?init="+initdate+"&month="+month+"&year="+year+"&type=1&div="+div_minical+"&input="+div_input,true);	xhr.send(null);}function CalSetDate(date,div_input,div_minical){	document.getElementById(div_input).value = date;	//new Effect.toggle(div_minical,'blind');}function InsertChar(balise_debut,balise_fin,textarea){	//on definit les variables initiales	var texte = '';	var selection = '';	//on récupère le formulaire	var formulaire = document.getElementById(textarea);		//Cas Internet Explorer	if (document.selection)	{		//on récupère le texte sélectionné		selection = document.selection.createRange().text;		//on place le texe récupèré entre les balises		texte = balise_debut + selection + balise_fin;		//on insère le texte dans le formulaire		formulaire.focus();		sel = document.selection.createRange();		sel.text = texte;		formulaire.focus();	}	//Cas Firefox	else if (formulaire.selectionStart || formulaire.selectionStart == 0)	{		//on recupère les positions du texte		var debut = formulaire.selectionStart;		var fin = formulaire.selectionEnd;		//on recupère le contenu du formulaire		var chaine = formulaire.value;		//on recupère le texte selectionné		selection = chaine.substr(debut,fin-debut);		//on place le texe récupèré entre les balises		texte = balise_debut + selection + balise_fin;		formulaire.value = chaine.substring(0,debut) + texte + chaine.substring(fin,chaine.length);	}	else	{		formulaire.value += texte;	}}//ajout d'un lien dans un formulairefunction InsertLink(textarea){	var url = '';	var title = '';	var init_bal = '<a>';	url = prompt("Veuillez spécifier l'adresse du site :","http://");	title = prompt("Veuillez spécifier le titre du lien :", "");	if((url == '') || (url == 'http://') || (title == ""))	{		alert("Le lien n'a pas été ajouté car vous n'avez pas spécifié d'URL ou de titre !");	}	else	{		init_bal = '<a href="'+url+'" title="'+title+'">';		//Au final, on insère dans le formulaire		InsertChar(init_bal,'</a>',textarea);	}}//Déplacement des images sur la page d'accueilfunction MoveImg(x_initial,x_final,y_initial,y_final,idimg){	var newpos_x = 0;	var newpos_y = 0;		if(x_initial < x_final)	{		newpos_x = x_initial + 4;	}	else	{		newpos_x = x_initial;	}	if(y_initial > y_final)	{		newpos_y = y_initial - 4;	}	else	{		newpos_y = y_initial;	}	document.getElementById(idimg).style.left = newpos_x+"px";	document.getElementById(idimg).style.top = newpos_y+"px";	if((newpos_x < x_final) || (newpos_y > y_final))	{		window.setTimeout("MoveImg("+newpos_x+","+x_final+","+newpos_y+","+y_final+",'"+idimg+"')",15);	}}//Modification de l'image du plongeur sur la page d'accueilfunction ChangePlong(type){	if(type == 'Out')	{		document.getElementById("plongeur_img").src = "./img/plong.gif";	}	else	{		document.getElementById("plongeur_img").src = "./img/plong2.gif";	}}function UpdateClub(){	if(document.getElementById("club").checked == true)	{		document.getElementById("clubname").disabled = "";	}	else	{		document.getElementById("clubname").disabled = "disabled";		document.getElementById("clubname").value = "";	}}function UpdatePersTable(id,valeur){	if(valeur == "non")	{		document.getElementById('fede_p'+id).disabled = "disabled";		document.getElementById('lvl_p'+id).disabled = "disabled";		document.getElementById('nbr_dive_p'+id).disabled = "disabled";		document.getElementById('type_p'+id).disabled = "disabled";		document.getElementById('encadr_p'+id).disabled = "disabled";		document.getElementById('valide_p'+id).disabled = "disabled";	}	else	{		document.getElementById('fede_p'+id).disabled = "";		document.getElementById('lvl_p'+id).disabled = "";		document.getElementById('nbr_dive_p'+id).disabled = "";		document.getElementById('type_p'+id).disabled = "";		document.getElementById('encadr_p'+id).disabled = "";		document.getElementById('valide_p'+id).disabled = "";	}}
