function statut(text) {
if (window.defaultStatus) window.defaultStatus ='Le Prieuré de Saint-Céols'
 //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' }
 }
}

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;




/*  retailler la PAGE en hauteur  */
function setHeight(){
  var item = getElement('main')
  if (item) {
    h = parseInt(  item.offsetHeight   )-77
    if (h>1) getElement('page').style.height=h+'px';
    //alert( h )
  }
}

function showMenu(no){
    //hideMenu()
	var element=document.getElementById('mnu'+no)
	if (element) element.src = '../images/menu/'+no+'_over.jpg';
}

function hideMenu(){
  for(no=1;no<10;no++){
   var element=document.getElementById('mnu'+no)
   if (element) element.src = '../images/menu/'+no+'.jpg';
  }
}

function showsmenu(no){
    hidesmenu()
	var element=document.getElementById('smenu'+no)
	if (element) element.style.display = 'block';
}
function hidesmenu(){
  for(no=1;no<10;no++){
   var element=document.getElementById('smenu'+no)
   if (element) element.style.display = 'none';
  }
}

function setTitre(titre) {
 var item=getElement('titre')
 if (item) item.innerHTML = titre;
}


var laphoto=1;
var clic=0;
var lphotos;

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