
var oldprod = null;
var plast = null;

/* HOME - Rollover produits */
function gfocus(){
 window.clearTimeout(plast);
 if(oldprod!=null){
  if(this==oldprod)
   return;
  else
   oldprod.gblur();
 }
 if(this.s)
  this.style.paddingLeft = '20px';
 else
  this.style.paddingRight = '20px';
 this.inf.style.visibility = 'visible';
 //RAJOUT SHT --> rendre INVISIBLE l'image et le descriptif par défaut lors du survol d'un modèle
 document.getElementById("gi").style.visibility = 'hidden';
 //FIN RAJOUT SHT
 oldprod = this;
}

function gblur(){
 if(this.s)
  this.style.paddingLeft = '0px';
 else
  this.style.paddingRight = '0px';
 this.inf.style.visibility = 'hidden';
 //RAJOUT SHT --> rendre VISIBLE l'image et le descriptif par défaut lors du survol d'un modèle
 document.getElementById("gi").style.visibility = 'visible';
 //FIN RAJOUT SHT
 window.clearTimeout(plast);
 oldprod = null;
}

function tm_gblur(){
 plast = window.setTimeout("oldprod.gblur()", 50);
}

function init_gfocus(){
 col = document.getElementById('gamm_list').getElementsByTagName('LI');
 for(i=0;i<col.length;i++){
  if(col[i].className=='')
   col[i].s = 1;
  else
   col[i].s = 0;
  // AJOUT SHT --> les événements onmouseover et onmouseout ne sont pas appliqués aux 'trous' de la gamme...
  if (document.getElementById('gi'+i) != null)	{
  // AJOUT SHT
	col[i].inf = document.getElementById('gi'+i);
	col[i].gfocus = gfocus;
	col[i].gblur = gblur;
	col[i].onmouseover = gfocus;
	col[i].onmouseout = tm_gblur;
// AJOUT SHT
  }
// FIN AJOUT SHT
 }
}


var oldimgprod = null;
var pimglast = null;




/* HOME - Rollover produits */
function gimgfocus(){
 window.clearTimeout(pimglast);
 if(oldimgprod!=null){
  if(this==oldimgprod)
   return;
  else
   oldimgprod.gimgblur();
 }
 if(this.s)
  this.style.paddingLeft = '20px';
 else
  this.style.paddingRight = '20px';
 this.inf.style.visibility = 'visible';
 //RAJOUT SHT --> rendre INVISIBLE l'image et le descriptif par défaut lors du survol d'un modèle
 document.getElementById("gi").style.visibility = 'hidden';
 //FIN RAJOUT SHT
 oldimgprod = this;
}

function gimgblur(){
 if(this.s)
  this.style.paddingLeft = '0px';
 else
  this.style.paddingRight = '0px';
 this.inf.style.visibility = 'hidden';
 //RAJOUT SHT --> rendre VISIBLE l'image et le descriptif par défaut lors du survol d'un modèle
 document.getElementById("gi").style.visibility = 'visible';
 //FIN RAJOUT SHT
 window.clearTimeout(pimglast);
 oldimgprod = null;
}

function tm_gimgblur(){
 pimglast = window.setTimeout("oldimgprod.gblur()", 50);
}

function init_imgfocus(){
 col = document.getElementById('img_list').getElementsByTagName('AREA');
 for(i=0;i<col.length;i++){
  if(col[i].className=='')
   col[i].s = 1;
  else
   col[i].s = 0;
  // AJOUT SHT --> les événements onmouseover et onmouseout ne sont pas appliqués aux 'trous' de la gamme...
  if (document.getElementById('gi'+i) != null)	{
  // AJOUT SHT
	col[i].inf = document.getElementById('gi'+i);
	col[i].gfocus = gimgfocus;
	col[i].gblur = gimgblur;
	col[i].onmouseover = gimgfocus;
	col[i].onmouseout = tm_gimgblur;

// AJOUT SHT
  }
// FIN AJOUT SHT
 }
}


/* HOME texte defilant */
function writemrq(texte){
 speed = 4;
 document.write('<div id="news"><marquee scrollamount="'+speed+'"><span>'+texte+'</span></marquee></div>');
}

var theedge = null;



//MAJ zopen, match_size, tm_resize, tm_resize_inv en fonction de la maquette 1.1
var _popzoom = null;
var IW = 0, IH = 0, HD = 0;

/* Zoom ouverture popup */
function zopen(u, l, t, ztitre){
 _popzoom = window.open(u, 'popzoom', 'width=1, height=1, top='+t+', left='+l+', location=no, menubar=no, resizable=0, scrollbars=auto, status=no, toolbar=no, fullscreen=no');
 window.focus();
 _popzoom.blur();
//_popzoom.document.write("<img src='"+u+"' onclick='window.close()'>");
window.setTimeout("match_size()", 10);
 return false;
}


/* Zoom resize popup */
function match_size(){

 if(!_popzoom){
  window.setTimeout("match_size()", 10);
  return false;
 }
 if(_popzoom.document.images==null){
  window.setTimeout("match_size()", 10);
  return false;
 }
 if(_popzoom.document.images.length==0){
  window.setTimeout("match_size()", 10);
  return false;
 }
 if(_popzoom.document.images[0].complete!=1)
  window.setTimeout("match_size()", 10);
 else{
  _popzoom.document.body.style.margin = 0;
  IW = _popzoom.document.getElementsByTagName('IMG').item(0).offsetWidth;
  IH = _popzoom.document.getElementsByTagName('IMG').item(0).offsetHeight;
  if((IW<_popzoom.document.body.clientWidth)||(IH<_popzoom.document.body.clientHeight)){
   _popzoom.resizeTo(2000, 2000);
   IW = _popzoom.document.getElementsByTagName('IMG').item(0).offsetWidth;
   IH = _popzoom.document.getElementsByTagName('IMG').item(0).offsetHeight;
   tm_resize_inv();
  }
  else
   tm_resize();
 }
 _popzoom.document.title = "Prieuré de la Chaise";

 return false;
}

function tm_resize(){
 if(document.all){
  _popzoom.resizeBy(IW-_popzoom.document.body.clientWidth, IH-_popzoom.document.body.clientHeight);
  if((IH>_popzoom.document.body.clientHeight)||(IW>_popzoom.document.body.clientWidth))
   window.setTimeout("tm_resize()", 1000);
  else
  _popzoom.focus();
 }
 else{
  _popzoom.resizeBy(IW-_popzoom.innerWidth, IH-_popzoom.innerHeight);
  if((IH>_popzoom.innerHeight)||(IW>_popzoom.innerWidth))
   window.setTimeout("tm_resize()", 1000);
  else
   _popzoom.focus();
 }
}

function tm_resize_inv(){
 _popzoom.resizeTo(IW, IH);
 _popzoom.document.getElementsByTagName('IMG').item(0).style.width = "100%";
 _popzoom.document.getElementsByTagName('IMG').item(0).style.height = "100%";
 _popzoom.focus();
}
//FIN MAJ


function popup(url, titre, width, height, top, left, loc, menu, resize, scroll, status, tool) {
// var left = (screen.width - width) / 2;
// var top = (screen.height - height) / 2 - 20;
// if(left < 0) left = 0;
// if(top < 0) top = 0;
 var _popup = window.open(url, ''+titre+'', 'width='+width+',height='+height+', top='+top+', left='+left+', location='+loc+',menubar='+menu+', resizable='+resize+', scrollbars='+scroll+',status='+status+', toolbar='+tool+'');
 _popup.focus();
}















