// JavaScript Document

//_________________________ POPUP IMAGES ___________________________________
function popup_image(id,categorie,dossier){
		window.open("html/popup.php?id_image=" + id + "&page=" + categorie + "&dossier=" + dossier,"","width=400, height=400, location=no");
	}
	
//_________________________ POPUP LABORATOIRE MERIGNAC ___________________________________
function popup_labo_merignac(){
		window.open("html/popup_labo_merignac.html","","width=680, height=600, location=no");
	}

function popup_labo_merignac2(){
		window.open("html/popup_labo_merignac2.html","","width=680, height=600, location=no");
	}
	
//_________________________ POPUP LABORATOIRE GRADIGNAN ___________________________________
function popup_labo_gradignan(){
		window.open("html/popup_labo_gradignan.html","","width=680, height=600, location=no");
	}
function popup_labo_gradignan2(){
		window.open("html/popup_labo_gradignan2.html","","width=680, height=600, location=no");
	}
	
//_________________________ POPUP LABORATOIRE VILLENAVE D'ORNON ___________________________________
function popup_labo_villenave(){
		window.open("html/popup_labo_villenave.html","","width=680, height=600, location=no");
	}
	
function popup_labo_villenave2(){
		window.open("html/popup_labo_villenave2.html","","width=680, height=600, location=no");
	}
	
//_________________________ POPUP LABORATOIRE BLANQUEFORT ___________________________________
function popup_labo_blanquefort(){
		window.open("html/popup_labo_blanquefort.html","","width=680, height=600, location=no");
	}
function popup_labo_blanquefort2(){
		window.open("html/popup_labo_blanquefort2.html","","width=680, height=600, location=no");
	}
	
//_________________________ POPUP LABORATOIRE SAINT-MEDARD-EN-JALLES ___________________________________
function popup_labo_stmedard(){
		window.open("html/popup_labo_st_medard.html","","width=680, height=600, location=no");
	}
function popup_labo_stmedard2(){
		window.open("html/popup_labo_st_medard2.html","","width=680, height=600, location=no");
	}
function popup_labo_stmedard3(){
		window.open("html/popup_labo_st_medard3.html","","width=680, height=600, location=no");
	}
	
//_________________________ POPUP INFOS LEGALES ___________________________________
function infos_legales(){
		window.open("html/infos_legales.html","","width=400, height=400, location=no");
	}
	
	
//_________________________ PAGE Actualites _______________________________________
function verif_liste_actualites(){
	if (document.getElementById("liste_actualites").value == 'aucune') {
			window.alert('Veuillez choisir un article dans la liste')
		}
	else{
		document.getElementById("recherche_actualites_medicales").method="POST";
		document.getElementById("recherche_actualites_medicales").action="actualites-audioprothesiste.html";
		document.getElementById("recherche_actualites_medicales").submit();
	}
}
//_________________________ PAGE Aces ORL _______________________________________
function verif_liste_orl(){
	if (document.getElementById("liste_orl").value == 'aucune') {
			window.alert('Veuillez choisir un article dans la liste')
		}
	else{
		document.getElementById("recherche_actulites_orl").method="POST";
		document.getElementById("recherche_actulites_orl").action="acces-orl.html";
		document.getElementById("recherche_actulites_orl").submit();
	}
}
//_________________________ PAGE CONTACT ____________________________________

function verif_contact(){
		bt_radio = 0;
		for(i=1; i<7; i++){
			
			if(document.getElementById(i).checked == false){
				bt_radio ++;
			}
		}

		if ((document.getElementById("ch_nom").value.length<3)||(document.getElementById("ch_nom").value==' ')) {
			window.alert('Il y a une erreur dans le champ Nom')
		}
		else if ((document.getElementById("ch_prenom").value.length<3)||(document.getElementById("ch_prenom").value==' ')){
			window.alert('Il y a une erreur dans le champ Prenom')
		}
		else if ((document.getElementById("ch_email").value.indexOf('.')==-1)||(document.getElementById("ch_email").value.indexOf('@')==-1)) {
			window.alert('Il y a une erreur dans le champ E-mail')
		}
		else if ((document.getElementById("ch_titre").value.length<3)||(document.getElementById("ch_titre").value==' ')){
			window.alert('Il y a une erreur dans le champ Titre')
		}
		else if ((document.getElementById("ch_message").value.length<10)||(document.getElementById("ch_message").value==' ')) {
			window.alert('Veuillez ecrire un message plus long')
		}
		/*else if(bt_radio != 5){
			window.alert('Vous n\'avez pas choisi de destinataire')
		}*/
		
		else document.getElementById("form_contact").submit()
	}

function icon_contact(){
 		for(i=1; i<7; i++){
			for(j=1; j<7; j++){
				if(document.getElementById(i).checked){
					document.getElementById('contact_'+i).style.visibility='visible';
					if(j != i) document.getElementById('contact_'+j).style.visibility='hidden';
			}
		}
	}
}
//_________________________ FONCTION FAVORIS _________________________________

function ajout_favoris() {
  if(navigator.appName != 'Microsoft Internet Explorer' ){
    window.sidebar.addPanel("Audio Conseil - Laboratoire d'audition sur Bordeaux - Audioprothésiste","http://www.audioconseil.fr/","");
  }
  else{
    window.external.AddFavorite("http://www.audioconseil.fr/","Audio Conseil - Laboratoire d'audition sur Bordeaux - Audioprothésiste");
  }
}
   