galerie = function(id_this, idelement, duree, transition, pause, blank){
	var src_null = document.getElementById(idelement).src;
	var m_this = this;
	var adNum=0;
	var arrAll = new Array();
	var preLoad= new Array();
	var i = -1;
	this.addCase = function(src, url, alt){
    i++;
    if(src=='' ) return false;
		arrAll[i]=new Array()
		arrAll[i]['src'] = src;
		arrAll[i]['url'] = url;
		arrAll[i]['alt'] = alt;
    preLoad[i]=new Image();
    preLoad[i].src=src;
    preLoad[i].alt=alt;
	}
  this.setTransition = function (){
  if (window.showModalDialog){
  document.getElementById(idelement).filters.revealTrans.Duration=duree;
  document.getElementById(idelement).filters.revealTrans.Transition=transition;
  document.getElementById(idelement).filters.revealTrans.apply();
  }
  }
  this.playTransition = function (){
  if (window.showModalDialog)
  document.getElementById(idelement).filters.revealTrans.play()
  }
  this.nextAd = function (){
  if(adNum<arrAll.length-1)adNum++ ;
  else adNum=0;
  if(blank==1)document.getElementById(idelement).src= src_null;
  m_this.setTransition();
  document.getElementById(idelement).src= arrAll[adNum]['src'];
  document.getElementById(idelement).alt= arrAll[adNum]['alt'];
  m_this.playTransition();
  theTimer=setTimeout(id_this+'.nextAd()', pause);
  }

  this.getUrl = function (){
  jumpUrl=arrAll[adNum]['url'];
  jumpTarget='_blank';
  if (jumpUrl != ''){
  if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
  else location.href=jumpUrl;
  }
  }

  this.getHref = function() {
  url = arrAll[adNum]['url'];
  if(url==''){
  document.getElementById(idelement).style.cursor='default';
  window.status='';
  }else{
  document.getElementById(idelement).style.cursor='pointer';
  window.status=url;}
  }
}
