//////////////////////////////////////////////////////
// fonctions de gestion passage souris sur images

function dessus(lieu,source)
{
	nom_image = source;   				// emplacement image a apeller
	url_rep_image = '../boutons/';
	lieu.src = url_rep_image + source;
}

function dehors(lieu,source)
{
	nom_image = source; 				// emplacement image de depart
	url_rep_image = '../boutons/';
	lieu.src = url_rep_image + source;
}
////////////////////////////////////////////////////////////////////////////////
///// fonctions de navigations
function suivant() {
window.history.forward();
}



function retour() {
window.history.back();
}

function favoris() {
window.external.addfavorite('http://www.les-lamas.com','Les lamas de granades');
return false;
}





/////////////////////////////////////
// fontion texte defilant

var id,pause=0,position=0,x=0;

function ima(texto)
{
var i,k,len;

msg=" André Richard vous souhaite la bienvenue et une agréable visite de son élevage......             ";  // message qui defile
msg+="                                                                   ";  // blanc entre 2 passages
len=msg.length;
k=(150/len)+1;
for(i=0;i<=k;i++) msg+=" "+msg;
document.defil.ima.value=msg.substring(position,position+len);
if(position++==len) position=0;
id=setTimeout("ima()",100);

}

///////////////////////////////////////////////
// fonctions ouverture fenetre

function fenetre_pop(adresse, name, x, y){
	window.open(adresse,name,'location=no,toolbar=no,directories=no,menubar=no,resizable=no,scrollbars=yes,status=no,width='+x+',height='+y);
}

function fenetre_new(adresse)
{
	window.open(adresse,'nom_de_la_fenetre','location=no,toolbar=no,directories=no,menubar=no,resizable=yes,scrollbars=auto,status=no,screenY=15,screenX=30,width=860, height=680 ');
}

////////////////////////////////////////////////////////
// fonctions de gestion de texte dans la barre d etat

function message_barre(txt)  // affichage ponctuel de texte
{
	window.status = txt;
}

function affichage_barre(texte)    // affichage permanent de texte
{
	window.defaultStatus = texte;
}

//////////////////////////////////////////////////////
// fonctions d aide a la selection dans les formulaires

// Detection du navigateur
nc6 = (typeof(window.controllers) != 'undefined' && typeof(window.locationbar) != 'undefined')? true:false;
nc4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;

// Insertion de styles pour Internet Explorer et Netscape 6.x
/*if ( ie4 || nc6 )
	{
		var nom = this.document.formName;
		if (nom == 'formulaire_off' )
			{
			document.write('<link rel="stylesheet" href="style_off.css">');
			}
		if (nom == 'formulaire_ent')
			{
			document.write('<link rel="stylesheet" href="style_ent.css">');
			}
		document.write('<link rel="stylesheet" href="style_ent.css">');
		alert(nom);


	}*/

// Fonction pour changer le style applique aux champs de formulaires
function change_classe(formulaire,champ,etat) {

	eval("document." + formulaire + "." + champ).className = etat;
	}
//<input type="button" onclick="window.opener.reload();document.form.xyz.submit();window.nom_pop-up.close();" value="Validez">
function resolution() {
document.location="securit.php?r=1&width="+screen.width+"&height="+screen.height+"&awidth="+screen.availWidth+"&aheight="+screen.availHeight+"&color="+screen.colorDepth;

}
///////////////////////////////////////////////////////////////////////////////////////////
//// fonction menu

var time =6000;
var numofitems = 7;

//menu constructor
function menu(allitems,thisitem,startstate){
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem;
	this.numberofmenuitems = 7;
	this.caller = document.getElementById(callname);
	this.thediv = document.getElementById(divname);
	this.thediv.style.visibility = startstate;
}

//menu methods
function ehandler(event,theobj){
  for (var i=1; i<= theobj.numberofmenuitems; i++){
	  var shutdiv =eval( "menuitem"+i+".thediv");
    shutdiv.style.visibility="hidden";
	}
	theobj.thediv.style.visibility="visible";
}

function closesubnav(event){
  if ((event.clientY <0)||(event.clientY > 120)){
    for (var i=1; i<= numofitems; i++){
      var shutdiv =eval('menuitem'+i+'.thediv');
			shutdiv.style.visibility='hidden';
		}
	}
}




