function clignotte(){
  var item = document.getElementById('blink');
  if (item.style.visibility!='visible')
      item.style.visibility='visible';
  else
      item.style.visibility='hidden';
  /*
  if (item.style.color!='#000000')
      item.style.color='#000000';
  else
      item.style.color='#FEE300';
  */
  clic=window.setTimeout("clignotte()", 900);
}

function statut(text) {
window.defaultStatus ='Relais de Pouilly -Val de Loire - Nièvre - Tel : 03 86 39 03 00'
 //if(self.name==top.name) { location.href="index.html" }
}

var isMinIE5 = (navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0
var isMinIE6 = (navigator.appVersion.indexOf("6.") >= 0) ? 1 : 0


function getdElement(d,nm) {
  if(nm == '') return null;
  return d.getElementById?d.getElementById(nm):(d.all?d.all(nm):null)
}
function getElement(nm) { return getdElement(document,nm) }

function set800() {
 if (navigator.appName.indexOf('Microsoft')!=-1) { if (screen.availWidth>800) window.resizeTo(800,600)  }
}

function setOn(no){
	setOff(no)
	var item=getElement('mnu'+no)
	if (item) item.className='mnuON'
}
function setOff(no){
 for ( var i=1; i<12; i++){
	var item=getElement('mnu'+i)
	if (item){ if (no!=i) item.className='mnuOFF' }
 }
}

/* gestionnaire d'evenement */
function addEvenement(node, evType, fn){
 if (node.addEventListener){   node.addEventListener(evType, fn, true);   return true; }
 else if (node.attachEvent){   var ret = node.attachEvent("on"+evType, fn);   return ret; }
 else return false;
}
function ajoutEvenement(id,evType, fn){ var item = document.getElementById(id); if (item) return addEvenement(item,evType,fn); }

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() { if (oldonload) { oldonload(); }; func(); }
  }
}

function load() {
	if (document.images) {
		this.length=preload.arguments.length;
		for (var i=0;i<this.length;i++) {
			this[i+1]=new Image();
			this[i+1].src=preload.arguments[i];
		}
	}
}
function preload() {
// Cette fonction charge dans le cache toutes les images passées en paramètre
	var mesImages=new load("COMMUN/images/cadre/puce_tra.gif","COMMUN/images/cadre/coin_hg.gif","COMMUN/images/cadre/coin_hd.gif","COMMUN/images/cadre/coin_bd.gif","COMMUN/images/cadre/coin_bg.gif","COMMUN/images/plateau/picto_choisir.gif","COMMUN/images/plateau/picto_recherche.gif","COMMUN/images/plateau/picto_panier.gif")
}


var nouveau;
function photo(nom, width, height){
 if (nouveau) {	if ( !nouveau.closed ) nouveau.close(); }
 nouveau =window.open('','photo','height='+height+',width='+width+',status=no,toolbar=no,menubar=no,location=no');
 nouveau.document.write('<html><body onLoad="window.focus();" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#ffffff" onclick="window.close()" scroll="no"><center><img src="'+nom+'" style="cursor:hand;" border="0" alt=""></center></body></html>');
}
function pop(nom, width, height){
 if (nouveau) {	if ( !nouveau.closed ) nouveau.close(); }
 nouveau =window.open(nom,'photo','height='+height+',width='+width+', scrollbars=yes, status=no,toolbar=no,menubar=no,location=no');
}

function stopError() { return true; }
 
window.onerror = stopError;
window.onload=statut;

var laphoto=1;
var clic=0;
var lphotos;
function initPhoto(nb,rep){
 if (nb>0){
	lphotos = new Array;
	for (i=1; i<=nb; i++){lphotos[i] = new Image; lphotos[i].src = rep+''+i+'.jpg' }
	clic=window.setTimeout("incPhoto()", 6000)
 }
}
function incPhoto(){
 var element = getElement('cadrephoto')
 if (element){
	 laphoto++; if (laphoto==lphotos.length) {
		laphoto=1
	}
	 if (element.filters.length>0) element.filters(0).Apply();
	 element.src =lphotos[laphoto].src	//rep+'/'+laphoto+'.jpg';
	 if (element.filters.length>0) element.filters(0).Play();
	 clic=window.setTimeout("incPhoto()", 6000);
 }
}
function decPhoto(){
 var element = getElement('cadrephoto')
 if (element){
	 laphoto--; if (laphoto<1) {
		laphoto=lphotos.length-1
	}
	 if (element.filters.length>0) element.filters(0).Apply();
	 element.src =lphotos[laphoto].src	//rep+'/'+laphoto+'.jpg';
	 if (element.filters.length>0) element.filters(0).Play();
	 clic=window.setTimeout("incPhoto()", 6000);
 }
}

addEvenement(window, 'load', clignotte);



