	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;	
	});	
	
    $('#Flash').cycle({ 
    	fx:    'fade',
    	timeout: 5000 
    });	
    $('.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";
    }
    
     $('.ResultatsVille').mouseleave(function(){ 
    	$('.ResultatsVille').fadeOut(500).hide('slow');
    });
    

 		 
}

function Animation()
{	
	$(".etiquete").animate({left: '-180px',},{duration:6000}).animate({left: '180px',},{duration:6000})
}

function Show(divShow,divHide)
{
	document.getElementById(divHide).style.display = 'none';
	document.getElementById(divShow).style.display = 'block';
	return false;
}


