$(function() {

    // -------------------------------------------------------------------------------------------------
    // Zooms
    (function($){
         
        $.fn.kZoom = function(){
        
            function __kzoom_exec(obj)
            {
                var href = obj.attr('href');
                var titre = obj.attr('title');
                
                if (!href)
                    return true;
                    
                var div = $("<div id='__kzoom' style='z-index:10000; overflow:hidden; display:none; position:absolute; width:100px; height:100px; border:1px solid #888; background-color:#FFF;'>");
                var left = ($(window).width() - 100) / 2;
                var top = ($(window).height() - 100) / 2;
                div.css('left', left + $(document).scrollLeft() + 'px').css('top', top + $(document).scrollTop() + 'px');
                $('body').append(div);

                var img = $("<img />").attr('src', href).ready(function() {
                
                    var html = "<div class='__kzoom'><img src='" + href + "' />";
                    if (titre)
                        html += "<h2>" + titre + "</h2>";
                    html += '</div>';
                        
                    div.html(html);
                    div.fadeIn(200, function() {

                        var width = $(this).find('img').outerWidth();
                        var height = $(this).find('.__kzoom').outerHeight();
                        
                        var left_i = ($(window).width() - width) / 2 + $(document).scrollLeft();
                        var top_i = ($(window).height() - height) / 2 + $(document).scrollTop();
                    
                        $(this).animate( { height: height + 'px', top: top_i + 'px' }, 400 )
                               .animate( { width: width + 'px', left: left_i + 'px' }, 400 );                               
                        
                        $(this).click(function() {
                        
                            $(this).fadeOut(400, function() {
                            
                                $(this).remove();
                            });
                        });
                    });
                });            
            }
        
            $(this).click(function() {

                var zthis = $(this);
                if ($('#__kzoom:visible').length > 0)
                {
                    $('#__kzoom:visible').fadeOut(500, function() {
        
                        $('#__kzoom').remove();
                        __kzoom_exec(zthis);
                    });
                }
                else
                    __kzoom_exec(zthis);           

                return false;
            });
        };
        
    })(jQuery)
    // Zooms
    // -------------------------------------------------------------------------------------------------
    
    // -------------------------------------------------------------------------------------------------
    // Lightbox
    activeLightboxAuto();
    // Lightbox
    // -------------------------------------------------------------------------------------------------

    // -------------------------------------------------------------------------------------------------
    // Effet ancres
    if ($("a[href*=#][rel!='noanim']").length) 
    {
        $("a[href*=#][rel!='noanim']").click(function() {
        
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.offset())
            {
                $('html,body').animate({ scrollTop: $target.offset().top },1000);
                return false;
            }
            return true;
        });
    }
    // Effet ancres
    // -------------------------------------------------------------------------------------------------

    // -------------------------------------------------------------------------------------------------
    // Menu lavaLamp
    $("#mh ul").lavaLamp({
    	fx: "backout",
    	speed: 500,
    	click: function(event, menuItem) {
    		$("#mh ul li").removeClass("current");
    		$(this).addClass("current");
    	}
    });
    // Menu lavaLamp
    // -------------------------------------------------------------------------------------------------
	
    // -------------------------------------------------------------------------------------------------
    // Effet logo
    $("#logo span").stop().animate({opacity: 0, left:"150px"}); // Opera Fix
	$("#logo").hover(
        function() {
    		$("#logo span").css({display:"block"});
            $(this).stop().animate({left: "30px", top: "24px" }, 150);
    		$(this).find('span').stop().animate({left:"5px", opacity: 1}, 200);
    		//$(this).stop().animate({left: "5px", top: "-3px"}, 150);
    	},
        function() {
            $(this).stop().animate({left: "25px", top: "21px"}, 150);
    		$(this).find('span').stop().animate({left:"150px", opacity: 0}, 300);
    		//$(this).stop().animate({left: "0", top: "0"}, 150);
        }            
    );
    // Effet logo
    // -------------------------------------------------------------------------------------------------
	
    // -------------------------------------------------------------------------------------------------
    // Effet Connexion client bandeau
	$("#blocconnexion").css({ right:"-50em", opacity: 0, display:"none"});
	$("#acces01").hover(
        function() {
			$('#blocconnexion').stop().fadeIn(0).animate({right:"6em", opacity: 1}, 200);
    	},
        function() {
			//$('#blocconnexionc').stop().animate({left:"50em", opacity: 0}, 300).fadeOut(0);
        }            
    );
	$("#fermerconnexion").click(
        function() {
			$('#blocconnexion').stop().animate({right:"-50em", opacity: 0}, 300).fadeOut(0);
        }            
    );
    // Effet Connexion client bandeau
    // -------------------------------------------------------------------------------------------------
	
    // -------------------------------------------------------------------------------------------------
    // Effet Full Service Menu
	$("#fullservice").css({ left:"50em", opacity: 0, display:"none"});
	$("#mh08").hover(
        function() {
			$('#fullservice').stop().fadeIn(0).animate({left:"0", opacity: 1}, 200);
    	},
        function() {
    		$('#fullservice').stop().animate({left:"50em", opacity: 0}, 300).fadeOut(0);
        }            
    );
    // Effet Full Service Menu
    // -------------------------------------------------------------------------------------------------

    // -------------------------------------------------------------------------------------------------
    // Effet news
    $("#actush").hover(
        function() {
            $(this).find('span').stop().animate({left: "3px", bottom: "-2px"}, 150);
    		//$(this).stop().animate({left: "5px", top: "-3px"}, 150);
    	},
        function() {
            $(this).find('span').stop().animate({left: "0", bottom: "0px"}, 150);
    		//$(this).stop().animate({left: "0", top: "0"}, 150);
        }
    );
    // Effet news
    // -------------------------------------------------------------------------------------------------

    // -------------------------------------------------------------------------------------------------
    // Effet galerie
    $("#galerieh a").hover(
        function() {
            $(this).find('span').stop().animate({left: "-5px"}, 150);
    		//$(this).stop().animate({left: "5px", top: "-3px"}, 150);
    	},
        function() {
            $(this).find('span').stop().animate({left: "-12px"}, 150);
    		//$(this).stop().animate({left: "0", top: "0"}, 150);
        }
    );
    // Effet galerie
    // -------------------------------------------------------------------------------------------------

    // -------------------------------------------------------------------------------------------------
    // Effet devis et Full service
    $("#devish a, #fullserviceh a").hover(
        function() {
            $(this).stop().animate({left: "5px", top: "-3px"}, 150);
    	},
        function() {
            $(this).stop().animate({left: "0", top: "0"}, 150);
        }
    );
    // Effet devis et Full service
    // -------------------------------------------------------------------------------------------------

    // ------------------------------------------------------------------------------------
	/* click zoom galerie */
		$("#galerie li a").click(function() {
									  	   
			$("#galerie li").removeClass("current");
			$(this).parent('li').addClass("current");
		});
	/* click zoom galerie */
    // ------------------------------------------------------------------------------------


    // -------------------------------------------------------------------------------------------------
    // masque / affiche la colonne
    $(".pleine a").click(function() {
        $(".pleine").fadeOut(350);
    	$(".reduire").fadeIn(350);
		$("#colonne1").hide(350);
    });
		
    $(".reduire a").click(function() {
        $(".reduire").fadeOut(350);
    	$(".pleine").fadeIn(350);
		$("#colonne1").show(350);
    });
    // masque / affiche la colonne
    // -------------------------------------------------------------------------------------------------

    // -------------------------------------------------------------------------------------------------
    // agrandie textare devis
    $("#commentaire").css({height: "15px"});
	$("#commentaire:first").click(function() {
        $(this).stop().animate({height: "100px"}, 350);
    });
    // agrandie textare devis
    // -------------------------------------------------------------------------------------------------

    // ------------------------------------------------------------------------------------
	/* click selection devis  */
		$("#listemateriels li a").click(function() {
									  	   
			$("#listemateriels li").removeClass("current");
			$(this).parent('li').addClass("current");
		});
	/* click selection devis */
    // ------------------------------------------------------------------------------------

    // -------------------------------------------------------------------------------------------------
    // Effet liste home
	$("#lh a").css({opacity: 1});
    $("#lh a").hover(
        function() {
    		$(this).stop().animate({opacity: 0.6, left: "5px"}, 150);
            $(this).find('span').stop().animate({left: "30px"}, 200);
    	},
        function() {
    	   $(this).stop().animate({opacity: 1, left: "0"}, 150);
           $(this).find('span').stop().animate({left: "28px"}, 200);
    	   //$(this).find('img').stop().animate({width: "210px"}, 150);
        }
    );
    // Effet liste home
    // -------------------------------------------------------------------------------------------------

    // -------------------------------------------------------------------------------------------------
    // Effet liste
    $(".listep .chapeau a").hover(
        function() {
    		$(this).parents('.listep').find('.imgchapeau').stop().animate({left: "10px"}, 150);
			$(this).parents('.chapeau').addClass("chapeauhover");
    	},
        function() {
    		$(this).parents('.listep').find('.imgchapeau').stop().animate({left: "0px"}, 150);
			$(this).parents('.chapeau').removeClass("chapeauhover");
        }
    );
		
    $(".listep .voir a").click(function() {
    
    	$('.listep').find('.table').removeClass("current");
    	$('.listep').find(".table[class!='current']").slideUp(300);
		$('.listep').find('.chapeau').removeClass("chapeauon");
		$(this).parents('.chapeau').addClass("chapeauon");
        var a = $(this);
    	
    	$(this).parents('.listep').find(".table").slideDown(350, function() {
        
            var top_page = $(window).scrollTop();
            var pos_bloc = a.parents('.chapeau').offset(); 
            var top_bloc = pos_bloc.top;
            var diff = top_bloc - top_page;
            $('html,body').animate({scrollTop: '+=' + diff }, 300);
        });
    	$(this).parents('.listep').find(".table").addClass("current");
    	
        $('.listep').find(".masquer[class!='current']").fadeOut(350);
    	$('.listep').find(".voir[class!='current']").fadeIn(350);
    	$(this).parents('.listep').find(".voir").fadeOut(350);
    	$(this).parents('.listep').find(".masquer").fadeIn(350);
    	$(this).parents('.listep').find(".masquer").addClass("current");
    });
		
    $(".listep .masquer a").click(function() {
            
		$(this).parents('.listep').find('.table').slideUp(350);
		$(this).parents('.listep').find('.table').removeClass("current");
		$(this).parents('.chapeau').removeClass("chapeauon");

		$(this).parents('.listep').find('.masquer').fadeOut(350);
		$(this).parents('.listep').find('.voir').fadeIn(350);
		$(this).parents('.listep').find('.masquer').removeClass("current");
    });

	// click img rajouter par flo
	$(".imgchapeau a").toggle(
        function() {
			$('.listep').find('.table').removeClass("current");
			
			$('.listep').find(".table[class!='current']").slideUp(500);
			
			$(this).parents('.listep').find(".table").slideDown(350);
			$(this).parents('.listep').find(".table").addClass("current");
			
			$('.listep').find(".masquer[class!='current']").fadeOut(350);
			$('.listep').find(".voir[class!='current']").fadeIn(350);
			$(this).parents('.listep').find(".voir").fadeOut(350);
			$(this).parents('.listep').find(".masquer").fadeIn(350);
			$(this).parents('.listep').find(".masquer").addClass("current");
    	},
        function() {
			$(this).parents('.listep').find('.table').slideUp(350);
			$(this).parents('.listep').find('.table').removeClass("current");
	
			$(this).parents('.listep').find('.masquer').fadeOut(350);
			$(this).parents('.listep').find('.voir').fadeIn(350);
			$(this).parents('.listep').find('.masquer').removeClass("current");
        }            
    );
	
	// hover td tableau rajouter par flo
	$(".table tr").hover(
        function() {
			$(this).addClass("trhover");
    	},
        function() {
			$(this).removeClass("trhover");
        }            
    );
	
	// hover td tableau rajouter par flo
	$(".table tr a").click(function() {
		$("table td").removeClass("tdhover");
		$("table tr a").removeClass("tdahover");
		
		$(this).parents('tr').find('td').addClass("tdhover");
		$(this).parents('tr').find('a').addClass("tdahover");
	});
	
	/*$("#smenu li a").click(function() {
		$("#smenu li").removeClass("current");
		$(this).parent('li').addClass("current");
	});*/

		
	
    // Effet liste
    // -------------------------------------------------------------------------------------------------

    // -------------------------------------------------------------------------------------------------
	// ColorBox
	$(".iframe").colorbox({
		width:"96%",
		height:"96%",
		iframe:true,
		opacity: 0.8,
		//slideshow:true,
		//slideshowSpeed:4000,
		//speed:800,
		
		previous : "&laquo; précédent",
		next : "suivant &raquo;",
		close : "fermer",
		slideshowStart: "démarrer le diaporama",
		slideshowStop: "arrêter le diaporama",
		current : "image {current} sur {total}"
	});
	
	$(".zoom2").colorbox({
		opacity: 0.85,
		//slideshow:true,
		transition:"elastic",

		previous : "&laquo; précédent",
		next : "suivant &raquo;",
		close : "fermer",
		slideshowStart: "démarrer le diaporama",
		slideshowStop: "arrêter le diaporama",
		current : "image {current} sur {total}"
	});
	
	$(".zoom").colorbox({
		opacity: 0.8,
		//slideshowSpeed: 4000,
		//slideshow:true,
		transition:"elastic",
		//preloading:true,
		//speed:800,

		maxWidth:"90%",
		maxHeight:"90%",

		previous : "&laquo; précédent",
		next : "suivant &raquo;",
		close : "fermer",
		slideshowStart: "démarrer le diaporama",
		slideshowStop: "arrêter le diaporama",
		current : "image {current} sur {total}"
	});
    // ColorBox
    // -------------------------------------------------------------------------------------------------
});


function activeLightboxAuto()
{
    $("a[rel='lightbox']").unbind('click');
    $("a[rel='lightbox']").click(function() {
    
        if ($('#dlb').length > 0)
            $('#dlb').dialog( "destroy" );
    
        var dlb = $("<div id='dlb' style='display:none' title=''></div>");
        $('body').append(dlb);
        
        var href = $(this).attr('href');
        href += (href.indexOf('?') > 0) ? '&ajax=1' : '?ajax=1';

        var width = $(this).attr('width') ? $(this).attr('width') : 800;
        var height = $(this).attr('height') ? $(this).attr('height') : 500;

        $('#dlb').attr('title', $(this).attr('title'));
        
        $.ajax({
            url: href,
            success: function(html) {
            
                $('#dlb').html(html);
                $('#dlb').dialog({
                    width: width,
                    height: height,
                    modal: true,
                    show: 'scale',
                    hide: 'scale'
                });
            }
        });        
        
        return false;
    });
}

/*  ------------------------------------------------*
 *			    Javascript test navigateurs         *
 *  ------------------------------------------------*/
 
// Version de navigateur
var browser = navigator.appName;
var version = parseInt(navigator.appVersion);
var version2 = navigator.appVersion;

// Javascript enable
var jvsenable = false;
if ( browser == "Microsoft Internet Explorer" && version > 3 ) jvsenable = true;
if ( browser == "Netscape" && version >= 3 ) jvsenable = true;

// print enable
var printenable = false;
if ( browser == "Microsoft Internet Explorer" && version > 3 && version2.indexOf("MSIE 4") < 0 ) printenable = true;
if ( browser == "Netscape" && version >= 3 ) printenable = true;

// detecte IE
var iedetect = true;
if ( browser == "Netscape") iedetect = false;

function SwitchImg (im,sr)
{
	if (jvsenable)
	{
		if ( document[im] != null ) document [im].src = sr;
	}
}


/*  --------------------------------------------------------------------------------------------------------------	*
 *											FONCTION AFFECTER CLASS													*
 *		<script language="JavaScript">																				*
 *		affecter_class("a01","LienMenuOn");																			*
 *		</script>																									*
 *																													*
 *		<A HREF="#" CLASS="LienMenu" ID="a01">TITRE</A>																*	
 *																													*		
 *  --------------------------------------------------------------------------------------------------------------	*/
			
		function affecter_class(obj_name,class_name)
		{
		var obj;
		
			obj = document.getElementById(obj_name);
			if (obj) 
				obj.className = class_name;
		}

/*  --------------------------------------------------------------------------------------------------------------	*
 *											FONCTION AFFECTER CLASS	POUR LISTE (01,02 etc)							*
 *																													*		
 *		affecter_class_liste('blocz',12,'blocznormal');																*
 *																													*		
 *		affecter_class_liste('id sans nombre',nombre d'objets,'style a appliquer');									*
 *																													*		
 *  --------------------------------------------------------------------------------------------------------------	*/
		function affecter_class_liste(prefixe_name, max_cpt, class_name)
		{
		var obj;
		var cpt_str;
		
			for (var i=0 ; i<=max_cpt ; i++)
			{
				if (i < 10)
					cpt_str = '0' + i;
				else
					cpt_str = i;
				obj = document.getElementById(prefixe_name + cpt_str);
				if (obj) 
					obj.className = class_name;
			}
		}

	
/*  --------------------------------------------------------------------------------------------------------------	*
 *											FONCTION AJOUTER À VOS FAVORIS											*
 *		<a href="url" title="titre"																					*
 *		onClick="javascript:bookmarksite('titre', 'url'); return(false);">											*
 *		Ajouter à vos favoris</a>																					*
 *																													*
 *  --------------------------------------------------------------------------------------------------------------	*/

function bookmarksite(title,url){
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all)// ie
		window.external.AddFavorite(url, title);
	}


	
	/*  --------------------------------------------------------------------------------------------------------------	*
 *											FONCTION AFFICHER DIV													*
 *		onclick="	javascript:showDiv('aff01');																	*
 *					javascript:hideDiv('aff02');																	*
 *					affecter_class('l01','current');																*
 *					affecter_class('l02','nor');																	*
 *																													*		
 *  --------------------------------------------------------------------------------------------------------------	*/

	function  showDiv(objid)
	{
	document.getElementById(objid).style.display="block";
	}
	function  hideDiv(objid)
	{
	document.getElementById(objid).style.display="none";
	}


/*  ----------------------------------------------------------------------------------------------------------	*
 *	popupfull																									*
 *	se redimensione par raport a l'ecran																		*
 *	<a href="xxxxx" onclick="popupfull(this.href,'popupall','yes','yes','60','80','10','40'); return(false);">	*
 *  <a href="fichier.htm" onclick="window.open(this.href);return false;">										*
 *  ----------------------------------------------------------------------------------------------------------	*/

	function popupfull(URL,FRAME,SCROLLBARS,RESIZABLE,WIDTH,HEIGHT,TOP,LEFT)
	{
		var param = "menubar=yes,location=yes,directories=yes,status=yes,toolbar=yes,scrollbars="+SCROLLBARS+",resizable="+RESIZABLE+",width="+((screen.width)-WIDTH)+",height="+((screen.height)-HEIGHT)+",top="+TOP+",left="+LEFT;
		window.open(URL,FRAME,param); 
	}


/*  ----------------------------------------------------------------------------------------------------------	*
 *	popupall																									*
 *	se redimensione par raport a l'ecran																		*
 *	<a href="xxxxx" onclick="popupall(this.href,'popupall','yes','yes','60','80','10','40'); return(false);">	*
 *  <a href="fichier.htm" onclick="window.open(this.href);return false;">										*
 *  ----------------------------------------------------------------------------------------------------------	*/

	function popupall(URL,FRAME,SCROLLBARS,RESIZABLE,WIDTH,HEIGHT,TOP,LEFT)
	{
		var param = "menubar=no,location=no,directories=no,status=yes,toolbar=no,scrollbars="+SCROLLBARS+",resizable="+RESIZABLE+",width="+((screen.width)-WIDTH)+",height="+((screen.height)-HEIGHT)+",top="+TOP+",left="+LEFT;
		window.open(URL,FRAME,param); 
	}


/*  ----------------------------------------------------------------------------------------------------------	*
 *	Popup fenêtre javascript																					*
 *	<a href="xxxxx" onclick="popupwin('xxxxx','Popupwin','yes','yes','550','370','20','40');return(false);">	*
 *	<a href="xxxxx" onclick="popupwin(this.href,'popupwin','no','yes','100','100','20','60'); return(false);">	*
 *  ----------------------------------------------------------------------------------------------------------	*/

	function popupwin(URL,FRAME,SCROLLBARS,RESIZABLE,WIDTH,HEIGHT,TOP,LEFT)
	{
		var param = "menubar=no,location=no,directories=no,status=no,toolbar=no,scrollbars="+SCROLLBARS+",resizable="+RESIZABLE+",width="+WIDTH+",height="+HEIGHT+",top="+TOP+",left="+LEFT;
		window.open(URL,FRAME,param); 
	}


/*  --------------------------------------------------------------------------------------------------------------	*
 *	retaille fenetre																								*
 *	<body onload="window.focus(); RetaillerFenetre();">																*
 *	<a href="javascript:window.close();"><IMG SRC="xxx" name="i" border=0 alt="Cliquer pour fermer la fenêtre"></a>	*
 *	valeur defaut IE : document.i.width+12,document.i.height+30														*
 *	valeur defaut FIREFOX : document.i.width+8,document.i.height+48													*
 *  --------------------------------------------------------------------------------------------------------------	*/
	

		function retaillerfenetre()
			{
				if (iedetect == true)
					window.resizeTo(document.i.width+100,document.i.height+140);
				else 
					window.resizeTo(document.i.width+100,document.i.height+140);
					
			window.focus();
			}

		



/*  -----------------------------------------------------------------*
 *			    print	<a href="javascript:imprimer();">            *
 *  -----------------------------------------------------------------*/

	// fonction print

	function imprimer()
	{

		if (printenable)
		{
			window.print();
		}
		else
		{
			alert("Votre navigateur n'est pas compatible.\nCliquez sur ok, puis faire clic droit sur la souris\nenfin cliquez sur \"Imprimer\" dans menu contextuel.\nOu Appuyez sur les touches CTRL + P sur PC.")
		}

	}


/*  -----------------------------------------------------------------*
 *			    			test email  					         *
 *  -----------------------------------------------------------------*/

	function testmail(mail)
	{
		var cpt=0;
		if( mail.length==0)
			return false;
		
		var taille=mail.length;
		
		if(mail.charAt(taille-2)!='.')
			{
			//window.alert(mail.charAt(mail.length-1));
			var pos=0;	
			for( i=0; i<mail.length; i++)
				{
				var verif=mail.charAt(i);

				if(verif=='@' && i>=1)
					{
					cpt++;
					pos=i;
					}
				//window.alert(pos);
				if(pos<=i && pos!=0)
					{
					if(verif=='.') cpt++;
					}
				}
				
			}
				
		if (cpt<2)
			return false;

		return true;
	}




/*  -----------------------------------------------------------------*
 *			    			test formulaire 				         *
 *  -----------------------------------------------------------------*/


	function testform()
	{
		var erreur="";

		if(document.getElementById('f').nom.value.length<3)
		{
			erreur+="Veuillez remplir le champ Nom / Lastname \n";
		}
		
		
		if(document.getElementById('f').tel.value.length<10)
		{
			erreur+="Veuillez remplir le champ Telephone / Phone \n";
		}/**/
		
		/*if (document.getElementById('f').fax.value.length<10)
		{	
			erreur+="Veuillez remplir le champ fax / Fax \n";
		}*/
		
		if	(!testmail(document.getElementById('f').email.value))
		{
			erreur+="Veuillez remplir le champ Email / Mail \n";
		}

		/*if(document.getElementById('f').societe.value.length<3)
		{
			erreur+="Veuillez remplir le champ Societe / Firm \n";
		}*/
		
		
		/*if(document.getElementById('f').adresse.value.length<5)
		{
			erreur+="Veuillez remplir le champ Adresse / Address \n";
		}
		
		if(document.getElementById('f').cp.value.length<5)
		{
			erreur+="Veuillez remplir le champ Code Postal / Zip \n";
		}
		
		
		if(document.getElementById('f').ville.value.length<3)
		{
			erreur+="Veuillez remplir le champ Ville / Town \n\n";
		}*/
		
		/*if((!document.getElementById('demande_gite').checked) && (!document.getElementById('demande_chambres').checked) )
		{
			erreur+="Veuillez remplir le type de demande \n\n";
		}*/		

		/* projet 

		if(document.getElementById('f').departement.value.length<3)
		{
			erreur+="Veuillez remplir le champ Département \n";
		}

		if(document.getElementById('f').ville_projet.value.length<3)
		{
			erreur+="Veuillez remplir le champ Ville de votre projet \n";
		}

		if(document.getElementById('f').altitude.value.length<3)
		{
			erreur+="Veuillez remplir le champ Altitude \n";
		}

		if(document.getElementById('f').surface.value.length<3)
		{
			erreur+="Veuillez remplir le champ Surface \n";
		}*/

		//if((!document.getElementById('demande_gite').checked) && (!document.getElementById('demande_chambres').checked) )
		//{
		//	erreur+="Veuillez remplir le type de demande \n";
		//}		


		if(erreur.length>0)
			{
			window.alert(erreur);
			return false;
			}

		return true;

	}



/*  -----------------------------------------------------------------*
 *			    			test formulaire 				         *
 *			    			Affiche le champ non remplie	         *
 *  -----------------------------------------------------------------*/
function checkInput(i,label)
{
    if (i.value=="")
        {
        i.style.border = '2px solid #E44000';
		i.style.paddingLeft = '3px';
		i.style.margin = '0px';
        return "  - " + label + "\n";
        }
    else
        i.style.border='';

    return "";
}

function reinitInput(i)
{
	i.style.border = '';
	i.style.paddingLeft = '';
	i.style.margin = '';
}

function checkFormContact(f)
{
var msg="";

    msg += checkInput(document.getElementById('f').societe,"Société");
	msg += checkInput(document.getElementById('f').nom,"Nom");
    //msg += checkInput(document.getElementById('f').prenom,"Prénom");
	//msg += checkInput(document.getElementById('f').adresse,"Adresse");
	msg += checkInput(document.getElementById('f').cp,"Code postal");
	msg += checkInput(document.getElementById('f').ville,"Ville");
    msg += checkInput(document.getElementById('f').tel,"Téléphone");
	/*checkInput(document.getElementById('f').email," ");
    if (!testmail(document.getElementById('f').email.value))
		msg += "  - " + 'Email' + "\n";*/
	//msg += checkInput(document.getElementById('f').date_naissance,"Date de naissance");
	
	/*if ( (!document.getElementById('sexe_m').checked) && (!document.getElementById('sexe_f').checked) )
	{
		msg += "  - " + 'Votre Sexe' + "\n";
	}*/
	
	/*if ( (!document.getElementById('extra_cuisine').checked) && (!document.getElementById('extra_service').checked) )
	{
		msg += "  - " + 'Extra cuisine ou salle ?' + "\n";
	}
	
	if ( (!document.getElementById('semaine').checked) && (!document.getElementById('week-end').checked) )
	{
		msg += "  - " + 'Semaine ou Week end' + "\n";
	}*/
	

    if (msg != "")
    {
        alert("Merci de remplir les champs suivants \n"+msg);
        return false;
    }

    return true;
}


/*function inputChiffres(id)
{
	$('#' + id).keyup(function(e) {
				
		var reg = new RegExp("[^0-9]");		
		$('#' + id).val($('#' + id).val().replace(reg, ''));
	});
}*/



