
function form_rech(vis0, vis1)
{
	document.getElementById("formHotel").style.display=vis0;
	document.getElementById("formMeuble").style.display=vis1;
}

function form_rech_meubles(vis0, vis1)
{
	document.getElementById("formMeuble").style.display=vis0;
	document.getElementById("formHotel").style.display=vis1;
}


function Style(numstyle){
	if(numstyle==1){
		document.getElementById("form-hotel").style.backgroundImage = 'url("http://www.bayonne-tourisme.com/fileadmin/templates/images/fond-form.jpg")';
	}

	else if(numstyle==2){
		document.getElementById("form-hotel").style.backgroundImage = 'url("http://www.bayonne-tourisme.com/fileadmin/templates/images/fond-form-m.jpg")';
	}
}
function Style_meubles(numstyle){
	if(numstyle==1){
		document.getElementById("form-hotel").style.backgroundImage = 'url("http://www.bayonne-tourisme.com/fileadmin/templates/images/fond-form.jpg")';
	}

	else if(numstyle==2){
		document.getElementById("form-hotel").style.backgroundImage = 'url("http://www.bayonne-tourisme.com/fileadmin/templates/images/fond-form-m.jpg")';
	}
}



function favoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel("Office de Tourisme de Bayonne","http://www.bayonne-tourisme.com/",""); }
else { window.external.AddFavorite("http://www.bayonne-tourisme.com/","Office de Tourisme de Bayonne"); } }





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 controleForm()
{
alert("on est dans la fonction");
	var blnOK=true;
	
	if((document.getElementById('type_broch1').checked == false) && (document.getElementById('type_broch2').checked == false) && (document.getElementById('type_broch3').checked == false) && (document.getElementById('type_broch4').checked == false) && (document.getElementById('type_broch5').checked == false))
	{
		blnOK = false;
		alert('Merci de choisir au moins une brochure');
		document.getElementById('type_broch1').focus();
		return 0;
	}

	if (!document.envoi_brochure.envoi_ligne.checked && !document.envoi_brochure.envoi_courrier.checked)
	{
		blnOK = false;
		alert('Vous devez indiquer le type envoi');
		document.envoi_brochure.envoi_ligne.focus();
		return 0;
	}
	
	if(document.envoi_brochure.nom.value=='')
	{
		blnOK = false;
		alert('Vous devez indiquer votre nom');
		document.envoi_brochure.nom.focus();
		return 0;
	}
	if(document.envoi_brochure.prenom.value=='') 
	{
		blnOK = false;
		alert('Vous devez indiquer votre prénom');
		document.envoi_brochure.prenom.focus();
		return 0;
	}
	
	if(document.envoi_brochure.adresse.value=='')
	{
		blnOK = false;
		alert('Vous devez indiquer votre adresse');
		document.envoi_brochure.adresse.focus();
		return 0;		
	}
	
	if(document.envoi_brochure.cpostal.value=='')
	{
		blnOK = false;
		alert('Vous devez indiquer votre code postal');
		document.envoi_brochure.cpostal.focus();
		return 0;
		
	}
	
	if(document.envoi_brochure.ville.value=='')
	{
		blnOK = false;
		alert('Vous devez indiquer votre ville');
		document.envoi_brochure.ville.focus();
		return 0;

	}
	
	if(document.envoi_brochure.pays.value=='')
	{
		blnOK = false;
		alert('Vous devez indiquer le pays');
		document.envoi_brochure.pays.focus();
		return 0;
	}
	
	if(document.envoi_brochure.email.value=='') 
	{
		blnOK = false;
		alert('Vous devez indiquer votre e-mail');
		document.envoi_brochure.email.focus();
		return 0;
	}
	
	if (document.envoi_brochure.email.value.indexOf("@")==-1)
	{
		blnOK = false;
		alert('Votre email ne semble pas valide');
		document.envoi_brochure.email.focus();
		return 0;
	}
	
	if(document.envoi_brochure.periode.value=='')
	{
		blnOK = false;
		alert('Vous devez indiquer les périodes de votre séjour');
		document.envoi_brochure.periode.focus();
		return 0;
	}
	
	if (blnOK==true)
	{
		document.envoi_brochure.method = "POST";
		document.envoi_brochure.action = "/brochures/index.html";
		document.envoi_brochure.submit();
		alert (rech);
	}
}*/
//permet de savoir si un champ est EMPTY
function IsEmpty(sValue){
	if (sValue != null){
		if (sValue != ""){
			return false;
		}
	}
	
	return true;
}
//teste le mail
function isEmailValid(val) {
	   var accepted = true;
	   var chaine = new String(val);
	   if (((chaine.indexOf("@") < 0) || (chaine.indexOf(".") < 0))|| chaine == ""){
	    	accepted = false;
	   }
	   return(accepted);
	}
	
//permet de cacher ou afficher une division en particulier
function ShowElem(idelem)
	{ document.getElementById(idelem).style.display='block'; }

function HideElem(idelem)
	{ document.getElementById(idelem).style.display='none'; }
	
function Hide_and_Show(idelem_1,idelem_2){ 
	document.getElementById(idelem_1).style.display='none';
	document.getElementById(idelem_2).style.display='block'; 
}



//fonction de controle des champs
function champs_valid(){
	var blnOK=true;
	
	thisForm=document.forms.envoi_brochure;
	
	if((document.getElementById('type_broch1').checked == false) && (document.getElementById('type_broch2').checked == false) && (document.getElementById('type_broch3').checked == false) && (document.getElementById('type_broch4').checked == false) && (document.getElementById('type_broch5').checked == false))
	{
		blnOK = false;
		alert('Merci de choisir au moins une brochure');
		document.getElementById('type_broch1').focus();
		return 0;
	}
	
	if (IsEmpty(thisForm.nom.value)) {
		blnOK=false;
		alert("Merci de renseigner le champ NOM.");
		thisForm.nom.focus();
		return false;
	}
	if (IsEmpty(thisForm.nom.value)) {
		blnOK=false;
		alert("Merci de renseigner le champ NOM.");
		thisForm.nom.focus();
		return false;
	}
	if (IsEmpty(thisForm.prenom.value)) {
		blnOK=false;
		alert("Merci de renseigner le champ PRENOM.");
		thisForm.prenom.focus();
		return false;
	}
	if (IsEmpty(thisForm.adresse.value)) {
		blnOK=false;
		alert("Merci de renseigner le champ ADRESSE.");
		thisForm.adresse.focus();
		return false;
	}
	if (IsEmpty(thisForm.cpostal.value)) {
		blnOK=false;
		alert("Merci de renseigner le champ CODE POSTAL.");
		thisForm.cpostal.focus();
		return false;
	}
	if (IsEmpty(thisForm.ville.value)) {
		blnOK=false;
		alert("Merci de renseigner le champ VILLE.");
		thisForm.ville.focus();
		return false;
	}
	if (IsEmpty(thisForm.pays.value)) {
		blnOK=false;
		alert("Merci de renseigner le champ PAYS.");
		thisForm.pays.focus();
		return false;
	}
	if (IsEmpty(thisForm.email.value)) {
		blnOK=false;
		alert("Merci de renseigner le champ E-MAIL.");
		thisForm.email.focus();
		return false;
	} else if (!isEmailValid(thisForm.email.value)) {
			blnOK=false;
			alert("L'adresse E-MAIL saisie est incorrecte.");
			thisForm.email.focus();
			return false;
		}
		
	
	if (blnOK==true)
	{
		//alert("form OK --> debut traitement");
		document.envoi_brochure.method = "POST";
		document.envoi_brochure.action = "brochures/index.html";
		document.envoi_brochure.submit();
		//alert (rech);
	}
}

function brochure_en_ligne(){

	/*document.envoi_brochure.method = "POST";
	document.envoi_brochure.action = "index.php?id=223";
	document.envoi_brochure.submit();*/
	window.location.href="http://www.bayonne-tourisme.com/brochures/telechargement/index.html";
}

function controleServ()
{
	var blnOK=true;
	
	if(document.contact_service.email.value=='') 
	{
		blnOK = false;
		alert('Vous devez indiquer votre e-mail');
		document.contact_service.email.focus();
		return 0;
	}
	
	if (document.contact_service.email.value.indexOf("@")==-1)
	{
		blnOK = false;
		alert('Votre email ne semble pas valide');
		document.contact_service.email.focus();
		return 0;
	}
	
	if(document.contact_service.objet.value=='')
	{
		blnOK = false;
		alert('Veuillez indiquer l\'objet de votre message');
		document.contact_service.objet.focus();
		return 0;
	}
	
	if (blnOK==true)
	{
		alert(document.contact_service.email.value+" "+document.contact_service.objet.value+" "+document.contact_service.contact.value);
		document.contact_service.method = "GET";
		//document.contact_service.action = "http://www.novaewebserver.com/contact/envoi/index.html?email=+document.contact_service.email.value+&mail_contact=+document.contact_service.contact.value+&objet=+document.contact_service.objet.value+&comment=+document.contact_service.comment.value";
		//document.contact_service.action = "http://www.novaewebserver.com/contact/envoi/index.html?mail_contact=+document.contact_service.contact.value

//document.contact_service.action = "http://www.pays-de-saint-jean-de-luz.com/fileadmin/templates/ext/envoi_mail.php";
		document.contact_service.submit();
	}
}
