// JavaScript Document
function lookForChecked() {
	var cases = document.getElementsByName('compare[]');
	var oneIsChecked = false;
	for (var i = cases.length; i-- && !oneIsChecked; ) {
		if (cases.item(i).checked) {
			oneIsChecked = true;
		}
	}
	//return oneIsChecked;
	if (oneIsChecked) {
		document.formListe.submit();
	}
}


function btnOv(idBtn) {
	document.getElementById(idBtn).style.backgroundImage = 'url(/images/navig/B1_over.gif)';
}
function btnOut(idBtn) {
	document.getElementById(idBtn).style.backgroundImage = 'url(/images/navig/B1.gif)';
}

function popUpPedigre(id,typeMF) {
	popGene = window.open("../pedigre/index.php?id="+id+"&type="+typeMF,"popGenea","width=900,height=650");
	popGene.focus();
}

function popUpFilles(id) {
	popFil = window.open("../pedigre/filles.php?id="+id,"popFilles","width=750,height=650");
	popFil.focus();
}

function popUpConditions(ancre) {
	popCGV1 = window.open("../infos-legales/CGV.php#"+ancre,"popCGV","width=750,height=550,scrollbars=1");
	popCGV1.focus();
}

////////// GESTION DES COOKIES JAVASCRIPT /////////////////
function EcrireCookie(nom, valeur)
{

var argv=EcrireCookie.arguments;
var argc=EcrireCookie.arguments.length;
var expires=(argc > 2) ? argv[2] : null;
var path=(argc > 3) ? argv[3] : null;
var domain=(argc > 4) ? argv[4] : null;
var secure=(argc > 5) ? argv[5] : false;
document.cookie=nom+"="+escape(valeur)+
((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
((path==null) ? "" : ("; path="+path))+
((domain==null) ? "" : ("; domain="+domain))+
((secure==true) ? "; secure" : "");

}

function getCookieVal(offset)
{

var endstr=document.cookie.indexOf (";", offset);
if (endstr==-1) endstr=document.cookie.length;
return unescape(document.cookie.substring(offset, endstr)); 
}

function LireCookie(nom)
{

var arg=nom+"=";
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while (i<clen)
{

var j=i+alen;
if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
i=document.cookie.indexOf(" ",i)+1;
if (i==0) break;


}
return null; 
}

function EffaceCookie(nom)
{

date=new Date;
date.setFullYear(date.getFullYear()-1);
EcrireCookie(nom,null,date); 
}

date=new Date;
date.setMonth(date.getMonth()+6); // cookies valable 6 mois

////////////////////////FIN GESTION COOKIES PRE REMPLISSAGE FORMULAIRE ////////////////////

function affmel( domaine, adresse )
{
	var admel = adresse ;
	admel += '@' ;
	admel += domaine ;
	
	var codehtml = '<a href="mailto:' ;
	codehtml += admel ;
	codehtml += '">' ;
	codehtml += admel ;
	codehtml += '</a>';
	
	document.write(codehtml);
	
	return false ;
}



