var largeurEcranClient = screen.availWidth;
var hauteurEcranClient = screen.availHeight;

function init(){
	//F_dimensionnerSiteEcranClient();
	//F_dimensionnerTitreSiteListe();
}
function F_dimensionnerSiteEcranClient(){
	if(largeurEcranClient >= 1200){
		document.getElementById("body").style.fontSize = "12px";	
	}else if(largeurEcranClient >= 1000 & largeurEcranClient <= 1200){
		document.getElementById("body").style.fontSize = "11px";	
	}else{
		document.getElementById("body").style.fontSize = "11px";	
	}
}


function report(element, event) {
	var elmtname = element.name;
	if ((element.type == "select-one") || (element.type == "select-multiple")){
		value = " ";
		for(var i = 0; i < element.options.length; i++)
			if (element.options[i].selected)
			value = element.options[i].value + " ";
			}
			else if (element.type == "textarea") value = "...";
			else value = element.value;
			var msg = value;
			var t = element.form.textarea;
			t.value =  msg;
}

function addhandlers(f) {
		for(var i = 0; i < f.elements.length; i++) {
			var e = f.elements[i];
			//e.onclick = function() { report(this, 'Click'); }
			e.onchange = function() { report(this, 'Change'); }
			//e.onfocus = function() { report(this, 'Focus'); }
			//e.onblur = function() { report(this, 'Blur'); }
			//e.onselect = function() { report(this, 'Select'); }
			//alert(e);
		}
		f.boutoneffacer.onclick = function( ) {
			this.form.textarea.value='';
			report(this/'Click');
	}
	f.boutonenvoyer.onclick = function () {
	report(this, 'Click'); return false;
	}
	f.boutonannuler.onclick = function( ) {
	this.form.reset( ); report(this, 'Click'); return false;
	}
}
//addhandlers(document.multicrit);

function F_dimensionnerTitreSiteListe(){
	var nombreDeBalises = document.getElementsByTagName("h3");
	for(var i=0;i<=nombreDeBalises.length-1;i++){
		var nombreDeLettresDansBalises = nombreDeBalises[i];
		for(var j=0;j<=nombreDeLettresDansBalises.length-1;j++){
			alert(nombreDeLettresDansBalises.length);
		}
	}
}

var map = null;
var geocoder = null;
var baseIcon = new GIcon();
baseIcon.shadow = "http://www.silk-info.com/images/1tef.png";//
baseIcon.shadowSize = new GSize(30, 30);
baseIcon.iconAnchor = new GPoint(5, 32);
baseIcon.infoWindowAnchor = new GPoint(5, 0);

function address(){
var address = address1 + address2;
if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map_canvas"));
		//map.setCenter(new GLatLng(46.75984,1.738281, 11.051697,26.367188), 13);
		map.addControl(new GLargeMapControl);
		geocoder = new GClientGeocoder();
		if (geocoder) {
			geocoder.getLatLng(
			address,
			function(point) {
				if (!point) {
					alert(address + " non-géolocalisée");
					callVille();
				} else {
					map.setCenter(point, 13);
					markerOptions = { icon:baseIcon };
				  	var marker = new GMarker(point, markerOptions);
					map.addOverlay(marker);
					/*marker.openInfoWindowHtml();"<h3><span>"+proprio+" </span></h3><p><span>"+address+"</span></p>"*/
					
				}
			}
		);
		}
		}
	
}
function callVille(){
var address = address3;
if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map_canvas"));
		//map.setCenter(new GLatLng(46.75984,1.738281, 11.051697,26.367188), 13);
		map.addControl(new GLargeMapControl);
		geocoder = new GClientGeocoder();
		if (geocoder) {
			geocoder.getLatLng(
			address,
			function(point) {
				if (!point) {
					callVille();
				} else {
					map.setCenter(point, 13);
					markerOptions = { icon:baseIcon };
				  	var marker = new GMarker(point, markerOptions);
					map.addOverlay(marker);
					/*marker.openInfoWindowHtml();"<h3><span>"+proprio+" </span></h3><p><span>"+address+"</span></p>"*/
					
				}
			}
		);
		}
	}
}
