function affiche(item, val){ 
	for (var v=0;v<val;v++)
	{
		document.getElementById("big-cat"+v).style.display = "none";
	}
	if (document.getElementById(item).style.display == "none"){ 
	  document.getElementById(item).style.display = "block";
	} 
	else{ 
	  document.getElementById(item).style.display = "none";
	} 
	
}

function cache(item){ 
	document.getElementById(item).style.display = "none";
}

function switchImage(imgName, imgSrc )
{
	if (document.images){
		if (imgSrc != "none"){
			document.images[imgName].src = imgSrc;
		}
	}
}

function go(User){
  window.location.href="mailto:" + User + "@deleage.com";
}

function validate(){
  if (document.getElementById("societe").value.length == 0) {
    alert("Veuillez indiquer votre Société"); 
    return false; 
  }
  
  if (document.getElementById("nom").value.length == 0) {
    alert("Veuillez indiquer votre Nom"); 
    return false; 
  }

  if (document.getElementById("telephone").value.length == 0) {
    alert("Veuillez indiquer votre N° de téléphone"); 
    return false; 
  }

  adresse = document.getElementById("email").value;
  var place = adresse.indexOf("@",1);
  var point = adresse.indexOf(".",place+1);
  if ((place > -1)&&(adresse.length >2)&&(point > 1)){
    return true;
  }
  else{
    alert('Merci de rentrer une adresse Email valide');
    return false;
  }
}

function popup(video,l,h,opts) {
  var top=(screen.height-h)/2;
  var left=(screen.width-l)/2;
  l = l+10;
  h = h+10;
  html = '<html><head><title>Visite virtuelle</title></head><body style="margin:0"><center><a href="#" onClick="window.close()"><embed src="'+video+'" width="720" height="495" controller="true"></a></center><p style="text-align:center;font-family:arial;color:#660099;font-weight:bold;font-size:11px;margin:10px 0;padding:0;">Faites glisser le curseur de la souris pour changer l\'angle de vue</p></body></html>';
  popupImage = window.open('','_blank','top='+top+',left='+left+',width='+l+',height='+h+',toolbar=0,location=0,directories=0,menuBar=0,'+opts);
  popupImage.document.open();
  popupImage.document.write(html);
  popupImage.document.close();
}
