	function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
	}

// Anti-mail non prévu.
// Usage : NoMail( 'fin DNS', 'compte', 'début DNS', 'title du lien' );
function NoMail( s1, s2, s3, title )
{
	document.write( "<a title='" + title + "' href='mailto:" + s2 + "@" + s3 + s1 + "'>" + s2 + "@" + s3 + s1 + "</a>" );
}

// Dessine un flash (correctif pour IE, afin d'éviter le cadre clignotant désagréable)
function draw_flash( name, width, height )
{
	document.write( "<object type=\"application/x-shockwave-flash\" data=\"" + name + "\" style=\"width: " + width + "px; height: " + height + "px\">" );
	document.write( "<param name=\"movie\" value=\"" + name + "\">" );
	document.write( "<param name=\"quality\" value=\"high\">" );
	document.write( "<param name=\"menu\" value=\"false\">" );
	document.write( "</object>" );
}
  
function fixPNG() {
	if(navigator.appName == 'Microsoft Internet Explorer') {
		var png = /\.png$/;
		var imgs = document.getElementsByTagName("img");
		for(var i = 0 ; i < imgs.length; i++) {
			if(imgs.item(i).src.indexOf(".png")>0) {
				imgs.item(i).style.width = imgs.item(i).offsetWidth;
				imgs.item(i).style.height = imgs.item(i).offsetHeight;
				imgs.item(i).style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + imgs.item(i).src + '\',sizingMethod=\'image\')';
				imgs.item(i).src = '/img/pix.gif';
			}
		}
	}
}

function favoris(url,titre) {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel(titre,url,""); }
else { window.external.AddFavorite(url,titre); } }


function CalculDiv()
   {
	EcranLarg = document.body.clientWidth;
	
	tmp = parseInt((EcranLarg - 1000 ) / 2);
	
	if( tmp == 0 )
	{
		document.getElementById("FleurG").style.display ='none';
		document.getElementById("FleurD").style.display ='none';
	}
	
	document.getElementById("ColGauche").style.width  = tmp +"px";
	document.getElementById("ColDroite").style.width  = tmp +"px";
	
	document.getElementById("FleurG").style.left  = parseInt(tmp-236) +"px";
	document.getElementById("FleurD").style.right  = parseInt(tmp - 280) +"px";
   }


function JSReplace(inStr, inReplace){
while(inStr.indexOf(inReplace) > 0){
inStr = inStr.replace(inReplace);
};
};

var old = -1;
function AfficheSsM(id)
{
	if ( old != "-1"){
		document.getElementById("SsM"+old).style.display = 'none';	
	}
	document.getElementById("SsM"+id).style.display = 'block';	
	old = id;
}



	var map = null;
	var geocoder = null;
	var zoom = 10;
	
	var tableauIcones = [];
    function load() {
        if (GBrowserIsCompatible()) {
	
		
        map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(48.1117611,-1.6802654), zoom );
    
		map.addControl(new GMapTypeControl());
			
		geocoder = new GClientGeocoder();   
			
		GDownloadUrl("/donnees.asp", function(data) {
        var xml = GXml.parse(data);
        var markers = xml.documentElement.getElementsByTagName("marker");
        for (var i = 0; i < markers.length; i++) {
			var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng")), 9);
			var marker = creerMarker(point,markers[i].getAttribute("titre"), markers[i].getAttribute("info"),markers[i].getAttribute("categorie"),markers[i].getAttribute("lien"),markers[i].getAttribute("photo") );
            map.addOverlay(marker);
           }
         });     
        }
    }
    
    function creerMarker(point, nom, html,categorie,lien,photo ) {
	   var marker = new GMarker(point,tableauIcones[categorie]);
       var infoTabs = [new GInfoWindowTab("Infos",nom+html+photo)];
      
		GEvent.addListener(marker, "click", function() 
		{
			window.location.href=lien;
		});

         
       return marker;
       }    
       
function changeGde(elt,Photo,id,Link)
{	
	oldPhoto = document.getElementById("PhotoGde"+id).src;
	oldTitle = document.getElementById("LinkGde"+id).title;

	document.getElementById("LinkGde"+id).title = document.getElementById(Link).title;
	oldPhoto = oldPhoto.replace("?w=393&h=294","");
	elt.src = oldPhoto +"?w=184&h=137";
	
	Photo = Photo.replace("?w=184&h=137","");
	document.getElementById("PhotoGde"+id).src = Photo+"?w=393&h=294";
	document.getElementById(Link).title = oldTitle;
	
} 


	
function loadingJS()
{
	$(".telephone").keypress(function(e){ 			
		errorField = "#Error"+$(this).attr("name");			
			if( e.which!=8  && e.which!=118 &&  e.which!=99 && e.which!=0 && (e.which<48 || e.which>57))
		{$(errorField).html("Caractères non valides").show().delay(1200).fadeOut(1000);
			return false;
		}
		value = $(this).attr("value"); 
		if( value.length<14 || e.which==8 || e.which==0 )
		{
			if( (value.length == 2 || value.length == 5 || value.length == 8 || value.length == 11 ) && e.which!=8 && e.which!=0 && e.which!=118 &&  e.which!=99  )
			{
				$(this).attr("value", value+" ");
			}
		}
		else
			return false;	
	});	
	
	
	var ctrlDown = false;
    var ctrlKey = 17, vKey = 86, cKey = 67;

    var ctrlDown = false;
    var ctrlKey = 17, vKey = 86, cKey = 67;

    $(document).keydown(function(e)
    {
        if (e.keyCode == ctrlKey) ctrlDown = true;
    }).keyup(function(e)
    {
        if (e.keyCode == ctrlKey) ctrlDown = false;
    });

    $(".no-copy-paste").keydown(function(e)
    {	
		
        if (ctrlDown && (e.keyCode == vKey || e.keyCode == cKey)){ alert("Copier-coller non autorisé pour ce champ"); ctrlDown = false;return false;}
    });	
    $('#Flash').cycle({ 
    	fx:    'fade',
    	timeout: 3000 
    });	
    $('.FlashP').cycle({ 
    	fx:    'fade',
    	timeout: 3000 
    });	 
    $('.Flash2').cycle({ 
    	fx:    'fade',
    	timeout: 3000 
    });
    
    $('.MoveLeft').cycle({ 
    	fx:    'scrollLeft',
    	timeout: 3000 
    });
    
     $('#Supper').click(function(){ 
		 $('#Supper').fadeOut(500).hide('slow');
	});
    
    $('.ResultatsVille').mouseleave(function(){ 
    	$('.ResultatsVille').fadeOut(500).hide('slow');
    });    
    
   $(".bienlist .supp .photo").cycle({ fx:  'fade', timeout: 1, speed:800}).cycle('pause');	
   $(".bienlist .supp .photo").mouseenter(function(){
		$(this).cycle('resume');	
    });       
    $(".bienlist .supp .photo").mouseleave(function(){ $(this).cycle('pause') });
    
    $(".bienlist2 .supp .photo").cycle({ fx:  'fade', timeout: 1, speed:800}).cycle('pause');	
	$(".bienlist2 .supp .photo").mouseenter(function(){
		$(this).cycle('resume');	
    });       
    $(".bienlist2 .supp .photo").mouseleave(function(){ $(this).cycle('pause') });
    
    $(".bienlist3 .supp .photo").cycle({ fx:  'fade', timeout: 1, speed:1000}).cycle('pause');	
	 $(".bienlist3 .supp .photo").mouseenter(function(){
		$(this).cycle('resume');	
    });       
    $(".bienlist3 .supp .photo").mouseleave(function(){ $(this).cycle('pause') });
    
    var open = false;
    $(".bienlist .actions .preview").mouseover(function(){
		$(this).addClass("selected");
		
		$(this).parent().parent().find("div.overlay").slideUp('low').hide();
		$(this).parent().parent().find("div.infos").slideDown('low').show();
		$(this).parent().parent().find("div.infos").css("left",$(this).parent().parent().position().left).css("top",$(this).parent().parent().position().top+$(this).parent().parent().height()+25);	
		$(".bienlist .actions").hover(function() {}, function(){       
			$(this).parent().parent().find("div.overlay").slideUp('low').hide();
			$(this).find("a.preview").removeClass("selected"); //When the mouse hovers out of the subnav, move it back up
		});		
    });    
    $(".bienlist .actions .preview").click(function(){
		$(this).addClass("selected");
		$(this).parent().parent().find("div.overlay").slideUp('low').hide();
		$(this).parent().parent().find("div.infos").slideDown('low').show();
		$(this).parent().parent().find("div.infos").css("left",$(this).parent().parent().position().left).css("top",$(this).parent().parent().position().top+$(this).parent().parent().height()+25);	
		$(".bienlist .actions").hover(function() {}, function(){       
			$(this).parent().parent().find("div.overlay").slideUp('low').hide();
			$(this).find("a.preview").removeClass("selected"); //When the mouse hovers out of the subnav, move it back up
		});	
		return false;	
    });    
    $(".bienlist .actions a.contact").mouseover(function(){
		$(this).addClass("selected");
		$(this).parent().parent().find("div.overlay").slideUp('low').hide();
		$(this).parent().parent().find("div.contact").slideDown('low').show();
		$(this).parent().parent().find("div.contact").css("left",$(this).parent().parent().position().left).css("top",$(this).parent().parent().position().top+$(this).parent().parent().height()+25);	
		$(".bienlist .actions").hover(function() {}, function(){       
			$(this).parent().parent().find("div.overlay").slideUp('low').hide();
			$(this).find("a.contact").removeClass("selected"); //When the mouse hovers out of the subnav, move it back up
		});
    });
    $(".bienlist .actions a.contact").click(function(){
		$(this).addClass("selected");
		$(this).parent().parent().find("div.overlay").slideUp('low').hide();
		$(this).parent().parent().find("div.contact").slideDown('low').show();
		$(this).parent().parent().find("div.contact").css("left",$(this).parent().parent().position().left).css("top",$(this).parent().parent().position().top+$(this).parent().parent().height()+25);	
		$(".bienlist .actions").hover(function() {}, function(){       
			$(this).parent().parent().find("div.overlay").slideUp('low').hide();
			$(this).find("a.contact").removeClass("selected"); //When the mouse hovers out of the subnav, move it back up
		});
		return false;
    });
    $(".bienlist2 .actions .preview").mouseover(function(){
		$(this).addClass("selected");
		$(this).parent().parent().find("div.overlay").slideUp('low').hide();
		$(this).parent().parent().find("div.infos").slideDown('low').show();
		$(this).parent().parent().find("div.infos").css("left",$(this).parent().parent().position().left).css("top",$(this).parent().parent().position().top+$(this).parent().parent().height()+18);	

		$(".bienlist2 .actions").hover(function() {}, function(){       
		$(this).parent().parent().find("div.infos").slideUp('low').hide();
		$(this).find("a.preview").removeClass("selected"); //When the mouse hovers out of the subnav, move it back up
		});		
    });    
     $(".bienlist2 .actions .preview").click(function(){
		$(this).addClass("selected");
		$(this).parent().parent().find("div.overlay").slideUp('low').hide();
		$(this).parent().parent().find("div.infos").slideDown('low').show();
		$(this).parent().parent().find("div.infos").css("left",$(this).parent().parent().position().left).css("top",$(this).parent().parent().position().top+$(this).parent().parent().height()+18);	

		$(".bienlist2 .actions").hover(function() {}, function(){       
		$(this).parent().parent().find("div.infos").slideUp('low').hide();
		$(this).find("a.preview").removeClass("selected"); //When the mouse hovers out of the subnav, move it back up
		});		
		return false;
    });    
     
     $(".bienlist2 .actions a.contact").mouseover(function(){
		$(this).addClass("selected");
		$(this).parent().parent().find("div.overlay").slideUp('low').hide();
		$(this).parent().parent().find("div.contact").slideDown('low').show();
		$(this).parent().parent().find("div.contact").css("left",$(this).parent().parent().position().left).css("top",$(this).parent().parent().position().top+$(this).parent().parent().height()+18);	
		$(".bienlist2 .actions").hover(function() {}, function(){       
			$(this).parent().parent().find("div.overlay").slideUp('low').hide();
			$(this).find("a.contact").removeClass("selected"); //When the mouse hovers out of the subnav, move it back up
		});
    });
    $(".bienlist2 .actions a.contact").click(function(){
		$(this).addClass("selected");
		$(this).parent().parent().find("div.overlay").slideUp('low').hide();
		$(this).parent().parent().find("div.contact").slideDown('low').show();
		$(this).parent().parent().find("div.contact").css("left",$(this).parent().parent().position().left).css("top",$(this).parent().parent().position().top+$(this).parent().parent().height()+18);	
		$(".bienlist2 .actions").hover(function() {}, function(){       
			$(this).parent().parent().find("div.overlay").slideUp('low').hide();
			$(this).find("a.contact").removeClass("selected"); //When the mouse hovers out of the subnav, move it back up
		});
		return false;
    });
    $("div.newSearch").mouseover(function(){
		$("#MenuInt").slideDown('low').show();
     });  
     $("div.newSearch").mouseleave(function(){
		$("#MenuInt").slideDown('low').hide();
     });
     
     $("a.morePhotos").mouseover(function(e){
		$("#TexteCompte").slideDown('low').show();
     });    
     $("a.morePhotos").mouseleave(function(){
		$("#TexteCompte").slideDown('low').hide();
     }); 
      $("#TexteCompte").mouseleave(function(){
		$("#TexteCompte").slideDown('low').hide();
     });     
     
	$("p.ongletsM a").click(function(e){
		$("p.ongletsM a").removeClass('selected');
		var div = "#"+$(this).attr("id")+"-Div";
		$(".onglets").hide();
		$(div).show();	
		$(this).addClass('selected');
		return false;
	});
	
	
	$("a.showCapitale").click(function(e){
		$("#Supper").slideDown('low').show();
		return false;
     }); 
     
     $("a.CloseSupper").click(function(e){
		$("#Supper").slideDown('low').hide();
		return false;
     }); 
   
   
	
    
}	

function Animation(){
	var time = 0;
		$('.Anim').fadeIn().show();
		$(".Anim2").animate({width: '185px',height: '135px',top: "-135px", right: "0"},{duration:0});   
		$('.Anim').cycle({ 
    		fx:    'fade',
    		timeout: 3000,
    		autostop:1,
    		end: function(){
    		$('.Anim2').show();
    		$('.Anim').hide();      
    		$('.Anim').css('zindex','0');
    		$('.Anim2').css('zindex','80');  	
    		$(".Anim2").animate({width: '185px',height: '135px',top: "-0", right: "0"},{duration:500}).animate({top: '-25px' },{duration:200}).animate({top: '0px' },{duration:100}).animate({top: '-8px' },{duration:100}).animate({top: '0px' },{duration:50});
    		
    		}
		});
	}

function Show(divShow,divHide)
{
	document.getElementById(divHide).style.display = 'none';
	document.getElementById(divShow).style.display = 'block';
	return false;
}


