function statut(text) {
if (window.defaultStatus) window.defaultStatus ='Chavignol Développement - Tel : 02 48 78 51 05'
 //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 getElement(nm) {
  if(nm == '') return null;
  return document.getElementById?document.getElementById(nm):(document.all?document.all(nm):null)
}

function set800() {
 if (screen.availHeigh) if (screen.availWidth>=800) window.resizeTo(800,600)
}

/* 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); return false; }

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() { if (oldonload) { oldonload(); }; func(); }
  }
}

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 preloadImages(){
// onload="preloadImages('images/m1.gif', ... , 'images/m42.gif')" 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

var nouveau;
function photo(nom, path, 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="'+path+nom+'" style="cursor:hand;" Xwidth="358" border="0" alt=""></center></body></html>');
}

function setTaille(){
	var item = getElement('page');
	if (item) {
      var body = getElement('body');
      if (body){
		     item.style.width =((body.clientWidth)-230)+'px';
		     item.style.height = ((body.clientHeight)-45-95)+'px';
	     }
	}
}

var laphoto=1;
var clic=0;
var lphotos;

function incPhoto(){
 window.clearTimeout(clic)
 var element = getElement('diaporama')
 if (element){
	 laphoto++; if (laphoto==lphotos.length) {		laphoto=1	}
	 //alert(laphoto)
	 try  {
	   if (element.filters) if (element.filters.length>0) element.filters[0].Apply();
	 }
    catch(e) { }
	 element.src =lphotos[laphoto].src	//rep+'/'+laphoto+'.jpg';
	 try  {
	   if (element.filters) if (element.filters.length>0) element.filters[0].Play();
	 }
    catch(e) { }
	 clic=window.setTimeout("incPhoto()", 3000);
 }
}
function initPhoto(nb,rep){
 if (nb>0){
	lphotos = new Array;
	for (var i=1; i<=nb; i++){
		lphotos[i] = new Image;
		lphotos[i].src = rep+''+i+'.jpg'
	}
	clic=window.setTimeout("incPhoto()", 1000)
 }
}


function stopError() { return true; }
 
//window.onerror = stopError;
//window.onload=statut;


addEvenement(window, 'load', statut);




