function AnimClass(ids, Proto) {
	var K, D
	this.Div = D = LID(ids);  D.objAnim = this;  window[D.id] = this;  Aff(D)
	this.id = D.id
	this.no = 0
	this.nb = 0
	this.Dias
	this.divTit = LID('.divTit',D)
	this.divIn	= LID('.divIn',D) || D
	this.divBtn = LID('.divBtn',D)
	this.divPos = LID('.divPos',D)
	this.divLoad = LID('.divLoad',D) || this.divIn
	if (Proto)  for (var K in Proto)  this[K] = Proto[K]
	this.Anim = function() { this.AnimExe() }
}

AnimClass.prototype.Init = function() {
}

AnimClass.prototype.Load = function(cl1) {
	var Me = this,  id = this.divLoad.id
	if (App.SIP) {
		JS = { Action:'Win', ValCle:cl1, Zone:id }
		ExecAction([JS],null,{noPush:1, Suite:function () { Me.finLoad() } })
	}else{
		ExecAction({Action:'ListData', ValCle:cl1, Zone:id}, function(re,S,reJ) {
			Me.finLoad()
		})
	}
}
AnimClass.prototype.finLoad = function() {
	this.PreparCode()
	this.PreparWidget()
	this.Dias = $('.dia',this.divIn)
	this.nb = this.Dias.length
	this.Anim()
}

AnimClass.prototype.AnimExe = function() {
  //return
	var Me = this
	$(this.divIn).cycle({
		fx:'fade',
		timeout:4000,
		after:function(curr,next,opts) {
			var D, H
		  Me.no = opts.currSlide;
			D = Me.Dias.get(Me.no)
			if (Me.divPos) {
				H = LX(D,'Lib');  $(Me.divPos).html((Me.no+1)+' sur '+opts.slideCount);
			}else
				H = '(' + (Me.no+1)+'/'+opts.slideCount+') &nbsp;&nbsp;' + LX(D,'Lib')
			$(Me.divTit).html(H);
		}
	});
}

AnimClass.prototype.Prev = function() { $(this.divIn).cycle('pause');  $(this.divIn).cycle('prev'); }
AnimClass.prototype.Next = function() { $(this.divIn).cycle('pause');  $(this.divIn).cycle('next'); }

AnimClass.prototype.Close = function() {
	$(this.divIn).cycle('pause');  $(this.divIn).cycle('destroy');
	this.divIn.innerHTML = this.divLoad.innerHTML = ''
	Hide(this.Div)
}

AnimClass.prototype.PreparCode = function(D) {
	//Repère les widgets en fonction du contenu widget= et les prépare pour les autres transformateurs (Table contenu avec classe info_nom-widget et pointeur sur container)
	//  Contenu   : <table class=Widget> : 1° cell=>nom=anim; widget=slide, autres cells : contenu widget
	//  Container : <div class=Widget style="width:700px; height:270px;">widget=anim</div>
	var Inf
	if (!D)  D = this.divLoad
	$("TABLE.Widget:contains('widget=')",D).each(function() {
	  var TA = this, D, Nom, Wid, S, T
		S = LText(this.rows[0].cells[0])
		T = Tableau1D(S, '=;')
		Nom = T.nom;
		Wid = T.widget
		AddClass(TA,'infoWidget');  AddClass(TA,'info_'+Wid);  PX(TA,'typeWidget',Wid)
		//alert(Nom+crr+Wid+crr+S)
		//Inf = S.split('\n');  alert(Inf[0])
		$(".Widget:contains('widget="+Nom+"')").each(function() {
			Aff(this)
			TA.DivWid = this;  this.TInfo = TA;		//alert(Lout(this))
		})
	})
}

AnimClass.prototype.PreparWidget = function(Div) {
	var Ta, D, S, Me = this
	if (!Div)  Div = this.divLoad
	$(".infoWidget",Div).each(function() {
		Ta = this;  if (!(D=Ta.DivWid)) { S = Isole(Ta.id,'_',1);  D = LID(S) }   // Destination définie dans Descript. Sinon divIn
		if (!D)  D = Me.divIn
		D.innerHTML = '';
		Me.PreparContenu(Ta, D)
		RMNod(Ta)
		//alert(Lout(D)+crr+Lout(Div))
	})
}

AnimClass.prototype.PreparContenu = function(Ta, Dest, JS) {
	var l, D, nb, O, S, H, Tit
	if (!JS)  JS={ Bal:'div' };  else if (isStr(JS))  JS = { Bal:JS }
	S = LText(Ta.rows[0].cells[0])
	l = (S.indexOf('=')) ? 1:0
	for (nb=Ta.rows.length; l<nb; l+=2) {
		Tit = LText(Ta.rows[l].cells[0]);
		if ((l+1)<nb)  H = Ta.rows[l+1].cells[0].innerHTML;
		O = MakeDom(JS.Bal, Dest, {Class:'dia'});  PX(O,'Lib',Tit)
		O.innerHTML = H
	}
}


// =============   SS-PGM   =============================
function LoadDiaporama(ids,Cle) {
	var WA = new AnimClass(ids)
	WA.Load(Cle)
}

