$(document).ready(function() {
		$("#slideshow1").cycle({
			fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle,zoom, turnDown etc...
			speed: 2000, // vitesse de la transition
			timeout : 5000, // pause entre chaque anim,
			pause : 1, // stop l'animation lorsque l'on est dessus
			pager : ".nav-slideshow"
		});
		$("#slideshow2").cycle({
			fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle,zoom, turnDown etc...
			speed: 1000, // vitesse de la transition
			timeout : 2000, // pause entre chaque anim,
			pause : 0 // stop l'animation lorsque l'on est dessus
		});
		$("a[rel=seclin_photo]").fancybox({
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'titlePosition' 	: 'outside',
			'padding'			: 0,
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
	});


function getMeteo(ville,nbjour)
{

	//recuperation des info du produit pour le mois donnée en AJAX
	var xhr = null;
	 if (window.XMLHttpRequest) // Firefox et autres
	 {
	  xhr = new XMLHttpRequest();
	 }
	 else if (window.ActiveXObject) // Internet Explorer
	 {
	  try
	  {
	   xhr = new ActiveXObject("Microsoft.XMLHTTP" );
	  }
	  catch (e)
	  {
	   try
	   {
	    xhr = new ActiveXObject("Msxml2.XMLHTTP" );
	   }
	   catch (e1)
	   {
	    xhr = null;
	   }
	     }
	}
    xhr.onreadystatechange  = function()
    { 
         if(xhr.readyState  == 4)
         {
	         
              if(xhr.status  == 200) 
              {
				var rep = xhr.responseText;								
	              	if(rep.length > 0 )
	                {
	              		//document.getElementById("contenumeteo").innerHTML = rep;
	              		
	              		var browserName=navigator.appName; 
						if (browserName=="Microsoft Internet Explorer")
						{
						 	var browserVer=parseInt(navigator.appVersion); 
							if (browserVer < 7)
								imagepng();
						
						}
	          		}
	          		
              } 
         }
    }; 

   xhr.open("GET", "/meteo/meteo3.php?ville="+ville+"&nbjour="+nbjour,true);
   xhr.send(null);

}


function verifContact(form)
{
  if(!form.nom.value)
  {	alert ("Veuillez saisir votre nom.");
	form.nom.focus();
	return false;
  }
  if(!form.email.value)
  {
	 alert("Veuillez saisir votre email.");
	 form.email.focus();
	 return false;
  }
  if(form.email.value && !verifMail(form.email.value))
  {
	 alert("L'e-mail saisi n'est pas valide.");
	 form.email.focus();
	 return false;
  }
  return true;
}


function verifMail(email)
{ var b = true;
  if (!email) b = false;
  var filtre  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
  if(!filtre.test(email)) b = false;
  return b;
}	


function colorIt(obj)
{
	obj.style.backgroundColor = "C3D782";
}

function clearIt(obj)
{ 
	obj.style.backgroundColor = "";
}


function afficheCalendar(mois, annee)
{
	//recuperation des info du produit pour le mois donnée en AJAX
	var xhr = null;
	 if (window.XMLHttpRequest) // Firefox et autres
	 {
	  xhr = new XMLHttpRequest();
	 }
	 else if (window.ActiveXObject) // Internet Explorer
	 {
	  try
	  {
	   xhr = new ActiveXObject("Microsoft.XMLHTTP" );
	  }
	  catch (e)
	  {
	   try
	   {
	    xhr = new ActiveXObject("Msxml2.XMLHTTP" );
	   }
	   catch (e1)
	   {
	    xhr = null;
	   }
	     }
	}
    xhr.onreadystatechange  = function()
    { 
         if(xhr.readyState  == 4)
         {
	         
              if(xhr.status  == 200) 
              {
				var rep = xhr.responseText;								
	              	if(rep.length > 0 )
	                {
	              		document.getElementById("calendrier").innerHTML = rep;
	              		
	              		var browserName=navigator.appName; 
						if (browserName=="Microsoft Internet Explorer")
						{
						 	var browserVer=parseInt(navigator.appVersion); 

							var tab = navigator.appVersion.split(";");
							var chaine = tab[1].substring("1", "9");

							if (chaine == "MSIE 6.0")
							{
								imagepng();
							}
						}
	          		}
	          		
              } 
         }
    }; 

   xhr.open("GET", "/getCalendar.php?mois=" + mois + "&annee=" + annee,true);
   xhr.send(null);

}

function afficheActuCalendar(jour, mois, annee)
{
	//recuperation des info du produit pour le mois donnée en AJAX
	var xhr = null;
	 if (window.XMLHttpRequest) // Firefox et autres
	 {
	  xhr = new XMLHttpRequest();
	 }
	 else if (window.ActiveXObject) // Internet Explorer
	 {
	  try
	  {
	   xhr = new ActiveXObject("Microsoft.XMLHTTP" );
	  }
	  catch (e)
	  {
	   try
	   {
	    xhr = new ActiveXObject("Msxml2.XMLHTTP" );
	   }
	   catch (e1)
	   {
	    xhr = null;
	   }
	     }
	}


    xhr.onreadystatechange  = function()
    { 
         if(xhr.readyState  == 4)
         {    
              if(xhr.status  == 200) 
              {
				var rep = xhr.responseText;
				/*var reg=new RegExp("\n", "g");
				rep = rep.replace(reg,"");	
				var reg=new RegExp("\t", "g");
				rep = rep.replace(reg,"");
				var reg=new RegExp("\r", "g");
				rep = rep.replace(reg,"");*/
				
	              	if(rep.length > 0 )
	                {
	              		document.getElementById("divcalendar").innerHTML = xhr.responseText;

						document.getElementById('divcalendar').style.display ='block';
	          		}
	          		
              } 
         }
    }; 

   xhr.open("GET", "/getActuCalendar.php?jour="+jour+"&mois="+mois+"&annee="+annee,true);
   xhr.send(null);
}

function afficheResultat(idEquipe)
{
	for(i = 1 ; i < 15 ; i++)
	{
		if(document.getElementById("equipe_" + i))
			document.getElementById("equipe_" + i).style.display = "none";
	}

	document.getElementById("equipe_" + idEquipe).style.display = "block";
}

function showHide(id)
{
	var element = document.getElementById(id);
	
	if(element.style.display == "block") element.style.display = "none";
	else element.style.display = "block"
}

<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function afficheFrame()
{
	from = document.getElementById("formGoogle").from.value;
	to = document.getElementById("formGoogle").to.value;
	document.getElementById("frame").src = "/gmaps.php?from=" + from + "&to=" + to;
	document.getElementById("divframe").style.display="block";
}

function fermeFrame()
{
	document.getElementById("divframe").style.display="none";
}

function getHeure()
{
	today = new Date();
	heures = today.getHours();
	minutes = today.getMinutes();
	secondes = today.getSeconds();
	if (heures<10) heures = "0"+heures;
	if (minutes<10) minutes = "0"+minutes;
	if (secondes<10) secondes = "0"+secondes;
	chaineHeure = heures+":"+minutes+":"+secondes;
	//alert(document.getElementById('montre').innerHTML+" --- "+chaineHeure);
	document.getElementById('montre').innerHTML = chaineHeure;
	setTimeout("getHeure()",100);
}

var time;
function afficheSelectJoueur(val)
{
	if(val == 1 && document.getElementById("selectJoueur").style.display == "block")
		document.getElementById("selectJoueur").style.display = "none";
	else document.getElementById("selectJoueur").style.display = "block";

	if(time)
		clearTimeout(time);

	time = setTimeout("fermeJoueur()", 10000);
}

function afficheJoueur(valtype, nomLien)
{
	document.getElementById("selectJoueur").style.display = "none";

	document.getElementById("lienJoueur").innerHTML = nomLien;
}

function fermeJoueur()
{
	document.getElementById("selectJoueur").style.display = "none";
}
