isIE = (document.all);
function searchText(form, texte, cible){
	for (var i = 0; i < form.elements.length; i++) {
		if (form.elements[i].name == "textToSearch") {
			alert(form.elements[i].value);
		}
	}
}

function montrer(id1) {
	divID1 = document.getElementById(id1);
	divID1.style.display = "block";
}

function cacher (id1) {
	divID1 = document.getElementById(id1);
		divID1.style.display = "none";
}
////POP UP///
function openPopUp(url,ext,width,height)
{
		window.open(url + ext, 'lespiedsdansleplat', 'resizable=no, location=no,' +'width='+width +',height='+height +', menubar=no, status=no, scrollbars=no, menubar=no');
	}
////FAVORIS
	function bookmarksite(title, url){ 
if (document.all) 
window.external.AddFavorite(url, title); 
else if (window.sidebar) 
window.sidebar.addPanel(title, url, "") 
}

//HP chargement image au hasard
//
// creation d'un tableau avec la liste des images
	var myImages = new Array("http://www.lespiedsdansleplat.com/images/index/1.jpg", "http://www.lespiedsdansleplat.com/images/index/2.jpg", "http://www.lespiedsdansleplat.com/images/index/3.jpg", "http://www.lespiedsdansleplat.com/images/index/4.jpg", "http://www.lespiedsdansleplat.com/images/index/6.jpg", "http://www.lespiedsdansleplat.com/images/index/7.jpg", "http://www.lespiedsdansleplat.com/images/index/8.jpg");

// generation image au hasard
function imgHasard()
	{
	var choix = Math.round(Math.random()*7);//genere un chiffre au hasard entre 0 et 5
	document.images["img1"].src = myImages[choix];
	}
//ecriture de l'image dans la page
/*var appImgHasard = '';
appImgHasard += '<img src=\"\" name=\"img1\" border="\0\" />';
document.write (appImgHasard);*/

/* détection téléphone mobile */
function detectDevice(user_agent)
{
   if (!mobile_base_url)
   {
      mobile_base_url = 'http://www.lespiedsdansleplat.com/mobile'
   }

   var url_mobile = mobile_base_url;
   var html_1 = 'Version mobile pour ';
   var html_2 = '<br><a href="'+url_mobile+'">lespiedsdansleplat.com/mobile</a>';

   // Liste des supports mobiles
   var device = new Array(
                  "Android",
                  "Blackberry",
                  "Blazer",
                  "Handspring",
                  "iPhone",
                  "iPod",
                  "Kyocera",
                  "LG",
                  "Motorola",
                  "Nokia",
                  "Palm",
                  "PlayStation Portable",
                  "Samsung",
                  "Smartphone",
                  "SonyEricsson",
                  "Symbian",
                  "WAP",
                  "Windows CE"
                );

   var max_device = device.length;

   for(i=0 ; i<max_device ; i++)
   {
      if(user_agent.indexOf(device[i]) != -1)
      {
         if (device[i] == "iPhone")
         {
            document.getElementById('annonce_site_mobile').innerHTML = html_1 + 'l\'Iphone' + html_2;
            document.getElementById('annonce_site_mobile').style.display = 'block';
         }
         else if (device[i] == "iPod")
         {
            document.getElementById('annonce_site_mobile').innerHTML = html_1 + 'l\'iPod Touch' + html_2;
            document.getElementById('annonce_site_mobile').style.display = 'block';
         }
         else if (device[i] == "Android")
         {
            document.getElementById('annonce_site_mobile').innerHTML = html_1 + 'Android' + html_2;
            document.getElementById('annonce_site_mobile').style.display = 'block';
         }
         else
         {
            document.location = url_mobile;
         }
         return;
      }
   }
}
function limiteur() { 
		maximum = 400;
		champ = document.formulaire.avis;
		indic = document.formulaire.indicateur;
		if (champ.value.length > maximum)
		champ.value = champ.value.substring(0, maximum);
		else 
		indic.value = maximum - champ.value.length;
		}

