// Fonctions JavaScript - UNAF - www.unaf.fr
// Realisation KIOWA - kiowa.fr
// Avril 99 - Modif: 12/07/99

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function getNavID() {
	navName = navigator.appName;
	navVer = parseInt(navigator.appVersion);
	navOs = navigator.userAgent;
	if ( ((navName=="Netscape") && (navVer>=3)) || ((navName=="Microsoft Internet Explorer") && (navVer>=4)) ) NavID = 3;
	else if ( (navOs.indexOf("(Win")>=0) || ((navName=="Microsoft Internet Explorer") && (navVer<4)) ) NavID = 2;
	else NavID = 1;
	return NavID;
}
var browserVer=getNavID();
function aff_email() {
	if (browserVer==1) {
		var emailWin = window.open("contact.html","eMail","status=0,toolbar=0,location=0,menu=0,scrollbars=1,height=270,width=450");
		emailWin = window.open("contact.html","eMail","status=0,toolbar=0,location=0,menu=0,scrollbars=1,height=270,width=450");
		}
	else {
		emailWin = window.open("contact.html","eMail","status=0,toolbar=0,location=0,menu=0,scrollbars=1,height=270,width=450");
		emailWin.focus();
	}
}
function aff_aide(fhtm) {
	if (browserVer==1) {
		var aideWin = window.open(fhtm,"Aide","status=0,toolbar=0,location=0,menu=0,scrollbars=1,height=200,width=300");
		aideWin = window.open(fhtm,"Aide","status=0,toolbar=0,location=0,menu=0,scrollbars=1,height=200,width=300");
		}
	else {
		aideWin = window.open(fhtm,"Aide","status=0,toolbar=0,location=0,menu=0,scrollbars=1,height=200,width=300");
		aideWin.focus();
	}
}

// fenetre Sur_le_vif
function aff_slv() {
	if (browserVer==1) {
		var aideWin = window.open("surlevif.html","Sur_le_vif","status=0,toolbar=0,location=0,menu=0,scrollbars=1,height=300,width=300");
		aideWin = window.open("surlevif.html","Sur_le_vif","status=0,toolbar=0,location=0,menu=0,scrollbars=1,height=300,width=300");
		}
	else {
		aideWin = window.open("surlevif.html","Sur_le_vif","status=0,toolbar=0,location=0,menu=0,scrollbars=1,height=300,width=300");
		aideWin.focus();
	}
}

function majframe(fram,fhtm) {
	var cmdf = 'window.top.' + fram + '.location.href = "' + fhtm + '"';
	eval(cmdf);
}
function hiLite(imgN,imgF) { if (browserVer==3) document.images[imgN].src = eval(imgF + ".src"); }
function mess(texte) { window.status = texte; return true; }

// submit formulaire recherche fiche udaf/uraf
function gof(ch,typ) {
	document.f.cdep.value = ch;
	if (!typ) { document.f.type.value = "UDAF"; }
	else { document.f.type.value = typ; }
	document.f.submit();
}

// submit formulaire recherche region
function gor(ch) {
	document.f2.creg.value = ch;
	document.f2.submit();
}

// submit formulaire recherche fiche mouvement
function gom(ch) {
	document.fm.org.value = ch;
	document.fm.submit();
}
nombrannonces="18"
datannonces="18 mars 2003"


function gotheme() {
	adrtheme = document.aff.theme.options[document.aff.theme.selectedIndex].value;
	if (adrtheme != "") {
		location = adrtheme;
	}

}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}


function EcrireCookie (nom) {
	var path = window.location.pathname;
	var pos = path.indexOf ('index.html',1);
	if (pos == -1) path= 'index.html';
	else path = path.substring(0,pos);

	document.cookie = nom+"; path= "+ path +"; expires=";
}
function OuvrirFenetre (url) {
   window.open (url,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600")
}



