	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 PopupCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

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 - 996 ) / 2);
		
	document.getElementById("ColG").style.width  = tmp +"px";
	document.getElementById("ColD").style.width  = tmp +"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;	
	});	
	
    $('#Flash').cycle({ 
    	fx:    'fade',
    	timeout: 5000 
    });	
    
     $('.FlashP').cycle({ 
    	fx:    'fade',
    	timeout: 3000 
    });	 
    
    $(".bienlist .infos .photo").cycle({ fx:  'fade', timeout: 1, speed:800}).cycle('pause');	
	$(".bienlist .infos .photo").mouseenter(function(){
		$(this).cycle('resume');	
    });       
    $(".bienlist .infos .photo").mouseleave(function(){ $(this).cycle('pause') });
    
    
    $(".bienlist .actionslist .preview").mouseover(function(){
		$(this).addClass("selected");
		$(this).parent().find("div.overlay").slideUp('low').hide();
		$(this).parent().find("div.desc").slideDown('low').show();
		$(this).parent().find("div.desc").css("left",$(this).parent().position().left).css("top",$(this).parent().position().top+25);	
		$(".bienlist .actionslist").hover(function() {}, function(){       
			$(this).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;	
    });    
    
    
    $('.ResultatsVille').mouseleave(function(){ 
    	$('.ResultatsVille').fadeOut(500).hide('slow');
    });
   
    if( document.getElementById("Diagnotics") != null)
    {	
		var divimg = document.getElementById("Diagnotics");
		var taille = 0;
		var imgs = divimg.getElementsByTagName("div");
		for(var i = 0 ; i < imgs.length; i++) {
			taille += imgs.item(i).width + 10;
		}
		document.getElementById("Diagnotics").width = taille +"px";
    }
    
     $("#Slider").easySlider({
		auto: true, 
		continuous: true,
		controlsShow: true,
		pause:4000,
		hoverpause: true,
		prevId : 'Prev1',
		nextId : 'Next1',
		prevText : "<img src='/img/prevS.jpg' alt='Precedent'/>",
		nextText : "<img src='/img/nextS.jpg' alt='Suivant'/>"
	});		
	
	$("a.CloseSupper").click(function(e){
		$("#Supper").slideDown('low').hide();
		return false;
     }); 
   
    
  
	
		 
}

function Show(divShow,divHide)
{
	document.getElementById(divHide).style.display = 'none';
	document.getElementById(divShow).style.display = 'block';
	return false;
}


