
function AddFavo() {
        if ((navigator.appName.indexOf("Microsoft",0)>=0) && (parseInt(navigator.appVersion)>=4)) {
                window.external.AddFavorite("http://www.villers-les-nancy.fr","Ville de Villers-les-Nancy" );
        } else {
                alert("Cette fonction n'est proposée que par Internet Explorer 4+")
        }
}

function imprimer() {
if(window.print)
	{
	window.print()
	}
	else
	{ alert (' Cette fonction n\'est pas disponible sur votre navigateur')
	}
}

function ouvrir(theURL) { 
//fenetre = null;
fenetre = window.open(theURL,'fenetreEdit','toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=500,height=450');
//fenetreEdit.focus();
}

w=640;
h=400;

browser = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )))


function openimage(url,w,h) {
	imgname="gato";
    popupWin2 = null;
	popupWin2 = window.open(url,imgname,'resizable=yes,status=0,width='+w+',height='+h+'');

// focus window (only for Navigator 3.0)
        if ( (navigator.appName != "Microsoft Internet Explorer") && (navigator.appVersion.substring(0,1) == "3") )
        popupWin2.focus();

}

goie3=(navigator.appName == "Microsoft Internet Explorer") && (navigator.appVersion.substring(0,1) == "2");
//alert (navigator.appName)
//alert (navigator.appVersion)
function go_url(myvar) {
	
	if (myvar.options[myvar.selectedIndex].value != "---") { 
		//alert (myvar.name)
		if (goie3) { 
			myurl = "/" + myvar.name + "/" + myvar.options[myvar.selectedIndex].value
		} else {
			myurl=  myvar.options[myvar.selectedIndex].value

		}
		location.href=myurl		
		}
}

function go_href(myvar) {
	location.href=myvar
}


function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_validateForm() { //v3.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
	
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
	if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='Le champ '+nm+' doit être une adresse email valide.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (val!=''+num) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += 'Le champ '+nm+' est obligatoire.\n'; }
  } if (errors) alert(errors);
  document.MM_returnValue = (errors == '');
}


function popupmodulo(adresse, name, x, y, top, left){
	window.open(adresse,name,'location=no,toolbar=no,directories=no,menubar=no,resizable=no,scrollbars=yes,status=yes,width='+x+',height='+y+'screenY='+top+',screenX='+left);
}



// set up a global variable.
        var isJs10 = true;
// -->
        

// This shows it is a JavaScript 1.1 browser
	var isJs11 = true;
// -->


// This shows it is a JavaScript 1.2 browser
	var isJs12 = true;
// -->

function meteo2 (){
document.write('<LAYER target="meteo1" SRC="http://www.meteodirect.com/md/vignette/md_vignette.php?url=' + document.location.href + '&params_meteo=' + params_meteo + '" visibility="hidden" width="140" height="166" onload="moveToAbsolute(meteo1.pageX,meteo1.pageY); visibility=\'show\';"></LAYER>');
}

function meteo1 (){
document.write('<table border="0" cellpadding="0" cellspacing="0"><tr><td><ILAYER  target="meteo1" ID="meteo1" VISIBILITY="hidden" WIDTH="139"  HEIGHT="163"></ILAYER></td></tr></table>');document.write('<NOLAYER><IFRAME name="meteo1"  width="140" height="166" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"  SRC="http://www.meteodirect.com/md/vignette/md_vignette.php?url=' + document.location.href + '&params_meteo=' + params_meteo + '">&nbsp;</IFRAME></NOLAYER>');
}




