
var
rialto={};
ria=rialto;
rialto.widget={};
rialto.widgetBehavior={};
rialto.lang={};
rialto.collection={};
rialto.session={
count:0,
objects:{},
reccord:function(obj,id){
this.objects[id]=obj;
this.count+=1;
}
,
removeAll:function(){
for(obj in this.objects){
if(this.objects[obj]){
if(this.objects[obj].remove){
this.objects[obj].remove();
}
}
else{
this.objects[obj]=null;
}
}
},
oParameters:{}
};
rialto.config=rialtoConfig;
if(rialto.config.isDesign){
rialto.composer={mode:'design'};
rialto.composer.toogleMode=function(e){
var newMode=(rialto.composer.mode==rialtoConfig.extIdCssComposerTryMode)
?rialtoConfig.extIdCssComposerDesignMode
:rialtoConfig.extIdCssComposerTryMode;
linkCssDesign=document.getElementById(rialtoConfig.baseIdCssComposer
+'_mode_'
+rialto.config.extIdCssComposerDesignMode);
linkCssTry=document.getElementById(rialto.config.baseIdCssComposer
+'_mode_'
+rialto.config.extIdCssComposerTryMode);
linkCssDesign.disabled=(newMode!=rialto.config.extIdCssComposerDesignMode);
linkCssTry.disabled=(newMode!=rialto.config.extIdCssComposerTryMode);
rialto.composer.mode=newMode;
traceExec('composer mode : '+rialto.composer.mode,73);
}
var obj=document.getElementById(rialto.config.baseIdCssComposer
+'_mode_'
+rialto.config.extIdCssComposerTryMode)
if(obj)obj.disabled=true;
}
window.__styleDeco='3D';
rialto.deprecated=function(object,oldMethod,newMethod){
alert(object+'.'+oldMethod+' deprecated; use '+object+'.'+newMethod);
}
rialto.lang={
addMethods:function(proto,methodList){
for(var m in methodList){
proto[m]=methodList[m];
}
return proto;
}
,
extendObject:function(proto,methodList){
this.addMethods(proto.prototype,methodList);
}
,
extend:function(proto,methodList){
this.extendObject(proto,methodList);
}
,
isString:function(ob,bNotEmpty){
if(bNotEmpty){
return((ob instanceof String||typeof ob=="string")&&ob!="");
}
else{
return(ob instanceof String||typeof ob=="string");
}
}
,
isStringIn:function(ob,arr){
if(this.isString(ob)){
return rialto.array.indexOf(arr,ob)!=-1;
}
}
,
isDate:function(ob){
return(ob instanceof Date);
}
,
isBoolean:function(ob){
return(ob instanceof Boolean||typeof ob=="boolean");
}
,
isNumber:function(ob){
return(ob!=null&&!isNaN(parseInt(ob)));
}
}
rialto.Dom={
isDescendantOf:function(nd1,nd2,orSelf){
if(orSelf&&(nd1==nd2))return true;
var n1=nd1,n2=nd2;
n1=n1.parentNode;
while(n1){
if(n1==n2){return true;}
n1=n1.parentNode;
}
return false;
}
,isCoveredBy:function(nd1,nd2){
var n1=nd1,n2=nd2;
if(n1.parentNode==n2.parentNode){
var styleN1=_rum.$getStyle(n1,'z-index');
var styleN2=_rum.$getStyle(n2,'z-index');
if(styleN1&&styleN2){
return(styleN1>styleN2);
}
else
if(styleN1)
return true;
else
if(styleN2)
return false;
else{
n1=n1.nextSibling;
while(n1){
if(n1==n2){
return true;
}
n1=n1.nextSibling;
}
return false;
}
}
else{
var childN1AscList={};
var n1p=n1.parentNode;
var pn1p=n1;
while(n1p){
if(!n1p.id)n1p.id='domElt_'+rialto.Dom.nbInstances++;
childN1AscList[n1p.id]=pn1p;
pn1p=n1p;
n1p=n1p.parentNode;
}
var	pn2p=n2p;
var n2p=n2.parentNode;
while(n2p){
if(n2p.id
&&childN1AscList[n2p.id]){
var siblAscN1=childN1AscList[n2p.id].nextSibling;
while(siblAscN1){
if(siblAscN1==pn2p){
return true;
}
siblAscN1=siblAscN1.nextSibling;
}
return false;
}
else{
pn2p=n2p;
n2p=n2p.parentNode;
}
}
}
}
}
rialto.Dom.nbInstances=0;
rialto.string={
trim:function(str){
return str.replace(/^\s*(\b.*\b|)\s*$/,"$1");
}
,
replace:function(str,strFind,strRemp){
var tab=str.split(strFind)
return new String(tab.join(strRemp));
}
,
formatHTTP:function(str){
if(rialto.lang.isString(str)){
return escape(str);
}
}
}
rialto.array={
add:function(arr,obj){
if(rialto.array.indexOf(arr,obj)==-1)
arr.push(obj);
}
,
remove:function(arr,obj){
if(arr[arr.length-1]==obj)
arr.pop();
else{
var pos=rialto.array.indexOf(arr,obj);
if(pos!=-1)
arr.splice(pos,1)[0];
}
return arr.length;
}
,
indexOf:function(arr,obj){
var i=0;
for(i=0;i<arr.length;i++){
if(arr[i]==obj)
return i;
}
return -1;
}
,
insert:function(arr,ind,obj){
arr.splice(ind,0,obj);
}
}
rialto.date={
_DayLong:new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'),
toDay:function(){
return new Date();
}
,
getWeekNumber:function(date){
var jour=date.getDate();
var mois=date.getMonth()+1;
var annee=date.getYear()
var a=Math.floor((14-(mois))/12);
var y=annee+4800-a;
var m=(mois)+(12*a)-3;
var jd=jour+Math.floor(((153*m)+2)/5)+
(365*y)+Math.floor(y/4) - Math.floor(y/100)+
Math.floor(y/400)-32045;
var d4=(jd+31741-(jd%7))%146097%36524%1461;
var L=Math.floor(d4/1460);
var d1=((d4-L)%365)+L;
numSem=Math.floor(d1/7)+1;
return numSem;
}
,
getBornes:function(numSem){
var sem53=false;
var dateJour=this.toDay();
var datePremJanv=new Date(dateJour.getYear(),0,1);
var jourSem1=datePremJanv.getDay()-1;
if(jourSem1<0)jourSem1=6;
if(jourSem1>3){
sem53=true;
numSem+=1;
}
if(numSem==1&&!sem53){
var date1=datePremJanv;
var date2=new Date(datePremJanv.getYear(),0,1+6-jourSem1);
}
else{
if(numSem==53&&sem53){
var date1=new Date(datePremJanv.getYear()-1,11,31-jourSem1+1);
var date2=new Date(datePremJanv.getYear(),0,1+6-jourSem1);
}
else{
var jour=1+(numSem-1)*7;
var date=new Date(dateJour.getYear(),0,jour);
var date1=new Date(date.getYear(),date.getMonth(),date.getDate()-jourSem1);
var date2=new Date(date.getYear(),date.getMonth(),date.getDate()-jourSem1+6);
}
}
return[date1,date2]
}
,
getDDMMYYYY:function(date){
var jour=date.getDate();
if(jour<10)(jour="0"+jour)
var mois=date.getMonth()+1;
if(mois<10)(mois="0"+mois)
var annee=date.getYear()
return jour+"/"+mois+"/"+annee;
}
,
getYYYYMMDD:function(date){
var jour=date.getDate();
if(jour<10)(jour="0"+jour)
var mois=date.getMonth()+1;
if(mois<10)(mois="0"+mois)
var annee=date.getYear()
return annee+""+mois+""+jour;
}
,
getLibJour:function(date){
return this._DayLong[date.getDay()];
}
,
DDMMYYYYfromYYYYMMDD:function(wdate){
jour=wdate.substr(6,2);
mois=wdate.substr(4,2);
annee=wdate.substr(0,4);
if(jour.length==1){jour="0"+jour;};
if(mois.length==1){mois="0"+mois;};
return jour+"/"+mois+"/"+annee;
}
,
AAAAMMJJfromDDMMYYYY:function(wdate){
jour=wdate.substr(0,2);
mois=wdate.substr(3,2);
if(jour.length==1){jour="0"+jour;};
if(mois.length==1){mois="0"+mois;};
annee=wdate.substr(6,4);
return annee+""+mois+""+jour;
}
,
setDateFromYYYYMMDD:function(wdate){
jour=wdate.substr(6,2);
mois=wdate.substr(4,2);
annee=wdate.substr(0,4);
return new Date(annee,parseInt(mois)-1,jour);
}
,
equals:function(date1,date2){
return(this.getYYYYMMDD(date1)==this.getYYYYMMDD(date2));
}
,
isDate:function(sDate){
var e=new RegExp("^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4}$");
if(!e.test(sDate))
return false;
var arrDate=sDate.split("/");
var d=parseInt(arrDate[0],10);
var m=parseInt(arrDate[1],10);
var y=parseInt(arrDate[2]);
var feb=28;
if(this.isBissextile(y))feb=29;
var nbJours=new Array(31,feb,31,30,31,30,31,31,30,31,30,31);
return(m>=1&&m<=12&&d>=1&&d<=nbJours[m-1]);
}
,
isBissextile:function(an){
return(((an%4==0)
&&(an%100!=0||an%400==0))?true:false);
}
}
rialto.url={
getUrl:function(){
return window.location;
},
getSearch:function(){
return window.location.search;
},
getObjectParameter:function(){
var sPar=this.getSearch();
var arrPar={};
if(sPar.length>1){
sPar=sPar.substring(1,sPar.length);
var arrTemp=sPar.split("&");
for(var i=0;i<arrTemp.length;i++){
var arrPair=arrTemp[i].split("=");
arrPar[arrPair[0]]=arrPair[1];
}
}
return arrPar;
},
getArrayParameter:function(){
var sPar=this.getSearch();
var arrPar=new Array;
if(sPar.length>1){
sPar=sPar.substring(1,sPar.length);
var arrTemp=sPar.split("&");
for(var i=0;i<arrTemp.length;i++){
var arrPair=arrTemp[i].split("=");
arrPar.push(arrPair);
}
}
return arrPar;
}
}
function loadLayout(lName,vJS){
var objLayout;
if(lName){
objLayout=eval("new "+lName+"();");
}
if(vJS)
vJS=objLayout;
else
return objLayout;
}
rialto.widget.AbstractComponent=function(objPar){
this.bRiaComp=true;
this.type="rialto.widget.AbstractComponent";
this.name="kindOf"+this.type;
this.position='absolute';
this.top=0;
this.left=0;
this.width='100%';
this.height='100%';
this.visible=true;
this.enable=true;
this.draggable=false;
this.resizable=true;
this.autoResizableH=false;
this.autoResizableW=false;
this.bWithoutPlaceIn=false;
if(objPar!=null){
if(objPar.bWithoutPlaceIn){
this.bWithoutPlaceIn=true;
}
if(objPar.name){
this.name=objPar.name;
}
if(objPar.type){
this.type=objPar.type;
}
if(rialto.lang.isNumber(objPar.top)){
this.top=objPar.top;
}
if(rialto.lang.isNumber(objPar.left)){
this.left=objPar.left;
}
if(rialto.lang.isNumber(objPar.width)){
this.width=objPar.width;
}
if(rialto.lang.isNumber(objPar.height)){
this.height=objPar.height;
}
if(rialto.lang.isStringIn(objPar.position,["static","absolute","relative"])){
this.position=objPar.position;
}
if(rialto.lang.isBoolean(objPar.enable)){
this.enable=objPar.enable;
}
if(rialto.lang.isBoolean(objPar.draggable)){
this.draggable=objPar.draggable;
}
if(rialto.lang.isBoolean(objPar.resizable)){
this.resizable=objPar.resizable;
}
if(rialto.lang.isBoolean(objPar.autoResizableH)){
this.autoResizableH=objPar.autoResizableH;
}
if(rialto.lang.isBoolean(objPar.autoResizableW)){
this.autoResizableW=objPar.autoResizableW;
}
this.id=name+"_"+this.type+"_"+(rialto.widget.AbstractComponent.prototype.nbreInstance++);
rialto.session.reccord(this,this.id);
this.divExt=document.createElement("DIV");
this.divExt.id=this.id+'_divExt';
}
}
rialto.widget.AbstractComponent.prototype.nbreInstance=0;
rialto.widget.AbstractComponent.prototype.moveTo=function(top,left){
this.setTop(top);
this.setLeft(left);
}
rialto.widget.AbstractComponent.prototype.setLeft=function(left){
var oHtml=this.getHtmlExt();
if((left==null)&&(this.left!=null)){
oHtml.style.left=this.left;
}
else{
if(typeof left!='undefined'){
this.left=left;
oHtml.style.left=this.left;
}
}
}
rialto.widget.AbstractComponent.prototype.setTop=function(top){
var oHtml=this.getHtmlExt();
if((top==null)&&(this.top!=null)){
oHtml.style.top=this.top;
}
else{
if(typeof top!='undefined'){
this.top=top;
oHtml.style.top=this.top;
}
}
}
rialto.widget.AbstractComponent.prototype.setWidth=function(width){
var oHtml=this.getHtmlExt();
if((width==null)&&(this.width!=null)){
oHtml.style.width=this.width;
}
else{
if(typeof width!='undefined'){
this.width=width;
oHtml.style.width=this.width;
}
}
}
rialto.widget.AbstractComponent.prototype.setHeight=function(height){
var oHtml=this.getHtmlExt();
if((height==null)&&(this.height!=null)){
oHtml.style.height=this.height;
}
else{
if(typeof height!='undefined'){
this.height=height;
oHtml.style.height=this.height;
}
}
}
rialto.widget.AbstractComponent.prototype.setVisible=function(visible){
var oHtml=this.getHtmlExt();
if(visible){
oHtml.style.display='block';
}
else{
oHtml.style.display='none';
}
this.visible=visible;
}
rialto.widget.AbstractComponent.prototype.getVisible=function(){
return this.visible;
}
rialto.widget.AbstractComponent.prototype.setEnable=function(enable){
}
rialto.widget.AbstractComponent.prototype.getEnable=function(){
return this.enable;
}
rialto.widget.AbstractComponent.prototype.setDraggable=function(draggable){
traceExec('draggable:'+draggable,1);
this.draggable=draggable;
var objDD=this.getHtmlDD();
objDD.dragAndDrop=this.draggable;
}
rialto.widget.AbstractComponent.prototype.setPosition=function(position){
this.position=position;
var oHtml=this.getHtmlExt();
oHtml.style.position=this.position;
}
rialto.widget.AbstractComponent.prototype.setStyle=function(obStyle){
var oHtml=this.getHtmlExt();
for(prop in obStyle){
oHtml.style[prop]=obStyle[prop];
}
}
rialto.widget.AbstractComponent.prototype.getStyle=function(obStyle){
var oHtml=this.getHtmlExt();
try{
if(typeof(obStyle)=='string')
obStyle=getComputStyle(oHtml,obStyle);
else{
for(prop in obStyle){
eval("obStyle."+prop+" =   getComputStyle(oHtml,'"+prop+"');");
}
}
}
catch(erreur){}
return obStyle;
}
rialto.widget.AbstractComponent.prototype.replaceInOriginalParent=function(){
if(!rialto.session.objects)rialto.session.objects=new Array;
if(rialto.session.objects["uicInTop"]){
var elt=rialto.session.objects["uicInTop"].uic;
rialto.session.objects["uicInTop"].parent.appendChild(elt);
elt.style.zIndex=rialto.session.objects["uicInTop"].zIndex;
rialto.session.objects["uicInTop"]=null;
}
}
rialto.widget.AbstractComponent.prototype.placeIn=function(parent){
if(!parent&&!this.parent)return;
if(parent==this.inParent)return;
if(!parent)
parent=this.parent;
var oHtml=this.getHtmlExt();
oHtml.oCiu=this;
oHtml.oRia=this;
if(parent.add){
parent.add(this,true);
}
else{
parent.appendChild(oHtml);
this.addInRialtoContainer(parent);
}
this.afterPlaceIn();
this.inParent=parent;
}
rialto.widget.AbstractComponent.prototype.addInRialtoContainer=function(objHTML){
if(!objHTML)return;
if(objHTML.oRia){
if(objHTML.oRia.isContainer){
objHTML.oRia.record(this)
}
else{
this.addInRialtoContainer(objHTML.parentNode)
}
}
else{
this.addInRialtoContainer(objHTML.parentNode)
}
}
rialto.widget.AbstractComponent.prototype.afterPlaceIn=function(){
if(this.alreadyAfterPlaceIn){return;}
var oHtml=this.getHtmlExt();
if(this.inParent){
var oldParent=this.parent;
}
this.parent=oHtml.parentNode;
if(oldParent&&oldParent.removeContents)
oldParent.removeContents(this);
this.adaptToContext();
this.initDD();
this.alreadyAfterPlaceIn=true;
}
rialto.widget.AbstractComponent.prototype.placeInTop=function(){
this.replaceInOriginalParent();
if(!rialto.session.objects)rialto.session.objects=new Array;
var elt=this.getHtmlExt();
rialto.session.objects["uicInTop"]={uic:this
,parent:this.parent
,zIndex:elt.style.zIndex};
elt.style.zIndex=1000002;
window.document.body.appendChild(elt);
}
rialto.widget.AbstractComponent.prototype.remove=function(bFromContainer){
this.release();
var oHtml=this.getHtmlExt();
if(oHtml.parentNode){oHtml.parentNode.removeChild(oHtml);}
if(!bFromContainer){
if(this.inContainer&&this.inContainer.removeContents)
this.inContainer.removeContents(this);
}
rialto.session.objects[this.id]=null;
this.parent=null;
this.inParent=null;
oHtml.oCiu=null;
oHtml.oRia=null;
for(prop in this){this[prop]=null};
}
rialto.widget.AbstractComponent.prototype.adaptToContext=function(){
}
rialto.widget.AbstractComponent.prototype.adaptAfterContainerChange=function(){
}
rialto.widget.AbstractComponent.prototype.release=function(){
}
rialto.widget.AbstractComponent.prototype.initDD=function(){
if(this.draggable){
var oHtml=this.getHtmlExt();
var objDD=this.getHtmlDD();
rialto.widgetBehavior.affect(this
,'DragAndDrop'
,{oHtmlToMove:oHtml
,oHtmlEvtTarget:objDD
,isWithLimitsDisplayed:false}
);
}
}
rialto.widget.AbstractComponent.prototype.initRZ=function(){
}
rialto.widget.AbstractComponent.prototype.getHtmlExt=function(){
return this.divExt;
}
rialto.widget.AbstractComponent.prototype.getHtmlImp=function(){
return this.divExt;
}
rialto.widget.AbstractComponent.prototype.getHtmlDD=function(){
return this.divExt;
}
rialto.widget.AbstractComponent.prototype.getHtmlRZ=function(){
return this.divExt;
}
rialto.widget.AbstractComponent.prototype.onclick=function(e){
};
rialto.widget.AbstractComponent.prototype.ondbleclick=function(e){
};
rialto.widget.AbstractComponent.prototype.onmouseover=function(e){
};
rialto.widget.AbstractComponent.prototype.onmouseout=function(e){
};
rialto.widget.AbstractComponent.prototype.onblur=function(e){
};
rialto.widget.AbstractComponent.prototype.onfocus=function(e){
};
rialto.widget.AbstractComponent.prototype.onmousemove=function(e){
};
rialto.widget.AbstractComponent.prototype.onmousedown=function(e){
};
rialto.widget.AbstractComponent.prototype.onmouseup=function(e){
};
rialto.widget.AbstractComponent.prototype.getNewParentHeight=function(){
var obj=this.getHtmlExt();
var heightCalc=ria.utils.measures.$getHeight(obj.parentNode,true);
return heightCalc;
}
rialto.widget.AbstractComponent.prototype.getNewParentWidth=function(){
var obj=this.getHtmlExt();
var widthCalc=ria.utils.measures.$getWidth(obj.parentNode,true);
return widthCalc;
}
rialto.widget.AbstractContainer=function(objPar){
this.base=rialto.widget.AbstractComponent;
this.base(objPar);
this.arrChild=new Array;
this.isContainer=true;
}
rialto.widget.AbstractContainer.prototype=new rialto.widget.AbstractComponent;
rialto.widget.AbstractContainer.prototype.add=function(elt,callByElt){
if(!elt)return;
var comp,oHtml;
if(elt.bRiaComp){
comp=elt;
oHtml=elt.getHtmlExt();
}
else
if(elt.oRia||elt.oCiu){
comp=elt.oRia||elt.oCiu;
oHtml=elt;
}
else{
comp=oHtml=elt;
}
this.getHtmlCont().appendChild(oHtml);
this.record(comp);
if(!callByElt&&comp.afterPlaceIn){
comp.afterPlaceIn();
}
}
rialto.widget.AbstractContainer.prototype.record=function(oRia){
if(!this.arrChild)
this.arrChild=new Array;
this.arrChild.push(oRia);
oRia.inContainer=this;
}
rialto.widget.AbstractContainer.prototype.removeContents=function(elt){
var comp;
if(elt.bRiaComp)
comp=elt;
else if(elt.oRia)
comp=elt.oRia;
else
comp=elt;
rialto.array.remove(this.arrChild,comp);
this.updateToContent();
}
rialto.widget.AbstractContainer.prototype.baseSetVisible=rialto.widget.AbstractComponent.prototype.setVisible;
rialto.widget.AbstractContainer.prototype.setVisible=function(visible){
this.basSetVisible(visible);
if(visible){this.$$activeContent();}
}
rialto.widget.AbstractContainer.prototype.updateToContent=function(){
}
rialto.widget.AbstractContainer.prototype.$$activeContent=function(){
if(!this.arrChild)return;
for(var i=0;i<this.arrChild.length;i++){
child=this.arrChild[i];
if(this.arrChild[i].adaptAfterContainerChange)
this.arrChild[i].adaptAfterContainerChange();
}
}
rialto.widget.AbstractContainer.prototype.adaptAfterContainerChange=function(){
this.$$activeContent();
}
rialto.widget.AbstractContainer.prototype.getHtmlCont=function(){
return this.divExt;
}
rialto.widget.AbstractContainer.prototype.remove=function(bFromContainer){
this.release();
for(var i=0;i<this.arrChild.length;i++){
if(this.arrChild[i].remove){
this.arrChild[i].remove(true);
}
}
this.arrChild=null;
var oHtml=this.getHtmlExt();
if(oHtml.parentNode){oHtml.parentNode.removeChild(oHtml);}
if(!bFromContainer){
if(this.inContainer&&this.inContainer.removeContents)
this.inContainer.removeContents(this);
}
rialto.session.objects[this.id]=null;
this.inParent=null;
oHtml.oCiu=null;
oHtml.oRia=null;
for(prop in this){this[prop]=null};
}
rialto.widget.AbstractContainer.prototype.resizeChilds=function(autoW,autoH){
for(var i=0;i<this.arrChild.length;i++){
if(!autoW&&!autoH){
if((this.arrChild[i].autoResizableW||this.arrChild[i].autoResizableH)&&this.arrChild[i].updateSize){
this.arrChild[i].updateSize();
}
}
else{
if(autoW&&this.arrChild[i].autoResizableW&&this.arrChild[i].updateWidth){
this.arrChild[i].updateWidth();
}
if(autoH&&this.arrChild[i].autoResizableH&&this.arrChild[i].updateHeight){
this.arrChild[i].updateHeight();
}
}
}
}
function Pile(tInit){
if(tInit)
this.t=tInit;
else
this.t=new Array;
}
Pile.prototype.push=function(nvElt){
this.t.push(nvElt);
}
Pile.prototype.pop=function(){
this.t.pop();
}
Pile.prototype.at=function(index){
this.t[index];
}
Pile.prototype.add=function(elt){
if(!this.curseurSur(elt))
this.push(elt);
}
Pile.prototype.remove=function(elt){
if(this.top()==elt)
this.pop();
else{
if(this.curseurSur(elt))
this.t.splice(this.indCourant,1)[0];
}
return this.length();
}
Pile.prototype.onTop=function(eltPromu){
if(this.t[this.indCourant]==eltPromu){
var i=this.indCourant;
bEltPresent=true;
}
else
{
var i=0;
var bEltPresent=false;
while(!bEltPresent
&&(i<this.t.length)){
if(this.t[i]==eltPromu)
bEltPresent=true;
else
i++;
}
}
if(bEltPresent)
{this.push(this.t.splice(i,1)[0]);
}
else
{this.push(eltPromu);
}
return;
}
Pile.prototype.length=function(){
return this.t.length;
}
Pile.prototype.top=function(){
if(this.t.length==0)
this.indCourant=0;
else
this.indCourant=this.t.length-1;
return this.t[this.indCourant];
}
Pile.prototype.bottom=function(){
this.indCourant=0;
return this.t[this.indCourant];
}
Pile.prototype.curseurSur=function(elt){
var i=0;
var bEltPresent=false;
while(!bEltPresent
&&(i<this.t.length)){
if(this.t[i]==elt)
bEltPresent=true;
else
i++;
}
this.indCourant=i;
return bEltPresent;
}
Pile.prototype.next=function(bCirculaire){
traceExec('next bCirculaire='+bCirculaire,32);
traceExec('next length()='+this.length(),32);
if(bCirculaire
&&(this.length()>1)){
this.indCourant=++this.indCourant%this.t.length;
return this.t[this.indCourant];
}
else
return((this.indCourant+1)<=this.t.length)?
this.t[++this.indCourant]:
null;
}
Pile.prototype.replaceCurrentVal=function(nvVal){
this.t[this.indCourant]=nvVal;
}
Pile.prototype.display=function(comportement){
var disp="";
for(var i=0;i<this.t.length;i++){
var ob=this.t[i];
if(ob.id)
disp=disp+"\n"+i+' '+ob.id;
else
disp=disp+"\n"+i+' '+'id inconnu';
}
if(comportement=='enRetour')
return disp;
else
traceExec('Contenu de la pile ('+this.t.length+' elts):\n'+disp,44);
}
function Container(oHtml,mode)
{
this.defMode='masque';
this.mode=this.mode||this.defMode;
this.bPseudoTailleMax=true;
this.idContainer=++Container.prototype.nbInstances;
this.setContainerHtml(oHtml,oHtml?'nonFen':mode);
this.managementMode='win';
this.barreOnglets=null;
this.bOptMSheetMode=true;
this.ctrlFenFi=null;
}
Container.prototype.nbInstances=0;
Container.prototype={
heightMinContainer:function(){
if(this.mode=='AutoScroll')
return this.oScroll.heightMin();
},
setContainerHtml:function(oHtml,mode,optionsMode){
if(!oHtml){
this.containerHtml=document.createElement('DIV');
}
else{
if(mode=='AutoScroll')
{
var w=oHtml.offsetWidth;
var h=oHtml.offsetHeight;
this.oScroll=new ContainerAutoScroll(oHtml,null,
w,h,optionsMode);
}
this.containerHtml=oHtml;
}
this.containerHtml.oContainer=this;
traceExec('mode= '+mode,76);
if(mode!='nonFen'){
this.mode=mode||this.defMode;
traceExec('setContainerHtml this.mode= '+this.mode,76);
this.setModeDisplayContains();
traceExec('setContainerHtml 1 this.containerHtml.className= '+this.containerHtml.className,76);
}
traceExec('setContainerHtml2 this.containerHtml.className= '+this.containerHtml.className,76);
},
setModeDisplayContains:function(mode){
if(mode)
this.mode=mode;
var etat=this.containerHtml.className.replace(/^[^\s]*/g,'');
this.containerHtml.className='container_'+this.mode+etat;
traceExec('->'+this.containerHtml.className+']',25);
traceExec('setModeDisplayContains  this.containerHtml.className=  '+this.containerHtml.className,76);
},
setMSheetMode:function(posTabs){
if(this.managementMode=='sheet')return;
this.managementMode='sheet';
this.ctrlFenFi.setManagtMode('sheet');
},
setMWinMode:function(){
if(this.managementMode=='win')return;
this.managementMode='win';
this.ctrlFenFi.setManagtMode('win');
},
setDimContainer:function(height,width){
if(this.mode=='AutoScroll'){
this.oScroll.setDim(width,height);
}
else{
this.containerHtml.style.height=height;
}
},
modDimContainer:function(deltaH,deltaW){
if(this.mode=='AutoScroll'){
this.oScroll.modDim(deltaW,deltaH);
}
else{
this.containerHtml.style.height=parseInt(this.containerHtml.style.height)+deltaH;
}
},
fill:function(eltHtml,bSaveOldContains,bClone){
if(bSaveOldContains
&&(!this.isEmpty())){
this.saveContains(bClear=true);
}
else
this.clear(bConserveEltsScroll=true);
if(eltHtml)
this.add(eltHtml,bClone);
return eltHtml;
},
isEmpty:function(){
if(this.mode=='AutoScroll')
return this.oScroll.isEmpty();
else
return !this.firstChild;
},
saveContains:function(bClear){
if(this.mode=='AutoScroll'){
this.oScroll.saveCurrentBuffer(bClear);
}
},
restoreContains:function(idContains,bSave){
if(this.mode=='AutoScroll'){
this.oScroll.restoreBuffer(idContains,bSave);
}
},
nextBuff:function(){
if(this.mode=='AutoScroll'){
this.oScroll.nextBuff();
}
},
prevBuff:function(){
if(this.mode=='AutoScroll'){
this.oScroll.prevBuff();
}
},
getHtmlCont:function(){
return this.containerHtml;
},
add:function(elt,bClone){
if(!elt){
window.status='demande d\'incorporation d\'un ?l?ment non pr?cis? : pas d\'action';
return -1;
}
if(this.mode=='AutoScroll'){
this.oScroll.add(elt,bClone);
}
else{
if(this.filleTailleMax)
this.svgZoneCentrale.appendChild(elt)
else{
var comp,oHtml;
if(elt.bRiaComp){
comp=elt;
oHtml=elt.getHtmlExt();
}
else
if(elt.oRia||elt.oCiu){
comp=elt.oRia||elt.oCiu;
oHtml=elt;
}
else{
comp=oHtml=elt;
}
if(comp!=oHtml)
this.record(comp);
this.getHtmlCont().appendChild(oHtml);
}
}
if(comp.afterPlaceIn){
comp.afterPlaceIn();
}
},
record:function(oRia){
if(!this.arrChild)
this.arrChild=new Array;
this.arrChild.push(oRia);
oRia.inContainer=this;
},
clear:function(bConserveEltsIU){
if(!this.isEmpty()){
if(this.mode=='AutoScroll'){
this.oScroll.clear(bConserveEltsIU);
}
}
},
addTabsPane:function(tabsPane,posTabs){
this.barreOnglets=tabsPane;
this.containerHtml.insertBefore(tabsPane.html,this.containerHtml.firstChild);
},
delTabsPane:function(){
this.containerHtml.removeChild(this.barreOnglets.html);
this.barreOnglets=null;
},
replaceContainsBy:function(nvContenu){
this.containerHtml.firstChild.nodeValue=nvContenu;
},
nbElts:function(){
return this.ctrlFenFi.length();
}
,
eltActif:function(){
return this.ctrlFenFi.top()
}
,
abandonModePPEtRes:function(sansActivation){
traceExec('abandonModePPEtRes vers Container  entree container= '+this.titreFenetre,31);
traceExec('abandonModePPEtMin fillePseudoTailleMax -> svgFenFille.suppAjustDimDynExt()',31);
this.svgFenFille.suppAjustDimDynExt();
this.svgFenFille.restoreSize(sansActivation);
traceExec('abandonModePPEtRes vers Container sortie',31);
}
}
function AutoScroll(top,left,width,height,aspect,DDInteractif,bClone){
this.AS=new ContainerAutoScroll(null
,this
,width
,height
,{mode:aspect
,DDinteractif:DDInteractif
,autoScrollSurTexte:!DDInteractif
,pasDeCloneContenuPasse:!bClone
}
,this.parentNode,top,left
);
this.autoScroll=function(mode){this.AS.autoScroll(mode);}
this.add=function(oHtmlElt){this.AS.add(oHtmlElt);}
this.setDim=function(width,height){this.AS.setDim(width,height);}
this.modDim=function(dWidth,dHeight){this.AS.modDim(dWidth,dHeight);}
this.adaptToContext=function(){
this.AS.reaffInterfaceScroll();
}
}
function ContainerAutoScroll(containerHtml,oHtmlTexte,width,height,options,parent,top,left){
this.valCssEtroit='5px';
valCss=document.createElement('DIV');
valCss.className='large';
valCss.style.display='none';
document.body.appendChild(valCss);
this.valCssLarge=getComputStyleStr(valCss,'width');
document.body.removeChild(valCss);
this.height=height;
this.width=width;
this.top=top;
this.left=left;
this.opt=new Array;
this.optionPasDeCloneContenuPasse=(options?(options.pasDeCloneContenuPasse||false):false);
this.optionCloneContenuAjoute=(options?(options.cloneContenuAjoute||false):false);
this.opt.Meta=new Object;
this.opt['Meta'].bascule=(options?((options.bascule!=null)?options.bascule:true)
:true);
this.opt['Meta'].CoherenceAuto=(options?((options.CoherenceAuto!=null)?options.CoherenceAuto:true)
:true);
this.optionAccesHaut=(options?(options.accesHaut||false):false);
this.optionAccesBas=(options?(options.accesBas||false):false);
this.optionAscenseur=(options?(options.ascenseur||false):false);
this.optionAscHautFleche=(options?(options.ascHautFleche||false):false);
this.optionAscBasFleche=(options?(options.ascBasFleche||false):false);
this.optionAscenseurWin=(options?(options.ascenseurWin||false):false);
this.optionAscHautFlecheWin=(options?(options.ascHautFlecheWin||false):false);
this.optionAscBasFlecheWin=(options?(options.ascBasFlecheWin||false):false);
this.opt.Mod=new Object;
this.opt['Mod'].PosAscWin=(options?((options.posAscWin!=null)?options.posAscWin
:'right')
:'right');
this.opt['Mod'].PosAscWinLeft=(this.opt['Mod'].PosAscWin=='left')?true:false;
this.opt['Mod'].PosAsc=(options?(options.posAsc||'left'):'left');
this.opt['Mod'].PosAscLeft=(this.opt['Mod'].PosAsc=='left')?true:false;
this.opt['Mod'].TemoinPos=(options?(options.temoinPosition||false):false);
this.opt['Mod'].ScrollSurTemoinPos=(options?(options.scrollSurTemoinPos||false):false);
this.opt['Mod'].DDInteractif=(options?(options.DDInteractif||false):false);
this.opt['Mod'].AutoScrollSurTexte=(options?((options.autoScrollSurTexte!=null)?options.autoScrollSurTexte
:true)
:true);
this.opt['Mod'].AscWinFin=(options?(options.ascWinFin||false):false);
if((this.optionAscHautFleche)
&&(!this.optionAccesHaut
&&!this.optionAscenseur))
this.optionAscHautFleche=false;
if(this.optionAscHautFlecheWin
&&!this.optionAscenseurWin)
this.optionAscHautFlecheWin=false;
if((this.optionAscBasFleche)
&&(!this.optionAccesBas
&&!this.optionAscenseur))
this.optionAscBasFleche=false;
if(this.optionAscBasFlecheWin
&&!this.optionAscenseurWin)
this.optionAscBasFlecheWin=false;
if(options&&options.mode){
this.initOptionsModePreDef(options.mode);
if(options.DDInteractif
&&options.AutoScrollSurTexte){
alert('Les options    \"d?placement du texte par Drag and Drop (Glisser-D?poser)\"\net    \"d?filement automatique suivant la position du curseur\" \nsont incompatibles; elles ont ?t? ajout?es ? l\'option du mode pr?d?fini:'
+'\n\n      '+options.mode+'\n\n Arbitrairement le syst?me conserve l\'option \"d?filement automatique\"');
}
if(options.DDInteractif!=null){
if(options.DDInteractif){
this.opt['Mod'].AutoScrollSurTexte=false;
this.opt['Mod'].DDInteractif=true;
}
else{
this.opt['Mod'].AutoScrollSurTexte=true;
this.opt['Mod'].DDInteractif=false;
}
}
if(options.AutoScrollSurTexte!=null){
if(options.AutoScrollSurTexte){
this.opt['Mod'].AutoScrollSurTexte=true;
this.opt['Mod'].DDInteractif=false;
}
else{
this.opt['Mod'].AutoScrollSurTexte=false;
this.opt['Mod'].DDInteractif=true;
}
}
}
else
if(this.opt['Mod'].DDInteractif
&&this.opt['Mod'].AutoScrollSurTexte){
alert('Les options    \"d?placement du texte par Drag and Drop (Glisser-D?poser)\"\n et    \"d?filement automatique suivant la position du curseur\" \n sont incompatibles. \n\n Arbitrairement le syst?me choisi la deuxi?me option : d?filement automatique');
this.opt['Mod'].DDInteractif=false;
this.opt['Mod'].AutoScrollSurTexte=true;
}
this.partieDoctCachee=true;
this.majListeEltsPresents();
this.majListeModalites();
this.idObjComp='containerAS_'+ContainerAutoScroll.prototype.nbInstances++;
if(!containerHtml){
this.containerHtml=document.createElement('DIV');
this.containerHtml.style.width=width;
this.containerHtml.style.height=height;
if(oHtmlTexte){
this.containerHtml.style.top=oHtmlTexte.style.top;
this.containerHtml.style.left=oHtmlTexte.style.left;
}
}
else{
this.containerHtml=containerHtml;
}
this.containerHtml.className='container_AutoScroll';
this.containerHtml.oCiu=this;
this.containerHtml.id=this.idObjComp+'_cadreExt';
if(this.opt['Meta'].bascule||this.optionAccesHaut){
this.oHtmlAccesHaut=document.createElement('DIV');
this.oHtmlAccesHaut.className='zoneAccesHaut';
this.oHtmlAccesHaut.id=this.idObjComp+'_accesHaut';
this.oHtmlAccesHaut.oCiu=this;
this.oHtmlAccesHaut.onclick=ContainerAutoScroll.eventHandlers.onclickHaut;
this.containerHtml.appendChild(this.oHtmlAccesHaut);
this.oHtmlAccesHaut.className+=' masqueEltScroll';
}
this.oHtmlCadreInt=document.createElement('DIV');
this.oHtmlCadreInt.id=this.idObjComp+'_cadreInt';
this.oHtmlCadreInt.className='zoneTexte';
this.oHtmlCadreInt.oCiu=this;
this.oHtmlCadreInt.prctHZoneInerte=0.1;
this.containerHtml.appendChild(this.oHtmlCadreInt);
if(this.opt['Meta'].bascule||this.optionAscenseur){
this.oHtmlAscenseur=document.createElement('DIV');
this.oHtmlAscenseur.oCiu=this;
this.oHtmlAscenseur.className='zoneAscenseur';
this.oHtmlCadreInt.appendChild(this.oHtmlAscenseur);
this.oHtmlAscenseur.className+=' masqueEltScroll';
this.oHtmlPiloteScroll=document.createElement('DIV');
this.oHtmlPiloteScroll.className='piloteScroll';
this.oHtmlPiloteScroll.oCiu=this;
this.oHtmlAscenseur.appendChild(this.oHtmlPiloteScroll);
this.oHtmlAscSup=document.createElement('DIV');
this.oHtmlAscSup.oCiu=this;
this.oHtmlAscSup.className='ascenseurHaut';
this.oHtmlPiloteScroll.appendChild(this.oHtmlAscSup);
this.oHtmlAscInf=document.createElement('DIV');
this.oHtmlAscInf.oCiu=this;
this.oHtmlAscInf.className='ascenseurBas';
this.oHtmlPiloteScroll.appendChild(this.oHtmlAscInf);
}
if(this.opt['Meta'].bascule||this.optionAscenseurWin){
this.oHtmlAscenseurWin=document.createElement('DIV');
this.oHtmlAscenseurWin.oCiu=this;
this.oHtmlAscenseurWin.className='zoneAscenseur';
this.oHtmlCadreInt.appendChild(this.oHtmlAscenseurWin);
this.oHtmlAscenseurWin.className+=' masqueEltScroll';
this.oHtmlPiloteScrollWin=document.createElement('DIV');
this.oHtmlPiloteScrollWin.className='piloteScroll';
this.oHtmlPiloteScrollWin.oCiu=this;
this.oHtmlAscenseurWin.appendChild(this.oHtmlPiloteScrollWin);
var oFixe=document.createElement('DIV');
oFixe.className='ascenseurWin';
oFixe.style.display='none';
oFixe.style.top=0;
oFixe.style.left=0;
oFixe.style.height='100%';
oFixe.style.fontSize='0.5em';
oFixe.id='cursPartieFixe_'+(++cursPartieFixe.prototype.nbInstances);
oFixe.oCiu=this;
var oMob=document.createElement('DIV');
oMob.className='cursAscenseurWin';
oMob.style.display='none';
oMob.style.top=0;
oMob.style.left=0;
oMob.style.height=10;
oMob.style.width='';
oMob.style.fontSize='0.5em';
oMob.style.border='2px white outset';
oMob.oCiu=this;
oMob.id='cursPartieMobile_'+(++cursPartieMobile.prototype.nbInstances);
this.cursTemoinPos=new CurseurMobile(
oFixe
,oMob
,{mobilite:'DragAndDrop'
,orientation:'v'
,posRelI:{top:0,left:0}
,bRectLim:true
,majDyn:true
,rectLim:{top:0,left:0,bottom:'this.oHtmlFixe.offsetHeight'}
,circulaire:false}
,0
);
oFixe.style.display='block';
oMob.style.display='block';
this.cursTemoinPos.placeIn(this.oHtmlPiloteScrollWin,0,0,'relative');
this.hCurs=new CouplageCurseurs(0);
traceExec('avant add this.cursTemoinPos = '+this.cursTemoinPos,9);
this.hCurs.add(this.cursTemoinPos);
}
this.oHtmlTexte=document.createElement('DIV');
if(oHtmlTexte){
oHtmlTexte.style.backgroundColor='';
var heightRef=oHtmlTexte.offsetHeight;
if(this.optionPasDeCloneContenuPasse){
oHtmlTexte.style.top=0;
oHtmlTexte.style.left=0;
oHtmlTexte.style.position='relative';
this.oHtmlTexte.appendChild(oHtmlTexte);
}
else{
var clo=oHtmlTexte.cloneNode(true);
clo.style.top=0;
clo.style.left=0;
clo.style.position='relative';
this.oHtmlTexte.appendChild(clo);
}
}
this.oHtmlTexte.className='texte';
if(window.getComputedStyle==undefined)
this.oHtmlTexte.className+=' texteIE';
this.oHtmlTexte.style.top=0;
this.oHtmlTexte.style.left=0;
this.oHtmlTexte.id='idTexte';
this.lBuff=new Array();
this.noCurrentBuff=this.createBuff();
this.oHtmlTexte.id=this.idObjComp+'_buffActif_'+this.noCurrentBuff;
this.bBuffMod=true;
var testHTexte=document.createElement('DIV');
testHTexte.className='texte';
testHTexte.style.visibility='hidden';
var uneLigne=document.createTextNode('pour evaluer la hauteur en pixel d une ligne');
testHTexte.appendChild(uneLigne);
document.body.appendChild(testHTexte);
this.oHtmlTexte.pxHLine=parseInt(testHTexte.offsetHeight);
document.body.removeChild(testHTexte);
this.oHtmlCadreInt.appendChild(this.oHtmlTexte);
if(this.opt['Meta'].bascule||this.optionAccesBas){
this.oHtmlAccesBas=document.createElement('DIV');
this.oHtmlAccesBas.className='zoneAccesBas';
this.oHtmlAccesBas.id=this.idObjComp+'_accesBas';
this.oHtmlAccesBas.oCiu=this;
this.containerHtml.appendChild(this.oHtmlAccesBas);
this.oHtmlAccesBas.onclick=ContainerAutoScroll.eventHandlers.onclickBas;
this.oHtmlAccesBas.className+=' masqueEltScroll';
}
if(this.opt['Meta'].bascule||this.optionAscHautFleche){
this.oHtmlAscHautFleche=document.createElement('DIV');
this.oHtmlAscHautFleche.oCiu=this;
this.oHtmlAscHautFleche.className='zoneHautFlecheDirect';
this.oHtmlAscHautFleche.onclick=ContainerAutoScroll.eventHandlers.onclickHaut;
this.oHtmlAscHautFleche.className+=' masqueEltScroll';
}
if(this.opt['Meta'].bascule||this.optionAscHautFlecheWin){
this.oHtmlAscHautFlecheWin=document.createElement('DIV');
this.oHtmlAscHautFlecheWin.oCiu=this;
this.oHtmlAscHautFlecheWin.className='zoneAscHautFleche';
this.oHtmlAscHautFlecheWin.className+=' masqueEltScroll';
}
if(this.opt['Meta'].bascule||this.optionAscBasFleche){
this.oHtmlAscBasFleche=document.createElement('DIV');
this.oHtmlAscBasFleche.oCiu=this;
this.oHtmlAscBasFleche.className='zoneBasFlecheDirect';
this.oHtmlAscBasFleche.onclick=ContainerAutoScroll.eventHandlers.onclickBas;
this.oHtmlAscBasFleche.className+=' masqueEltScroll';
}
if(this.opt['Meta'].bascule||this.optionAscBasFlecheWin){
this.oHtmlAscBasFlecheWin=document.createElement('DIV');
this.oHtmlAscBasFlecheWin.oCiu=this;
this.oHtmlAscBasFlecheWin.className='zoneAscBasFleche';
this.oHtmlAscBasFlecheWin.className+=' masqueEltScroll';
}
if(this.optionAscHautFleche){
if(this.optionAccesHaut){
this.oHtmlAccesHaut.className+=' zoneAccesElargie';
this.oHtmlAscHautFleche.className+=' dansZoneAccesHB';
this.oHtmlAccesHaut.appendChild(this.oHtmlAscHautFleche);
}
else
if(this.optionAscenseur)
this.oHtmlAscenseur.insertBefore(this.oHtmlAscHautFleche,this.oHtmlPiloteScroll);
}
if(this.optionAscHautFlecheWin)
this.oHtmlAscenseurWin.insertBefore(this.oHtmlAscHautFlecheWin,this.oHtmlPiloteScrollWin);
if(this.optionAscBasFleche){
if(this.optionAccesBas){
this.oHtmlAccesBas.className+=' zoneAccesElargie';
this.oHtmlAscBasFleche.className+=' dansZoneAccesHB'
this.oHtmlAccesBas.appendChild(this.oHtmlAscBasFleche);
}
else
if(this.optionAscenseur)
this.oHtmlAscenseur.appendChild(this.oHtmlAscBasFleche);
}
if(this.optionAscBasFlecheWin)
this.oHtmlAscenseurWin.insertBefore(this.oHtmlAscHautFlecheWin,this.oHtmlPiloteScrollWin);
this.zoneTexteCommeCurseur=function(){
this.cursTexte=new CurseurMobile(this.oHtmlCadreInt
,this.oHtmlTexte
,{mobilite:'DragAndDrop'
,orientation:'v'
,complementProp:true
,rectLim:{
top:'-(   parseInt(this.oHtmlMobile.offsetHeight) '
+'     - Math.min('
+'           parseInt(this.oHtmlFixe.style.height),'
+'            (  parseInt(this.oHtmlMobile.offsetHeight)'
+'             - Math.abs(parseInt(this.oHtmlMobile.style.top))))'
+' )'
,bottom:'this.oHtmlMobile.offsetHeight'}
}
,0);
if(!this.opt['Mod'].DDInteractif)
this.oHtmlTexte.dragAndDrop=false;
if(this.optionAscenseurWin){
traceExec('avant couplageAscenseurTexte this.cursTexte = '+this.cursTexte,9);
this.couplageAscenseurTexte(true);
}
}
execAfterLoad(this.containerHtml.id,'affInterfaceScroll');
traceExec('execAfterLoad(this.containerHtml.id = '+this.containerHtml.id+' ,"zoneTexteCommeCurseur"',74);
if(parent)
this.placeIn(parent,top,left);
this.containerHtml.onresize=function(){
}
this.tMode=new Array(6);
this.tMode[0]=new Array(2);
this.tMode[0][0]='windows type Lift';
this.tMode[0][1]='AscenseurWin';
this.tMode[1]=new Array(2);
this.tMode[1][0]="windows type Lift + DragAndDrop / Text";
this.tMode[1][1]="TextDDAscenseurWin";
this.tMode[2]=new Array(2);
this.tMode[2][0]="automatic Scroll with variable Speed / Lift";
this.tMode[2][1]="AscenseurAuto";
this.tMode[3]=new Array(2);
this.tMode[3][0]="the same + Indicator of position";
this.tMode[3][1]="AscenseurAutoTemoin";
this.tMode[4]=new Array(2);
this.tMode[4][0]="automatic Scroll with variable Speed / Text";
this.tMode[4][1]="TextAutoMin";
this.tMode[5]=new Array(2);
this.tMode[5][0]="the same + Indicator of position + top-bottom Area";
this.tMode[5][1]="TextAutoDebFinTemoin";
this.menuContext=new objMenuCont('mCtxtEditeur',400);
this.menuContext.createMenu(this.containerHtml);
this.menuContext.oCiu=this;
this.menuContext.add(this.tMode[0][0],actif=true,true);
this.menuContext.add(this.tMode[1][0],actif=true,true,true);
this.menuContext.addSeparation();
this.menuContext.add(this.tMode[2][0],actif=true,true);
this.menuContext.add(this.tMode[3][0],actif=true,true);
this.menuContext.addSeparation();
this.menuContext.add(this.tMode[4][0],actif=true,true);
this.menuContext.add(this.tMode[5][0],actif=true,true);
this.containerHtml.oCiu=this;
this.containerHtml.oncontextmenu=function(e){
var menu=this.oCiu.menuContext;
menu.cible=null;
menu.afficheMenu(e);
}
this.menuContext.itemClickApplicatif=function(i){
var modeChoisi=this.oCiu.tMode[i][1];
this.oCiu.autoScroll(modeChoisi);
}
}
ContainerAutoScroll.prototype.nbInstances=0;
ContainerAutoScroll.prototype.listeEltsScroll=
'Ascenseur#AscenseurWin#AccesHaut#AccesBas#AscHautFleche#AscBasFleche#AscHautFlecheWin#AscBasFlecheWin#';
ContainerAutoScroll.prototype.listeModalites=
'DDInteractif#AutoScrollSurTexte#TemoinPos#ScrollSurTemoinPos#PosAscLeft#PosAscWinLeft#AscWinFin#';
ContainerAutoScroll.prototype.listeModePreDef=
'TextDDAscenseurWin#TextDDAscAutoDebFinTemoin#AscenseurAuto#AscenseurWin#AscenseurAutoTemoin#TextAutoMin#TextAutoDebFin#TextAutoDebFinTemoin#NoScroll#TextDDTemoin#TextDDDebFinTemoin#';
ContainerAutoScroll.prototype.modePreDefEltsPresents={
AscenseurAuto:['Ascenseur','AscHautFleche','AscBasFleche']
,AscenseurWin:['AscenseurWin','AscHautFlecheWin','AscBasFlecheWin']
,AscenseurAutoTemoin:['AscenseurWin','Ascenseur','AscHautFleche','AscBasFleche']
,TextAutoMin:[]
,TextAutoDebFin:['AccesBas','AccesHaut','AscHautFleche','AscBasFleche']
,TextAutoDebFinTemoin:['AccesBas','AccesHaut','AscenseurWin','AscHautFleche','AscBasFleche']
,TextDDTemoin:['AscenseurWin']
,TextDDDebFinTemoin:['AscenseurWin','AccesBas','AccesHaut','AscHautFleche','AscBasFleche']
,TextDDAscAutoDebFinTemoin:['AscenseurWin','Ascenseur','AscHautFleche','AscBasFleche']
,TextDDAscenseurWin:['AscenseurWin','AscHautFlecheWin','AscBasFlecheWin']
,NoScroll:[]
}
ContainerAutoScroll.prototype.modePreDefEltsAbsents={
AscenseurAuto:['AccesBas','AccesHaut','AscenseurWin','AscHautFlecheWin','AscBasFlecheWin']
,AscenseurWin:['AccesBas','AccesHaut','Ascenseur','AscHautFleche','AscBasFleche']
,AscenseurAutoTemoin:['AccesBas','AccesHaut','AscHautFlecheWin','AscBasFlecheWin']
,TextAutoMin:['Ascenseur','AscenseurWin','AccesBas','AccesHaut','AscHautFleche','AscBasFleche','AscHautFlecheWin','AscBasFlecheWin']
,TextAutoDebFin:['Ascenseur','AscenseurWin','AscHautFlecheWin','AscBasFlecheWin']
,TextAutoDebFinTemoin:['Ascenseur','AscHautFlecheWin','AscBasFlecheWin']
,TextDDTemoin:['Ascenseur','AccesBas','AccesHaut','AscHautFleche','AscBasFleche','AscHautFlecheWin','AscBasFlecheWin']
,TextDDDebFinTemoin:['Ascenseur','AscHautFlecheWin','AscBasFlecheWin']
,TextDDAscAutoDebFinTemoin:['AccesBas','AccesHaut','AscHautFlecheWin','AscBasFlecheWin']
,TextDDAscenseurWin:['AccesBas','AccesHaut','Ascenseur','AscHautFleche','AscBasFleche']
,NoScroll:['Ascenseur','AscenseurWin','AccesBas','AccesHaut','AscHautFleche','AscBasFleche','AscHautFlecheWin','AscBasFlecheWin']
}
ContainerAutoScroll.prototype.modePreDefComportements={
AscenseurAuto:['AscWinFin=false','DDInteractif = false','AutoScrollSurTexte = false','TemoinPos=false','ScrollSurTemoinPos=false','PosAscLeft=false','PosAscWinLeft=false']
,AscenseurWin:['AscWinFin=false','DDInteractif = false','AutoScrollSurTexte = false','TemoinPos=false','ScrollSurTemoinPos=false','PosAscLeft=false','PosAscWinLeft=false']
,AscenseurAutoTemoin:['AscWinFin=true','DDInteractif = false','AutoScrollSurTexte = false','TemoinPos=true','ScrollSurTemoinPos=false','PosAscLeft=false','PosAscWinLeft=true']
,TextAutoMin:['AscWinFin=false','DDInteractif = false','AutoScrollSurTexte = true','TemoinPos=false','ScrollSurTemoinPos=false','PosAscLeft=false','PosAscWinLeft=false']
,TextAutoDebFin:['AscWinFin=false','DDInteractif = false','AutoScrollSurTexte = true','TemoinPos=false','ScrollSurTemoinPos=false','PosAscLeft=false','PosAscWinLeft=false']
,TextAutoDebFinTemoin:['AscWinFin=true','DDInteractif = false','AutoScrollSurTexte = true','TemoinPos=true','ScrollSurTemoinPos=false','PosAscLeft=false','PosAscWinLeft=true']
,TextDDTemoin:['AscWinFin=true','DDInteractif = true','AutoScrollSurTexte = false','TemoinPos=true','ScrollSurTemoinPos=false','PosAscLeft=false','PosAscWinLeft=true']
,TextDDDebFinTemoin:['AscWinFin=true','DDInteractif = true','AutoScrollSurTexte = false','TemoinPos=true','ScrollSurTemoinPos=false','PosAscLeft=false','PosAscWinLeft=true']
,TextDDAscAutoDebFinTemoin:['AscWinFin=true','DDInteractif = true','AutoScrollSurTexte = false','TemoinPos=true','ScrollSurTemoinPos=false','PosAscLeft=false','PosAscWinLeft=true']
,TextDDAscenseurWin:['AscWinFin=false','DDInteractif = true','AutoScrollSurTexte = false','TemoinPos=false','ScrollSurTemoinPos=false','PosAscLeft=false','PosAscWinLeft=false']
,NoScroll:['AscWinFin=false','DDInteractif = false','AutoScrollSurTexte = false','TemoinPos=false','ScrollSurTemoinPos=false','PosAscLeft=false','PosAscWinLeft=false']
}
ContainerAutoScroll.prototype.heightMinCursTemoinPos=10;
ContainerAutoScroll.prototype.majListeEltsPresents=function(elt,mode){
traceExec('majListe deb  this.listeEltsPresents= '+this.listeEltsPresents,9);
traceExec('majListe deb  this.listeEltsAbsents= '+this.listeEltsAbsents,9);
var listeEltsPresents='',listeEltsAbsents='';
if(!elt){
var opt;
var tlisteElts=new Array();
tlisteElts=ContainerAutoScroll.prototype.listeEltsScroll.split('#');
tlisteElts.pop();
for(var i=0;i<tlisteElts.length;i++){
opt=tlisteElts[i];
if(eval('this.option'+opt))
listeEltsPresents=listeEltsPresents+opt+'#';
else
listeEltsAbsents=listeEltsAbsents+opt+'#';
}
if(this.partieDoctCachee){
this.listeEltsPresents=listeEltsPresents;
this.listeEltsAbsents=listeEltsAbsents;
}
else{
this.svgListeEltsPresents=listeEltsPresents;
this.svgListeEltsAbsents=listeEltsAbsents;
}
}
else{
traceExec('majListe '+(this.partieDoctCachee?'doct cach?':'doct visible')+' svg mode= '+mode,9);
var regExp=new RegExp(elt+'#');
if(this.partieDoctCachee){
if(mode=='ajout'){
if(this.listeEltsPresents.indexOf(elt+'#')==-1)
this.listeEltsPresents+=elt+'#';
this.listeEltsAbsents=this.listeEltsAbsents.replace(regExp,'');
}
else{
this.listeEltsPresents=this.listeEltsPresents.replace(regExp,'');
if(this.listeEltsAbsents.indexOf(elt+'#')==-1)
this.listeEltsAbsents+=elt+'#';
}
}
else{
if(mode=='ajout'){
if(this.svgListeEltsPresents.indexOf(elt+'#')==-1)
this.svgListeEltsPresents+=elt+'#';
this.svgListeEltsAbsents=this.svgListeEltsAbsents.replace(regExp,'');
}
else{
this.svgListeEltsPresents=this.svgListeEltsPresents.replace(regExp,'');
if(this.svgListeEltsAbsents.indexOf(elt+'#')==-1)
this.svgListeEltsAbsents+=elt+'#';
}
}
}
traceExec('majListe  this.listeEltsPresents= '+this.listeEltsPresents,9);
traceExec('majListe  this.listeEltsAbsents= '+this.listeEltsAbsents,9);
}
ContainerAutoScroll.prototype.majListeModalites=function(){
traceExec('majListeModalites entree',31);
var modalite;
var tlisteMods=new Array();
tlisteMods=ContainerAutoScroll.prototype.listeModalites.split('#');
tlisteMods.pop();
this.listeModalites='';
for(var i=0;i<tlisteMods.length;i++){
modalite='this.opt["Mod"].'+tlisteMods[i];
this.listeModalites=this.listeModalites
+tlisteMods[i]+' = '+(eval(modalite)?'true':'false')
+'#';
traceExec('majListeModalites mod '+tlisteMods[i]+' = '+eval(modalite),31);
}
traceExec('majListeModalites = '+this.listeModalites,31);
}
ContainerAutoScroll.prototype.couplageTexteAvecCursExt=function(coupleur){
if(coupleur)
coupleur.add(this.cursTexte);
}
ContainerAutoScroll.prototype.couplageDeCursExt=function(curs){
if(!this.hCurs){
this.hCurs=new CouplageCurseurs();
if(this.cursTexte){
this.cursTexte.loadLimitsDyn();
this.hCurs.add(this.cursTexte,majTousCurs=true);
}
}
this.hCurs.add(curs);
}
ContainerAutoScroll.prototype.couplageAscenseurTexte=function(couplage){
if(!this.hCurs)
this.hCurs=new CouplageCurseurs();
if(couplage){
traceExec('couplageAscenseurTexte avant add this.cursTexte = '+this.cursTexte,10);
if(this.cursTexte){
this.cursTexte.loadLimitsDyn();
this.hCurs.add(this.cursTexte,majTousCurs=true);
}
traceExec('couplageAscenseurTexte avant add this.cursTemoinPos = '+this.cursTemoinPos,10);
if(this.cursTemoinPos)this.hCurs.add(this.cursTemoinPos);
}
else{
traceExec('couplageAscenseurTexte avant rem this.cursTemoinPOs = '+this.cursTemoinPos,10);
this.hCurs.remove(this.cursTemoinPos);
if(this.hCurs.nbEltsCouples==1){
traceExec('couplageAscenseurTexte avant rem this.cursTexte = '+this.cursTexte,10);
this.hCurs.remove(this.cursTexte);
}
}
}
ContainerAutoScroll.prototype.autoScrollSurTexte=function(suppression){
if(suppression){
this.oHtmlCadreInt.onmousemove=null;
this.oHtmlCadreInt.onclick=null;
this.oHtmlCadreInt.onmouseout=null;
this.opt['Mod'].AutoScrollSurTexte=false;
this.autoScrollMin();
}
else{
this.oHtmlCadreInt.onmousemove=ContainerAutoScroll.eventHandlers.onmousemove;
this.oHtmlCadreInt.onclick=ContainerAutoScroll.eventHandlers.onclickCentre;
this.oHtmlCadreInt.onmouseout=ContainerAutoScroll.eventHandlers.onmouseout;
this.opt['Mod'].AutoScrollSurTexte=true;
}
this.majListeModalites();
}
ContainerAutoScroll.prototype.zoneAscModeInteractif=function(interactif){
if(interactif){
this.cursTemoinPos.oHtmlMobile.dragAndDrop=true;
this.opt['Mod'].TemoinPos=false;
}
else{
this.cursTemoinPos.oHtmlMobile.dragAndDrop=false;
this.opt['Mod'].TemoinPos=true;
}
this.autoScrollMin();
this.majListeModalites();
}
ContainerAutoScroll.prototype.zoneTemoinScrollAuto=function(auto){
if(auto)
this.fixeModalitesParticulieres('ScrollSurTemoinPos=true');
else
this.fixeModalitesParticulieres('ScrollSurTemoinPos=false');
this.majListeModalites();
}
ContainerAutoScroll.prototype.zoneAffModeInteractif=function(interactif){
if(interactif){
this.opt['Mod'].DDInteractif=true;
this.oHtmlTexte.dragAndDrop=true;
this.oHtmlCadreInt.onmousemove=null;
this.oHtmlCadreInt.onclick=null;
this.oHtmlCadreInt.onmouseout=null;
}
else{
this.opt['Mod'].DDInteractif=false;
this.oHtmlTexte.dragAndDrop=false
if(!this.optionAscenseur
&&(!this.optionAscenseurWin
||this.opt['Mod'].TemoinPos)
&&this.opt['Meta'].CoherenceAuto){
this.oHtmlCadreInt.onmousemove=ContainerAutoScroll.eventHandlers.onmousemove;
this.oHtmlCadreInt.onclick=ContainerAutoScroll.eventHandlers.onclickCentre;
this.oHtmlCadreInt.onmouseout=ContainerAutoScroll.eventHandlers.onmouseout;
}
}
this.majListeModalites();
}
ContainerAutoScroll.prototype.barreTemoinPosEtroite=function(etroite){
if(this.oldLargTemoin==etroite)return;
this.oldLargTemoin=etroite;
if(etroite){
this.opt['Mod'].AscWinFin=true;
this.cursTemoinPos.oHtmlFixe.style.width=this.valCssEtroit;
this.cursTemoinPos.oHtmlMobile.style.width=this.valCssEtroit;
this.oHtmlAscenseurWin.className+=' etroit';
if(window.getComputedStyle!=undefined){
this.oHtmlTexte.style.width=parseInt(this.oHtmlTexte.style.width)
+(parseInt(this.valCssLarge)
-parseInt(this.valCssEtroit));
if(this.oldPosAscWin=='left')
this.oHtmlTexte.style.left=parseInt(this.oHtmlTexte.style.left)
-(parseInt(this.valCssLarge)
-parseInt(this.valCssEtroit));
}
if(this.optionAscHautFlecheWin){
this.oHtmlAscHautFlecheWin.className+=' etroitFleche';
}
if(this.optionAscBasFlecheWin){
this.oHtmlAscBasFlecheWin.className+=' etroitFleche';
}
}
else{
this.opt['Mod'].AscWinFin=false;
this.cursTemoinPos.oHtmlFixe.style.width=this.valCssLarge;
this.cursTemoinPos.oHtmlMobile.style.width=this.valCssLarge;
this.oHtmlAscenseurWin.className=this.oHtmlAscenseurWin.className.replace(/etroit/g,'');
if(window.getComputedStyle!=undefined){
this.oHtmlTexte.style.width=parseInt(this.oHtmlTexte.style.width)
-(parseInt(this.valCssLarge)
-parseInt(this.valCssEtroit));
if(this.oldPosAscWin=='left')
this.oHtmlTexte.style.left=parseInt(this.oHtmlTexte.style.left)
+(parseInt(this.valCssLarge)
-parseInt(this.valCssEtroit));
}
if(this.optionAscHautFlecheWin){
this.oHtmlAscHautFlecheWin.className=this.oHtmlAscHautFlecheWin.className.replace(/etroitFleche/g,'');
}
if(this.optionAscBasFlecheWin){
this.oHtmlAscBasFlecheWin.className=this.oHtmlAscBasFlecheWin.className.replace(/etroitFleche/g,'');
}
}
this.majListeModalites();
}
ContainerAutoScroll.prototype.basculeModalite=function(mode){
var opt='this.opt["Mod"].'+mode;
if(eval(opt))
this.fixeModalitesParticulieres(mode+'=false');
else
this.fixeModalitesParticulieres(mode+'=true');
}
ContainerAutoScroll.prototype.existModePreDef=function(mode){
var tokElt=mode+'#';
if(ContainerAutoScroll.prototype.listeModePreDef.indexOf(tokElt)==-1){
alert('\"'+mode+'\"'+' est une d?nomination d\' aspect de scroll inconnue;le mode d\' affichage ainsi d?sign? ne peut donc ?tre pris en compte.');
return false;
}
else
return true;
}
ContainerAutoScroll.prototype.initOptionsModePreDef=function(mode){
traceExec('initOptionsModePredef entree mode= '+mode,31);
if(mode
&&!this.existModePreDef(mode))return;
var elts;
if(mode){
var elements=ContainerAutoScroll.prototype.modePreDefEltsPresents[mode];
if(!(elements instanceof Array)){
elts=new Array();
elts[0]=elements;
}
else
elts=elements;
}
else{
elts=new Array();
elts=this.listeEltsPresents.split("#");
elts.pop();
}
var instr;
for(var i=0;i<elts.length;i++){
instr='this.option'+elts[i]+' = true';
eval(instr);
}
if(mode){
elements=ContainerAutoScroll.prototype.modePreDefEltsAbsents[mode];
if(elements!=''){
if(!(elements instanceof Array)){
elts=new Array();
elts[0]=elements;
}
else
elts=elements;
}
}
else{
elts=new Array();
elts=this.listeEltsAbsents.split("#");
elts.pop();
}
var instr;
for(var i=0;i<elts.length;i++){
instr='this.option'+elts[i]+' = false';
eval(instr);
}
if(mode){
elements=ContainerAutoScroll.prototype.modePreDefComportements[mode];
if(elements!=''){
if(!(elements instanceof Array)){
elts=new Array();
elts[0]=elements;
}
else
elts=elements;
}
}
else{
elts=new Array();
elts=this.listeModalites.split("#");
elts.pop();
}
var instr;
for(var i=0;i<elts.length;i++){
instr='this.opt["Mod"].'+elts[i];
traceExec('instr= '+instr,31);
eval(instr);
}
this.opt.Mod.PosAscWin=this.opt.Mod.PosAscWinLeft?'left':'right';
this.opt.Mod.PosAsc=this.opt.Mod.PosAscLeft?'left':'right';
}
ContainerAutoScroll.prototype.isEmpty=function(){
return !this.oHtmlTexte.firstChild;
}
ContainerAutoScroll.prototype.createBuff=function(bForcecreation){
if((!bForcecreation)
&&(this.lBuff.length>0)
&&(!this.oHtmlTexte.firstChild)){
return this.noCurrentBuff;
}
traceExec('createBuff entree this.lBuff.length = '+this.lBuff.length+' this.noCurrentBuff= '+this.noCurrentBuff,77);
this.lBuff.push({doct:null,descr:''});
traceExec('createBuff ajout this.lBuff.length = '+this.lBuff.length+' n? buff= '+(this.lBuff.length-1),77);
return(this.lBuff.length-1);
}
ContainerAutoScroll.prototype.fillAndDisplayBuff=function(noB,doct,bClone,descrDoct,refDoct){
traceExec('fillAndDisplayBuff this.noCurrentBuff= '+this.noCurrentBuff,77);
if(noB>=this.lBuff.length){
return;
}
if(noB!=this.noCurrentBuff){
this.saveCurrentBuffer(effact=false);
this.noCurrentBuff=noB;
traceExec('fillAndDisplayBuff ap saveC... reaff de this.noCurrentBuff= '+this.noCurrentBuff,77);
}
this.lBuff[this.noCurrentBuff].descr=descrDoct;
this.lBuff[this.noCurrentBuff].refExt=refDoct;
this.lBuff[this.noCurrentBuff].bClone=bClone;
if(doct)
this.containerHtml.oContainer.fill(doct,save=false,bClone);
traceExec('fillAndDisplayBuff this.noCurrentBuff= '+this.noCurrentBuff,77);
}
ContainerAutoScroll.prototype.getDescrDoct=function(){
return this.lBuff[this.noCurrentBuff].descr;
}
ContainerAutoScroll.prototype.refExtCurrentBuff=function(){
traceExec('this.lBuff[this.noCurrentBuff].refExt = '+this.lBuff[this.noCurrentBuff].refExt+
' this.noCurrentBuffer= '+this.noCurrentBuff,77);
return this.lBuff[this.noCurrentBuff].refExt;
}
ContainerAutoScroll.prototype.isCurrentBuffRefExt=function(){
return(this.lBuff[this.noCurrentBuff].refExt!=null);
}
ContainerAutoScroll.prototype.bCloneCurrentBuff=function(){
traceExec('this.lBuff[this.noCurrentBuff].bClone = '+this.lBuff[this.noCurrentBuff].bClone+
' this.noCurrentBuffer= '+this.noCurrentBuff,77);
return this.lBuff[this.noCurrentBuff].bClone;
}
ContainerAutoScroll.prototype.saveCurrentBuffer=function(bClear){
traceExec('saveCurrentBuffer',31);
if(this.isEmpty())return;
if(!this.oHtmlSvgBuff){
this.oHtmlSvgBuff=document.createElement('DIV');
this.oHtmlSvgBuff.id=this.idObjComp+'_svgBuff';
this.oHtmlSvgBuff.style.display='none';
this.containerHtml.appendChild(this.oHtmlSvgBuff);
}
if(this.bBuffMod){
traceExec('saveCurrentBuff  test de lBuff[this.noCurrentBuff].doct avec noCurrentBuff= '+this.noCurrentBuff,77);
traceExec('saveCurrentBuff this.lBuff.length = '+this.lBuff.length,77);
if(this.lBuff[this.noCurrentBuff].doct)
this.oHtmlSvgBuff.removeChild(this.lBuff[this.noCurrentBuff].doct);
var nvBuff=this.oHtmlTexte.cloneNode(true);
nvBuff.id=this.idObjComp+'_buff_'+this.noCurrentBuff;
this.oHtmlSvgBuff.appendChild(nvBuff);
traceExec('saveCurrentBuff  svg ds lBuff[this.noCurrentBuff] noCurrentBuff= '+this.noCurrentBuff,77);
this.lBuff[this.noCurrentBuff].doct=nvBuff;
}
this.lBuff[this.noCurrentBuff].propAff=this.cursTexte?this.cursTexte.prop:0;
if(bClear)
this.clear();
}
ContainerAutoScroll.prototype.nextBuff=function(){
traceExec('nextBuff',31);
var noB=this.noCurrentBuff+1;
if(noB>=this.lBuff.length){
window.status='dernier buffer (n?'+this.noCurrentBuff+') de la liste atteint';
return;
}
this.restoreBuffer(noB,save=true);
}
ContainerAutoScroll.prototype.prevBuff=function(){
traceExec('prevBuff',31);
var noB=this.noCurrentBuff-1;
if(noB<0){
window.status='premier buffer de la liste atteint';
return;
}
this.restoreBuffer(noB,save=true);
}
ContainerAutoScroll.prototype.restoreBuffer=function(noB,bSave){
traceExec('restoreBuffer',31);
if((noB<0)
||(noB>=this.lBuff.length)){
alert('restauration de buffer impossible : n? de buffer erronn?');
return;
}
if(bSave)
this.saveCurrentBuffer(false);
this.clear(bConserveELtsScroll=true);
this.noCurrentBuff=noB;
var height=this.lBuff[noB].doct.style.height;
var nvBuff=this.lBuff[noB].doct.cloneNode(true);
while(nvBuff.firstChild){
this.oHtmlTexte.appendChild(nvBuff.firstChild);
}
this.oHtmlTexte.id=this.idObjComp+'_buffActif_'+this.noCurrentBuff;
this.oHtmlTexte.style.height=height;
if(this.bAffInterfaceScroll)
this.reaffInterfaceScroll(bBottom=false);
this.cursTexte.fixeProp(this.lBuff[noB].propAff);
this.bBuffMod=false;
}
ContainerAutoScroll.prototype.clear=function(bConserveEltsScroll){
traceExec('clear',31);
this.videBuff();
if(!bConserveEltsScroll)
this.suppEltsScroll();
this.initBuff();
}
ContainerAutoScroll.prototype.videBuff=function(){
traceExec('videBuff',31);
while(!this.isEmpty()){
this.oHtmlTexte.removeChild(this.oHtmlTexte.firstChild);
}
}
ContainerAutoScroll.prototype.suppEltsScroll=function(){
traceExec('suppEltsScroll',31);
if(this.partieDoctCachee){
this.passBascule=true;
this.suppToutScroll();
this.passBascule=false;
this.partieDoctCachee=false;
}
}
ContainerAutoScroll.prototype.initBuff=function(){
traceExec('initBuff',31);
this.oHtmlTexte.style.height='auto';
this.oHtmlTexte.style.top=0;
this.oHtmlTexte.style.left=0;
this.bBuffMod=true;
}
ContainerAutoScroll.prototype.add=function(oHtmlElt,bClone){
traceExec('add  this.bAffInterfaceScroll= '+this.bAffInterfaceScroll,31);
var bBottom=this.bDisplBottomText();
if(this.optionCloneContenuAjoute
||bClone)
this.oHtmlTexte.appendChild(oHtmlElt.cloneNode(true));
else
this.oHtmlTexte.appendChild(oHtmlElt);
if(oHtmlElt.nodeType==1){
var typePosition=getComputStyleStr(oHtmlElt,'position');
if((typePosition=='relative')
||(typePosition=='absolute')){
if(this.oHtmlTexte.offsetHeight
<(parseInt(oHtmlElt.style.top)+parseInt(oHtmlElt.style.height))){
this.oHtmlTexte.style.height=parseInt(oHtmlElt.style.top)+parseInt(oHtmlElt.style.height)-1;
}
}
}
traceExec('this.bAffInterfaceScrollEnCours = '+this.bAffInterfaceScrollEnCours,31);
if(this.bAffInterfaceScroll)
this.reaffInterfaceScroll(bBottom);
this.bBuffMod=true;
}
ContainerAutoScroll.prototype.reaffInterfaceScroll=function(bBottom,bTop,heightRef,heightTexte){
if(heightTexte==null)traceExec("reaffInterfaceScroll 2eieme argt null",31);
if(heightTexte)traceExec("reaffInterfaceScroll 2eieme argt",31);
if(!heightTexte)traceExec("reaffInterfaceScroll ! 2eieme argt",31);
if(heightTexte==undefined)traceExec("reaffInterfaceScroll 2eieme argt undefined",31);
var height=(heightRef!=null)?heightRef:parseInt(this.containerHtml.style.height);
var heightTxt=(heightTexte!=null)?heightTexte:this.oHtmlTexte.offsetHeight;
if((height<parseInt(heightTxt))
&&(!this.partieDoctCachee)){
traceExec('reaffInterfaceScroll height container < --> reactiveScroll',31);
this.partieDoctCachee=true;
this.passBascule=true;
this.reactiveScroll();
this.passBascule=false;
}
else
if((height>=parseInt(heightTxt))
&&(this.partieDoctCachee)){
traceExec('reaffInterfaceScroll height container > --> suppELtsScroll',31);
this.suppEltsScroll();
this.oHtmlTexte.style.top=0;
}
if(!document.getElementById(this.containerHtml.id))
execAfterLoad(this.containerHtml.id,'computeDims');
else
this.computeDims(height);
if(bBottom)
this.oHtmlTexte.style.top=Math.min(0,
(-1*parseInt(this.oHtmlTexte.style.height)
+parseInt(this.oHtmlCadreInt.style.height)));
if(this.cursTexte){
this.cursTexte.loadLimitsDyn();
this.cursTexte.synchro();
}
}
ContainerAutoScroll.prototype.methodesPubliques=function(){
return
"new (oHtmlTexte, width, height)"
+"modDim (dWidth,dHeight)"
+"setDim (width,height)"
+"placeIn (oHtmlParent, top, left)"
+"moveTo (top,left)"
+"shift (deltaTop,deltaLeft)"
+"add (oHtmlElt)"
+"moveTopText ()"
+"moveBottomText ()"
+"posLine (noLine)"
+"scrollLineText  (sens, nbLine)"
+"scrollTextDown (nbLine,vitesse,sansEntretien)"
+"scrollTextUp (nbLine,vitesse,sansEntretien)"
+"scrollText  (sens, nbLine, vitesse,id, sansEntretienMvt)"
+"autoScroll  (mode)"
+"basculeScroll (elements,dejaEnreg,ssReDim)"
+"fixeEltScroll (elements,mode,ssReDim)"
+"positionAscenseur (position)"
+"basculeModalite (mode) "
+"fixeModalitesParticulieres (elements)"
+"autoScrollSurTexte (suppression)"
+"couplageAvecCursExt(coupleur) "
+"zoneAscModeInteractif (interactif)"
+"zoneTemoinScrollAuto (auto)"
+"zoneAffModeInteractif (interactif)"
+"barreTemoinPos(etroite)"
;
}
ContainerAutoScroll.prototype.affInterfaceScroll=function(){
this.bAffInterfaceScrollEnCours=true;
traceExec('**************************************',31);
traceExec('**************************************',31);
traceExec('**************************************',31);
traceExec('**************************************',31);
traceExec('affInterf this.oHtmlCadreInt.style.height = '+parseInt(this.oHtmlCadreInt.style.height),9);
if(this.oHtmlTexte.offsetHeight
>(pixHeight(this.containerHtml,true)
-getComputStyleIf(this.oHtmlBarreAction,'height'))){
this.passBascule=true;
this.partieDoctCachee=true;
this.fixeEltScroll(null,null,true);
this.fixeModalitesParticulieres();
this.computeDims();
this.passBascule=false;
}
else{
this.svgParamScroll();
this.partieDoctCachee=false;
}
this.zoneTexteCommeCurseur();
this.bAffInterfaceScroll=true;
this.bAffInterfaceScrollEnCours=false;
traceExec('affInterf this.bAffInterfaceScroll = '+this.bAffInterfaceScroll,31);
}
ContainerAutoScroll.prototype.appliOptScroll=function(){
this.fixeEltScroll();
this.fixeModalitesParticulieres();
}
ContainerAutoScroll.prototype.computeDims=function(heightRef,widthRef){
traceExec("computeDims ext= pixHeight(this.containerHtml)"+pixHeight(this.containerHtml,true),31);
traceExec("computeDims - act=getComputStyle(this.oHtmlBarreAction,'height')= "+getComputStyleIf(this.oHtmlBarreAction,'height'),31);
traceExec('computeDims av this.oHtmlCadreInt.style.height= '+this.oHtmlCadreInt.style.height,31);
this.oHtmlCadreInt.style.height=Math.max(1,
(heightRef||pixHeight(this.containerHtml,true))
-getComputStyleIf(this.oHtmlBarreAction,'height')
-getComputStyleIf(this.oHtmlAccesHaut,'height')
-getComputStyleIf(this.oHtmlAccesBas,'height')
);
traceExec('computeDims ap this.oHtmlCadreInt.style.height= '+this.oHtmlCadreInt.style.height,31);
traceExec('computeDims av this.oHtmlCadreInt.style.width = '+this.oHtmlCadreInt.style.width,31);
this.oHtmlCadreInt.style.width=Math.max(1,
(widthRef||pixWidth(this.containerHtml,true))
);
traceExec('computeDims ap FFox this.oHtmlCadreInt.style.width = '+this.oHtmlCadreInt.style.width,31);
traceExec("computeDims entree appel de loadLimitsDyn",76);
if(this.oHtmlAscenseurWin||this.oHtmlAscenseur){
traceExec('computeDims FFox this.oHtmlTexte.style.width = '+this.oHtmlTexte.style.width,31);
traceExec('computeDims FFox this.oHtmlCadreInt.offsetWidth = '+this.oHtmlCadreInt.offsetWidth,31);
this.oHtmlTexte.style.width=this.oHtmlCadreInt.offsetWidth
-(9
+(this.optionAscenseur?parseInt(this.valCssLarge):0)
+(this.optionAscenseurWin?(this.opt['Mod'].AscWinFin?parseInt(this.valCssEtroit)
:parseInt(this.valCssLarge))
:0)
+9
);
traceExec('computeDims ap this.oHtmlTexte.style.width = '+this.oHtmlTexte.style.width,31);
}
if(this.oHtmlPiloteScroll){
this.oHtmlPiloteScroll.style.height=parseInt(this.oHtmlCadreInt.style.height);
if(!this.optionAccesHaut){
this.oHtmlPiloteScroll.style.height=parseInt(this.oHtmlPiloteScroll.style.height)
-getComputStyleIf(this.oHtmlAscHautFleche,'height');
}
if(!this.optionAccesBas)
this.oHtmlPiloteScroll.style.height=parseInt(this.oHtmlPiloteScroll.style.height)
-getComputStyleIf(this.oHtmlAscBasFleche,'height');
var excedent=parseInt(this.oHtmlPiloteScroll.style.height)
-ContainerAutoScroll.prototype.heightMaxAsc;
if(excedent>0){
this.oHtmlAscCentre=document.createElement('DIV');
this.oHtmlAscCentre.oCiu=this;
this.oHtmlAscCentre.className='ascenseurCentre';
this.oHtmlPiloteScroll.insertBefore(this.oHtmlAscCentre,this.oHtmlAscInf);
this.oHtmlAscCentre.style.height=excedent;
this.oHtmlAscSup.style.height=this.oHtmlAscInf.style.height=ContainerAutoScroll.prototype.heightMaxAsc/2;
}
else{
if(getComputStyleStr(this.oHtmlAscSup,'height')!='50%'){
this.oHtmlAscSup.style.height=this.oHtmlAscInf.style.height='50%';
if(this.oHtmlAscCentre)
this.oHtmlAscCentre.parentNode.removeChild(this.oHtmlAscCentre);
}
}
}
if(this.oHtmlPiloteScrollWin){
this.oHtmlPiloteScrollWin.style.height=parseInt(this.oHtmlCadreInt.style.height);
this.oHtmlPiloteScrollWin.style.height=parseInt(this.oHtmlPiloteScrollWin.style.height)
-getComputStyleIf(this.oHtmlAscHautFlecheWin,'height');
this.oHtmlPiloteScrollWin.style.height=parseInt(this.oHtmlPiloteScrollWin.style.height)
-getComputStyleIf(this.oHtmlAscBasFlecheWin,'height');
}
this.oHtmlTexte.style.height=this.oHtmlTexte.offsetHeight;
if(this.optionAscenseurWin){
this.cursTemoinPos.loadLimitsDyn();
var lgTexteApparent=Math.min(
parseInt(this.oHtmlCadreInt.style.height),
(parseInt(this.oHtmlTexte.offsetHeight)
-Math.abs(parseInt(this.oHtmlTexte.style.top)))
)
this.cursTemoinPos.oHtmlMobile.style.height=Math.min(
parseInt(this.oHtmlPiloteScrollWin.style.height)
,((
lgTexteApparent
/parseInt(this.oHtmlTexte.offsetHeight))
*parseInt(this.oHtmlPiloteScrollWin.style.height)
));
this.cursTemoinPos.oHtmlMobile.style.height=Math.max(ContainerAutoScroll.prototype.heightMinCursTemoinPos
,parseInt(this.cursTemoinPos.oHtmlMobile.style.height));
}
traceExec("computeHeightCadreInt this.oHtmlCadreInt.style.height = "+this.oHtmlCadreInt.style.height,20);
traceExec("computeHeightCadreInt sortie",20);
}
ContainerAutoScroll.prototype.heightMaxAsc=2*288;
ContainerAutoScroll.prototype.placeIn=function(oHtmlParent,top,left){
this.containerHtml.style.top=top;
this.containerHtml.style.left=left;
oHtmlParent.appendChild(this.containerHtml);
traceExec('appel depuis placeIn de exec',31);
execAfterLoad(this.containerHtml.id,'setDimAsynch');
}
ContainerAutoScroll.prototype.moveTo=function(top,left){
this.containerHtml.style.top=top;
this.containerHtml.style.left=left;
}
ContainerAutoScroll.prototype.shift=function(deltaTop,deltaLeft){
traceExec('shift top= '+this.containerHtml.style.top,20);
traceExec('shift left= '+this.containerHtml.style.left,20);
if(this.containerHtml.style.top.indexOf('%')!=-1){
this.containerHtml.style.top=parseInt(this.containerHtml.style.top)+parseInt(deltaTop)+"%";
}
else
this.containerHtml.style.top=parseInt(this.containerHtml.style.top)+parseInt(deltaTop);
if(this.containerHtml.style.left.indexOf('%')!=-1){
this.containerHtml.style.left=parseInt(this.containerHtml.style.left)+parseInt(deltaLeft)+"%";
}
else
this.containerHtml.style.left=parseInt(this.containerHtml.style.left)+parseInt(deltaLeft);
}
ContainerAutoScroll.prototype.setDimAsynch=function(){
this.setDim(this.width,this.height);
}
ContainerAutoScroll.prototype.setDim=function(width,height){
height=(height==null)?'100%':height;
width=(width==null)?'100%':width;
this.width=width;
this.height=height;
if(width){
this.containerHtml.style.width=width;
}
if(height){
var strHeight=height+'';
if(strHeight.indexOf('%')!=-1){
var heightRef=this.containerHtml.parentNode.offsetHeight*parseInt(height)/100;
}
else{
var heightRef=Math.max(
height,
(!this.optionAccesHaut?0:10)
+(!this.optionAccesBas?0:10)
+2
);
}
}
var bBottom=this.bDisplBottomText();
var bTop=this.bDisplTopText();
traceExec('modDim bTop = '+bTop,10);
this.reaffInterfaceScroll(bBottom,bTop,heightRef,this.oHtmlTexte.style.height);
this.containerHtml.style.height=heightRef;
}
ContainerAutoScroll.prototype.reactive=function(){
this.modDim(0,0);
}
ContainerAutoScroll.prototype.modDim=function(dWidth,dHeight){
traceExec('modDim dWidth= '+dWidth+' dHeight= '+dHeight,31);
traceExec('modDim this.containerHtml.style.width = '+this.containerHtml.style.width,31);
traceExec('modDims this.containerHtml.offsetWidth= '+this.containerHtml.offsetWidth,31);
var strDWidth=dWidth+'';
if(strDWidth.indexOf('%')!=-1){
dWidth=this.containerHtml.offsetWidth*parseInt(dWidth)/100;
}
var widthRef;
if(this.containerHtml.style.width=='')
if(dWidth<0)
widthRef=this.containerHtml.offsetWidth+dWidth;
else
widthRef=this.containerHtml.offsetWidth;
else
widthRef=this.containerHtml.offsetWidth+dWidth;
if(dHeight){
var strDHeight=dHeight+'';
if(strDHeight.indexOf('%')!=-1){
dHeight=this.containerHtml.offsetHeight*parseInt(dHeight)/100;
var heightRef=parseInt(this.containerHtml.style.height)+dHeight;
}
else{
var height=parseInt(this.containerHtml.style.height)+dHeight;
var heightRef=Math.max(
height,
+(!this.optionAccesHaut?0:10)
+(!this.optionAccesBas?0:10)
+2
);
}
var bBottom=this.bDisplBottomText();
var bTop=this.bDisplTopText();
traceExec('modDim bTop = '+bTop,10);
traceExec('ContainerAutoScroll.modDim height = '+height+' this.oHtmlTexte.style.height= '+this.oHtmlTexte.style.height,31);
if((height>=parseInt(this.oHtmlTexte.style.height))
&&(this.partieDoctCachee)){
this.passBascule=true;
traceExec('moddim avant suppToutScroll',10);
this.suppToutScroll();
this.passBascule=false;
this.partieDoctCachee=false;
traceExec('moddim avant moveTopText',10);
this.oHtmlTexte.style.top=0;
if(this.cursTexte){
traceExec('moveTop Text av synchro() ');
this.cursTexte.synchro();
}
}
else
if((height<parseInt(this.oHtmlTexte.style.height))
&&(!this.partieDoctCachee)){
this.partieDoctCachee=true;
traceExec('moddim avant reactiveSCroll',10);
this.passBascule=true;
this.reactiveScroll();
this.passBascule=false;
}
}
if(dHeight
||dWidth){
traceExec('-> computeDims heightRef= '+heightRef+' widthRef= '+widthRef,31);
this.computeDims(heightRef,widthRef);
}
if(dHeight){
if(bBottom)
this.oHtmlTexte.style.top=Math.min(0,
(-1*parseInt(this.oHtmlTexte.style.height)
+parseInt(this.oHtmlCadreInt.style.height)));
if(this.cursTexte){
this.cursTexte.loadLimitsDyn();
this.cursTexte.synchro();
}
this.containerHtml.style.height=heightRef;
}
if(dWidth)
this.containerHtml.style.width=widthRef;
traceExec('modDims sortie this.containerHtml.style.height= '+this.containerHtml.style.height,31);
traceExec('modDims sortie this.containerHtml.style.width= '+this.containerHtml.style.width,31);
}
ContainerAutoScroll.prototype.heightMin=function(){
return Math.max(50,
(getComputStyleIf(this.oHtmlAccesHaut,'height')
+getComputStyleIf(this.oHtmlAccesBas,'height')));
}
ContainerAutoScroll.prototype.posNd=function(ndTok){
if(this.searchOccFocus){
var noTok=this.searchOccFocus.nodeName.substr(3,this.searchOccFocus.nodeName.length-3);
this.searchOccFocus.className='token'+noTok+'Visible';
}
ndTok.className='tokenFocus';
this.searchOccFocus=ndTok;
this.posLine(ndTok.noLine);
}
ContainerAutoScroll.prototype.posOcc=function(noTok,noOcc){
if(this.searchOccFocus){
var noTok=this.searchOccFocus.nodeName.substr(3,this.searchOccFocus.nodeName.length-3);
this.searchOccFocus.className='token'+noTok+'Visible';
}
var lNdTok=document.getElementsByTagName('TOK'+noTok);
var ndTok=lNdTok[noOcc-1];
this.searchOccFocus=ndTok;
ndTok.className='tokenFocus';
this.posLine(ndTok.noLine);
}
ContainerAutoScroll.prototype.bDisplTopText=function(){
traceExec('bDisplTopText this.oHtmlTexte.style.top= '+this.oHtmlTexte.style.top,10);
return(parseInt(this.oHtmlTexte.style.top)==0);
}
ContainerAutoScroll.prototype.bDisplBottomText=function(){
return(parseInt(this.oHtmlTexte.style.top)
==(-1*parseInt(this.oHtmlTexte.offsetHeight)
+parseInt(this.oHtmlCadreInt.style.height)));
}
ContainerAutoScroll.prototype.moveTopText=function(){
this.oHtmlTexte.style.top=0;
if(this.cursTexte){
traceExec('moveTop Text av synchro() ');
this.cursTexte.synchro();
}
}
ContainerAutoScroll.prototype.moveBottomText=function(){
this.oHtmlTexte.style.top=Math.min(0,
(-1*parseInt(this.oHtmlTexte.style.height)
+parseInt(this.oHtmlCadreInt.style.height)));
if(this.cursTexte)
this.cursTexte.loadLimitsDyn();
if(this.cursTexte)
this.cursTexte.synchro();
}
ContainerAutoScroll.prototype.posLine=function(noLine){
this.oHtmlTexte.style.top=-1*((noLine-1)*this.oHtmlTexte.pxHLine);
}
ContainerAutoScroll.prototype.scrollLineText=function(sens,nbLine){
this.oHtmlTexte.style.top=parseInt(this.oHtmlTexte.style.top)-nbLine*this.oHtmlTexte.pxHLine;
}
ContainerAutoScroll.prototype.scrollTextDown=function(nbLine,vitesse,sansEntretien){
traceExec('scrollTextDown',20);
this.scroll=true;
this.scrollDown=true;
this.scrollText('Down',nbLine,vitesse,null,sansEntretien);
}
ContainerAutoScroll.prototype.scrollTextUp=function(nbLine,vitesse,sansEntretien){
traceExec('scrollTextUp',20);
this.scroll=true;
this.scrollUp=true;
this.scrollText('Up',nbLine,vitesse,null,sansEntretien);
}
ContainerAutoScroll.prototype.scrollText=function(sens,nbLine,vitesse,id,sansEntretienMvt){
var oThis,oHtml;
if(id){
oHtml=document.getElementById(id);
oThis=oHtml.oCiu;
}
else
oThis=this;
traceExec('oThis.id= '+oThis.idObjComp,20);
traceExec('getComputStyle(This.oHtmlTexte,height)= '+getComputStyle(oThis.oHtmlTexte,'height'),20);
traceExec('oThis.oHtmlTexte.offsetHeight= '+oThis.oHtmlTexte.offsetHeight,20);
traceExec('oThis.oHtmlCadreInt.style.height= '+oThis.oHtmlCadreInt.style.height,20);
if(oThis.oHtmlTexte.offsetHeight<parseInt(oThis.oHtmlCadreInt.style.height)){
return;
}
traceExec('scrollText cdt? de scroll r?unies',20);
traceExec('scrollText oThis.oHtmlTexte.style.top= '+oThis.oHtmlTexte.style.top,20);
if(!oThis.scroll)return;
if(!eval('oThis.scroll'+sens))return;
if(sens=='Down'){
var butee=-1*oThis.oHtmlTexte.offsetHeight
+parseInt(oThis.oHtmlCadreInt.style.height);
oThis.oHtmlTexte.style.top=Math.max(butee,
(parseInt(oThis.oHtmlTexte.style.top)
-nbLine*oThis.oHtmlTexte.pxHLine));
}
else{
oThis.oHtmlTexte.style.top=Math.min(0,
(parseInt(oThis.oHtmlTexte.style.top)
+nbLine*oThis.oHtmlTexte.pxHLine));
}
if(oThis.cursTexte)
oThis.cursTexte.synchro();
traceExec('scrollText sens = '+sens+' oThis.oHtmlTexte.style.top= '+oThis.oHtmlTexte.style.top,20);
if(!sansEntretienMvt){
oThis.scrollTextTimeout=setTimeout('ContainerAutoScroll.prototype.scrollText(\"'
+sens+'\",\"'+nbLine+'\",\"'+vitesse+'\",\"'+oThis.idObjComp+'_cadreExt'
+'\")',vitesse);
}
}
ContainerAutoScroll.prototype.autoScroll=function(mode){
if(this.existModePreDef(mode)){
this.fixeEltScroll(ContainerAutoScroll.prototype.modePreDefEltsPresents[mode],'ajout');
this.fixeEltScroll(ContainerAutoScroll.prototype.modePreDefEltsAbsents[mode],'supp');
if(mode=='NoScroll')
this.opt['Meta'].CoherenceAuto=false;
this.fixeModalitesParticulieres(ContainerAutoScroll.prototype.modePreDefComportements[mode]);
}
}
ContainerAutoScroll.prototype.positionAscenseur2=function(position,win){
traceExec('posAsc position= '+position,9);
this.optionPosAsc=((position&&!win)?position:null)||this.optionPosAsc||'right';
this.optionPosAscWin=((position&&win)?position:null)||this.optionPosAscWin||'left';
traceExec('posAsc this.optionPosAsc= '+this.optionPosAsc,9);
traceExec('posAsc this.optionPosAscWin= '+this.optionPosAscWin,9);
if(this.optionAscenseur){
if(this.optionPosAsc=='left'){
this.oHtmlAscenseur.className+=' posLeft';
if(window.getComputedStyle!=undefined)
this.oHtmlTexte.className+=' zoneDecalee';
else
this.oHtmlTexte.className+=' texteDecale';
if(this.optionAccesHaut
&&this.optionAscHautFleche)
this.oHtmlAscHautFleche.className+=' posLeft';
if(this.optionAccesBas
&&this.optionAscBasFleche)
this.oHtmlAscBasFleche.className+=' posLeft';
}
else{
this.oHtmlAscenseur.className=this.oHtmlAscenseur.className.replace(/posLeft/g,'');
if(window.getComputedStyle!=undefined)
this.oHtmlTexte.className=this.oHtmlTexte.className.replace(/zoneDecalee/g,'');
else
this.oHtmlTexte.className=this.oHtmlTexte.className.replace(/texteDecale/g,'');
if(this.optionAccesHaut
&&this.optionAscHautFleche)
this.oHtmlAscHautFleche.className=this.oHtmlAscHautFleche.className.replace(/posLeft/g,'');
if(this.optionAccesBas
&&this.optionAscBasFleche)
this.oHtmlAscBasFleche.className=this.oHtmlAscBasFleche.className.replace(/posLeft/g,'');
}
}
}
ContainerAutoScroll.prototype.positionAscenseur=function(position,win){
traceExec('posAsc entree this.oHtmlTexte.style.left= '+this.oHtmlTexte.style.left,31);
traceExec('posAsc entree position= '+position+' win= '+win,31);
traceExec('posAsc entree this.opt["Mod"].PosAsc= '+this.opt.Mod.PosAsc,31);
traceExec('posAsc entree this.opt["Mod"].PosAscWin= '+this.opt.Mod.PosAscWin,31);
this.opt["Mod"].PosAsc=((position&&!win)?position:null)||this.opt["Mod"].PosAsc||'right';
this.opt["Mod"].PosAscWin=((position&&win)?position:null)||this.opt["Mod"].PosAscWin||'left';
traceExec('posAsc ap init this.opt["Mod"].PosAsc= '+this.opt.Mod.PosAsc,31);
traceExec('posAsc ap init this.opt["Mod"].PosAscWin= '+this.opt.Mod.PosAscWin,31);
if(eval('this.oldPosAsc'+(win?'Win':'')+
'=='+
'this.opt["Mod"].PosAsc'+(win?'Win':''))
){traceExec('posAsc deja posit sortie ');return;}
if((win
&&(this.optionAscenseurWin))
||(!win
&&(this.optionAscenseur))){
var typAsc=win?'Win':'';
traceExec('posAsc typAsc = '+typAsc,31);
if(eval('this.opt.Mod.PosAsc'+typAsc+' == "left"')){
traceExec('posAsc left',31);
eval('this.oHtmlAscenseur'+typAsc+'.className +=  " posLeft"');
if(window.getComputedStyle!=undefined){
traceExec('posAsc win left --> shift right',31);
if(typAsc=='Win'){
traceExec('posAsc win left --> shift variab this.oHtmlTexte.style.left= '
+this.oHtmlTexte.style.left+' this.valCssEtroit= '+this.valCssEtroit,31);
this.oHtmlTexte.style.left=(parseInt(this.oHtmlTexte.style.left)||0)
+(this.opt['Mod'].AscWinFin?parseInt(this.valCssEtroit)
:parseInt(this.valCssLarge));
}
else{
traceExec('posAsc win left --> shift large this.oHtmlTexte.style.left= '+parseInt(this.oHtmlTexte.style.left)
+' parseInt(this.valCssLarge)= '+parseInt(this.valCssLarge),31);
this.oHtmlTexte.style.left=parseInt(this.oHtmlTexte.style.left)
+parseInt(this.valCssLarge);
traceExec('posAsc win left --> = '+this.oHtmlTexte.style.left,31);
}
this.oldLargTemoin=this.opt['Mod'].AscWinFin;
}
else{
this.oHtmlTexte.className+=' texteDecale';
}
if(this.optionAccesHaut
&&eval('this.optionAscHautFleche'+typAsc))
eval('this.oHtmlAscHautFleche'+typAsc+'.className += " posLeft"');
if(this.optionAccesBas
&&eval('this.optionAscBasFleche'+typAsc))
eval('this.oHtmlAscBasFleche'+typAsc+'.className += " posLeft"');
}
else{
var eltClassName='this.oHtmlAscenseur'+typAsc+'.className';
eval(eltClassName+'='+eltClassName+'.replace(/ posLeft/g,"")');
if(window.getComputedStyle!=undefined){
if(typAsc=='Win'){
if(this.oldPosAscWin=='left'){
this.oHtmlTexte.style.left=parseInt(this.oHtmlTexte.style.left)
-(this.opt['Mod'].AscWinFin?parseInt(this.valCssEtroit)
:parseInt(this.valCssLarge));
}
}
else
if(this.oldPosAsc=='left'){
this.oHtmlTexte.style.left=parseInt(this.oHtmlTexte.style.left)
-parseInt(this.valCssLarge);
}
this.oldLargTemoin=this.opt['Mod'].AscWinFin;
}
else
this.oHtmlTexte.className=this.oHtmlTexte.className.replace(/texteDecale/g,'');
if(this.optionAccesHaut
&&eval('this.optionAscHautFleche'+typAsc)){
eltClassName='this.oHtmlAscHautFleche'+typAsc+'.className';
eval(eltClassName+' = '+eltClassName+'.replace(/ posLeft/g,"")');
}
if(this.optionAccesBas
&&eval('this.optionAscBasFleche'+typAsc)){
eltClassName='this.oHtmlAscBasFleche'+typAsc+'.className';
eval(eltClassName+'= '+eltClassName+'.replace(/ posLeft/g,"")');
}
}
eval('this.oldPosAsc'+(win?'Win':'')+
'='+
'this.opt["Mod"].PosAsc'+(win?'Win':''));
traceExec('posAsc sortie this.opt["Mod"].PosAsc= '+this.opt["Mod"].PosAsc+
' this.opt["Mod"].PosAscWin= '+this.opt["Mod"].PosAscWin,31);
traceExec('posAsc sortie this.oHtmlTexte.style.left= '+this.oHtmlTexte.style.left,31);
}
}
ContainerAutoScroll.prototype.svgParamScroll=function(){
this.svgListeEltsPresents=this.listeEltsPresents;
this.svgListeEltsAbsents=this.listeEltsAbsents;
this.svgListeModalites=this.listeModalites;
this.svgOptMetaCoherence=this.opt["Meta"].CoherenceAuto;
}
ContainerAutoScroll.prototype.restoreParamScroll=function(){
if(this.svgListeEltsPresents)this.listeEltsPresents=this.svgListeEltsPresents;
if(this.svgListeEltsAbsents)this.listeEltsAbsents=this.svgListeEltsAbsents;
if(this.svgListeModalites)this.listeModalites=this.svgListeModalites;
this.opt["Meta"].CoherenceAuto=this.svgOptMetaCoherence;
}
ContainerAutoScroll.prototype.suppToutScroll=function(){
traceExec('suppToutScroll --> svgParamScroll',74);
this.svgParamScroll();
traceExec('suppToutScroll elts svgd?s= '+this.svgListeEltsPresents,74);
traceExec('suppToutScroll mods svgd?s= '+this.svgListeModalites,74);
this.autoScroll('NoScroll');
}
ContainerAutoScroll.prototype.reactiveScroll=function(){
traceExec('reactiveScroll',74);
this.restoreParamScroll();
traceExec('react this.listeModalites= '+this.listeModalites,9);
this.initOptionsModePreDef();
traceExec('reactiveScroll elts= '+this.listeEltsPresents,9);
traceExec('reactiveScroll mods= '+this.listeModalites,9);
this.fixeEltScroll(null,null,true);
this.fixeModalitesParticulieres();
}
ContainerAutoScroll.prototype.fixeModalitesParticulieres=function(elements){
var elts;
if(elements){
if(!(elements instanceof Array)){
elts=new Array();
elts[0]=elements;
}
else
elts=elements;
}
else{
elts=new Array();
elts=this.listeModalites.split("#");
elts.pop();
}
for(var i=0;i<elts.length;i++){
elt=elts[i];
var opt='this.opt["Mod"].'+elt;
eval(opt);
}
traceExec('-> positionAscenseur depuis fixeModalitesParticulieres',31);
this.positionAscenseur(this.opt['Mod'].PosAscWinLeft?'left':'right',ascWin=true);
if(this.opt['Mod'].AscWinFin){
this.barreTemoinPosEtroite(true);
}
else{
this.barreTemoinPosEtroite(false);
}
traceExec('-> positionAscenseur depuis fixeModalitesParticulieres',31);
this.positionAscenseur(this.opt['Mod'].PosAscLeft?'left':'right');
this.oHtmlTexte.dragAndDrop=this.opt['Mod'].DDInteractif;
this.cursTemoinPos.oHtmlMobile.dragAndDrop=!this.opt['Mod'].TemoinPos;
if(this.opt['Mod'].TemoinPos){
this.oHtmlAscBasFlecheWin.onclick=ContainerAutoScroll.eventHandlers.onclickBas;
this.oHtmlAscBasFlecheWin.onmousedown=null;
this.oHtmlAscBasFlecheWin.onmouseup=null;
this.oHtmlAscBasFlecheWin.onmousemove=function(e){if(!e)e=window.event;stopEvent(e);}
this.oHtmlAscHautFlecheWin.onclick=ContainerAutoScroll.eventHandlers.onclickHaut;
this.oHtmlAscHautFlecheWin.onmousedown=null;
this.oHtmlAscHautFlecheWin.onmouseup=null;
this.oHtmlAscHautFlecheWin.onmousemove=function(e){if(!e)e=window.event;stopEvent(e);}
this.oHtmlPiloteScrollWin.onclick=null;
if(this.opt['Mod'].ScrollSurTemoinPos)
this.oHtmlPiloteScrollWin.onmousemove=null;
else
this.oHtmlPiloteScrollWin.onmousemove=function(e){if(!e)e=window.event;stopEvent(e);}
this.oHtmlPiloteScrollWin.onmouseout=null;
}
else{
this.oHtmlAscBasFlecheWin.onmousedown=ContainerAutoScroll.eventHandlers.onMouseDownFlecheBasAscWin;
this.oHtmlAscBasFlecheWin.onmouseup=ContainerAutoScroll.eventHandlers.onMouseUpFlecheBasAscWin;
this.oHtmlAscBasFlecheWin.onmousemove=function(e){if(!e)e=window.event;stopEvent(e);}
this.oHtmlAscHautFlecheWin.onmousedown=ContainerAutoScroll.eventHandlers.onMouseDownFlecheHautAscWin;
this.oHtmlAscHautFlecheWin.onmouseup=ContainerAutoScroll.eventHandlers.onMouseUpFlecheHautAscWin;
this.oHtmlAscHautFlecheWin.onmousemove=function(e){if(!e)e=window.event;stopEvent(e);}
this.oHtmlPiloteScrollWin.onclick=ContainerAutoScroll.eventHandlers.onMouseClickAscWin;
this.oHtmlPiloteScrollWin.onmousemove=ContainerAutoScroll.eventHandlers.onmousemoveAscWin;
this.oHtmlPiloteScrollWin.onmouseout=ContainerAutoScroll.eventHandlers.onmouseoutAscWin;
}
this.autoScrollSurTexte(suppression=!this.opt['Mod'].AutoScrollSurTexte);
if(elements)
this.majListeModalites();
}
ContainerAutoScroll.prototype.fixeEltScroll=function(elements,mode,ssReDim){
var dejaEnregistres=false;
var elts;
if(!elements){
elts=new Array();
dejaEnregistres=true;
mode='ajout';
elts=this.listeEltsPresents.split('#');
elts.pop();
}
else{
if(!(elements instanceof Array)){
elts=new Array();
elts[0]=elements;
}
else
elts=elements;
}
for(var i=0;i<elts.length;i++){
elt=elts[i];
var tokElt=elt+'#';
if(ContainerAutoScroll.prototype.listeEltsScroll.indexOf(tokElt)==-1){
break;
}
var opt='this.option'+elt;
if(mode=='ajout'){
if((!eval(opt))
||(dejaEnregistres))
this.basculeScroll(elt,dejaEnregistres,ssReDim);
}
else
if(eval(opt))
this.basculeScroll(elt,dejaEnregistres,ssReDim);
}
}
ContainerAutoScroll.prototype.basculeScroll=function(elements,dejaEnreg,ssReDim){
var bAsc;
if(!this.opt['Meta'].bascule
&&!this.passBascule){
alert('Ce container n\'offre pas la possibilit?de modifier son interface de d?filement de contenu');
return;
}
if(!elements)return;
var elts;
if(!(elements instanceof Array)){
elts=new Array();
elts[0]=elements;
}
else
elts=elements;
var modeScroll;
for(var i=0;i<elts.length;i++){
modeScroll=elts[i];
if(ContainerAutoScroll.prototype.listeEltsScroll.indexOf(modeScroll)==-1){
break;
}
var opt='this.option'+modeScroll;
if(!this.partieDoctCachee){
this.majListeEltsPresents(modeScroll
,(this.svgListeEltsPresents.indexOf(modeScroll+'#')==-1)?'ajout':'retrait'
);
return;
}
var className='this.oHtml'+modeScroll+'.className';
if((eval(opt))
&&(!dejaEnreg)){
eval(className+' += \' masqueEltScroll\'');
}
else{
var nvClass=eval(className).replace(/masqueEltScroll/g,'');
eval(className+' = nvClass');
}
if(!dejaEnreg){
eval(opt+'= !'+opt);
this.majListeEltsPresents(modeScroll,eval(opt)?'ajout':'retrait');
}
if('AccesHaut#AccesBas#AscHautFleche#AscBasFleche#AscHautFlecheWin#AscBasFlecheWin'.indexOf(modeScroll)
!=-1)
this.gereFlechesAccesDirect(modeScroll);
if(modeScroll.indexOf('Ascenseur')!=-1){
bAsc=true;
traceExec('-> positionAscenseur depuis basculeScroll',31);
this.positionAscenseur(null,(modeScroll.indexOf('Win')!=-1));
}
}
if(!ssReDim){
this.computeDims();
}
if(bAsc){
this.gereAscenseurs(modeScroll);
traceExec('basculeScroll modeScroll= '+modeScroll+' argt1= null argt2= '
+(modeScroll.indexOf('Win')!=-1),9);
}
}
ContainerAutoScroll.prototype.gereAscenseurs=function(modeMod){
if(modeMod=='Ascenseur'){
if(this.optionAscenseur){
if(this.oHtmlPiloteScroll.onmousemove==null){
this.oHtmlPiloteScroll.onmousemove=ContainerAutoScroll.eventHandlers.onmousemove;
this.oHtmlPiloteScroll.onclick=ContainerAutoScroll.eventHandlers.onclickCentre;
this.oHtmlPiloteScroll.onmouseout=ContainerAutoScroll.eventHandlers.onmouseout;
}
if(this.opt['Meta'].CoherenceAuto){
this.oHtmlCadreInt.onmousemove=null;
this.oHtmlCadreInt.onclick=null;
this.oHtmlCadreInt.onmouseout=null;
}
}
else
this.autoScrollMin();
}
else
if(modeMod=='AscenseurWin'){
if(this.optionAscenseurWin){
this.couplageAscenseurTexte(true);
}
else{
this.couplageAscenseurTexte(false);
}
this.zoneAscModeInteractif(!this.opt['Mod'].TemoinPos);
}
}
ContainerAutoScroll.prototype.autoScrollMin=function(){
if(this.opt['Meta'].CoherenceAuto
&&!this.optionAscenseur
&&!this.opt['Mod'].DDInteractif
&&(!this.optionAscenseurWin
||(this.opt['Mod'].TemoinPos))
){
this.oHtmlCadreInt.onmousemove=ContainerAutoScroll.eventHandlers.onmousemove;
this.oHtmlCadreInt.onclick=ContainerAutoScroll.eventHandlers.onclickCentre;
this.oHtmlCadreInt.onmouseout=ContainerAutoScroll.eventHandlers.onmouseout;
}
}
ContainerAutoScroll.prototype.gereFlechesAccesDirect=function(modeMod){
if((modeMod=='AccesHaut')
&&this.optionAscHautFleche){
if(this.optionAccesHaut){
this.oHtmlAscHautFleche.className+=' dansZoneAccesHB';
this.oHtmlAccesHaut.appendChild(this.oHtmlAscHautFleche);
this.oHtmlAccesHaut.className='zoneAccesHaut zoneAccesElargie';
}
else
if(this.optionAscenseur){
this.oHtmlAscHautFleche.className='zoneHautFlecheDirect';
this.oHtmlAscenseur.insertBefore(this.oHtmlAscHautFleche,this.oHtmlPiloteScroll);
}
else
if(this.optionAscenseurWin){
this.oHtmlAscHautFleche.className='zoneAscHautFleche';
this.oHtmlAscenseurWin.insertBefore(this.oHtmlAscHautFleche,this.oHtmlPiloteScrollWin);
}
}
else
if((modeMod=='AccesBas')
&&this.optionAscBasFleche){
if(this.optionAccesBas){
this.oHtmlAscBasFleche.className+=' dansZoneAccesHB';
this.oHtmlAccesBas.appendChild(this.oHtmlAscBasFleche);
this.oHtmlAccesBas.className='zoneAccesBas zoneAccesElargie';
}
else
if(this.optionAscenseur){
this.oHtmlAscBasFleche.className='zoneBasFlecheDirect';
this.oHtmlAscenseur.appendChild(this.oHtmlAscBasFleche);
}
else
if(this.optionAscenseurWin){
this.oHtmlAscBasFleche.className='zoneAscBasFleche';
this.oHtmlAscenseurWin.appendChild(this.oHtmlAscBasFleche);
}
}
else
if(modeMod=='AscHautFleche'){
if(this.optionAscHautFleche){
if(this.optionAccesHaut){
this.oHtmlAccesHaut.className='zoneAccesHaut zoneAccesElargie';
this.oHtmlAscHautFleche.className+=' dansZoneAccesHB';
this.oHtmlAccesHaut.appendChild(this.oHtmlAscHautFleche);
}
else
if(this.optionAscenseur){
this.oHtmlAscHautFleche.className='zoneHautFlecheDirect';
this.oHtmlAscenseur.insertBefore(this.oHtmlAscHautFleche,this.oHtmlPiloteScroll);
}
}
else{
this.oHtmlAscHautFleche.className+=' masqueEltScroll';
if(this.optionAccesHaut){
this.oHtmlAccesHaut.className='zoneAccesHaut';
}
}
}
else
if(modeMod=='AscBasFleche'){
if(this.optionAscBasFleche){
if(this.optionAccesBas){
this.oHtmlAccesBas.className='zoneAccesBas zoneAccesElargie';
this.oHtmlAscBasFleche.className+=' dansZoneAccesHB';
this.oHtmlAccesBas.appendChild(this.oHtmlAscBasFleche);
}
else
if(this.optionAscenseur){
this.oHtmlAscBasFleche.className='zoneBasFlecheDirect';
this.oHtmlAscenseur.appendChild(this.oHtmlAscBasFleche);
}
}
else
if(this.optionAscenseur){
this.oHtmlAscBasFleche.className+=' masqueEltScroll';
if(this.optionAccesBas){
this.oHtmlAccesBas.className='zoneAccesBas';
}
}
}
else
if(modeMod=='AscHautFlecheWin'){
if(this.optionAscHautFlecheWin){
this.oHtmlAscHautFlecheWin.className='zoneAscHautFleche';
this.oHtmlAscenseurWin.insertBefore(this.oHtmlAscHautFlecheWin,this.oHtmlPiloteScrollWin);
}
else{
this.oHtmlAscHautFlecheWin.className+=' masqueEltScroll';
}
}
else
if(modeMod=='AscBasFlecheWin'){
if(this.optionAscBasFlecheWin){
this.oHtmlAscBasFlecheWin.className='zoneAscBasFleche';
this.oHtmlAscenseurWin.appendChild(this.oHtmlAscBasFlecheWin);
}
else{
this.oHtmlAscBasFlecheWin.className+=' masqueEltScroll';
}
}
}
ContainerAutoScroll.eventHandlers={
fctNull:function(e){},
onMouseClickAscWin:function(e){
if(!e)e=window.event;
var cible=(e.target?e.target:e.srcElement);
var idEvt=(e.target?e.target.id:e.srcElement.id);
var oEd=this.oCiu;
if(cible==oEd.cursTemoinPos.oHtmlMobile)
return;
var nbLignes=parseInt(oEd.oHtmlCadreInt.style.height)/oEd.oHtmlTexte.pxHLine;
var yPRC=e.offsetY?e.offsetY:e.layerY;
if(parseInt(yPRC)
<oEd.cursTemoinPos.oHtmlMobile.offsetTop){
oEd.scrollTextUp(nbLignes,vitesse=null,unSaut=true);
}
else{
oEd.scrollTextDown(nbLignes,vitesse=null,unSaut=true);
}
},
onMouseDownFlecheHautAscWin:function(e){
var prct=0.5;
var vit=parseInt(10+prct*400);
var nbLine=(1-prct)*5;
if(!e)e=window.event;
var cible=(e.target?e.target:e.srcElement);
var idEvt=(e.target?e.target.id:e.srcElement.id);
var oEd=this.oCiu;
oEd.scrollTextUp(nbLine,vit);
stopEvent(e);
},
onMouseDownFlecheBasAscWin:function(e){
var prct=0.5;
var vit=parseInt(10+prct*400);
var nbLine=(1-prct)*5;
if(!e)e=window.event;
var cible=(e.target?e.target:e.srcElement);
var idEvt=(e.target?e.target.id:e.srcElement.id);
var oEd=this.oCiu;
oEd.scrollTextDown(nbLine,vit);
stopEvent(e);
},
onMouseUpFlecheHautAscWin:function(e){
var oEd=this.oCiu;
if(oEd.scroll)
clearTimeout(oEd.scrollTextTimeout);
oEd.scroll=false;
oEd.scrollUp=false;
oEd.scrollDown=false;
stopEvent(e);
},
onMouseUpFlecheBasAscWin:function(e){
var oEd=this.oCiu;
if(oEd.scroll)
clearTimeout(oEd.scrollTextTimeout);
oEd.scroll=false;
oEd.scrollUp=false;
oEd.scrollDown=false;
stopEvent(e);
},
onmouseout:function(e){
var oEd=this.oCiu;
if(oEd.scroll)
clearTimeout(oEd.scrollTextTimeout);
oEd.scroll=false;
},
onclickVersHaut:function(e){
},
onclickVersBas:function(e){
},
onclickHaut:function(e){
this.oCiu.moveTopText();
},
onclickBas:function(e){
this.oCiu.moveBottomText();
},
onclickCentre:function(e){
var oEd=this.oCiu;
if(oEd.scroll)
clearTimeout(oEd.scrollTextTimeout);
oEd.scroll=false;
oEd.scrollUp=false;
oEd.scrollDown=false;
},
onmousemove:function(e){
if(!e)e=window.event;
var cible=(e.target?e.target:e.srcElement);
var idEvt=(e.target?e.target.id:e.srcElement.id);
var oEd=this.oCiu;
if(cible==oEd.oHtmlCadreInt)return;
traceExec('Mm oEd.idObjComp= '+oEd.idObjComp+' idEvt= '+idEvt+' oEd.id= '+oEd.idObjComp+
' oEd.scroll= '+oEd.scroll+' class= '+cible.className,9);
if(oEd.cursTemoinPos&&oEd.cursTemoinPos.DDCursTemoin)return true;
if(oEd.bCursDsTemoinPosAscWin)return true;
traceExec('Mm exec traitt',3);
if(oEd.scroll)
clearTimeout(oEd.scrollTextTimeout);
var hZoneTexte=parseInt(oEd.oHtmlCadreInt.style.height);
var hZoneInerte=oEd.oHtmlCadreInt.prctHZoneInerte*hZoneTexte;
traceExec('pos-> '+(parseInt(oEd.oHtmlCadreInt.offsetTop)
+compOffsetParent(oEd.oHtmlCadreInt)),20);
traceExec('e.pageY-> '+e.pageY,20);
traceExec('Int offsetTop-> '+parseInt(oEd.oHtmlCadreInt.offsetTop),20);
traceExec('offsetParent -> '+compOffsetParent(oEd.oHtmlCadreInt),20);
traceExec('oEd.oHtmlTexte.style.width= '+oEd.oHtmlTexte.style.width
+' oEd.oHtmlTexte.style.height= '+oEd.oHtmlTexte.style.height
+' parseInt(oEd.oHtmlTexte.style.top)= '+parseInt(oEd.oHtmlTexte.style.top)+
' e.offsetY= '+e.offsetY,3);
if((oEd.optionAscenseur||oEd.optionAscenseurWin)
&&ContainerAutoScroll.eventHandlers.cibleAscenseur(cible)){
var yPRC=e.offsetY?e.offsetY:e.layerY;
traceExec('ContainerAutoScroll.eventHandlers.cibleAscenseur(cible) = '+
ContainerAutoScroll.eventHandlers.cibleAscenseur(cible),2);
traceExec('yPRC = '+yPRC,2);
traceExec('hZoneTexte= '+hZoneTexte,2);
if(cible==oEd.oHtmlAscCentre){
traceExec(' cible == oEd.oHtmlAscCentre',2);
yPRC=yPRC+parseInt(oEd.oHtmlAscSup.style.height);
}
else
if(cible==oEd.oHtmlAscInf){
traceExec(' cible == oEd.oHtmlAscInf',2);
if(cible.previousSibling==oEd.oHtmlAscCentre){
yPRC=yPRC
+parseInt(oEd.oHtmlAscSup.style.height)
+parseInt(oEd.oHtmlAscCentre.style.height);
}
else{
traceExec('cible.id= '+cible.id,2);
traceExec(' cible == else',2);
yPRC+=(hZoneTexte/2);
}
}
}
else{
traceExec('pageY= '+e.pageY,9);
var yPRC=e.offsetY?(e.offsetY+parseInt(oEd.oHtmlTexte.style.top))
:(
e.pageY
-(parseInt(oEd.oHtmlCadreInt.offsetTop)
+compOffsetParent(oEd.oHtmlCadreInt)));
}
var hZoneSensible=(hZoneTexte/ 2)-(hZoneInerte/ 2);
traceExec('hZoneSensible= '+hZoneSensible,2);
if(yPRC
<((hZoneTexte/2)
-(hZoneInerte/2))){
var prctHaut=yPRC/hZoneSensible;
var vit=parseInt(10+prctHaut*400);
var nbLine=(1-prctHaut)*5;
traceExec('prctHaut = '+prctHaut,2);
oEd.scrollTextUp(nbLine,vit);
}
else
if(yPRC
>((hZoneTexte/2)
+(hZoneInerte/2))){
var prctBas=(hZoneTexte-yPRC)/hZoneSensible;
var vit=parseInt(10+prctBas*400);
var nbLine=(1-prctBas)*5;
traceExec('prctBas = '+prctBas,2);
oEd.scrollTextDown(nbLine,vit);
}
else{
oEd.scroll=false;
oEd.scrollUp=false;
oEd.scrollDown=false;
}
},
cibleAscenseur:function(oHtml){
var div=oHtml;
traceExec('cibleAscenseur div.className= '+div.className,9);
while(div&&(div.className!='piloteScroll')){
div=div.parentNode;
}
return(div?(div.className=='piloteScroll'):false);
},
onmouseoutAscWin:function(e){
if(!e)e=window.event;
var oSourceEvt=e.target?e.target:e.srcElement;
if(oSourceEvt.oCiu)oSourceEvt.oCiu.bCursDsTemoinPosAscWin=false;
stopEvent(e);
},
onmousemoveAscWin:function(e){
if(!e)e=window.event;
var oSourceEvt=e.target?e.target:e.srcElement;
traceExec('onmousemoveAscWin oSourceEvt.id = '+oSourceEvt.id,3);
oSourceEvt.oCiu.bCursDsTemoinPosAscWin=true;
traceExec('onmousemoveAscWin oSourceEvt.oCiu.bCursDsTemoinPosAscWin = '+oSourceEvt.oCiu.bCursDsTemoinPosAscWin,3);
}
}
ContainerAutoScroll.prototype.nbInstances=0;
if(!rialto.widgetBehavior)rialto.widgetBehavior={};
rialto.widgetBehavior.createBehavior=function(behavior,baseFunction,extendedBehavior){
rialto.widgetBehavior[behavior]=function(setup){
if(!rialto.widgetBehavior.$$coreAffect.apply(this,[behavior,setup]))
return;
baseFunction.apply(this,[setup]);
if(baseFunction.prototype)
for(var proto in baseFunction.prototype){
if(typeof baseFunction.prototype[proto]=='function')
this[proto]=baseFunction.prototype[proto];
}
}
if(baseFunction.prototype)
rialto.widgetBehavior[behavior].prototype={};
for(var proto in baseFunction.prototype){
if(typeof baseFunction.prototype[proto]!='function')
rialto.widgetBehavior[behavior].prototype[proto]=
baseFunction.prototype[proto];
}
if(extendedBehavior)
rialto.widgetBehavior[behavior].superClass=rialto.widgetBehavior[extendedBehavior];
}
rialto.widgetBehavior.$$coreAffect=function(behavior,setup){
if(!this.withBehavior)this.withBehavior={};
if(typeof this.withBehavior[behavior]!='undefined'){
return false;
}
else{
if(rialto.widgetBehavior[behavior].superClass){
this.base=rialto.widgetBehavior[behavior].superClass;
this.base(setup);
}
this.withBehavior[behavior]=true;
return true;
}
}
rialto.widgetBehavior.affect=function(widget,behavior,setup){
if(!setup)setup={};
if((!widget.withBehavior)||widget.withBehavior[behavior]==undefined){
widget[behavior]=rialto.widgetBehavior[behavior];
widget[behavior](setup);
}
else
rialto.widgetBehavior.modify(widget,behavior,setup);
}
rialto.widgetBehavior.modify=function(widget,behavior,setup){
alert('a implementer : doit realiser une modification de comportement');
}
rialto.widgetBehavior.DragAndDrop_cstes={
zIndexMovingOHtml:1000000,
zIndexInfoFrame:1000001
}
rialto.widgetBehavior.DragAndDrop_defaults={
ghost_opacity:0.5,
markSelect_opacity:0.5
}
rialto.widgetBehavior.DragAndDropMouseDownHandler=function(e){
if(!e)var e=window.event;
var oSourceEvt=e.target?e.target:e.srcElement;
var cibl=rialto.widgetBehavior.DDtargetOrTargetChild(oSourceEvt);
if(!cibl){
return;
}
else{
oSourceEvt=cibl;
}
var oHtml=oSourceEvt;
var oSpecs=oHtml.refObjSpecs;
var direction=DirDeplact(oHtml,e
,_rum.$getHeight(oHtml)
,_rum.$getWidth(oHtml)
,oSpecs.specs.sensitiveEdgeWidth,true
,oSpecs.movingLimits.orientation);
if(!direction){
return;
}
if((oHtml.behavior['RS'])
&&(oHtml.behavior['RS'].isRunning))
return;
else
oHtml.behavior['DD'].isRunning=true;
if(oSpecs.specs.bDynamicsMovingLimits)
oSpecs.loadLimitsDyn();
var oHtmlToMove=oSpecs.specs.oHtmlToMove;
var oHtmlParentRef=oHtmlToMove.parentNode;
var boundOHtmlRef=oSpecs.movingLimits.oHtmlRef;
if(oSpecs.specs.bSelectMark){
var maskSelect=document.createElement('DIV');
maskSelect.id='maskSelectDD_unique';
maskSelect.className='maskSelectDD';
maskSelect.style.top=-_rum.$$getBorderTopWidth(oHtmlToMove);
maskSelect.style.left=-_rum.$$getBorderLeftWidth(oHtmlToMove);
maskSelect.style.width=oHtmlToMove.offsetWidth;
maskSelect.style.height=oHtmlToMove.offsetHeight;
rialto.effect.opacity(maskSelect,0.5);
oHtmlToMove.appendChild(maskSelect);
}
var parentOHtmlToMove;
var nextSiblOHtmlToMove;
var isMovingOHtmlInDoct=true;
var topLeftDivToMoveInVP=_rum.$divTopLeftInViewPort(oHtmlToMove);
var topDivToMoveInVP=topLeftDivToMoveInVP.top;
var leftDivToMoveInVP=topLeftDivToMoveInVP.left;
traceExec('topDivToMoveInVP  	= '+topLeftDivToMoveInVP.top+
' leftDivToMoveInVP 	= '+topLeftDivToMoveInVP.left,73);
var topLeftEvtInVP=_rum.$eventTopLeftInViewPort(e);
var topEvtInVP=topLeftEvtInVP.top;
var leftEvtInVP=topLeftEvtInVP.left;
shiftTopForIcon=0;
shiftLeftForIcon=0;
if((oSpecs.specs.ghost.bIcone)
&&(!oSpecs.specs.magneticsGrid)){
shiftTopForIcon=(oSpecs.movingLimits.orientation=='h')?0:topEvtInVP-topDivToMoveInVP;
shiftLeftForIcon=(oSpecs.movingLimits.orientation=='v')?0:leftEvtInVP-leftDivToMoveInVP;
topDivToMoveInVP=topEvtInVP;
leftDivToMoveInVP=leftEvtInVP;
}
var iTopLeftBoundDivToMoveInVP=_rum.$divInternalTopLeftInViewPort(boundOHtmlRef);
var iTopBoundDivToMoveInVP=iTopLeftBoundDivToMoveInVP.top;
var iLeftBoundDivToMoveInVP=iTopLeftBoundDivToMoveInVP.left;
var iTopLeftParDivToMoveInVP=_rum.$divInternalTopLeftInViewPort(oHtmlParentRef);
var iTopParDivToMoveInVP=iTopLeftParDivToMoveInVP.top;
var iLeftParDivToMoveInVP=iTopLeftParDivToMoveInVP.left;
var deltaTopCursOHtmlToMove=topEvtInVP-topDivToMoveInVP;
var deltaLeftCursOHtmlToMove=leftEvtInVP-leftDivToMoveInVP;
topMovingDiv=topDivToMoveInVP;
leftMovingDiv=leftDivToMoveInVP;
var isMovingOHtmlRelPos=false;
var	 initTopInRel;
var	 initLeftInRel;
var topInNaturalFlow,leftInNaturalFlow;
if(oSpecs.specs.ghost
&&!oSpecs.specs.ghost.asChild){
var ghostFrame=document.getElementById('singleGhostFrame');
if(ghostFrame==null){
ghostFrame=document.createElement('DIV');
ghostFrame.id='singleGhostFrame';
}
ghostFrame.style.width='';
ghostFrame.style.height='';
ghostFrame.className='ghostDD_'+oSpecs.specs.ghost.aspect;
rialto.effect.opacity(ghostFrame,
rialto.widgetBehavior.DragAndDrop_defaults.ghost_opacity
);
document.body.appendChild(ghostFrame);
ghostFrame.style.top=topMovingDiv;
ghostFrame.style.left=leftMovingDiv;
if(!oSpecs.specs.ghost.bIcone){
_rum.$setSizeConformW3C(ghostFrame,oHtmlToMove);
if(oSpecs.specs.ghost.height)
ghostFrame.style.height=eval(oSpecs.specs.ghost.height);
}
if(oSpecs.specs.ghost.top)
ghostFrame.style.top=eval(oSpecs.specs.ghost.top);
ghostFrame.style.display='block';
var movingOHtml=ghostFrame;
movingOHtml.refObjSpecs=oSpecs;
}
else
if(oSpecs.specs.ghost
&&oSpecs.specs.ghost.asChild){
var ghostFrame=document.getElementById('singleGhostFrame');
if(ghostFrame==null){
ghostFrame=document.createElement('DIV');
ghostFrame.id='singleGhostFrame';
}
ghostFrame.style.top=oHtmlToMove.offsetTop;
ghostFrame.style.left=oHtmlToMove.offsetLeft;
ghostFrame.style.width='';
ghostFrame.style.height='';
ghostFrame.className='ghostDD_'+oSpecs.specs.ghost.aspect;
rialto.effect.opacity(ghostFrame,
rialto.widgetBehavior.DragAndDrop_defaults.ghost_opacity
);
oHtmlToMove.parentNode.appendChild(ghostFrame);
if(!oSpecs.specs.ghost.bIcone){
_rum.$setSizeConformW3C(ghostFrame,oHtmlToMove);
if(oSpecs.specs.ghost.height)
ghostFrame.style.height=eval(oSpecs.specs.ghost.height);
}
ghostFrame.style.zIndex=rialto.widgetBehavior.DragAndDrop_cstes.zIndexMovingOHtml;
ghostFrame.style.display='block';
var movingOHtml=ghostFrame;
movingOHtml.refObjSpecs=oSpecs;
isMovingOHtmlInDoct=false;
isMovingOHtmlRelPos=(movingOHtml.style.position=='relative');
initTopInRel=parseInt(_rum.$getStyle(movingOHtml,'top'));
initLeftInRel=parseInt(_rum.$getStyle(movingOHtml,'left'));
topInNaturalFlow=movingOHtml.offsetTop-initTopInRel;
leftInNaturalFlow=movingOHtml.offsetLeft-initLeftInRel;
topMovingDiv=(movingOHtml.style.position=='relative')?
initTopInRel
:movingOHtml.offsetTop;
leftMovingDiv=(movingOHtml.style.position=='relative')?
initLeftInRel
:movingOHtml.offsetLeft;
}
else{
var movingOHtml,top,left;
movingOHtml=oHtmlToMove;
isMovingOHtmlInDoct=false;
isMovingOHtmlRelPos=(movingOHtml.style.position=='relative');
initTopInRel=parseInt(_rum.$getStyle(movingOHtml,'top'));
initLeftInRel=parseInt(_rum.$getStyle(movingOHtml,'left'));
topInNaturalFlow=movingOHtml.offsetTop-initTopInRel;
leftInNaturalFlow=movingOHtml.offsetLeft-initLeftInRel;
topMovingDiv=(movingOHtml.style.position=='relative')?
initTopInRel
:movingOHtml.offsetTop;
leftMovingDiv=(movingOHtml.style.position=='relative')?
initLeftInRel
:movingOHtml.offsetLeft;
}
var shiftRelToAbsTop=(isMovingOHtmlInDoct)?0:iTopLeftParDivToMoveInVP.top;
var shiftRelToAbsLeft=(isMovingOHtmlInDoct)?0:iTopLeftParDivToMoveInVP.left;
var shiftAbsToRelTop=(isMovingOHtmlInDoct)?-iTopLeftParDivToMoveInVP.top:0;
var shiftAbsToRelLeft=(isMovingOHtmlInDoct)?-iTopLeftParDivToMoveInVP.left:0;
if(oSpecs.movingLimits.bRectLim){
var dLimLeft=dLimTop=dLimRight=dLimBottom=0;
if(oSpecs.movingLimits.orientation=='h'){
dLimTop=iTopParDivToMoveInVP-iTopBoundDivToMoveInVP
+oHtmlToMove.offsetTop;
dLimBottom=dLimTop+oHtmlToMove.offsetHeight;
}
else{
dLimTop=oSpecs.movingLimits.rectLim.top;
dLimBottom=oSpecs.movingLimits.rectLim.bottom;
}
if(oSpecs.movingLimits.orientation=='v'){
dLimLeft=oHtmlToMove.offsetLeft
+iLeftParDivToMoveInVP-iLeftBoundDivToMoveInVP;
dLimRight=dLimLeft+oHtmlToMove.offsetWidth;
}
else{
dLimLeft=oSpecs.movingLimits.rectLim.left;
dLimRight=oSpecs.movingLimits.rectLim.right;
}
var gheight=(dLimBottom-dLimTop);
var gwidth=(dLimRight-dLimLeft);
if(oSpecs.specs.magneticsGrid){
oSpecs.specs.magneticsGrid.nbHorizontalLines=
parseInt((gheight-parseInt(oHtmlToMove.offsetHeight))
/oSpecs.specs.magneticsGrid.heightRow)+1;
oSpecs.specs.magneticsGrid.nbVerticalLines=
parseInt((gwidth-parseInt(oHtmlToMove.offsetWidth))
/oSpecs.specs.magneticsGrid.widthCol)+1;
}
}
if(oSpecs.movingLimits.isWithLimitsDisplayed){
var limRect=document.createElement('DIV');
limRect.style.width=gwidth;
limRect.style.height=gheight;
limRect.className='line dashed greenBorder';
document.body.appendChild(limRect);
_rum.$setWidthConformW3C(limRect);
var revisedHeight=_rum.$setHeightConformW3C(limRect);
var IEBorder=revisedHeight-gheight;
var gridEdgeWidth=_rum.$$getBorderTopWidth(limRect);
limRect.style.top=iTopBoundDivToMoveInVP-gridEdgeWidth+dLimTop;
limRect.style.left=iLeftBoundDivToMoveInVP-gridEdgeWidth+dLimLeft;
if(oSpecs.specs.magneticsGrid
&&oSpecs.specs.magneticsGrid.bDisplayed){
traceExec('MD grid dLimTop= '+dLimTop+' dLimLeft= '+dLimLeft
+' gwidth = '+gwidth+' gheight= '+gheight,2);
gtop=-gridEdgeWidth;
for(var i=0;i<oSpecs.specs.magneticsGrid.nbHorizontalLines;i++){
line=document.createElement('DIV');
line.className='line horizontal redBorder';
line.style.top=gtop;
line.style.left=0;
line.style.width=parseInt(limRect.style.width)-(IEBorder);
line.style.height=0;
gtop=gtop+oSpecs.specs.magneticsGrid.heightRow;
limRect.appendChild(line);
}
gleft=-gridEdgeWidth;
for(var i=0;i<oSpecs.specs.magneticsGrid.nbVerticalLines;i++){
lineV=document.createElement('DIV');
lineV.className='line vertical aquamarineBorder';
lineV.style.left=gleft;
lineV.style.top=0;
lineV.style.height=parseInt(limRect.style.height)-(IEBorder);
lineV.style.clip='rect(0,'
+gridEdgeWidth+','+
+parseInt(lineV.style.height)+'px'
+',0)';
gleft=gleft+oSpecs.specs.magneticsGrid.widthCol;
limRect.appendChild(lineV);
}
}
}
if(oSpecs.isWithMovingInfo){
var infoFrame=document.createElement('DIV');
infoFrame.className="DDinfoFrame";
infoFrame.topShift=10;
infoFrame.leftShift=20;
infoFrame.topShiftI=topEvtInVP;
infoFrame.leftShiftI=leftEvtInVP;
infoFrame.style.top=infoFrame.topShiftI+infoFrame.topShift;
infoFrame.style.left=infoFrame.leftShiftI+infoFrame.leftShift;
infoFrame.style.filter="alpha(opacity:50)";
infoFrame.style.opacity=0.5;
infoFrame.style.zIndex=rialto.widgetBehavior.DragAndDrop_cstes.zIndexInfoFrame;
infoFrame.isWithMovingInParentInfo=oSpecs.isWithMovingInParentInfo;
if(oSpecs.isWithMovingInParentInfo)
infoFrame.innerHTML=(parseInt(movingOHtml.style.top)+shiftAbsToRelTop)+","+
(parseInt(movingOHtml.style.left)+shiftAbsToRelLeft);
else
infoFrame.innerHTML=(parseInt(movingOHtml.style.top)+shiftRelToAbsTop)+","+
(parseInt(movingOHtml.style.left)+shiftRelToAbsLeft);
document.body.appendChild(infoFrame);
}
traceExec('isMovingOHtmlRelPos	: '+isMovingOHtmlRelPos+
' initTopInRel			: '+initTopInRel+
' initLeftInRel			: '+initLeftInRel,2);
var dTopParentToBoundRef,dLeftParentToBoundRef;
if(oHtmlParentRef==boundOHtmlRef){
dTopParentToBoundRef=0;
dLeftParentToBoundRef=0;
}
else{
dTopParentToBoundRef=iTopLeftBoundDivToMoveInVP.top-iTopLeftParDivToMoveInVP.top;
dLeftParentToBoundRef=iTopLeftBoundDivToMoveInVP.left-iTopLeftParDivToMoveInVP.left;
}
top=parseInt(movingOHtml.style.top);
left=parseInt(movingOHtml.style.left);
_DDMgr.currDrag={
oThis:oSpecs,
oSource:oHtml,
ghost:oSpecs.specs.ghost,
maskSelect:(oSpecs.specs.bSelectMark?
maskSelect:null),
movingOHtml:movingOHtml,
oHtmlToMove:oHtmlToMove,
bMUpAction:oSpecs.specs.bMUpAction,
isMovingOHtmlRelPos:isMovingOHtmlRelPos,
topInNaturalFlow:topInNaturalFlow,
leftInNaturalFlow:leftInNaturalFlow,
isMovingOHtmlInDoct:isMovingOHtmlInDoct,
initialTop:initTopInRel,
initialLeft:initLeftInRel,
topDivToMoveInVP:topDivToMoveInVP,
leftDivToMoveInVP:leftDivToMoveInVP,
topEvtInVP:topEvtInVP,
leftEvtInVP:leftEvtInVP,
iTopBoundDivToMoveInVP:iTopBoundDivToMoveInVP,
iLeftBoundDivToMoveInVP:iLeftBoundDivToMoveInVP,
shiftAbsToRelTop:shiftAbsToRelTop,
shiftAbsToRelLeft:shiftAbsToRelLeft,
shiftRelToAbsTop:shiftRelToAbsTop,
shiftRelToAbsLeft:shiftRelToAbsLeft,
deltaTopCursOHtmlToMove:deltaTopCursOHtmlToMove,
deltaLeftCursOHtmlToMove:deltaLeftCursOHtmlToMove,
eventTopLeftInDiv:{top:deltaTopCursOHtmlToMove
,left:deltaLeftCursOHtmlToMove},
topMovingDiv:topMovingDiv,
leftMovingDiv:leftMovingDiv,
totDeltaMoveTop:0,
totDeltaMoveLeft:0,
dTopParentToBoundRef:dTopParentToBoundRef,
dLeftParentToBoundRef:dLeftParentToBoundRef,
prevTop:top,
prevLeft:left,
mvtEffectif:false,
cibleOk:false,
svgZIndex:movingOHtml.style.zIndex||0,
oHtmlParentRef:oHtmlParentRef,
boundOHtmlRef:boundOHtmlRef,
oHtmlLimitsRect:limRect,
oHtmlInfoFrame:infoFrame
};
_DDMgr.currDrag.movingOHtml.style.zIndex=rialto.widgetBehavior.DragAndDrop_cstes.zIndexMovingOHtml;
if(this.setCapture){
this.setCapture();
if((!oSpecs.specs.modCurs.avantDD)
&&(oSpecs.specs.modCurs.auClic)){
rialto.widgetBehavior.DDmodCursor(oHtml,direction,oSpecs.movingLimits.orientation,false);
}
}
else{
if((!oSpecs.specs.modCurs.avantDD)
&&(oSpecs.specs.modCurs.auClic)){
if(oSpecs.specs.ghost)
rialto.widgetBehavior.DDmodCursor(objetEnDeplact,direction,oSpecs.movingLimits.orientation,true);
else
rialto.widgetBehavior.DDmodCursor(oHtml,direction,oSpecs.movingLimits.orientation,true);
}
}
var oThis=_DDMgr.currDrag.oThis;
if(oThis.afterMD){
oThis.afterMD();
}
}
rialto.widgetBehavior.DragAndDropMouseMoveHandler=function(e){
if(!e)var e=window.event;
var oHtml=e.target?e.target
:e.srcElement;
if(!_DDMgr.currDrag){
if(!oHtml.dragAndDrop){
return;
}
var oSpecs=oHtml.refObjSpecs;
if(oSpecs.specs.modCurs.avantDD){
var direction=DirDeplact(oHtml,e
,_rum.$getHeight(oHtml)
,_rum.$getWidth(oHtml)
,oSpecs.specs.sensitiveEdgeWidth,true
,oSpecs.movingLimits.orientation);
rialto.widgetBehavior.DDmodCursor(oHtml,direction,oSpecs.movingLimits.orientation,false);
}
}
else{
if(e.clientX>=0&&e.clientY>=0){
var oMovingStyle=_DDMgr.currDrag.movingOHtml.style;
traceExec('MM : '
+' top= '+oMovingStyle.top
+' left= '+oMovingStyle.left
+' width= '+oMovingStyle.width
+' height = '+oMovingStyle.height
+' backColor = '+oMovingStyle.backgroundColor
+' e.clientX = '+e.clientX
,2);
_DDMgr.currDrag.mvtEffectif=true;
var nvEventTopLeft=_rum.$eventTopLeftInViewPort(e);
var totDeltaMoveTop=nvEventTopLeft.top-_DDMgr.currDrag.topEvtInVP;
var totDeltaMoveLeft=nvEventTopLeft.left-_DDMgr.currDrag.leftEvtInVP;
newPos={};
newPos.top=_DDMgr.currDrag.topMovingDiv
+totDeltaMoveTop;
newPos.left=_DDMgr.currDrag.leftMovingDiv
+totDeltaMoveLeft;
var oWithSpecs=_DDMgr.currDrag.oThis;
var dTopLeft=rialto.widgetBehavior.$$DDMM_AbsToRel();
if(oWithSpecs.movingLimits.bRectLim){
rialto.widgetBehavior.$$DDMM_applyConstraintsLimits(oWithSpecs,newPos,dTopLeft.top,dTopLeft.left);
}
if(oWithSpecs.specs.magneticsGrid){
rialto.widgetBehavior.$$DDMM_applyConstraintsMagneticsGrid(oWithSpecs,newPos,dTopLeft.top,dTopLeft.left);
}
oMovingStyle.left=newPos.left;
oMovingStyle.top=newPos.top;
traceExec('apply newPos.top= '+newPos.top
+'newPos.left= '+newPos.left,73);
if((oWithSpecs.specs.dropTargets)
&&(!oWithSpecs.specs.cibleOk)){
rialto.widgetBehavior.$$DDMM_applyConstraintTargets(oWithSpecs);
rialto.widgetBehavior.DDmodCursor(_DDMgr.currDrag.movingOHtml,oWithSpecs.movingLimits.orientation,_DDMgr.currDrag.orientation,_DDMgr.currDrag.cibleOk);
}
_DDMgr.currDrag.totDeltaMoveTop=newPos.top
-_DDMgr.currDrag.topMovingDiv
_DDMgr.currDrag.totDeltaMoveLeft=newPos.left
-_DDMgr.currDrag.leftMovingDiv
if(_DDMgr.currDrag.oHtmlInfoFrame){
rialto.widgetBehavior.$$DDMM_displayInfos(oMovingStyle,e,nvEventTopLeft);
}
if(oWithSpecs.synchro)
rialto.widgetBehavior.$$DDMM_CallBackSynchro(oWithSpecs);
}
}
}
rialto.widgetBehavior.$$DDMM_AbsToRel=function(){
var dTop,dLeft;
if(_DDMgr.currDrag.isMovingOHtmlInDoct){
dTop=_DDMgr.currDrag.iTopBoundDivToMoveInVP;
dLeft=_DDMgr.currDrag.iLeftBoundDivToMoveInVP;
}
else{
dTop=_DDMgr.currDrag.dTopParentToBoundRef;
dLeft=_DDMgr.currDrag.dLeftParentToBoundRef;
if(_DDMgr.currDrag.isMovingOHtmlRelPos){
dTop-=
_DDMgr.currDrag.topInNaturalFlow;
dLeft-=
_DDMgr.currDrag.leftInNaturalFlow;
}
}
return{top:dTop,left:dLeft};
}
rialto.widgetBehavior.$$DDMM_applyConstraintsMagneticsGrid=function(oSpecs,newPos,dTop,dLeft){
var nvTop=newPos.top;
var nvLeft=newPos.left;
var dLimLeft=dLimTop=0;
if(oSpecs.movingLimits.rectLim){
dLimLeft=oSpecs.movingLimits.rectLim.left;
dLimTop=oSpecs.movingLimits.rectLim.top;
}
if(oSpecs.movingLimits.orientation!='v'){
var nInterv=Math.round((nvLeft
-dLeft-dLimLeft)
/oSpecs.specs.magneticsGrid.widthCol
);
nInterv=Math.min((oSpecs.specs.magneticsGrid.nbVerticalLines-1),
nInterv);
nvLeft=
(nInterv)
*oSpecs.specs.magneticsGrid.widthCol
+dLeft+dLimLeft;
}
if(oSpecs.movingLimits.orientation!='h'){
var nInterv=Math.round((nvTop
-dTop-dLimTop)
/oSpecs.specs.magneticsGrid.heightRow
);
nInterv=Math.min((oSpecs.specs.magneticsGrid.nbHorizontalLines-1),
nInterv);
nvTop=
(nInterv)
*oSpecs.specs.magneticsGrid.heightRow
+dTop+dLimTop;
}
newPos.top=nvTop;
newPos.left=nvLeft;
}
rialto.widgetBehavior.$$DDMM_displayInfos=function(oMovingStyle,e,nvEventTopLeft){
if(_DDMgr.currDrag.oHtmlInfoFrame.isWithMovingInParentInfo)
var topLeft=(parseInt(oMovingStyle.top)+_DDMgr.currDrag.shiftAbsToRelTop)+","+
(parseInt(oMovingStyle.left)+_DDMgr.currDrag.shiftAbsToRelLeft);
else
var topLeft=(parseInt(oMovingStyle.top)+_DDMgr.currDrag.shiftRelToAbsTop)+","+
(parseInt(oMovingStyle.left)+_DDMgr.currDrag.shiftRelToAbsLeft);
_DDMgr.currDrag.oHtmlInfoFrame.innerHTML=
topLeft
+' ( '
+_DDMgr.currDrag.totDeltaMoveTop
+','
+_DDMgr.currDrag.totDeltaMoveLeft
+')';
_DDMgr.currDrag.oHtmlInfoFrame.style.top=
nvEventTopLeft.top
+_DDMgr.currDrag.oHtmlInfoFrame.topShift;
_DDMgr.currDrag.oHtmlInfoFrame.style.left=
nvEventTopLeft.left
+_DDMgr.currDrag.oHtmlInfoFrame.leftShift;
}
rialto.widgetBehavior.$$DDMM_applyConstraintsLimits=function(oWithSpecs,newPos,dTop,dLeft){
var oHtmlToMove=_DDMgr.currDrag.oHtmlToMove;
var posMovingOHtml=_DDMgr.currDrag.movingOHtml.style;
var nvTop=newPos.top;
var nvLeft=newPos.left;
traceExec('nvTop= '+nvTop+' - dTop <? '+dTop+' oWithSpecs.movingLimits.rectLim.top= '+
oWithSpecs.movingLimits.rectLim.top,2);
if(oWithSpecs.movingLimits.orientation=='v'){
nvLeft=_DDMgr.currDrag.leftMovingDiv;
}
else
if(oWithSpecs.movingLimits.orientation=='h')
nvTop=_DDMgr.currDrag.topMovingDiv;
if((oWithSpecs.movingLimits.orientation=='v')
||(oWithSpecs.movingLimits.orientation=='2D')){
if((parseInt(nvTop)-dTop)
<parseInt(oWithSpecs.movingLimits.rectLim.top)){
nvTop=
oWithSpecs.movingLimits.bCircular?(oWithSpecs.movingLimits.rectLim.bottom
-parseInt(posMovingOHtml.height))
:oWithSpecs.movingLimits.rectLim.top;
nvTop=parseInt(nvTop)+dTop;
}
else
if((parseInt(nvTop)-dTop
+parseInt(oHtmlToMove.offsetHeight))
>parseInt(oWithSpecs.movingLimits.rectLim.bottom)){
nvTop=
oWithSpecs.movingLimits.bCircular?oWithSpecs.movingLimits.rectLim.top
:(oWithSpecs.movingLimits.rectLim.bottom
-parseInt(oHtmlToMove.offsetHeight));
nvTop=parseInt(nvTop)+dTop;
}
}
if((oWithSpecs.movingLimits.orientation=='h')
||(oWithSpecs.movingLimits.orientation=='2D')){
if((parseInt(nvLeft)
-dLeft)
<parseInt(oWithSpecs.movingLimits.rectLim.left)){
nvLeft=oWithSpecs.movingLimits.bCircular?(parseInt(oWithSpecs.movingLimits.rectLim.right)
-parseInt(posMovingOHtml.width))
:parseInt(oWithSpecs.movingLimits.rectLim.left);
nvLeft=parseInt(nvLeft)+dLeft;
}
else
if(((parseInt(nvLeft)-dLeft)
+parseInt(oHtmlToMove.offsetWidth))
>parseInt(oWithSpecs.movingLimits.rectLim.right)){
nvLeft=
oWithSpecs.movingLimits.bCircular?parseInt(oWithSpecs.movingLimits.rectLim.left)
:(parseInt(oWithSpecs.movingLimits.rectLim.right)
-parseInt(oHtmlToMove.offsetWidth));
nvLeft=parseInt(nvLeft)+dLeft;
}
}
newPos.top=nvTop;
newPos.left=nvLeft;
}
rialto.widgetBehavior.$$DDMM_applyConstraintTargets=function(oWithSpecs){
if(!
_DDMgr.flyOverTarget(oWithSpecs)
)
_DDMgr.flyOverTarget(oWithSpecs,unauthorized=true);
}
rialto.widgetBehavior.$$DDMM_CallBackSynchro=function(oWithSpecs){
var oMovingStyle=_DDMgr.currDrag.movingOHtml.style;
var deltaTop=parseInt(oMovingStyle.top)
-parseInt(_DDMgr.currDrag.prevTop);
var deltaLeft=parseInt(oMovingStyle.left)
-parseInt(_DDMgr.currDrag.prevLeft);
_DDMgr.currDrag.prevTop=parseInt(oMovingStyle.top);
_DDMgr.currDrag.prevLeft=parseInt(oMovingStyle.left);
oWithSpecs.synchro({top:_DDMgr.currDrag.totDeltaMoveTop,left:_DDMgr.currDrag.totDeltaMoveLeft}
,{top:deltaTop,left:deltaLeft}
,{}
);
}
rialto.widgetBehavior.DragAndDropMouseUpHandler=function(e){
if(!e)var e=window.event;
if(_DDMgr.currDrag
&&_DDMgr.currDrag.movingOHtml){
if(this.releaseCapture){
if((!_DDMgr.currDrag.oThis.specs.modCurs.avantDD)
&&(_DDMgr.currDrag.oThis.specs.modCurs.auClic)){
this.style.cursor='default';
}
this.releaseCapture();
}
else{
if(_DDMgr.currDrag.ghost)
_DDMgr.currDrag.movingOHtml.style.cursor='default';
else
_DDMgr.currDrag.oSource.style.cursor='default';
}
var oHtml=_DDMgr.currDrag.movingOHtml;
_DDMgr.currDrag.oSource.behavior['DD'].isRunning=false;
var oThis=_DDMgr.currDrag.oThis;
if(_DDMgr.currDrag.bMUpAction){
if((!oThis.specs.dropTargets)
||(_DDMgr.currDrag.cibleOk)){
if(_DDMgr.currDrag.oHtmlToMove!=_DDMgr.currDrag.movingOHtml){
if(_DDMgr.currDrag.mvtEffectif){
_DDMgr.currDrag.oHtmlToMove.style.top=
_DDMgr.currDrag.oHtmlToMove.offsetTop
+_DDMgr.currDrag.totDeltaMoveTop
+shiftTopForIcon;
_DDMgr.currDrag.oHtmlToMove.style.left=
_DDMgr.currDrag.oHtmlToMove.offsetLeft
+_DDMgr.currDrag.totDeltaMoveLeft
+shiftLeftForIcon;
traceExec('Mup indirect move top f= '+_DDMgr.currDrag.movingOHtml.style.top
+' oad= '+_DDMgr.currDrag.oHtmlToMove.style.top,5);
}
}
else{
_DDMgr.currDrag.oHtmlToMove.style.zIndex
=_DDMgr.currDrag.svgZIndex;
}
if(oThis.synchroDDMup){
oThis.synchroDDMup({
top:_DDMgr.currDrag.totDeltaMoveTop
,left:_DDMgr.currDrag.totDeltaMoveLeft
}
,{}
);
}
}
else{
traceExec('oThis.specs.dropTargets = '+oThis.specs.dropTargets
+' _DDMgr.currDrag.cibleOk= '+_DDMgr.currDrag.cibleOk,77);
if(_DDMgr.currDrag.oHtmlToMove
==_DDMgr.currDrag.movingOHtml){
traceExec('places initiale topI = '+_DDMgr.currDrag.initialTop
+' leftI= '+_DDMgr.currDrag.initialLeft,79);
_DDMgr.currDrag.movingOHtml.style.top=
_DDMgr.currDrag.initialTop;
_DDMgr.currDrag.movingOHtml.style.left=
_DDMgr.currDrag.initialLeft;
}
}
}
if(_DDMgr.currDrag.ghost)
_DDMgr.currDrag.movingOHtml.style.display='none';
traceExec('Mup objetEnDeplact.top = '+_DDMgr.currDrag.movingOHtml.style.top
+' oHtmlToMov.top = '+_DDMgr.currDrag.oHtmlToMove.style.top,1);
if(_DDMgr.currDrag.oThis.movingLimits.isWithLimitsDisplayed)
document.body.removeChild(_DDMgr.currDrag.oHtmlLimitsRect);
if(_DDMgr.currDrag.oHtmlInfoFrame)
document.body.removeChild(_DDMgr.currDrag.oHtmlInfoFrame);
if(_DDMgr.currDrag.mvtEffectif){
if(oThis.afterDD){
oThis.afterDD(_DDMgr.currDrag.totDeltaMoveTop
,_DDMgr.currDrag.totDeltaMoveLeft
,(_DDMgr.currDrag.cibleOk?{oCible:_DDMgr.currDrag.target
,topInCible:_DDMgr.currDrag.topInTarget
,leftInCible:_DDMgr.currDrag.leftInTarget
}
:null)
);
}
_DDMgr.drop();
traceExec('Mup after drop objetEnDeplact.top = '+_DDMgr.currDrag.movingOHtml.style.top
+' oHtmlToMov.top = '+_DDMgr.currDrag.oHtmlToMove.style.top,1);
}
else{
if(oThis.afterClic)
oThis.afterClic();
}
if(_DDMgr.currDrag.maskSelect){
_DDMgr.currDrag.maskSelect.parentNode.removeChild(_DDMgr.currDrag.maskSelect);
}
_DDMgr.currDrag=null;
stopEvent(e);
}
}
function DDManager(){
if(instanceUnique=eval(recupSingletonCD()))
return instanceUnique;
this.tMissiles=new Array
this.tTargets=new Array;
this.tTargets['undef']=new Object;
this.lastUnderTarget=null;
this.missInFlight={tMiss:new Array
,top:null
,left:null}
this.currDrag=null;
this.id='ID_InstanceUniqueDDManager';
}
DDManager.prototype.addTarget=function(oTarget,domain,domainInvalidTarget,idRegistTarg){
var uriDom=domain||'undef';
if(uriDom.substr(0,5)!='undef')
uriDom='undef.'+uriDom;
if(this.tTargets[uriDom]==undefined){
this.tTargets[uriDom]=new Object;
}
var id=(idRegistTarg==undefined)?oTarget.id:idRegistTarg;
this.tTargets[uriDom][id]=oTarget;
}
DDManager.prototype.flyOverTarget=function(oDrag,isTargetsUnAuthorized){
var goodTarg=null;
var oDrag=_DDMgr.currDrag;
var specsODrag=oDrag.oThis.specs;
var sUri='undef'
if((isTargetsUnAuthorized==undefined)
||(!isTargetsUnAuthorized)){
if(oDrag.oThis.specs.domain)
sUri=sUri+'.'+oDrag.oThis.specs.domain;
}
else{
if(oDrag.oThis.specs.domainUnauthorizedTarget)
sUri=sUri+'.'+oDrag.oThis.specs.domainUnauthorizedTarget;
}
var tUri=sUri.split('.');
for(var n=tUri.length;n>0;n--){
var targHtml,missHtml;
if(this.tTargets[sUri]){
missHtml=oDrag.movingOHtml;
var topMissile=_rum.$posInViewPort(missHtml).top;
var leftMissile=_rum.$posInViewPort(missHtml).left;
var oTargMiss,oTarg,targHtml,topTarget,leftTarget,widthTarget,heightTarget;
var widthMissile,heightMissile;
var j=0;
for(var i in this.tTargets[sUri]){
j++;
oTarg=this.tTargets[sUri][i];
targHtml=oTarg.oHtml;
if(specsODrag.circularDropAuthorized
||!rialto.Dom.isDescendantOf(targHtml,oDrag.oHtmlToMove,true)){
if(oTarg.specsTarg.missileAsOnePixel){
widthMissile=1;
heightMissile=1;
}
else{
widthMissile=oDrag.oHtmlToMove.offsetWidth;
heightMissile=oDrag.oHtmlToMove.offsetHeight;
}
borderExclude=!oTarg.specsTarg.borderIsTarget;
var targetPosInVP=borderExclude
?_rum.$divInternalTopLeftInViewPort(targHtml)
:_rum.$posInViewPort(targHtml);
topTarget=targetPosInVP.top;
leftTarget=targetPosInVP.left;
widthTarget=_rum.$getWidth(targHtml,bBorderLess=borderExclude);
heightTarget=_rum.$getHeight(targHtml,bBorderLess=borderExclude);
if((leftMissile
>=leftTarget)
&&(topMissile
>=topTarget)
&&((leftMissile
+widthMissile)
<=(leftTarget
+widthTarget))
&&((topMissile
+heightMissile)
<=(topTarget
+heightTarget))
){
if(goodTarg){
if(DDManager.isTargetHover(oTarg,goodTarg)){
goodTarg=oTarg;
var shiftTop=borderExclude
?0
:_rum.$$getBorderTopWidth(targHtml);
var shiftLeft=borderExclude
?0
:_rum.$$getBorderLeftWidth(targHtml);
goodTarg.topInTarget=topMissile-topTarget-shiftTop;
goodTarg.leftInTarget=leftMissile-leftTarget-shiftLeft;
}
else{
}
}
else{
goodTarg=oTarg;
var shiftTop=borderExclude
?0
:_rum.$$getBorderTopWidth(targHtml);
var shiftLeft=borderExclude
?0
:_rum.$$getBorderLeftWidth(targHtml);
goodTarg.topInTarget=topMissile-topTarget-shiftTop;
goodTarg.leftInTarget=leftMissile-leftTarget-shiftLeft;
}
if(specsODrag.targetChoice=='firstIsBetter')break;
}
}
}
}
if(goodTarg){
break;
}
sUri=tUri.slice(0,n-1).join('.');
}
if(this.lastUnderTarget&&this.lastUnderTarget.DDOuter){
if(!goodTarg
||(goodTarg!=this.lastUnderTarget)){
this.lastUnderTarget.DDOuter(
{oHtml:_DDMgr.currDrag.oHtmlToMove
,topAbs:topMissile
,leftAbs:leftMissile
});
}
}
this.lastUnderTarget=goodTarg;
if(goodTarg&&goodTarg.DDHover)
goodTarg.DDHover(
{oHtml:_DDMgr.currDrag.oHtmlToMove
,top:goodTarg.topInTarget
,left:goodTarg.leftInTarget
},isTargetsUnAuthorized);
_DDMgr.currDrag.cibleOk=(goodTarg!=null)&&(!isTargetsUnAuthorized);
return goodTarg;
}
DDManager.isTargetHover=function(n1,n2){
if(rialto.Dom.isDescendantOf(n1,n2))
return true;
else{
return rialto.Dom.isCoveredBy(n2,n1);
}
}
DDManager.prototype.flyOverTarget_simpleVersion=function(oDrag,isTargetsUnAuthorized){
var goodTarg=null;
var oDrag=_DDMgr.currDrag;
var sUri='undef'
if((isTargetsUnAuthorized==undefined)
||(!isTargetsUnAuthorized)){
if(oDrag.oThis.specs.domain)
sUri=sUri+'.'+oDrag.oThis.specs.domain;
}
else{
if(oDrag.oThis.specs.domainUnauthorizedTarget)
sUri=sUri+'.'+oDrag.oThis.specs.domainUnauthorizedTarget;
}
var tUri=sUri.split('.');
for(var n=tUri.length;n>0;n--){
var targHtml,missHtml;
if(this.tTargets[sUri]){
missHtml=oDrag.movingOHtml;
var topMissile=_rum.$posInViewPort(missHtml).top;
var leftMissile=_rum.$posInViewPort(missHtml).left;
var oTargMiss,oTarg,targHtml,topTarget,leftTarget,widthTarget,heightTarget;
var widthMissile,heightMissile;
for(var i in this.tTargets[sUri]){
oTarg=this.tTargets[sUri][i];
targHtml=oTarg.oHtml;
if(oTarg.specsTarg.missileAsOnePixel){
widthMissile=1;
heightMissile=1;
}
else{
widthMissile=oDrag.oHtmlToMove.offsetWidth;
heightMissile=oDrag.oHtmlToMove.offsetHeight;
}
borderExclude=!oTarg.specsTarg.borderIsTarget;
var targetPosInVP=borderExclude
?_rum.$divInternalTopLeftInViewPort(targHtml)
:_rum.$posInViewPort(targHtml);
topTarget=targetPosInVP.top;
leftTarget=targetPosInVP.left;
widthTarget=_rum.$getWidth(targHtml,bBorderLess=borderExclude);
heightTarget=_rum.$getHeight(targHtml,bBorderLess=borderExclude);
if((leftMissile
>=leftTarget)
&&(topMissile
>=topTarget)
&&((leftMissile
+widthMissile)
<=(leftTarget
+widthTarget))
&&((topMissile
+heightMissile)
<=(topTarget
+heightTarget))
){
goodTarg=oTarg;
var shiftTop=borderExclude
?0
:_rum.$$getBorderTopWidth(targHtml);
var shiftLeft=borderExclude
?0
:_rum.$$getBorderLeftWidth(targHtml);
goodTarg.topInTarget=topMissile-topTarget-shiftTop;
goodTarg.leftInTarget=leftMissile-leftTarget-shiftLeft;
break;
}
}
}
if(goodTarg)
break;
sUri=tUri.slice(0,n-1).join('.');
}
if(this.lastUnderTarget&&this.lastUnderTarget.DDOuter){
if(!goodTarg
||(goodTarg!=this.lastUnderTarget)){
this.lastUnderTarget.DDOuter(
{oHtml:_DDMgr.currDrag.oHtmlToMove
,topAbs:topMissile
,leftAbs:leftMissile
});
}
}
this.lastUnderTarget=goodTarg;
if(goodTarg&&goodTarg.DDHover)
goodTarg.DDHover(
{oHtml:_DDMgr.currDrag.oHtmlToMove
,top:goodTarg.topInTarget
,left:goodTarg.leftInTarget
},isTargetsUnAuthorized);
_DDMgr.currDrag.cibleOk=(goodTarg!=null)&&(!isTargetsUnAuthorized);
return goodTarg;
}
DDManager.prototype.drop=function(){
if(this.lastUnderTarget){
if(this.lastUnderTarget.DDOuter){
this.lastUnderTarget.DDOuter(
{oHtml:_DDMgr.currDrag.oHtmlToMove
,topAbs:_DDMgr.currDrag.topObjEnDeplact
,leftAbs:_DDMgr.currDrag.leftObjEnDeplact
});
}
if(_DDMgr.currDrag.cibleOk){
if(this.lastUnderTarget.receiveAfterDrop){
this.lastUnderTarget.receiveAfterDrop(
{oHtml:_DDMgr.currDrag.oHtmlToMove
,top:_DDMgr.lastUnderTarget.topInTarget
,left:_DDMgr.lastUnderTarget.leftInTarget
,pathMissile:_DDMgr.currDrag.oThis.specs.domain
}
);
}
else{
_DDMgr.currDrag.oHtmlToMove.style.position='absolute';
_DDMgr.currDrag.oHtmlToMove.style.top=_DDMgr.lastUnderTarget.topInTarget;
_DDMgr.currDrag.oHtmlToMove.style.left=_DDMgr.lastUnderTarget.leftInTarget;
this.lastUnderTarget.appendChild(_DDMgr.currDrag.oHtmlToMove);
}
}
this.lastUnderTarget=null;
}
}
DDManager.prototype.getGoodTarget=function(oDrag){
var goodTarg=null;
var sUri='undef'
if(oDrag.domain)
sUri=sUri+'.'+oDrag.doamin;
var tUri=sUri.split('.');
for(var n=tUri.length;n>0;n--){
var targHtml,missHtml;
if(this.tTargets[sUri]){
missHtml=oDrag.oHtml;
var topMissile=_rum.$posInViewPort(missHtml).top;
var leftMissile=_rum.$posInViewPort(missHtml).left;
var oTarg,targHtml,topTarget,leftTarget;
var widthMissile,heightMissile;
for(var i=0;i<this.tTargets[sUri].length;i++){
oTarg=this.tTargets[sUri][i];
targHtml=oTarg.oHtml;
if(oTarg.specsTarg.bHMinMiss){
widthMissile=1;
heightMissile=1;
}
else{
widthMissile=parseInt(missHtml.style.width);
heightMissile=parseInt(missHtml.style.height);
}
topTarget=_rum.$posInViewPort(targHtml).top;
leftTarget=_rum.$posInViewPort(targHtml).left;
if((leftMissile
>=leftTarget)
&&(topMissile
>=topTarget)
&&((leftMissile
+widthMissile)
<=(leftTarget
+pixWidth(targHtml)))
&&((topMissile
+heightMissile)
<=(topTarget
+pixHeight(targHtml)))
){
goodTarg=oTarg;
break;
}
}
}
if(goodTarg)
break;
sUri=tUri.slice(0,n-1).join('.');
}
return goodTarg;
}
_DDMgr=new DDManager();
rialto.widget.Image
=function(imageOut,left,top,parent,alternateText,imageOn,objParam){
if(arguments.length==0)return;
this.base=rialto.widget.AbstractComponent;
var objPar=(typeof objParam!="undefined")?objParam:{};
objPar.type='image'+imageOut;
objPar.left=left;
objPar.top=top;
this.base(objPar);
this.imgOn=this.ImgRef=imageOut;
if(imageOn&&imageOn!=""){this.ImgRef2=imageOn;}
this.alt=alternateText;
this.display="block";
this.enable=true;
this.avecLim=false;
this.imageDisabled=imageOut;
this.boolFloatRight=false;
this.boolFloatLeft=false;
this.onclick=null;
if(objPar!=null){
if(objPar.imageDisabled!=null){
this.imageDisabled=objPar.imageDisabled;
}
if(rialto.lang.isBoolean(objPar.boolFloatRight)){
this.boolFloatRight=objPar.boolFloatRight;
}
if(rialto.lang.isBoolean(objPar.boolFloatLeft)){
this.boolFloatLeft=objPar.boolFloatLeft;
}
}
if(this.boolFloatLeft||this.boolFloatRight){
this.position="relative";
}
objPar=null;
objParam=null;
this.base=null;
var oThis=this;
this.divExt.style.position=this.position;
this.divExt.style.display=this.display;
this.divExt.style.left=this.left+"px";
this.divExt.style.top=this.top+"px";
this.divExt.className="img-div";
this.divExt.style.width='auto';
this.divExt.style.height='auto';
if(this.boolFloatLeft)
this.divExt.style[ATTRFLOAT]='left';
if(this.boolFloatRight)
this.divExt.style[ATTRFLOAT]='right';
if(this.alt!=null)
this.divExt.title=this.alt;
this.divExt.onmouseout=function(e){
if(oThis.enable){
if(!e)e=window.event;
oThis.$$loadImage();
oThis.onmouseout(e);
}
};
this.divExt.onselectstart=function(){return false};
this.divExt.onmousemove=function(e){
if(oThis.avecLim){
if(!e)e=window.event;
this.onmouseover(e);
}
};
this.divExt.onmouseover=function(e){
if(!e)e=window.event;
if(oThis.verifLimReac(e)){
if(oThis.enable){
if(oThis.onclick){
this.style.cursor="pointer";
}
else{
this.style.cursor="default";
}
if(oThis.ImgRef2){
oThis.$$loadImage(altImg=true);
}
}
else{
this.style.cursor="default";
}
oThis.onmouseover();
}
else{
this.onmouseout(e);
}
stopEvent(e);
};
this.divExt.onclick=function(e){
if(!e)e=window.event;
if(oThis.verifLimReac(e)){
if(oThis.enable&&oThis.onclick){
oThis.onclick(e);
stopEvent(e);
}
}
};
this.divExt.ondblclick=function(e){
if(!e)e=window.event;
if(oThis.verifLimReac(e)){
if(oThis.enable){
oThis.ondbleclick(e);
stopEvent(e);
}
}
};
this._imgDiv=document.createElement("DIV");
this._imgImg=document.createElement("IMG");
this.$$loadImage();
this.divExt.appendChild(this._img);
this._img.onerror=function(evt){
alert('pb de chargt d 1 image dans l obj js image de ref : '+this.src);
}
if(parent!=null){this.placeIn(parent);};
}
rialto.widget.Image.prototype=new rialto.widget.AbstractComponent;
rialto.widget.Image.prototype.getHtmlDD=function(){
return this._img;
}
rialto.lang.extend(rialto.widget.Image,
{
$$loadImage:function(bAlt){
var wImgRef;
if(!this.enable){
if(this.imageDisabled)
wImgRef=this.imageDisabled;
else
return;
}
else
if(!bAlt)
wImgRef=this.ImgRef;
else
wImgRef=this.ImgRef2;
if(wImgRef.indexOf(".")!=-1){
this._imgDiv.style.display='none';
this._imgImg.style.display='block';
this._imgImg.src=wImgRef;
this._img=this._imgImg;
}
else{
this._imgImg.style.display='none';
this._imgDiv.style.display='block';
this._imgDiv.className=wImgRef;
this._img=this._imgDiv;
}
}
,
$changeImages:function(imageOut,imageOver,imageDisabled){
if(imageOut!=null)
this.imgOn=this.ImgRef=imageOut;
if(imageOver!=null)
this.ImgRef2=imageOver;
if(imageDisabled!=null)
this.imageDisabled=imageDisabled;
this.$$loadImage();
}
,
setLimReac:function(x,y,delX,delY){
this.x=x;
this.y=y;
this.delX=delX;
this.delY=delY;
this.avecLim=true;
},
verifLimReac:function(e){
if(this.avecLim){
if(window.event){
var evX=parseInt(e.offsetX)
var evY=parseInt(e.offsetY)
}
else{
var evX=parseInt(e.layerX)
var evY=parseInt(e.layerY)
}
return((evX>=this.x&&evX<=(this.x+this.delX))&&(evY>=this.y&&evY<=(this.y+this.delY)))
}
else{
return true
}
},
setImageReference:function(imageOut,imageOver){
this.$changeImages(imageOut,imageOver);
},
setImages:function(imageOut,imageOver,imageDisabled){
this.$changeImages(imageOut,imageOver,imageDisabled);
},
setAlt:function(alt){
this.alt=alt;
this._img.title=alt;
},
masqueImage:function(){
rialto.deprecated('rialto.widget.Image','masqueImage','setVisible(false)');
this.setVisible(false);
},
afficheImage:function(){
rialto.deprecated('rialto.widget.Image','afficheImage','setVisible(true)');
this.setVisible(true);
},
setVisible:function(visible){
var oHtml=this.getHtmlExt();
if(visible){
oHtml.style.display='block';
this._img.style.display=this.display;
}
else{
oHtml.style.display='none';
}
this.visible=visible;
},
inactive:function(){
rialto.deprecated('rialto.widget.Image','inactive','setEnable(false)');
this.setEnable(false);
},
active:function(){
rialto.deprecated('rialto.widget.Image','active','setEnable(true)');
this.setEnable(true);
},
setEnable:function(enable){
this.enable=enable;
this.$changeImages(null,null,this.imageDisabled);
},
clignote:function(){
if(this.imgOn==this.ImgRef){
this.imgOn=this.ImgRef2
}
else{
this.imgOn=this.ImgRef
}
this._img.className=this.imgOn;
this.Tclignote=window.setTimeout("rialto.session.objects[\""+this.id+"\"].clignote()",500);
},
arreteClignote:function(){
this.imgOn=this.ImgRef;
this._img.className=this.ImgRef;
if(this.Tclignote){window.clearTimeout(this.Tclignote);};
}
,
release:function(){
this.divExt.onmouseout=null;
this.divExt.onselectstart=null;
this.divExt.onmousemove=null;
this.divExt.onmouseover=null;
this.divExt.onclick=null;
this.divExt.ondblclick=null;
this._img.onerror=null;
this.$changeImages=null;
this.onclick=null;
}
}
);
function MasqueZones(suffFond,argtZonesCtrlees,oCiuLie,modeMasque){
var masque;
this.creeMasque=CreeVoileHtml;
if(!argtZonesCtrlees)
argtZonesCtrlees=window.document.body;
var emprise=new Array;
if(!(argtZonesCtrlees instanceof Array))
emprise[0]=argtZonesCtrlees;
else
emprise=argtZonesCtrlees;
if(modeMasque=='strict'){
traceExec('create mask mode "strict"',1);
masque=rialto.session?(rialto.session.masque?rialto.session.masque:null)
:null;
if((!masque)
||(masque.style.display=='block')){
traceExec('no mask exist or hidden mode --> create new mask',1);
masque=this.creeMasque(suffFond,withoutStopEvent=true);
}
else{
traceExec('already a mask',1);
masque.className='ecranMasque'+suffFond;
masque.style.display='block';
}
emprise[0].appendChild(masque);
}
else{
traceExec('create mask mode "no strict"',1);
masque=this.creeMasque(suffFond);
masque.style.width=emprise[0].offsetWidth;
masque.style.height=emprise[0].offsetHeight;
emprise[0].appendChild(masque);
}
if(typeof masque.espaceReqLie=="undefined")
masque.espaceReqLiee=new Array;
masque.espaceReqLiee.push(oCiuLie);
traceExec('mask / area 0 created',1);
for(var e=1;e<emprise.length;e++){
traceExec('mask / area '+e,1);
if((emprise[e].firstChild)
&&(emprise[e].lastChild.className)
&&(emprise[e].lastChild.className.indexOf('ecranMasque')!=-1)){
wMasque=emprise[e].lastChild;
if(wMasque.style.display=='none'){
masque=wMasque;
masque.className='ecranMasque'+suffFond;
masque.style.display='block';
}
else
if(wMasque.firstChild){
alert('masque activ? avec popup inscrit dedans n? masque= '+wMasque.id);
while((wMasque.firstChild)
&&(wMasque.lastChild.className)
&&(wMasque.lastChild.className.indexOf('ecranMasque')!=-1)){
wMasque=wMasque.lastChild;
}
masque=this.creeMasque(suffFond);
wMasque.appendChild(masque);
}
else{
masque=wMasque;
}
}
else{
masque=this.creeMasque(suffFond);
emprise[e].appendChild(masque);
}
masque.espaceReqLiee.push(oCiuLie);
}
masque=emprise[0].lastChild;
return masque;
}
function CreeVoileHtml(suffFond,withoutStopEvent){
traceExec('CreeVoileHtml withoutStopEvent= '+withoutStopEvent,1);
var masque=document.createElement('DIV');
masque.className='ecranMasque'+suffFond;
masque.style.width='100%';
masque.style.height='100%';
masque.style.zIndex=10000;
masque.espaceReqLiee=new Array;
masque.id=CreeVoileHtml.prototype.nbInstances++;
masque.onclick=function(e){
for(var i=0;i<this.espaceReqLiee.length;i++){
oCiuLie=this.espaceReqLiee[i];
if(oCiuLie&&oCiuLie.infoAccesInterdit)
oCiuLie.infoAccesInterdit();
else{
if(oCiuLie&&oCiuLie.fen){
oCiuLie.fen.chgEtat('inactive');
setTimeout("rialto.session.objects.singletonCDs[\""+oCiuLie.sourceReq+"\"].fen.chgEtat('active')",500);
}
}
}
if(!withoutStopEvent){
traceExec('masque.onclick with StopEvent',1);
stopEvent(e);
}
else
traceExec('masque.onclick withoutStopEvent',1);
}
masque.suppRef=function(ref){
for(var i=0;i<this.espaceReqLiee.length;i++){
if(this.espaceReqLiee[i]==ref){
this.espaceReqLiee.splice(i,1);
break;
}
}
return this.espaceReqLiee.length;
}
return masque
}
CreeVoileHtml.prototype.nbInstances=0;
__baseZIndexFenetres=1;
function PileFenFille(fen){
var nvId=(PileFenFille.prototype.nbInstance++);
this.id="ctrlFenFi_"+nvId;
this.idObjComp=nvId;
if(fen.typeContainer=='CadreFenetre'){
this.ctrlParent=fen.container.container.ctrlFenFi;
this.zIndexBase=this.ctrlParent.zIndexBase+1;
}
else{
this.ctrlParent="";
if(getComputStyle(fen.container.containerHtml,'zIndex'))
this.zIndexBase=getComputStyle(fen.container.containerHtml,'zIndex');
else
this.zIndexBase=__baseZIndexFenetres;
}
this.eltManager=fen.container;
this.typeEltManager=fen.typeContainer;
this.managementMode='win';
this.tabsPane=null;
this.heightTabs=0;
this.supportTabs=null;
this.base=Pile;
this.base();
}
PileFenFille.prototype=new Pile;
PileFenFille.prototype.setManagtMode=function(mode,supportTabs){
if(this.managementMode==mode)return;
var doct=this.bottom();
if(doct){
this.managementMode=mode;
if((mode=='sheet')
&&(this.eltManager.bOptMSheetMode)){
this.eltManager.managementMode='sheet';
this.tabsPane=new TabsPane(this);
this.supportTabs=(supportTabs||this.eltManager);
this.supportTabs.addTabsPane(this.tabsPane);
this.heightTabs=getComputSTyle(this.tabsPane.html,'height');
while(doct){
this.tabsPane.addTab(doct);
doct.changeDisplayMode(mode);
doct=this.next();
}
this.tabsPane.selectTab(this.top());
}
else if(mode=='win'){
this.eltManager.managementMode='win';
while(doct){
doct.changeDisplayMode(mode);
doct=this.next();
}
this.supportTabs.delTabsPane();
this.heightTabs=0;
this.tabsPane=null;
}
}
}
PileFenFille.prototype.baseRemove=Pile.prototype.remove;
PileFenFille.prototype.remove=function(elt){
traceExec('remove entree fen= '+elt.titreFenetre,32);
if(this.managementMode=='sheet'){
this.tabsPane.removeTab(elt);
var nbFilleRest=this.baseRemove(elt);
var top;
if(top=this.top())
this.tabsPane.selectTab(top);
else
{
this.supportTabs.delTabsPane();}
return nbFilleRest;
}
else{
var nbEltRestants;
if(this.length()==1){
traceExec('remove une seule fen ->focusOn()',32);
this.focusOn();
nbEltsRestants=this.baseRemove(elt);
}
else{
traceExec('remove plus d une fen ->baseRemove(elt) ',32);
nbEltsRestants=this.baseRemove(elt);
traceExec(' nbEltsRestants = '+nbEltsRestants,32);
}
return nbEltsRestants;
}
}
PileFenFille.prototype.focusOn=function(fen){
if(!fen){
if(this.length()>0){
traceExec('focusOn() entree ->top().display("inactive")',32);
this.modEtatFenTopEtDesc('inactive');
}
return;
}
else
traceExec('focusOn entree fen= '+fen.titreFenetre,32);
if(fen.active){
traceExec('focusOn fen deja active --> 0',32);
return;
}
this.activeFenEtAsc(fen);
this.modEtatFenDesc('active');
if(this.managementMode=='sheet'){
if(!this.supportTabs.barreOnglets){
this.tabsPane=new TabsPane(this);
this.supportTabs.addTabsPane(this.tabsPane);
this.heightTabs=getComputStyle(this.tabsPane.html,'height');
}
this.tabsPane.selectTab(fen);
}
}
PileFenFille.prototype.activeFenEtAsc=function(fen){
traceExec('activeFenEtAsc'+this.id,25);
if(fen.active)return;
var fenActiveAnt=this.top();
if((fenActiveAnt)
&&(fenActiveAnt!=fen)
&&(fenActiveAnt.active)){
traceExec('desactive fen cour et descendants',44)
traceExec('-> fenActiveAnt.chgEtat(inactive) fen= '+fenActiveAnt.titreFenetre,25);
fenActiveAnt.chgEtat('inactive');
traceExec('-> modEtatFenTopEtDesc',25);
this.modEtatFenTopEtDesc('inactive');
}
if(this.ctrlParent){
traceExec('activeFenEtAsc recurs',44)
this.ctrlParent.activeFenEtAsc(fen.container);
}
traceExec('fen onTop + chgt etat '+fen.titreFenetre,44);
traceExec('-> fen.chgEtat(active) fen= '+fen.titreFenetre,25);
this.onTop(fen);
fen.chgEtat('active');
}
PileFenFille.prototype.modEtatFenTopEtDesc=function(nvEtat){
traceExec('modEtatFenTopEtDesc '+this.id+' '+nvEtat,25);
var fen=this.top();
if(!fen)return;
traceExec('-> fen.chgEtat('+nvEtat+') fen= '+fen.titreFenetre,25);
fen.chgEtat(nvEtat);
var ctrlDesc=fen.ctrlFenFi;
if(ctrlDesc)
ctrlDesc.modEtatFenTopEtDesc(nvEtat);
}
PileFenFille.prototype.modEtatFenDesc=function(nvEtat){
traceExec('modEtatFenTopEtDesc '+this.id+' '+nvEtat,25);
var fen=this.top();
if(!fen)return;
var ctrlDesc=fen.ctrlFenFi;
if(ctrlDesc)
ctrlDesc.modEtatFenTopEtDesc(nvEtat);
}
PileFenFille.prototype.basePush=Pile.prototype.push;
PileFenFille.prototype.push=function(elt){
this.basePush(elt);
this.fixeZIndex(this.length());
}
PileFenFille.prototype.display=function(comportement){
var disp="";
for(var i=0;i<this.t.length;i++){
if((i+1)==this.indCourant)
disp=disp+'<';
var ob=this.t[i];
if(ob.id){
disp=disp+"\n"+i+' '+ob.id;
disp=disp+'('+ob.cadreExterne.style.zIndex+')';
}
else
disp=disp+"\n"+i+' '+'id inconnu';
if((i+1)==this.indCourant)
disp=disp+'>';
}
if(comportement=='enRetour')
return disp;
else
traceExec('Contenu de la pile ('+this.t.length+' elts):\n'+disp,44);
}
PileFenFille.prototype.basePop=Pile.prototype.pop;
PileFenFille.prototype.pop=function(){
this.basePop();
if(this.length()>0)
this.focusOn(this.top());
else
traceExec('pas d autre fenetre ds le container -> pas de focusOn -> pas d activation -> pas de abandonModePP..',44);
}
PileFenFille.prototype.baseOnTop=Pile.prototype.onTop;
PileFenFille.prototype.onTop=function(eltPromu){
if(this.curseurSur(eltPromu))
{
this.baseOnTop(eltPromu);
}
else
{
this.push(eltPromu);
}
this.reZIndexVersTop();
}
PileFenFille.prototype.focusNext=function(){
traceExec('foxusNext entree ->focusOn(this.next())',32);
traceExec('focusNext fen curr = '+this.top().titreFenetre,32);
var n=this.next(true);
this.focusOn(n);
traceExec('foxusNext sortie',32);
}
PileFenFille.prototype.reZIndexVersTop=function(){
this.fixeZIndex();
while(this.next())
this.fixeZIndex();
}
PileFenFille.prototype.fixeZIndex=function(ind){
if(ind)
ind--;
else
ind=this.indCourant;
this.t[ind].cadreExterne.style.zIndex=
this.zIndexBase+ind+1;
}
PileFenFille.prototype.nbInstance=0;
function PrintBehavior(){
if(!this.getInfoPrint){
info=new rialto.widget.Alert("Cette partie du document n'est pas imprimable (pas de m?thode getInfoPrint).");
return false;
}
else{
this.objP=this.getInfoPrint();
}
var patient="";
if(objFenetreSimple.prototype.fenetreActive.patDependant){
var wMaladItem=rialto.session.objects["bandeau"].patientActif;
patient=wMaladItem.dossier+" "+wMaladItem.cle+" - "+wMaladItem.nom+" "+wMaladItem.prenom;
}
var titre=new String;
titre=rialto.string.formatHTTP(this.objP.titre);
var url="print_elmt?FENID="+this.id+"&TITRE="+titre+"&NBLIGNE="+this.objP.NbreLig+"&NBCOLONNES="+this.objP.NBCOL+"&ENTETE="+this.objP.strEntete+"&PATIENT="+patient;
var widthGlobal=document.body.clientWidth;
var heightGlobal=document.body.clientHeight;
this.fenImp=window.open(url,'IMPRESSION',"height="+heightGlobal+",width="+widthGlobal+",top=0,left=0,scrollbars,resizable,toolbar,menubar");
this.rempFenImp=PrintBehaviorRempFenImp;
this.rempFenImp();
}
function PrintBehaviorRempFenImp(){
if(this.fenImp.rempPage){
this.fenImp.rempPage(this.objP);
}
else{
window.setTimeout("rialto.session.objects[\""+this.id+"\"].rempFenImp()",50);
}
}
var ENREG_RS=99;
var oReSize=null;
var defMargeSensibleDD=3;
function RSLoadLimitsDyn(oBase){
if(this.limitReDim.bRectLim){
this.limitReDim.rectLim.bottom=eval(this.limitReDim.rectLim.bottomSpecs);
this.limitReDim.rectLim.right=eval(this.limitReDim.rectLim.rightSpecs);
}
else{
this.limitReDim.rectLim.bottom=pixHeight(oBase);
this.limitReDim.rectLim.right=pixWidth(oBase);
}
if(this.limitReDim.bLimMax){
this.limitReDim.widthMax=eval(this.limitReDim.widthMaxSpecs);
this.limitReDim.heightMax=eval(this.limitReDim.heightMaxSpecs);
}
else{
this.limitReDim.widthMax=(this.limitReDim.rectLim.right-this.limitReDim.rectLim.left+1);
this.limitReDim.heightMax=(this.limitReDim.rectLim.bottom-this.limitReDim.rectLim.top+1);
}
traceExec('RSLoadLimitsDyn id= '+this.id+' this.limitReDim.rectLim.top = '+this.limitReDim.rectLim.top,60);
traceExec('RSLoadLimitsDyn this.limitReDim.rectLim.left = '+this.limitReDim.rectLim.left,58);
traceExec('RSLoadLimitsDyn this.limitReDim.rectLim.bottom = '+this.limitReDim.rectLim.bottom,60);
traceExec('RSLoadLimitsDyn this.limitReDim.rectLim.right = '+this.limitReDim.rectLim.right,58);
traceExec('RSLoadLimitsDyn this.limitReDim.rectLim.widthMax = '+this.limitReDim.widthMax,58);
traceExec('RSLoadLimitsDyn this.limitReDim.rectLim.heightMax = '+this.limitReDim.heightMax,60);
}
function RSLoadSpecs(specs){
traceExec('RSLoadSpecs entree',76);
this.specs=new Object;
if(!specs)
specs=new Object;
if(!specs.cibleEvt){
this.specs.cibleEvt=new Array;
this.specs.cibleEvt[0]={oHtml:this,mode:'mono',dir:'2D'};
this.specs.orientation='2D';
}
else
if(!(specs.cibleEvt instanceof Array)){
var wCibleEvt=specs.cibleEvt;
this.specs.cibleEvt=new Array;
this.specs.cibleEvt[0]=new Object;
this.specs.cibleEvt[0].oHtml=wCibleEvt.oHtml;
this.specs.cibleEvt[0].mode=wCibleEvt.mode||'mono';
var orientation=specs.orientation||'2D';
this.specs.cibleEvt[0].dir=(this.specs.cibleEvt[0].mode=='mono')?orientation:wCibleEvt.dir;
this.specs.orientation=this.specs.cibleEvt[0].dir;
}
else
if(specs.cibleEvt instanceof Array){
this.specs.cibleEvt=specs.cibleEvt;
}
else{
traceExec('pb def cible DD',30);
}
this.specs.objetADeformer=specs.objetADeformer?specs.objetADeformer:this;
this.specs.fantome=new Object;
if(specs.fantome)
this.specs.fantome.aspect=specs.fantome.aspect||'cadre';
else
this.specs.fantome=null;
this.specs.modCurs=new Object;
if(specs.modCursor){
this.specs.modCurs.avantDD=(specs.modCursor.avantDD!='undefined')?specs.modCursor.avantDD:true;
this.specs.modCurs.auClic=(specs.modCursor.auClic!='undefined')?specs.modCursor.auClic:true;
}
else{
this.specs.modCurs.avantDD=true;
this.specs.modCurs.auClic=true;
}
if(specs.grilleMagnetic){
this.specs.magnet=new Object;
this.specs.magnet.widthCol=specs.grilleMagnetic.widthCol||10;
this.specs.magnet.heightRow=specs.grilleMagnetic.heightRow||10;
}
this.limitReDim=new Object;
this.limitReDim.symetrie=specs.symetrie||false;
if(this.limitReDim.symetrie)
this.limitReDim.centrage=true;
this.limitReDim.bRectLim=(specs.bRectLim!=null)?specs.bRectLim:true;
this.limitReDim.bLimMax=(specs.bRectLim!=null)?specs.bLimMax:false;
this.limitReDim.rectLim=new Object;
if(!specs.rectLim)
specs.rectLim=new Object;
else{
this.limitReDim.bRectLim=true;
}
this.limitReDim.rectLim.left=specs.rectLim.left||0;
this.limitReDim.rectLim.top=specs.rectLim.top;
this.specs.majDyn=(specs.majDyn!=null)?specs.majDyn:true;
if(!this.specs.majDyn){
this.limitReDim.rectLim.right=specs.rectLim.right||pixWidth(this.specs.objetADeformer.parentNode);
this.limitReDim.rectLim.bottom=specs.rectLim.bottom||pixHeight(this.specs.objetADeformer.parentNode);
}
else{
this.limitReDim.rectLim.rightSpecs=specs.rectLim.right||pixWidth(this.specs.objetADeformer.parentNode);
this.limitReDim.rectLim.bottomSpecs=specs.rectLim.bottom||pixHeight(this.specs.objetADeformer.parentNode);
this.limitReDim.widthMaxSpecs=specs.rectLim.widthMax;
this.limitReDim.heightMaxSpecs=specs.rectLim.heightMax;
}
if(!specs.limitReDim)specs.limitReDim=new Object;
this.limitReDim.heightMin=specs.limitReDim.heightMin||10;
this.limitReDim.heightMax=specs.limitReDim.heightMax||(this.limitReDim.bottom-this.limitReDim.top+1);
traceExec('** RSLoadSpecs specs.limitReDim.widthMin    = '+specs.limitReDim.widthMin,76);
this.limitReDim.widthMin=specs.limitReDim.widthMin||10;
traceExec('** RSLoadSpecs this.limitReDim.rectLim.widthMin    = '+this.limitReDim.widthMin,76);
this.limitReDim.widthMax=specs.limitReDim.widthMax||(this.limitReDim.right-this.limitReDim.left+1);
traceExec('RSLoadSpecs this.limitReDim.rectLim.top    = '+this.limitReDim.rectLim.top,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.left   = '+this.limitReDim.rectLim.left,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.bottom = '+this.limitReDim.rectLim.bottom,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.right  = '+this.limitReDim.rectLim.right,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.bottomSpecs = '+this.limitReDim.rectLim.bottomSpecs,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.rightSpecs  = '+this.limitReDim.rectLim.rightSpecs,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.heightMin   = '+this.limitReDim.heightMin,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.heightMax   = '+this.limitReDim.heightMax,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.widthMin    = '+this.limitReDim.widthMin,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.widthMax    = '+this.limitReDim.widthMax,76);
traceExec('RSLoadSpecs fin',58);
}
function ReSize(specs)
{
if(!this.oCiu)this.oCiu=new Array();
this.oCiu['ReSize']=this;
this.oCiu['ReSize'].lockReSize=false;
if(!this.oCiu['ReSize'].loadSpecsRS){
this.oCiu['ReSize'].loadSpecsRS=RSLoadSpecs;
}
this.oCiu['ReSize'].loadSpecsRS(specs);
if(this.oCiu['ReSize'].specs.majDyn){
if(!this.oCiu['ReSize'].loadLimitsDynRS)
this.oCiu['ReSize'].loadLimitsDynRS=RSLoadLimitsDyn;
this.oCiu['ReSize'].loadLimitsDynRS(this.oCiu['ReSize'].specs.objetADeformer.parentNode);
}
var oCiu=this.oCiu['ReSize'];
var oHtmlCible;
for(var i=0;i<oCiu.specs.cibleEvt.length;i++){
oHtmlCible=oCiu.specs.cibleEvt[i].oHtml;
oHtmlCible.reSize=true;
oHtmlCible.refObjSpecsRS=this;
oHtmlCible.modeRS=oCiu.specs.cibleEvt[i].mode;
oHtmlCible.dirRS=oCiu.specs.cibleEvt[i].dir;
}
if(typeof document.addEventListener=="undefined"){
for(var i=0;i<oCiu.specs.cibleEvt.length;i++){
oHtmlCible=oCiu.specs.cibleEvt[i].oHtml;
oHtmlCible.addHandler=addHandler;
oHtmlCible.methodRSMouseDown=ReSizeMouseDownHandler;
oHtmlCible.methodRSMouseMove=ReSizeMouseMoveHandler;
oHtmlCible.methodRSMouseUp=ReSizeMouseUpHandler;
oHtmlCible.addHandler(oHtmlCible,'onmousedown','methodRSMouseDown');
oHtmlCible.addHandler(oHtmlCible,'onmousemove','methodRSMouseMove');
oHtmlCible.addHandler(oHtmlCible,'onmouseup','methodRSMouseUp');
oHtmlCible.methodDebRS=function(){window.status='debut de la deformation this.id='+this.id;};
oHtmlCible.addHandler(oHtmlCible,'onmousedown','methodDebRS');
oHtmlCible.methodFinRS=function(){window.status='fin de la deformation';};
oHtmlCible.addHandler(oHtmlCible,'onmouseup','methodFinRS');
}
}
else{
if(!document.enregtReSize){
document.enregtReSize=true;
document.addEventListener("mousemove",ReSizeMouseMoveHandler,false);
document.addEventListener("mouseup",ReSizeMouseUpHandler,false);
document.addEventListener("mousedown",ReSizeMouseDownHandler,false);
document.addEventListener("mousedown",StopSelectDef,false);
}
}
}
StopSelectDef=function(e){
stopDefault(e);
}
ReSizeMouseDownHandler=function(e){
if(!e)var e=window.event;
var oSourceEvt=e.target?e.target:e.srcElement;
if((!oSourceEvt.reSize)
||(oSourceEvt.refObjSpecsRS
&&(oSourceEvt.refObjSpecsRS.oCiu['ReSize'].lockReSize)))
return;
var oHtml=oSourceEvt;
var direction;
if(oHtml.modeRS!='mono'){
direction=oHtml.dirRS;
}
else{
direction=DirDeplact(oHtml,e,pixHeight(oHtml),pixWidth(oHtml)
,oHtml.margeSensible||defMargeSensibleDD,false);
}
if(!direction){
traceExec('position invalide/RS',58);
oHtml.style.cursor="default";
return;
}
else
oHtml.style.cursor=direction+"-resize";
traceExec('position valide/RS',58);
var oSpecs=oHtml.refObjSpecsRS;
if(oSpecs.specs.majDyn)
oSpecs.loadLimitsDynRS(oSpecs.specs.objetADeformer.parentNode);
var objetADeformer=oSpecs.specs.objetADeformer;
traceExec(';;;Md objetADeformer.style.height= '+parseInt(objetADeformer.style.height),60);
if(oSpecs.specs.fantome){
var cadreFantome=document.getElementById('cadreFantomeUnique');
if(cadreFantome==null){
cadreFantome=document.createElement('DIV');
cadreFantome.id='cadreFantomeUnique';
cadreFantome.className='fantomeRS_'+oSpecs.specs.fantome.aspect;
objetADeformer.parentNode.appendChild(cadreFantome);
}
else
if(cadreFantome.parentNode!=objetADeformer){
cadreFantome.parentNode.removeChild(cadreFantome);
cadreFantome=document.createElement('DIV');
cadreFantome.id='cadreFantomeUnique';
cadreFantome.className='fantomeRS_'+oSpecs.specs.fantome.aspect;
objetADeformer.parentNode.appendChild(cadreFantome);
}
cadreFantome.style.zIndex=100000;
cadreFantome.style.top=pixTop(objetADeformer);
cadreFantome.style.left=pixLeft(objetADeformer);
cadreFantome.style.width=pixWidth(objetADeformer);
var bWidth=0;
if(window.getComputedStyle){
var topWidthBord=getComputStyle(cadreFantome,'borderTopWidth','0');
var bottomWidthBord=getComputStyle(cadreFantome,'borderBottomWidth','0');
if(topWidthBord||bottomWidthBord){
bWidth=topWidthBord+bottomWidthBord;
cadreFantome.style.width=parseInt(cadreFantome.style.width)-bWidth;
}
}
traceExec('!!! objetADeformer.id= '+objetADeformer.id,60);
cadreFantome.style.height=pixHeight(objetADeformer);
traceExec('RS -1- Md cadreFantome.style.height = pixHeight(objetADeformer)= '+pixHeight(objetADeformer),75);
traceExec('!!! Md cadreFantome.style.height= '+cadreFantome.style.height,60);
var bHeight=0;
if(window.getComputedStyle){
bHeight=topWidthBord+bottomWidthBord;
cadreFantome.style.height=parseInt(cadreFantome.style.height)-bHeight;
}
cadreFantome.style.visibility='visible';
var objetEnDeformation=cadreFantome;
objetEnDeformation.refObjSpecs=oSpecs;
}
else
var objetEnDeformation=objetADeformer;
var top=pixTop(objetEnDeformation);
var left=pixLeft(objetEnDeformation);
var width=pixWidth(objetEnDeformation);
var height=pixHeight(objetEnDeformation);
traceExec('++++Md  height obj en def= '+height,58);
oReSize={oThis:oSpecs,
oSource:oHtml,
fantome:oSpecs.specs.fantome,
objetEnDeformation:objetEnDeformation,
objetADeformer:objetADeformer,
limitReDim:oSpecs.limitReDim,
direction:direction,
clientXI:e.clientX,
clientYI:e.clientY,
topI:top,
leftI:left,
widthI:width,
wBordGD:bWidth,
wBordHB:bHeight,
heightI:height,
magnet:oSpecs.specs.magnet,
mvtEffectif:false
};
traceExec('RS -0- objetEnDeformation.style.height= '+objetEnDeformation.style.height,75);
traceExec('RS -0- heightI = pixHeight(objetEnDeformation)= '+oReSize.heightI,75);
traceExec('RS -0- objetADeformer.style.height= '+objetADeformer.style.height,75);
traceExec('Md oReSize.objetEnDeformation.style.height= '+parseInt(oReSize.objetEnDeformation.style.height),62);
traceExec('Md oReSize.objetADeformer.style.height=     '+pixHeight(oReSize.objetADeformer),62);
if(this.setCapture){
this.setCapture();
stopEvent(e);
if((!oSpecs.specs.modCurs.avantDD)
&&(oSpecs.specs.modCurs.auClic)){
DragAndDrop.modCurseur(oHtml,direction,oSpecs.limitDeplact.orientation);
}
}
else
if((!oSpecs.specs.modCurs.avantDD)
&&(oSpecs.specs.modCurs.auClic)){
if(oSpecs.specs.fantome)
DragAndDrop.modCurseur(objetEnDeplact,direction,oSpecs.limitDeplact.orientation);
else
DragAndDrop.modCurseur(oHtml,direction,oSpecs.limitDeplact.orientation);
}
}
ReSizeMouseMoveHandler=function(e){
if(!e)var e=window.event;
var oHtml=e.target?e.target:e.srcElement;
if(!oReSize){
if((!oHtml.reSize)
||(oHtml.refObjSpecsRS
&&(oHtml.refObjSpecsRS.oCiu['ReSize'].lockReSize))){
oHtml.style.cursor="default";
return;
}
if(oHtml.reSize)
{
var direction;
if(oHtml.modeRS!='mono'){
direction=oHtml.dirRS;
}
else{
direction=DirDeplact(oHtml,e,pixHeight(oHtml),pixWidth(oHtml)
,oHtml.margeSensible||defMargeSensibleDD,false);
}
if(direction==""){
oHtml.style.cursor="default";
traceExec('RS mm ap DirDeplact dir='+direction+' curs def restor?',58);
}
else{
oHtml.style.cursor=direction+"-resize";
traceExec('RS mm ap DirDeplact dir='+direction+' curs ad hoc',58);
}
}
}
else{
if(e.clientX>=0&&e.clientY>=0){
oReSize.mvtEffectif=true;
var nvTop=parseInt(oReSize.objetEnDeformation.style.top);
var nvLeft=parseInt(oReSize.objetEnDeformation.style.left);
var nvWidth=parseInt(oReSize.objetEnDeformation.style.width);
var nvHeight=pixHeight(oReSize.objetEnDeformation);
traceExec('Mm (oReSize.objetEnDeformation.id= '+oReSize.objetEnDeformation.id,60);
traceExec('Mm dim ss mvt height= '+nvHeight,60);
var direction=oReSize.direction;
if(oReSize.limitReDim.dbleSymetrie){
}
else
if(!oReSize.limitReDim.symetrie){
if(direction.indexOf('e')!=-1){
nvWidth=oReSize.widthI+(e.clientX-oReSize.clientXI);
}
else
if(direction.indexOf('w')!=-1){
nvLeft=oReSize.leftI+(e.clientX-oReSize.clientXI);
nvWidth=oReSize.widthI-(e.clientX-oReSize.clientXI);
}
if(direction.indexOf('s')!=-1){
nvHeight=oReSize.heightI+(e.clientY-oReSize.clientYI);
}
else if(direction.indexOf('n')!=-1){
nvTop=oReSize.topI+(e.clientY-oReSize.clientYI);
nvHeight=oReSize.heightI-(e.clientY-oReSize.clientYI);
}
}
else{
var diff;
if(direction.indexOf('n')!=-1){
nvTop=oReSize.topI+(e.clientY-oReSize.clientYI);
nvHeight=oReSize.heightI-2*(e.clientY-oReSize.clientYI);
if(oReSize.limitReDim.symetrie=='radiale'){
diff=(e.clientY-oReSize.clientYI);
nvLeft=oReSize.leftI+diff;
nvWidth=oReSize.widthI-2*diff;
}
}
else if(direction.indexOf('s')!=-1){
nvTop=oReSize.topI-(e.clientY-oReSize.clientYI);
nvHeight=oReSize.heightI+2*(e.clientY-oReSize.clientYI);
if(oReSize.limitReDim.symetrie=='radiale'){
diff=(e.clientY-oReSize.clientYI);
nvLeft=oReSize.leftI-diff;
nvWidth=oReSize.widthI+2*diff;
}
}
if(direction.indexOf('w')!=-1){
nvLeft=oReSize.leftI+(e.clientX-oReSize.clientXI);
nvWidth=oReSize.widthI-2*(e.clientX-oReSize.clientXI);
if(oReSize.limitReDim.symetrie=='radiale'){
diff=(e.clientX-oReSize.clientXI);
nvTop=oReSize.topI+diff;
nvHeight=oReSize.heightI-2*diff;
}
}
else if(direction.indexOf('e')!=-1){
nvLeft=oReSize.leftI-(e.clientX-oReSize.clientXI);
nvWidth=oReSize.widthI+2*(e.clientX-oReSize.clientXI);
if(oReSize.limitReDim.symetrie=='radiale'){
diff=(e.clientX-oReSize.clientXI);
nvTop=oReSize.topI-diff;
nvHeight=oReSize.heightI+2*diff;
}
}
}
traceExec('Mm av contraintes nvHeight = '+nvHeight+' nvWidth= '+nvWidth+' nvLeft= '+nvLeft,58);
var rectLim=oReSize.limitReDim.rectLim;
var lim=oReSize.limitReDim;
traceExec('Mm rectLim left = '+rectLim.left+' right= '+rectLim.right+' lim.widthMax= '+lim.widthMax
+' lim.widthMin= '+lim.widthMin,58);
if(!lim.symetrie){
if(nvWidth>lim.widthMax){
nvWidth=lim.widthMax;
if(direction=='w')
nvLeft=(oReSize.leftI+oReSize.widthI-1)-lim.widthMax+1;
traceExec('contrainte 1');
}
if((rectLim.left!=undefined)
&&(nvLeft<rectLim.left)){
nvWidth=nvWidth-(rectLim.left-nvLeft);
nvLeft=rectLim.left;
traceExec('contrainte 2');
}
else
if((rectLim.right!=undefined)
&&((nvWidth+nvLeft-1)>rectLim.right)){
nvWidth=rectLim.right-oReSize.leftI+1;
traceExec('contrainte 3');
}
else
if(nvWidth<lim.widthMin){
nvWidth=lim.widthMin;
traceExec('contrainte 4 nvWidth = '+nvWidth+' lim.widthMin= '+lim.widthMin,58);
if(direction.indexOf('w')!=-1)
nvLeft=(oReSize.leftI+oReSize.widthI-1)-lim.widthMin+1;
}
if(nvHeight>lim.heightMax){
traceExec('Mm (nvHeight > lim.heightMax) nvHeight= '+nvHeight+' lim.heightMax= '+lim.heightMax,60);
nvHeight=lim.heightMax;
if(direction.indexOf('n')!=-1)
nvTop=(oReSize.topI+oReSize.heightI-1)-lim.heightMax+1;
traceExec('contrainte 5');
}
if((rectLim.top!=undefined)
&&(nvTop<rectLim.top)){
traceExec('Mm (nvTop < rectLim.top) nvHeight= '+nvHeight+' rectLim.top= '+rectLim.top+' nvTop= '+nvTop,60);
nvHeight=nvHeight-(rectLim.top-nvTop);
nvTop=rectLim.top;
traceExec('contrainte 6');
}
else
if((rectLim.bottom!=undefined)
&&((nvHeight+nvTop-1)>rectLim.bottom)){
traceExec('Mm (nvHeight + nvTop - 1) > rectLim.bottom) nvHeight= '+nvHeight+' rectLim.bottom= '+rectLim.bottom+' TopI= '+oReSize.topI,60);
nvHeight=rectLim.bottom-oReSize.topI+1;
traceExec('contrainte 7');
}
else
if(nvHeight<lim.heightMin){
traceExec('Mm (nvHeight < lim.heightMin) nvHeight= '+nvHeight+' lim.heightMin= '+lim.heightMin,60);
nvHeight=lim.heightMin;
if(direction.indexOf('n')!=-1)
nvTop=(oReSize.topI+oReSize.heightI-1)-lim.heightMin+1;
traceExec('contrainte 8');
}
}
else{
if(nvWidth>lim.widthMax){
nvWidth=lim.widthMax;
nvLeft=oReSize.leftI-((lim.widthMax-oReSize.widthI)/2)+1;
}
if((rectLim.left!=undefined)
&&(nvLeft<rectLim.left)){
nvWidth=nvWidth-2*(rectLim.left-nvLeft);
nvLeft=rectLim.left;
}
if((rectLim.right!=undefined)
&&((nvWidth+nvLeft-1)>rectLim.right)){
var tropW=(nvWidth+nvLeft-1)-rectLim.right;
nvWidth=nvWidth-2*tropW;
nvLeft=nvLeft+tropW-1;
}
if(nvWidth<lim.widthMin){
var manqueW=lim.widthMin-nvWidth;
nvWidth=nvWidth+manqueW;
nvLeft=nvLeft-0.5*manqueW;
}
if(nvHeight>lim.heightMax){
nvHeight=lim.heightMax;
nvTop=oReSize.topI-((lim.heightMax-oReSize.heightI)/2)+1;
traceExec('Mm sym contrainte 1');
}
if((rectLim.top!=undefined)
&&(nvTop<rectLim.top)){
traceExec('Mm sym ctr 2 nvHeight= '+nvHeight+' rectLim.top= '+rectLim.top+'  nvTop= '+nvTop,60);
nvHeight=nvHeight-2*(rectLim.top-nvTop);
nvTop=rectLim.top;
traceExec('Mm sym contrainte 2',60);
}
if((rectLim.bottom!=undefined)
&&((nvHeight+nvTop-1)>rectLim.bottom)){
var tropH=(nvHeight+nvTop-1)-rectLim.bottom;
nvHeight=nvHeight-2*tropH;
nvTop=nvTop+tropH-1;
traceExec('Mm sym contrainte 3');
}
if(nvHeight<lim.heightMin){
var manqueH=lim.heightMin-nvHeight;
nvHeight=nvHeight+manqueH;
nvTop=nvTop-0.5*manqueH;
traceExec('Mm sym contrainte 4');
}
}
traceExec('Mm ap nvHeight= contraintes'+nvHeight,60);
if(oReSize.magnet){
if(!oReSize.limitReDim.symetrie){
if(direction.indexOf('n')!=-1){
var nvTopGrille=Math.round(nvTop/oReSize.magnet.heightRow)
*oReSize.magnet.heightRow;
var diffMagn=nvTop-nvTopGrille;
nvTop=nvTopGrille;
nvHeight=nvHeight+diffMagn;
}
if(direction.indexOf('w')!=-1){
var nvLeftGrille=Math.round(parseInt(nvLeft)/oReSize.magnet.widthCol)
*oReSize.magnet.widthCol;
diffMagn=nvLeft-nvLeftGrille;
nvLeft=nvLeftGrille;
nvWidth=nvWidth+diffMagn;
}
if(direction.indexOf('s')!=-1){
var nvHeightGrille=Math.round(parseInt(nvHeight)/oReSize.magnet.heightRow)
*oReSize.magnet.heightRow;
diffMagn=nvHeight-nvHeightGrille;
nvHeight=nvHeightGrille;
}
if(direction.indexOf('e')!=-1){
nvWidth=Math.round(parseInt(nvWidth)/oReSize.magnet.widthCol)
*oReSize.magnet.widthCol;
}
}
else{
alert('deformation symetrique + grille magnetique non encore impl?ment?e');
}
}
if(oReSize.oThis.synchro){
var deltaTop=nvTop-parseInt(oReSize.objetEnDeformation.style.top);
var deltaLeft=nvLeft-parseInt(oReSize.objetEnDeformation.style.left);
var deltaWidth=nvWidth-parseInt(oReSize.objetEnDeformation.style.width);
traceExec('Mm appli nvHeight= '+nvHeight,60);
var deltaHeight=nvHeight-pixHeight(oReSize.objetEnDeformation);
traceExec('Mm appli deltaHeight = '+deltaHeight,60);
}
oReSize.objetEnDeformation.style.top=nvTop;
oReSize.objetEnDeformation.style.left=nvLeft;
oReSize.objetEnDeformation.style.width=nvWidth;
traceExec('Mm nvHeight= '+nvHeight,60);
oReSize.objetEnDeformation.style.height=nvHeight;
traceExec('RS -2- Mm appli oReSize.objetEnDeformation.style.height = nvHeight= '+nvHeight,75);
if(oReSize.oThis.synchro)
oReSize.oThis.synchro({top:deltaTop,left:deltaLeft,width:deltaWidth,height:deltaHeight});
}
}
stopEvent(e);
}
ReSizeMouseUpHandler=function(e){
if(!e)var e=window.event;
if(oReSize&&oReSize.objetEnDeformation){
if(this.releaseCapture){
this.releaseCapture();
}
else{
if(oReSize.fantome)
oReSize.objetEnDeformation.style.cursor='default';
else
oReSize.oSource.style.cursor='default';
}
var oHtml=oReSize.objetEnDeformation;
if(oHtml.oCiu&&oHtml.oCiu['DragAndDrop']){
oHtml.dragAndDrop=oHtml.svgDragAndDrop;
}
var oThis=oReSize.oThis;
if(oThis.afterRS){
if(oReSize.objetADeformer!=oReSize.objetEnDeformation){
var deltaTop=parseInt(oReSize.objetEnDeformation.style.top)
-parseInt(oReSize.objetADeformer.style.top);
var deltaLeft=parseInt(oReSize.objetEnDeformation.style.left)
-parseInt(oReSize.objetADeformer.style.left);
var deltaWidth=parseInt(oReSize.objetEnDeformation.style.width)
-parseInt(oReSize.objetADeformer.style.width)+oReSize.wBordGD;
traceExec('oReSize.objetEnDeformation.style.height= '+parseInt(oReSize.objetEnDeformation.style.height),60);
traceExec('oReSize.objetADeformer.style.height=     '+pixHeight(oReSize.objetADeformer),60);
var deltaHeight=parseInt(oReSize.objetEnDeformation.style.height)
-pixHeight(oReSize.objetADeformer)+oReSize.wBordHB;
traceExec('RS -3- Mup  afterRs existe deltaHeight = parseInt(oReSize.objetEnDeformation.style.height)- pixHeight(oReSize.objetADeformer) + oReSize.wBordHB= '+deltaHeight,75);
traceExec('______deltaHeight= '+deltaHeight,62);
}
else{
var deltaTop=parseInt(oReSize.objetEnDeformation.style.top)
-parseInt(oReSize.topI);
var deltaLeft=parseInt(oReSize.objetEnDeformation.style.left)
-parseInt(oReSize.leftI);
var deltaWidth=parseInt(oReSize.objetEnDeformation.style.width)
-parseInt(oReSize.widthI);
var deltaHeight=parseInt(oReSize.objetEnDeformation.style.height)
-parseInt(oReSize.heightI);
traceExec('RS -4- Mup pas de afterRs deltaHeight = parseInt(oReSize.objetEnDeformation.style.height)- parseInt(oReSize.heightI)= '+deltaHeight,75);
}
}
if(oReSize.objetADeformer!=oReSize.objetEnDeformation){
oReSize.objetADeformer.style.top=oReSize.objetEnDeformation.style.top;
oReSize.objetADeformer.style.left=oReSize.objetEnDeformation.style.left;
oReSize.objetADeformer.style.width=parseInt(oReSize.objetEnDeformation.style.width)+oReSize.wBordGD;
oReSize.objetADeformer.style.height=parseInt(oReSize.objetEnDeformation.style.height)+oReSize.wBordHB;
traceExec('RS -5- Mup oReSize.objetADeformer.id= '+oReSize.objetADeformer.id
+' oReSize.objetADeformer.style.height = parseInt(oReSize.objetEnDeformation.style.height) + oReSize.wBordHB='+oReSize.objetADeformer.style.height,1);
}
if(oReSize.fantome)
oReSize.objetEnDeformation.style.visibility='hidden';
if(oReSize.mvtEffectif){
if(oThis.afterRS)
oThis.afterRS({top:deltaTop,left:deltaLeft,width:deltaWidth,height:deltaHeight});
}
else{
if(oThis.afterClic)
oThis.afterClic();
}
oReSize=null;
stopEvent(e);
}
}
ReSize.modCurseur=function(oHtml,direction,orientation){
if(direction==""){
oHtml.style.cursor="default";
}
else
if(orientation=='v')
{oHtml.style.cursor=direction+"-resize";
}
else
if(orientation=='h'){
oHtml.style.cursor=direction+"-resize";
}
else{
oHtml.style.cursor='move';
}
}
var ENREG_RS=99;
var oReSize=null;
var defMargeSensibleDD=3;
var SENSITIVEEDGEWIDTH_DEFAULT=3
rialto.widgetBehavior.RSLoadLimitsDyn
=function(oBase){
if(this.limitReDim.bRectLim){
this.limitReDim.rectLim.bottom=eval(this.limitReDim.rectLim.bottomSpecs);
this.limitReDim.rectLim.right=eval(this.limitReDim.rectLim.rightSpecs);
}
else{
this.limitReDim.rectLim.bottom=pixHeight(oBase);
this.limitReDim.rectLim.right=pixWidth(oBase);
}
if(this.limitReDim.bLimMax){
this.limitReDim.widthMax=eval(this.limitReDim.widthMaxSpecs);
this.limitReDim.heightMax=eval(this.limitReDim.heightMaxSpecs);
}
else{
this.limitReDim.widthMax=(this.limitReDim.rectLim.right-this.limitReDim.rectLim.left+1);
this.limitReDim.heightMax=(this.limitReDim.rectLim.bottom-this.limitReDim.rectLim.top+1);
}
traceExec('RSLoadLimitsDyn id= '+this.id+' this.limitReDim.rectLim.top = '+this.limitReDim.rectLim.top,60);
traceExec('RSLoadLimitsDyn this.limitReDim.rectLim.left = '+this.limitReDim.rectLim.left,58);
traceExec('RSLoadLimitsDyn this.limitReDim.rectLim.bottom = '+this.limitReDim.rectLim.bottom,60);
traceExec('RSLoadLimitsDyn this.limitReDim.rectLim.right = '+this.limitReDim.rectLim.right,58);
traceExec('RSLoadLimitsDyn this.limitReDim.rectLim.widthMax = '+this.limitReDim.widthMax,58);
traceExec('RSLoadLimitsDyn this.limitReDim.rectLim.heightMax = '+this.limitReDim.heightMax,60);
}
rialto.widgetBehavior.RSLoadSpecs
=function(specs){
traceExec('RSLoadSpecs entree',76);
this.specsRS=new Object;
if(!specs)
specs=new Object;
if(!specs.cibleEvt){
this.specsRS.cibleEvt=new Array;
this.specsRS.cibleEvt[0]={oHtml:this,mode:'mono',dir:'2D'};
this.specsRS.orientation='2D';
}
else
if(!(specs.cibleEvt instanceof Array)){
var wCibleEvt=specs.cibleEvt;
this.specsRS.cibleEvt=new Array;
this.specsRS.cibleEvt[0]=new Object;
this.specsRS.cibleEvt[0].oHtml=wCibleEvt.oHtml;
this.specsRS.cibleEvt[0].mode=wCibleEvt.mode||'mono';
var orientation=specs.orientation||'2D';
this.specsRS.cibleEvt[0].dir=(this.specsRS.cibleEvt[0].mode=='mono')?orientation:wCibleEvt.dir;
this.specsRS.orientation=this.specsRS.cibleEvt[0].dir;
}
else
if(specs.cibleEvt instanceof Array){
this.specsRS.cibleEvt=specs.cibleEvt;
}
else{
traceExec('pb def cible DD',30);
}
this.specsRS.sensitiveEdgeWidth=specs.sensitiveEdgeWidth||SENSITIVEEDGEWIDTH_DEFAULT;
this.specsRS.objetADeformer=specs.objetADeformer?specs.objetADeformer:this;
this.specsRS.fantome=new Object;
if(specs.fantome)
this.specsRS.fantome.aspect=specs.fantome.aspect||'cadre';
else
this.specsRS.fantome=null;
this.specsRS.modCurs=new Object;
if(specs.modCursor){
this.specsRS.modCurs.avantDD=(specs.modCursor.avantDD!='undefined')?specs.modCursor.avantDD:true;
this.specsRS.modCurs.auClic=(specs.modCursor.auClic!='undefined')?specs.modCursor.auClic:true;
}
else{
this.specsRS.modCurs.avantDD=true;
this.specsRS.modCurs.auClic=true;
}
if(specs.grilleMagnetic){
this.specsRS.magnet=new Object;
this.specsRS.magnet.widthCol=specs.grilleMagnetic.widthCol||10;
this.specsRS.magnet.heightRow=specs.grilleMagnetic.heightRow||10;
}
this.limitReDim=new Object;
this.limitReDim.symetrie=specs.symetrie||false;
if(this.limitReDim.symetrie)
this.limitReDim.centrage=true;
this.limitReDim.bRectLim=(specs.bRectLim!=null)?specs.bRectLim:true;
this.limitReDim.bLimMax=(specs.bRectLim!=null)?specs.bLimMax:false;
this.limitReDim.rectLim=new Object;
var flagModSpecsRectLim=false;
if(!specs.rectLim){
specs.rectLim=new Object;
flagModSpecsRectLim=true;
}
else{
this.limitReDim.bRectLim=true;
}
this.limitReDim.rectLim.left=specs.rectLim.left||0;
this.limitReDim.rectLim.top=specs.rectLim.top;
this.specsRS.majDyn=(specs.majDyn!=null)?specs.majDyn:true;
if(!this.specsRS.majDyn){
this.limitReDim.rectLim.right=specs.rectLim.right||pixWidth(this.specsRS.objetADeformer.parentNode);
this.limitReDim.rectLim.bottom=specs.rectLim.bottom||pixHeight(this.specsRS.objetADeformer.parentNode);
}
else{
this.limitReDim.rectLim.rightSpecs=specs.rectLim.right||pixWidth(this.specsRS.objetADeformer.parentNode);
this.limitReDim.rectLim.bottomSpecs=specs.rectLim.bottom||pixHeight(this.specsRS.objetADeformer.parentNode);
this.limitReDim.widthMaxSpecs=specs.rectLim.widthMax;
this.limitReDim.heightMaxSpecs=specs.rectLim.heightMax;
}
if(!specs.limitReDim)specs.limitReDim=new Object;
this.limitReDim.heightMin=specs.limitReDim.heightMin||10;
this.limitReDim.heightMax=specs.limitReDim.heightMax||(this.limitReDim.bottom-this.limitReDim.top+1);
traceExec('** RSLoadSpecs specs.limitReDim.widthMin    = '+specs.limitReDim.widthMin,76);
this.limitReDim.widthMin=specs.limitReDim.widthMin||10;
traceExec('** RSLoadSpecs this.limitReDim.rectLim.widthMin    = '+this.limitReDim.widthMin,76);
this.limitReDim.widthMax=specs.limitReDim.widthMax||(this.limitReDim.right-this.limitReDim.left+1);
traceExec('RSLoadSpecs this.limitReDim.rectLim.top    = '+this.limitReDim.rectLim.top,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.left   = '+this.limitReDim.rectLim.left,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.bottom = '+this.limitReDim.rectLim.bottom,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.right  = '+this.limitReDim.rectLim.right,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.bottomSpecs = '+this.limitReDim.rectLim.bottomSpecs,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.rightSpecs  = '+this.limitReDim.rectLim.rightSpecs,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.heightMin   = '+this.limitReDim.heightMin,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.heightMax   = '+this.limitReDim.heightMax,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.widthMin    = '+this.limitReDim.widthMin,76);
traceExec('RSLoadSpecs this.limitReDim.rectLim.widthMax    = '+this.limitReDim.widthMax,76);
traceExec('RSLoadSpecs fin',58);
if(flagModSpecsRectLim)
specs.rectLim=null;
}
rialto.widgetBehavior.constructorReSize
=function(specs)
{
if(!this.oCiu)this.oCiu=new Array();
this.oCiu['ReSize']=this;
this.oCiu['ReSize'].lockReSize=false;
if(!this.oCiu['ReSize'].loadSpecsRS){
this.oCiu['ReSize'].loadSpecsRS=rialto.widgetBehavior.RSLoadSpecs;
}
this.oCiu['ReSize'].loadSpecsRS(specs);
if(this.oCiu['ReSize'].specsRS.majDyn){
if(!this.oCiu['ReSize'].loadLimitsDynRS)
this.oCiu['ReSize'].loadLimitsDynRS=rialto.widgetBehavior.RSLoadLimitsDyn;
this.oCiu['ReSize'].loadLimitsDynRS(this.oCiu['ReSize'].specsRS.objetADeformer.parentNode);
}
var oCiu=this.oCiu['ReSize'];
var oHtmlCible;
for(var i=0;i<oCiu.specsRS.cibleEvt.length;i++){
oHtmlCible=oCiu.specsRS.cibleEvt[i].oHtml;
oHtmlCible.reSize=true;
oHtmlCible.refObjSpecsRS=this;
oHtmlCible.modeRS=oCiu.specsRS.cibleEvt[i].mode;
oHtmlCible.dirRS=oCiu.specsRS.cibleEvt[i].dir;
if(!oHtmlCible.behavior)
oHtmlCible.behavior={};
if(!oHtmlCible.behavior['RS'])
oHtmlCible.behavior['RS']={};
oHtmlCible.behavior['RS'].running=false;
}
if(typeof document.addEventListener=="undefined"){
for(var i=0;i<oCiu.specsRS.cibleEvt.length;i++){
oHtmlCible=oCiu.specsRS.cibleEvt[i].oHtml;
oHtmlCible.addHandler=addHandler;
oHtmlCible.methodRSMouseDown=rialto.widgetBehavior.ReSizeMouseDownHandler;
oHtmlCible.methodRSMouseMove=rialto.widgetBehavior.ReSizeMouseMoveHandler;
oHtmlCible.methodRSMouseUp=rialto.widgetBehavior.ReSizeMouseUpHandler;
oHtmlCible.addHandler(oHtmlCible,'onmousedown','methodRSMouseDown');
oHtmlCible.addHandler(oHtmlCible,'onmousemove','methodRSMouseMove');
oHtmlCible.addHandler(oHtmlCible,'onmouseup','methodRSMouseUp');
oHtmlCible.methodDebRS=function(){window.status='debut de la deformation this.id='+this.id;};
oHtmlCible.addHandler(oHtmlCible,'onmousedown','methodDebRS');
oHtmlCible.methodFinRS=function(){window.status='fin de la deformation';};
oHtmlCible.addHandler(oHtmlCible,'onmouseup','methodFinRS');
}
}
else{
if(!document.enregtReSize){
document.enregtReSize=true;
document.addEventListener("mousemove",rialto.widgetBehavior.ReSizeMouseMoveHandler,false);
document.addEventListener("mouseup",rialto.widgetBehavior.ReSizeMouseUpHandler,false);
document.addEventListener("mousedown",rialto.widgetBehavior.ReSizeMouseDownHandler,false);
document.addEventListener("mousedown",StopSelectDef,false);
}
}
}
rialto.widgetBehavior.createBehavior(
'ReSize',
rialto.widgetBehavior.constructorReSize
);
StopSelectDef=function(e){
stopDefault(e);
}
rialto.widgetBehavior.ReSizeMouseDownHandler=function(e){
if(!e)var e=window.event;
var oSourceEvt=e.target?e.target:e.srcElement;
var oHtml=oSourceEvt;
if(!oHtml.reSize){
return;
}
var direction;
if(oHtml.modeRS!='mono'){
direction=oHtml.dirRS;
}
else{
direction=DirDeplact(oHtml,e,pixHeight(oHtml),pixWidth(oHtml)
,oHtml.refObjSpecsRS.specsRS.sensitiveEdgeWidth
,marginLess=false);
}
if(!direction){
traceExec('position invalide/RS',58);
oHtml.style.cursor="default";
return;
}
else
oHtml.style.cursor=direction+"-resize";
if((oHtml.behavior['DD'])
&&(oHtml.behavior['DD'].isRunning)){
return;
}
else
oHtml.behavior['RS'].isRunning=true;
traceExec('position valide/RS',58);
var oSpecs=oHtml.refObjSpecsRS;
if(oSpecs.specsRS.majDyn)
oSpecs.loadLimitsDynRS(oSpecs.specsRS.objetADeformer.parentNode);
var objetADeformer=oSpecs.specsRS.objetADeformer;
traceExec(';;;Md objetADeformer.style.height= '+parseInt(objetADeformer.style.height),60);
if(oSpecs.specsRS.fantome){
var cadreFantome=document.getElementById('cadreFantomeUnique');
if(cadreFantome==null){
cadreFantome=document.createElement('DIV');
cadreFantome.id='cadreFantomeUnique';
cadreFantome.className='fantomeRS_'+oSpecs.specsRS.fantome.aspect;
objetADeformer.parentNode.appendChild(cadreFantome);
}
else
if(cadreFantome.parentNode!=objetADeformer){
cadreFantome.parentNode.removeChild(cadreFantome);
cadreFantome=document.createElement('DIV');
cadreFantome.id='cadreFantomeUnique';
cadreFantome.className='fantomeRS_'+oSpecs.specsRS.fantome.aspect;
objetADeformer.parentNode.appendChild(cadreFantome);
}
cadreFantome.style.zIndex=100000;
cadreFantome.style.top=pixTop(objetADeformer);
cadreFantome.style.left=pixLeft(objetADeformer);
cadreFantome.style.width=pixWidth(objetADeformer);
var bWidth=0;
if(window.getComputedStyle){
var topWidthBord=getComputStyle(cadreFantome,'borderTopWidth','0');
var bottomWidthBord=getComputStyle(cadreFantome,'borderBottomWidth','0');
if(topWidthBord||bottomWidthBord){
bWidth=topWidthBord+bottomWidthBord;
cadreFantome.style.width=parseInt(cadreFantome.style.width)-bWidth;
}
}
traceExec('!!! objetADeformer.id= '+objetADeformer.id,60);
cadreFantome.style.height=pixHeight(objetADeformer);
traceExec('RS -1- Md cadreFantome.style.height = pixHeight(objetADeformer)= '+pixHeight(objetADeformer),75);
traceExec('!!! Md cadreFantome.style.height= '+cadreFantome.style.height,60);
var bHeight=0;
if(window.getComputedStyle){
bHeight=topWidthBord+bottomWidthBord;
cadreFantome.style.height=parseInt(cadreFantome.style.height)-bHeight;
}
cadreFantome.style.visibility='visible';
var objetEnDeformation=cadreFantome;
objetEnDeformation.refObjSpecs=oSpecs;
}
else
var objetEnDeformation=objetADeformer;
var top=pixTop(objetEnDeformation);
var left=pixLeft(objetEnDeformation);
var width=pixWidth(objetEnDeformation);
var height=pixHeight(objetEnDeformation);
traceExec('++++Md  height obj en def= '+height,58);
var topLeftEvtInVP=_rum.$eventTopLeftInViewPort(e);
var topEvtInVP=topLeftEvtInVP.top;
var leftEvtInVP=topLeftEvtInVP.left;
oReSize={oThis:oSpecs,
oSource:oHtml,
fantome:oSpecs.specsRS.fantome,
objetEnDeformation:objetEnDeformation,
objetADeformer:objetADeformer,
limitReDim:oSpecs.limitReDim,
direction:direction,
clientXI:e.clientX,
clientYI:e.clientY,
topI:top,
leftI:left,
widthI:width,
wBordGD:bWidth,
wBordHB:bHeight,
heightI:height,
magnet:oSpecs.specsRS.magnet,
mvtEffectif:false,
topEvtInVP:topEvtInVP,
leftEvtInVP:leftEvtInVP
};
oReSize.prevTop=parseInt(oReSize.objetEnDeformation.style.top);
oReSize.prevLeft=parseInt(oReSize.objetEnDeformation.style.left);
oReSize.prevWidth=parseInt(oReSize.objetEnDeformation.style.width);
oReSize.prevHeight=parseInt(oReSize.objetEnDeformation.style.height);
traceExec('RS -0- objetEnDeformation.style.height= '+objetEnDeformation.style.height,75);
traceExec('RS -0- heightI = pixHeight(objetEnDeformation)= '+oReSize.heightI,75);
traceExec('RS -0- objetADeformer.style.height= '+objetADeformer.style.height,75);
traceExec('Md oReSize.objetEnDeformation.style.height= '+parseInt(oReSize.objetEnDeformation.style.height),62);
traceExec('Md oReSize.objetADeformer.style.height=     '+pixHeight(oReSize.objetADeformer),62);
if(this.setCapture){
this.setCapture();
stopEvent(e);
if((!oSpecs.specsRS.modCurs.avantDD)
&&(oSpecs.specsRS.modCurs.auClic)){
rialto.widgetBehavior.DDmodCursor(oHtml,direction,oSpecs.limitDeplact.orientation);
}
}
else
if((!oSpecs.specsRS.modCurs.avantDD)
&&(oSpecs.specsRS.modCurs.auClic)){
if(oSpecs.specsRS.fantome)
rialto.widgetBehavior.DDmodCursor(objetEnDeplact,direction,oSpecs.limitDeplact.orientation);
else
rialto.widgetBehavior.DDmodCursor(oHtml,direction,oSpecs.limitDeplact.orientation);
}
}
rialto.widgetBehavior.ReSizeMouseMoveHandler=function(e){
if(!e)var e=window.event;
var oHtml=e.target?e.target:e.srcElement;
if(!oReSize){
if(oHtml.reSize){
var direction;
if(oHtml.modeRS!='mono'){
direction=oHtml.dirRS;
}
else{
traceExec('MM oHtml.margeSensible= '+oHtml.margeSensible+' defMargeSensibleDD= '+
defMargeSensibleDD+' oHtml.refObjSpecsRS.sensitiveEdgeWidth= '+
oHtml.refObjSpecsRS.specsRS.sensitiveEdgeWidth,74);
traceExec('RS MM b',74);
direction=DirDeplact(oHtml,e,pixHeight(oHtml),pixWidth(oHtml)
,oHtml.refObjSpecsRS.specsRS.sensitiveEdgeWidth
,marginExcluded=false);
traceExec('RS MM e',74);
}
if(direction==""){
traceExec('RS mm ap DirDeplact dir='+direction+' curs def restor?',74);
}
else{
oHtml.style.cursor=direction+"-resize";
traceExec('RS mm ap DirDeplact dir='+direction+' curs ad hoc',74);
}
this.releaseCapture();
}
else{
if(oReSize.fantome)
oReSize.objetEnDeformation.style.cursor='default';
else
oReSize.oSource.style.cursor='default';
}
oReSize.oSource.behavior['RS'].isRunning=false;
var oThis=oReSize.oThis;
if(oThis.afterRS){
if(oReSize.objetADeformer!=oReSize.objetEnDeformation){
var deltaTop=parseInt(oReSize.objetEnDeformation.style.top)
-parseInt(oReSize.objetADeformer.style.top);
var deltaLeft=parseInt(oReSize.objetEnDeformation.style.left)
-parseInt(oReSize.objetADeformer.style.left);
var deltaWidth=parseInt(oReSize.objetEnDeformation.style.width)
-parseInt(oReSize.objetADeformer.style.width)+oReSize.wBordGD;
traceExec('oReSize.objetEnDeformation.style.height= '+parseInt(oReSize.objetEnDeformation.style.height),60);
traceExec('oReSize.objetADeformer.style.height=     '+pixHeight(oReSize.objetADeformer),60);
var deltaHeight=parseInt(oReSize.objetEnDeformation.style.height)
-pixHeight(oReSize.objetADeformer)+oReSize.wBordHB;
traceExec('RS -3- Mup  afterRs existe deltaHeight = parseInt(oReSize.objetEnDeformation.style.height)- pixHeight(oReSize.objetADeformer) + oReSize.wBordHB= '+deltaHeight,75);
traceExec('______deltaHeight= '+deltaHeight,62);
}
else{
var deltaTop=parseInt(oReSize.objetEnDeformation.style.top)
-parseInt(oReSize.topI);
var deltaLeft=parseInt(oReSize.objetEnDeformation.style.left)
-parseInt(oReSize.leftI);
var deltaWidth=parseInt(oReSize.objetEnDeformation.style.width)
-parseInt(oReSize.widthI);
var deltaHeight=parseInt(oReSize.objetEnDeformation.style.height)
-parseInt(oReSize.heightI);
traceExec('RS -4- Mup pas de afterRs deltaHeight = parseInt(oReSize.objetEnDeformation.style.height)- parseInt(oReSize.heightI)= '+deltaHeight,75);
}
}
if(oReSize.objetADeformer!=oReSize.objetEnDeformation){
oReSize.objetADeformer.style.top=oReSize.objetEnDeformation.style.top;
oReSize.objetADeformer.style.left=oReSize.objetEnDeformation.style.left;
oReSize.objetADeformer.style.width=parseInt(oReSize.objetEnDeformation.style.width)+oReSize.wBordGD;
oReSize.objetADeformer.style.height=parseInt(oReSize.objetEnDeformation.style.height)+oReSize.wBordHB;
traceExec('RS -5- Mup oReSize.objetADeformer.id= '+oReSize.objetADeformer.id
+' oReSize.objetADeformer.style.height = parseInt(oReSize.objetEnDeformation.style.height) + oReSize.wBordHB='+oReSize.objetADeformer.style.height,1);
}
if(oReSize.fantome)
oReSize.objetEnDeformation.style.visibility='hidden';
if(oReSize.mvtEffectif){
if(oThis.afterRS)
oThis.afterRS({top:deltaTop,left:deltaLeft,width:deltaWidth,height:deltaHeight});
}
else{
if(oThis.afterClic)
oThis.afterClic();
}
oReSize=null;
stopEvent(e);
}
}
rialto.widgetBehavior.ReSize.modCurseur=function(oHtml,direction,orientation){
if(direction==""){
oHtml.style.cursor="default";
}
else
if(orientation=='v')
{oHtml.style.cursor=direction+"-resize";
}
else
if(orientation=='h'){
oHtml.style.cursor=direction+"-resize";
}
else{
oHtml.style.cursor='move';
}
}
rialto.io={};
rialto.lang.link=function(obj,method){
var object=obj;
var fcn=method;
return function(){
return fcn.apply(object,arguments);
}
}
rialto.io.AjaxRequest=function(objPar){
this.url=objPar.url;
this.withWaitWindow=true;
this.callBackObjectOnSuccess=null;
this.callBackObjectOnFailure=null;
this.canBeCancel=true;
this.config={
asynchronous:true
,method:'get'
,onSuccess:this.reportSuccess
,onFailure:this.reportError
};
if(objPar!=null){
if(objPar.url){
this.url=objPar.url;
}
if(objPar.callBackObjectOnSuccess){
this.callBackObjectOnSuccess=objPar.callBackObjectOnSuccess;
}
if(objPar.callBackObjectOnFailure){
this.callBackObjectOnFailure=objPar.callBackObjectOnFailure;
}
if(objPar.canBeCancel!=null&&(objPar.canBeCancel==true||objPar.canBeCancel==false)){
this.canBeCancel=objPar.canBeCancel;
}
if(objPar.withWaitWindow!=null&&(objPar.withWaitWindow==true||objPar.withWaitWindow==false)){
this.withWaitWindow=objPar.withWaitWindow;
}
if(objPar.method!=''&&objPar.method!=null&&(objPar.method=="post"||objPar.method=="get")){
this.config.method=objPar.method;
}
if(objPar.onSuccess){
if(this.callBackObjectOnSuccess){
this.config.onSuccess=rialto.lang.link(this.callBackObjectOnSuccess,objPar.onSuccess);
}
else{
this.config.onSuccess=objPar.onSuccess;
}
}
if(objPar.onFailure){
if(this.callBackObjectOnFailure){
this.config.onFailure=rialto.lang.link(this.callBackObjectOnFailure,objPar.onFailure);
}
else{
this.config.onFailure=objPar.onFailure;
}
}
}
if(this.withWaitWindow){
this.config.onLoading=rialto.lang.link(this,this.displayWaitWindow);
}
this.xhttpr=null;
if(window.XMLHttpRequest){
this.xhttpr=new XMLHttpRequest();
}
else if(window.ActiveXObject){
try{
this.xhttpr=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
this.xhttpr=new ActiveXObject("Microsoft.XMLHTTP");
}
}
else{
this.xhttpr=false;
}
this.status=['Uninitialized','Loading','Loaded','Interactive','Complete'];
}
rialto.io.AjaxRequest.prototype={
load:function(parameters){
var url=this.url;
this.config.parameters=parameters;
try{
if(this.config.method=='get'
&&this.config.parameters.length>0)
url+=(url.match(/\?/)?'&':'?')+parameters;
this.xhttpr.open(this.config.method,url,this.config.asynchronous);
this.xhttpr.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");
if(this.config.method=='post'){
this.xhttpr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
}
if(this.config.asynchronous){
this.xhttpr.onreadystatechange=rialto.lang.link(this,this.respondToReadyState);
}
this.xhttpr.send(this.config.method=='post'?this.config.parameters:null);
}catch(e){alert(e+'\n (url :'+url+')');}
}
,
responseIsSuccess:function(){
return(this.xhttpr.status==undefined||
this.xhttpr.status==0||
(this.xhttpr.status>=200&&this.xhttpr.status<300));
},
responseIsFailure:function(){
return !this.responseIsSuccess();
},
respondToReadyState:function(){
var readyState=this.xhttpr.readyState;
var status=this.status[readyState];
switch(status){
case 'Complete':
if(this.withWaitWindow){this.fen.masqueFen();};
try{
this.config['on'+(this.responseIsSuccess()?'Success':'Failure')](this.xhttpr);
}catch(e){
}
break;
default:
try{
this.config['on'+status](this.xhttpr)
}catch(e){
}
break;
}
}
,
abort:function(){
if(this.canBeCancel){this.xhttpr.abort();}
}
,
displayWaitWindow:function(){
if(this.fen){
this.fen.display();
}
else{
var oThis=this;
widthGlobal=document.body.clientWidth;
heightGlobal=document.body.clientHeight;
var top=(heightGlobal/2)-60;
var left=(widthGlobal/2)-100;
this.fen=new rialto.widget.Dialog("fen",top,left,200,90,""," ","transparent");
var divLib=document.createElement("DIV");
divLib.className="libelle2";
divLib.style.position="absolute";
divLib.style.top="5px";
divLib.style.left="65px";
divLib.style.width="100%";
divLib.innerHTML="LOADING";
this.fen.add(divLib);
var img=document.createElement("IMG");
img.src=rialtoConfig.pathRialtoE+"images/sablier.gif";
img.style.position="absolute";
img.style.height='35px';
img.style.width='27px';
img.style.left='75px';
img.style.top='22px';
this.fen.add(img);
if(this.canBeCancel){
var BANN=new rialto.widget.Button(60,50,"CANCEL");
BANN.onclick=function(){
oThis.abort();
oThis.fen.masqueFen();
}
this.fen.add(BANN);
}
}
}
,
reportSuccess:function(request){
var div=document.createElement("DIV");
div.innerHTML=request.responseText;
var fen=new rialto.widget.objFenData(600,400,div,'Response')
}
,
reportError:function(request){
var div=document.createElement("DIV");
div.innerHTML=request.responseText;
var fen=new rialto.widget.objFenData(600,400,div,'Sorry. There was an error.')
}
}
function areaAccesCtrl(libel,sourceReq,emprise){
var instanceExistante=eval(recupSingletonCD(sourceReq));
if(instanceExistante)
return instanceExistante;
else
this.init(libel,sourceReq,emprise);
}
areaAccesCtrl.prototype.init=function(libel,sourceReq,emprise,typeVoile){
this.libel=libel
this.sourceReq=sourceReq;
this.emprise=emprise;
if(this.libel){
this.titre=libel;
var top=(document.body.clientWidth/2)-60;
var left=(document.body.clientHeight/2)-100;
this.fen=new rialto.widget.Dialog("fen",0,0,200,90,""," ",typeVoile||"transparent",null,this.emprise,this);
this.divLib=document.createElement("DIV");
this.divLib.className="libelle1";
this.divLib.style.position="absolute";
this.divLib.style.top="5px";
this.divLib.style.left="25px";
this.divLib.style.width="100%";
this.text=document.createTextNode(this.libel);
this.divLib.appendChild(this.text);
this.fen.add(this.divLib);
this.img=document.createElement("IMG");
this.img.src="images/sablier.gif";
this.img.style.position="absolute";
this.img.style.height='35px';
this.img.style.width='27px';
this.img.style.left='75px';
this.img.style.top='22px';
this.fen.add(this.img);
var wBtn=50;
var hBtn=60;
this.BANN=new rialto.widget.Button(hBtn,wBtn,"ANN","Annuler la demande",this.fen);
this.BANN.oCiu=this;
this.BANN.requete=function(){
var url=this.oCiu.urlStopServ;
if(!this.iframe){
this.iframe=new objFrame("ifr",0,0,0,0,hidden=true);
this.iframe.create(window.document);
}
traceExec('areaAccesCtrl.requete iframe.load url= '+url,1);
this.iframe.load(url);
}
this.BANN.onclick=function(){
this.oCiu.stopEnCours=true;
this.requete();
};
}
else{
var suffFond=typeVoile||"transparent";
var masque;
this.comportVerrouillage=MasqueZones;
masque=this.comportVerrouillage(suffFond,emprise,this);
}
}
areaAccesCtrl.prototype.specNewReq=function(idReq,url){
if(!this.libel)return;
if(!idReq){
this.BANN.setVisible(false);
}
else{
this.BANN.setVisible(true);
this.idReq=idReq;
i=url.indexOf("?");
this.urlStopServ=(i==-1)?url:url.substr(0,i);
this.urlStopServ=this.urlStopServ
+'?METHOD=STOP'
+'&SOURCEREQ='+this.sourceReq
+'&IDREQ='+this.idReq;
}
this.nbPeriodeAttente=0;
this.animeText();
}
areaAccesCtrl.prototype.animeText=function(id){
var strPoints="";
this.nbPeriodeAttente++;
this.nbPeriodeAttente=this.nbPeriodeAttente%5;
for(i=0;i<this.nbPeriodeAttente;i++){
strPoints+=".";
}
this.divLib.removeChild(this.divLib.firstChild);
this.text=document.createTextNode(this.titre+" "+strPoints);
this.divLib.appendChild(this.text);
this.time=window.setTimeout("rialto.session.objects.singletonCDs[\""+this.sourceReq+"\"].animeText()",500);
}
areaAccesCtrl.prototype.stopControl=function(modeStop){
for(var e=0;e<this.emprise.length;e++){
if((nbRef=this.emprise[e].lastChild.suppRef(this))==0)
this.emprise[e].removeChild(this.emprise[e].lastChild);
}
if(this.libel){
if(this.stopEnCours&&(!modeStop))return;
this.stopEnCours=false;
window.clearTimeout(this.time);
this.fen.masqueFen();
}
}
function CadreFenetre(nomFen,
top,left,width,height,heightExtern,
contenuInitial,titreFenetre,
eltContainer,
bWithSB,
typePanelBtons
,bWithBtonClose,
bMobile,bReDim,
modeAffContenu
,optionsMode)
{
this.onClose=function(){};
this.styleDeco=window.__styleDeco;
this.modeAffContenu=modeAffContenu;
this.optionsMode=optionsMode;
traceExec('modeAffContenu= '+modeAffContenu,76);
this.displayMode='win';
this.autoAdjust=false;
this.eltContainer=eltContainer||"";
this.nomFen=nomFen||"FenPrototype";
this.width=width||100;
this.heightExtern=heightExtern||'auto';
this.height=height||'auto';
this.top=top||"auto";
this.left=left||"auto";
this.contenuInitial=contenuInitial||"";
this.titreFenetre=titreFenetre||"anonymous Window";
this.bOptMSheetMode=true;
this.typePanelBtons=typePanelBtons;
if(this.nomFen=="FenPrototype")
return;
this.bStatusBar=bWithSB;
this.bWithBtonClose=bWithBtonClose;
traceExec('=+=+=+=+=+=+ CadreFenetre this.bWithBtonClose= '+this.bWithBtonClose,61);
var nvId=(CadreFenetre.prototype.nbInstance++);
this.id="cadreFenetre_"+nvId;
this.idObjComp=nvId;
this.cadreExterne=document.createElement('DIV');
this.cadreExterne.idObjComp=this.idObjComp;
this.cadreExterne.id="cadreExterne_"+this.idObjComp;
this.cadreExterne.objCiu=this;
this.cadreExterne.oThis=this;
this.cadreExterne.oCiu=this;
this.cadreExterne.style.position='absolute';
this.cadreExterne.style.width=this.width;
this.cadreExterne.style.top=this.top;
this.cadreExterne.style.left=this.left;
this.cadreExterne.style.height=this.heightExtern;
traceExec('-1- CadreFenetre height= this.heightExtern'+this.cadreExterne.style.height,75);
if(this.heightExtern=='100%')
this.modeAjustExt=true;
this.cadreExterne.pixWidtharevoir=function(telQuel){
}
this.cadreExterne.pixHeight=function(telQuel){
traceExec('CadreFenetre.cadreExterne.prototype.pixHeight entree this.id='+this.id,60);
traceExec('pixHeight this.oCiu='+this.oCiu,60);
traceExec('pixHeight this.oCiu.cadreContenu='+this.oCiu.containerHtml,60);
var cadreContenu=this.oCiu.containerHtml;
if(
(telQuel)
&&
(this.style.height)){
var pHeight=parseInt(this.style.height)
traceExec('pixHeight height fix?e = '+pHeight,60);
}
else{
if(cadreContenu.style.display=='none'){
var pHeight;
if(this.oCiu.styleDeco=='3D')
pHeight=parseInt(this.oCiu.deco.hTitre)
+parseInt(this.oCiu.deco.tDecor.hi.style.height);
traceExec('pixHeight fen reduite pHeight= '+pHeight,60);
}
else
{
var hauteurContenu=getComputStyle(cadreContenu,'height');
var hauteurBarreTitre=parseInt(this.oCiu.deco.hTitre);
var hauteurBasCadre=parseInt(this.oCiu.deco.hBasCadre);
var pHeight;
pHeight=hauteurBarreTitre
+hauteurContenu
+hauteurBasCadre;
}
}
traceExec('CadreFenetre.cadreExterne.prototype.pixHeight sortie pHeight='+pHeight,60);
return pHeight;
}
this.deco=new objDiv3D('','FenetreAvecTirette','sansInnerHtml');
this.deco.createDiv3D(this.cadreExterne);
if(bMobile){
var tirette=this.deco.tDecor.divTirette;
tirette.style.left=(pixWidth(this.cadreExterne)/2)-(parseInt(tirette.style.width)/2);
}
else{
this.deco.tDecor.divTirette.style.display='none';
}
this.cadreExterne.previousTop=this.top;
this.cadreExterne.previousLeft=this.left;
this.cadreExterne.deletePossible=function(){
var oThis=this.oThis;
if(oThis.bStatusBar){
if(this.childNodes[2].scroll){
this.childNodes[2].scroll=false;
return false;
}
else
return true;
}
else
return true;
}
this.deletePossible=function(){
if(this.bStatusBar){
if(this.cadreExterne.childNodes[2].scroll){
this.cadreExterne.childNodes[2].scroll=false;
return false;
}
else
return true;
}
else
return true;
}
traceExec('av appel setContainer modeAffcontenu = '+this.modeAffContenu,31);
traceExec('av appel setContainerHtml height= '+height+' width = '+width,31);
this.setContainerHtml(this.deco.tDecor.zoneCentrale,this.modeAffContenu,this.optionsMode);
this.setDimContainer(height,(width-(this.styleDeco=='3D'?this.deco.diffExtInt:0)));
traceExec('-2- CadreFenetre contenu height= this.height'+this.containerHtml.style.height,75);
this.containerHtml.idObjComp=this.id;
if(!this.containerHtml.id)
this.containerHtml.id="containerHtml_"+this.idObjComp;
if(this.contenuInitial!="")
this.add(document.createTextNode(this.contenuInitial));
traceExec('constr prev Top='+this.cadreExterne.previousTop,60);
traceExec('constr prev Left='+this.cadreExterne.previousLeft,60);
this.cadreExterne.previousHeight=this.cadreExterne.pixHeight();
this.cadreExterne.previousWidth=this.cadreExterne.style.width;
traceExec('constr prev Height='+this.cadreExterne.previousHeight,60);
traceExec('constr prev Width='+this.cadreExterne.previousWidth,60);
this.titre=document.createTextNode(this.titreFenetre);
if(this.bStatusBar){
}
else{
this.barreTitre=new TitleBar((this.styleDeco=='3D')?this.deco:null
,this.titre
,this.logo
,(this.typePanelBtons=='stdt')?'2:Min-Res-Max':this.typePanelBtons
,this.bWithBtonClose
,this);
}
this.cadreExterne.activationAuClic=function(e){
this.objCiu.activeFen();
if(!this.oCiu.bModale){
var rightclick;
if(!e)var e=window.event;
if(e.which)rightclick=(e.which==3);
else if(e.button)rightclick=(e.button==2);
if(rightclick){
alert("Changement de mode d'affichage des fenetres");
this.objCiu.changeDisplayMode();
}
}
}
this.cadreExterne.suppSelDefSurMm=function(e){
stopDefault(e);
}
if(typeof document.addEventListener=="undefined"){
this.cadreExterne.addHandler=addHandler;
this.cadreExterne.addHandler(this.cadreExterne,'onmousedown','activationAuClic');
this.cadreExterne.addHandler(this.cadreExterne,'onmousemove','suppSelDefSurMm');
}
else
{
this.cadreExterne.addEventListener("mousedown",this.cadreExterne.activationAuClic,false);
}
if(eltContainer){
if(eltContainer=="_fenPrinc_")
{
eltContainer=window.document.body;
}
this.placeIn(eltContainer);
}
else{
this.container=null;
this.typeContainer=null;
traceExec('constr CadreFenetre--> activeFen',25);
this.activeFen();
}
}
CadreFenetre.prototype=new Container;
CadreFenetre.prototype.nbInstance=0;
CadreFenetre.prototype.comportReDimFen=function(fantome){
this.RS=true;
this.cadreExterne.comportementReDim=ReSize;
fantome=true;
this.cadreExterne.comportementReDim(
{
cibleEvt:[
{oHtml:this.deco.tDecor.csgh,mode:'fragment',dir:'nw'},
{oHtml:this.deco.tDecor.csdh,mode:'fragment',dir:'ne'},
{oHtml:this.deco.tDecor.csgb,mode:'fragment',dir:'w'},
{oHtml:this.deco.tDecor.csdb,mode:'fragment',dir:'e'},
{oHtml:this.deco.tDecor.cTirette,mode:'fragment',dir:'n'},
{oHtml:this.deco.tDecor.hi,mode:'fragment',dir:'s'},
{oHtml:this.deco.tDecor.g,mode:'fragment',dir:'w'},
{oHtml:this.deco.tDecor.d,mode:'fragment',dir:'e'},
{oHtml:this.deco.tDecor.cig,mode:'fragment',dir:'sw'},
{oHtml:this.deco.tDecor.cid,mode:'fragment',dir:'se'}
]
,fantome:fantome
,bRectLim:false
,limitReDim:{
widthMin:220
,heightMin:44}
}
);
if(fantome){
this.cadreExterne.afterRS=function(deplact){
traceExec('afterRS deplact.height= '+deplact.height,60);
traceExec(' height= '+this.oCiu.containerHtml.style.height,60);
for(var i in deplact)traceExec('deplact.'+i+' = '+deplact[i],60);
this.oCiu.modDimContainer(deplact.height,deplact.width);
if(this.oCiu.filleTailleMax){
this.oCiu.svgZoneCentrale.style.height=this.oCiu.containerHtml.style.height;
traceExec('-3 bis- AfterRS svgContenu height= this.oCiu.containerHtml.style.height = '+this.oCiu.svgZoneCentrale.style.height,75);
}
traceExec('-3- afterRS contenu height= parseInt(this.oCiu.containerHtml.style.height) + deplact.height = '+this.oCiu.containerHtml.style.height,75);
traceExec('aftRS this.oCiu.containerHtml.style.height = '+this.oCiu.containerHtml.style.height,62);
traceExec('aftRS this.oCiu.containerHtml.style.width = '+this.oCiu.containerHtml.style.width,62);
this.oCiu.deco.majTirette(parseInt(this.oCiu.cadreExterne.style.width));
}
}
else{
this.cadreExterne.synchro=function(deplact){
traceExec('synchro deplact.height= '+deplact.height,60);
this.oCiu.containerHtml.style.height=parseInt(this.oCiu.containerHtml.style.height)+deplact.height;
if(this.oCiu.filleTailleMax){
this.oCiu.svgZoneCentrale.style.height=this.oCiu.containerHtml.style.height;
traceExec('-4 bis- AfterRS svgContenu height= this.oCiu.containerHtml.style.height = '+this.oCiu.svgZoneCentrale.style.height,75);
}
traceExec('-4- synchro contenu height= parseInt(this.oCiu.containerHtml.style.height) + deplact.height = '+this.oCiu.containerHtml.style.height,75);
this.oCiu.deco.majTirette(parseInt(this.oCiu.cadreExterne.style.width));
}
}
}
CadreFenetre.prototype.comportMobileFen=function()
{
this.DD=true;
rialto.widgetBehavior.affect(this.deco.tDecor.tirette
,'DragAndDrop'
,{
oHtmlToMove:this.cadreExterne
,oHtmlEvtTarget:this.deco.tDecor.tirette
,ghost:{aspect:'frame'}
,bRectLim:false
,bSelectMark:false
}
);
}
CadreFenetre.prototype.baseAddTabsPane=Container.prototype.addTabsPane;
CadreFenetre.prototype.addTabsPane=function(tabsPane){
this.baseAddTabsPane(tabsPane);
this.comportementReDim=tailleFixe;
this.comportementReDim();
}
CadreFenetre.prototype.baseDelTabsPane=Container.prototype.delTabsPane;
CadreFenetre.prototype.delTabsPane=function(){
this.baseDelTabsPane();
this.comportementReDim=ReDimCadre;
this.comportementReDim();
}
CadreFenetre.prototype.baseAdd=Container.prototype.add;
CadreFenetre.prototype.add=function(elt,bClone)
{
this.baseAdd(elt,bClone);
if(this.autoAdjust)
this.reSize();
}
CadreFenetre.prototype.activeFen=function(){
traceExec('activeFen entree fen= '+this.titreFenetre,31);
if(this.active){
traceExec('activeFen deja active -> 0',31);
return;
}
if(this.container){
if(!this.container.ctrlFenFi){
traceExec('activeFen container sans controleur',31);
traceExec('activeFen -> new PileFenFille(this)',31);
this.container.ctrlFenFi=new PileFenFille(this);
}
traceExec('activeFen -> container.ctrlFenFi.focusOn(this)',31);
this.container.ctrlFenFi.focusOn(this);
}
traceExec('activeFen sortie',31);
}
CadreFenetre.prototype.deleteCiu=function(id){
var cadreExterne;
if(id!=null)
cadreExterne=document.getElementById("cadreExterne_"+id);
else
cadreExterne=this.cadreExterne;
if(cadreExterne.deletePossible()){
var gestFen=cadreExterne.objCiu.container.ctrlFenFi;
var oFen=cadreExterne.objCiu;
var parentHtmlFen=cadreExterne.parentNode;
var suppMasque=(oFen.bModale?
"parentHtmlFen.style.display = 'none';":"");
parentHtmlFen.removeChild(cadreExterne);
if(suppMasque)eval(suppMasque);
gestFen.remove(oFen);
}
else
setTimeout("deleteCiu(\""+ cadreExterne.idObjComp +"\")",200);
}
CadreFenetre.prototype.chgEtat=function(nvEtat){
traceExec('CadreFenetre.chgEtat entree nvEtat= '+nvEtat+' fen= '+this.titreFenetre,31);
var modeActif=((nvEtat=='active')?true:false);
if(this.active==modeActif){
traceExec('chgEtat fenetre '+this.titreFenetre+' deja '+nvEtat,31);
return;
}
this.active=modeActif;
this.paint();
}
CadreFenetre.prototype.paint=function(){
traceExec('CadreFenetre.display entree',31);
if(this.displayMode=='win'){
traceExec('display fenetre '+this.titreFenetre+' old ClassName = '+this.containerHtml.className,20);
this.containerHtml.className=this.containerHtml.className.replace(/\s.*/g,'');
if(this.active){
traceExec('display extension CN += contenuActif',31);
this.containerHtml.className+=' contenuActif';
if(this.container.fillesModePP
&&(!this.modePP)
&&(!this.modePseudoPP)){
if(this.container.modePPSansFille){
traceExec('display active avec modePPSansFille -> pas de abandonModePP(deja fait ds remove)',31);
this.container.modePPSansFille=false;
}
else{
if(this.container.filleTailleMax){
traceExec('display active modePP -> abandonModePPEtRes(sansActivation) ',31);
this.container.abandonModePPEtRes('sansActivation');
this.container.fillesModePP=true;
}
else
if(this.container.fillePseudoTailleMax){
traceExec('display active modepseudoPP -> container.abandonModePPEtRes(sansActivation)',31);
this.container.abandonModePPEtRes('sansActivation');
this.container.fillesModePP=true;
alert('encore en mode pseudo ? '+this.container.fillePseudoTailleMax,31);
}
}
traceExec('display active container.filleTailleMax ',31);
traceExec('display active ->maximize("sansActivation") ',31);
this.maximize('sansActivation');
}
if(this.container.modePPSansFille){
traceExec('display active avec modePPSansFille -> pas de abandonModePP(deja fait ds remove)',31);
this.container.modePPSansFille=false;
}
this.afterActive();
}
else{
traceExec('display extension CN += contenuInactif',31);
this.containerHtml.className+=' contenuInactif';
traceExec('display fenetre '+this.titreFenetre+' new CN = '+this.containerHtml.className,25);
this.afterInactive();
}
}
traceExec('CadreFenetre.display sortie',31);
}
CadreFenetre.prototype.afterActive=function(){
}
CadreFenetre.prototype.afterInactive=function(){
}
CadreFenetre.prototype.maximize=function(sansActivation,silence){
traceExec('maximiZe entree this='+this.titreFenetre,31);
var btonMaxDispo;
if(btonMaxDispo=this.barreTitre.ensBoutons.btonDispo('Max')){
if((sansActivation)
||(this.active)){
traceExec('maximize btonMaxDispo.boutonHtml.traitButton() ',31);
traceExec('maximize btonMaxDispo.boutonHtml =  '+btonMaxDispo.boutonHtml,31);
btonMaxDispo.boutonHtml.traitButton();
}
else{
traceExec('maximize btonMaxDispo.boutonHtml.onclick() ',31);
btonMaxDispo.boutonHtml.onclick();
}
}
else
alert(" Le bouton Maximise de la fen?tre "+this.titreFenetre+" n'est pas disponible alors qu'il existe.\nS'il n'est pas disponible s'est sans doute que le contexte\nne se prete pas ? cette action : elle est donc abandonn?e");
traceExec('maximiZe sortie',31);
}
CadreFenetre.prototype.maximise=function(){
traceExec('maximise entree',31);
if((this.modePP)
||(this.modePseudoPP)){
traceExec('maximise modePP -> 0',31);
return;
}
traceExec('maximise entree this= '+this.cadreExterne.id,31);
traceExec('maximise -> rePlace(0,0)',31);
this.rePlace(0,0);
traceExec('maximise passage en mode block de ligneCentre et zoneCentrale',31);
if(typeof document.addEventListener=="undefined")
this.deco.ligneCentre.style.display='block';
else
this.deco.ligneCentre.style.display='table-row';
this.deco.tDecor.zoneCentrale.style.display='block';
if((this.typeContainer=='CadreFenetre')
&&((!this.container.modePP)
||(this.container.modePPMasque))
&&(!this.filleTailleMax)
){
traceExec('maximise mode confondu possible',31);
traceExec('maximise ->basculeModePP()',31);
this.basculeModePP();
}
else{
traceExec('maximise mode confondu impossible',31);
traceExec('maximise -> ajustDimDynExt()',31);
this.ajustDimDynExt();
}
traceExec('maximise deco.masqueTirette',31);
if(this.DD)
this.deco.masqueTirette();
traceExec('maximise lockReSize',31);
if(this.RS)
this.ReSize.lockReSize=true;
traceExec('maximise sortie ',31);
}
CadreFenetre.prototype.ajustDimDynExt=function(){
this.modeAjustSvg={width:this.cadreExterne.style.width
,heightExt:this.cadreExterne.style.height
,heightInt:this.containerHtml.style.height};
traceExec('-20- ajustDimDynExt svg width= '+this.modeAjustSvg.width,75);
traceExec('-20- ajustDimDynExt svg height Ext = '+this.modeAjustSvg.heightExt,75);
traceExec('-20- ajustDimDynExt svg height Int = '+this.modeAjustSvg.heightInt,75);
if(this.container.containerHtml.tagName=='BODY'){
traceExec('ajustDimDynExt container = body --> reSize(max,max)',31);
this.reSize("max","max");
}
else{
this.cadreExterne.style.width='100%';
traceExec('-20- ajustDimDynExt width= 100%',75);
this.cadreExterne.style.height='100%';
traceExec('-20- ajustDimDynExt height= 100%',75);
this.containerHtml.style.height='100%';
traceExec('-20- ajustDimDynExt contenu height= 100%',75);
}
if(this.filleTailleMax){
this.svgZoneCentrale.style.height=this.containerHtml.style.height;
traceExec('-20- ajustDimDynExt height de svgZoneCentrale = '+this.svgZoneCentrale.style.height,75);
}
this.modePseudoPP=true;
traceExec('ajustDimDynExt  marquage PP  fen = '+this.titreFenetre+' modePseudoPP= '+this.modePseudoPP,31);
this.container.fillePseudoTailleMax=true;
this.container.fillesModePP=true;
this.container.svgFenFille=this;
}
CadreFenetre.prototype.suppAjustDimDynExt=function(){
traceExec('SuppAjustDimDynExt  entree fen = '+this.titreFenetre+' modePseudoPP= '+this.modePseudoPP,31);
if(!this.modePseudoPP)return;
this.cadreExterne.style.width=this.modeAjustSvg.width;
traceExec('-20- SuppAjustDimDynExt  width = '+this.cadreExterne.style.width,75);
this.cadreExterne.style.height=this.modeAjustSvg.heightExt;
traceExec('-20- SuppAjustDimDynExt  height = '+this.cadreExterne.style.height,75);
this.containerHtml.style.height=this.modeAjustSvg.heightInt;
if(this.filleTailleMax){
traceExec('-20- ajustDimDynExt height de svgZoneCentrale = 100%',75);
this.svgZoneCentrale.style.height=this.modeAjustSvg.heightInt;
}
traceExec('-20- SuppAjustDimDynExt contenu height = '+this.containerHtml.style.height,75);
this.modeAjustSvg=null;
this.modePseudoPP=false;
this.container.fillePseudoTailleMax=false;
this.container.fillesModePP=false;
traceExec('SuppAjustDimDynExt sortie fen = '+this.titreFenetre+' modePseudoPP= '+this.modePseudoPP,31);
}
CadreFenetre.prototype.abandonModePPEtMin=function(){
traceExec('abandonModePPEtMin entree container = '+this.titreFenetre,31);
var fenTop;
if((!this.filleTailleMax)
&&(!this.fillePseudoTailleMax)){
traceExec('abandonModePPETRes non mode PP -> ctrlFenFi.top().restoreSize()',31);
if(this.ctrlFenFi
&&(fenTop=this.ctrlFenFi.top()))
fenTop.minimize();
}
else{
if(this.filleTailleMax){
traceExec('abandonModePPEtMin filleTailleMax -> abandonModePP',31);
this.abandonModePP();
traceExec('abandonModePPEtMin apres abandonModePP this.filleTailleMax= '+this.filleTailleMax,31);
traceExec('abandonModePPEtMin --> svgFenFille.minimize()',31);
this.svgFenFille.minimize();
}
else{
traceExec('abandonModePPEtMin fillePseudoTailleMax -> ctrlFenFi.top().suppAjustDimDynExt()',31);
this.svgFenFille.suppAjustDimDynExt();
traceExec('abandonModePPEtMin apres suppAjustDimDynExt fillePseudoTailleMax= '+this.svgFenFille.fillePseudoTailleMax,31);
this.svgFenFille.minimize();
}
}
traceExec('abandonModePPEtMin sortie',31);
}
CadreFenetre.prototype.minimizeDim=function(silence){
traceExec('minimizeDim entree',31);
if((this.modePP)
||(this.modePseudoPP)){
traceExec('minimizeDim mode(pseudo)PP -> abandonModePPEtMin',31)
this.container.abandonModePPEtMin();
}
else{
traceExec('minimizeDim non Mode PP-> minimize',31)
this.minimize();
}
}
CadreFenetre.prototype.minimize=function(silence){
traceExec('minimize entree this='+this.titreFenetre,31);
var btonMinDispo;
if(btonMinDispo=this.barreTitre.ensBoutons.btonDispo('Min')){
traceExec('minimize -> btonMinDispo.boutonHtml.traitButton() ',31);
btonMinDispo.boutonHtml.traitButton();
}
else
alert(" Le bouton Minimise de la fen?tre "+this.titreFenetre+" n'est pas disponible alors qu'il existe.\nS'il n'est pas disponible s'est sans doute que le contexte\nne se prete pas ? cette action : elle est donc abandonn?e");
traceExec('minimize sortie this='+this.titreFenetre,31);
}
CadreFenetre.prototype.minimise=function(){
traceExec('minimise entree this='+this.titreFenetre,31);
if(this.deco.ligneCentre.style.display=='none'){
traceExec('minmise d?ja min : -> 0',31);
return;
}
if(this.modePseudoPP){
traceExec('minimise ->suppAjustDimDynExt() ',31);
this.suppAjustDimDynExt();
}
traceExec('minimise ->desactiveFen',31);
this.desactiveFen();
this.rePlace();
traceExec('minimise display= none',31);
this.deco.ligneCentre.style.display='none';
this.deco.tDecor.zoneCentrale.style.display='none';
if(this.RS)
this.ReSize.lockReSize=true;
traceExec('minimise fixe HautcadreExterne= pixHeight()',31)
this.cadreExterne.style.height=this.cadreExterne.pixHeight();
traceExec('-7- minimize height= this.cadreExterne.pixHeight()= '+this.cadreExterne.style.height,75);
if(this.DD)
this.deco.affTirette();
traceExec('etat display '+this.deco.ligneCentre.style.display,31);
traceExec('etat display '+this.deco.tDecor.zoneCentrale.style.display,31);
traceExec('minimise sortie this='+this.titreFenetre,31);
}
CadreFenetre.prototype.desactiveFen=function(){
traceExec('desactiveFen entree fen= '+this.titreFenetre,31);
if(!this.active){
traceExec('desactiveFen deja inactive -> 0',31);
return;
}
else
if(this.container){
traceExec('desactiveFen -> container.focusNext()',31);
this.container.ctrlFenFi.focusNext();
}
else
traceExec('desactiveFen pas de container',31);
traceExec('desactiveFen sortie',31);
}
CadreFenetre.prototype.abandonModePPEtRes=function(sansActivation){
traceExec('abandonModePPEtRes entree container= '+this.titreFenetre,31);
var fenTop;
if((!this.filleTailleMax)
&&(!this.fillePseudoTailleMax)){
traceExec('abandonModePPETRes non mode(pseudo)PP -> ctrlFenFi.top().restoreSize()',31);
if(this.ctrlFenFi
&&(fenTop=this.ctrlFenFi.top()))
fenTop.restoreSize();
}
else{
if(this.filleTailleMax){
traceExec('abandonModePPEtMin filleTailleMax -> abandonModePP',31);
this.abandonModePP();
traceExec('abandonModePPEtRes --> svgFenFille.restoreSize()',31);
this.svgFenFille.restoreSize(sansActivation);
}
else{
traceExec('abandonModePPEtMin fillePseudoTailleMax -> svgFenFille.suppAjustDimDynExt()',31);
this.svgFenFille.suppAjustDimDynExt();
this.svgFenFille.restoreSize(sansActivation);
}
}
traceExec('abandonModePPEtRes sortie',31);
}
CadreFenetre.prototype.restoreDim=function(){
traceExec('restoreDim entree',31);
if((this.modePP)
||(this.modePseudoPP)){
traceExec('restoreDim modePP -> abandonModePPEtRes',31)
this.container.abandonModePPEtRes();
}
else{
traceExec('restoreDim non Mode PP-> restoreSize',31)
if((this.container.filleTailleMax)
||(this.container.fillePseudoTailleMax)){
traceExec('restoreDim container mode PP-> restoreSize(sansActivation)',31)
this.restoreSize('sansActivation');
}
else{
traceExec('restoreDim container non Mode PP-> restoreSize()',31)
this.restoreSize();
}
}
}
CadreFenetre.prototype.restoreSize=function(sansActivation,silence){
traceExec('restoreSize entree this='+this.titreFenetre,31);
var btonResDispo;
if(btonResDispo=this.barreTitre.ensBoutons.btonDispo('Res')){
if((sansActivation)
||((this.container.filleTailleMax)
&&(!this.modePP))
||((this.container.fillePseudoTailleMax)
&&(!this.modePseudoPP))
){
traceExec('restoreSize btonResDispo.boutonHtml.traitButton() ',31);
btonResDispo.boutonHtml.traitButton();
}
else{
traceExec('restoreSize btonResDispo.boutonHtml.onclick() ',31);
btonResDispo.boutonHtml.onclick();
}
}
else
alert(" Le bouton Restaure de la fen?tre <"+this.titreFenetre+"> n'est pas disponible alors qu'il existe.\nS'il n'est pas disponible s'est sans doute que le contexte\nne se prete pas ? cette action : elle est donc abandonn?e");
traceExec('restoreSize sortie this='+this.titreFenetre,31);
}
CadreFenetre.prototype.restaureTaille=function(){
traceExec('restaureTaille this='+this.titreFenetre,31);
traceExec('restaureTaille ->rePlace()',31);
this.rePlace();
traceExec('restaureTaille ligneCentre+zoneCentrale block',31);
if(typeof document.addEventListener=="undefined")
this.deco.ligneCentre.style.display='block';
else
this.deco.ligneCentre.style.display='table-row';
this.deco.tDecor.zoneCentrale.style.display='block';
if(this.modePseudoPP){
traceExec('restaureTaille ->suppAjustDimDynExt() ',31);
this.suppAjustDimDynExt();
}
traceExec('restaureTaille ->reSize(previous,previous)',31);
this.reSize('previous','previous');
if(this.RS)
this.ReSize.lockReSize=false;
if(this.DD)
this.deco.affTirette();
traceExec('restaureTaille sortie this='+this.titreFenetre,31);
}
CadreFenetre.prototype.closeFenTop=function(){
traceExec('closeFenTop entree',31);
traceExec('closeFenTop -> ctrlFenFi.top().closeFen()',31);
var fenTop;
if(this.ctrlFenFi
&&(fenTop=this.ctrlFenFi.top()))
fenTop.closeFen();
traceExec('closeFenTop sortie',31);
}
CadreFenetre.prototype.close=function(){
traceExec('close entree',31);
traceExec('close -> closeFen',31)
this.closeFen();
}
CadreFenetre.prototype.closeFen=function(){
traceExec('closeFen entree this='+this.titreFenetre,31);
var btonCloseDispo;
if(btonCloseDispo=this.barreTitre.ensBoutons.btonDispo('Close')){
traceExec('closeFen -> btonCloseDispo.boutonHtml.traitButton() ',31);
btonCloseDispo.boutonHtml.traitButton();
}
else
alert(" Le bouton Close de la fen?tre "+this.titreFenetre+" n'est pas disponible alors qu'il existe.\nS'il n'est pas disponible s'est sans doute que le contexte\nne se prete pas ? cette action : elle est donc abandonn?e");
traceExec('close sortie this='+this.titreFenetre,31);
}
CadreFenetre.prototype.fermeFen=function(){
traceExec('close entree this='+this.titreFenetre,31);
this.supp=delOHtmlCiu;
traceExec('close ->delOHtmlCiu',31);
this.supp();
traceExec('close sortie this='+this.titreFenetre,31);
}
CadreFenetre.prototype.remove=function(){
traceExec('remove entree this='+this.titreFenetre,31);
var gestFen=this.container.ctrlFenFi;
traceExec('remove ->gestFen.remove',31);
var nbFille=gestFen.remove(this);
if(nbFille==0){
traceExec('remove  nbFille=0 flag modePPSansFille',31);
this.container.modePPSansFille=true;
}
var containerHtml;
if(this.container.filleTailleMax){
if(nbFille==0){
traceExec('remove filleTailleMax et nbFille=0 -> abandonModePP',31);
this.container.abandonModePP();
containerHtml=this.container.containerHtml;
traceExec('remove  conservation des flags modePP',31);
this.container.fillesModePP=true;
}
else{
traceExec('remove deja fen remplacante en mode PP -> modif pt fen ? supp',31);
containerHtml=this.container.svgZoneCentrale;
}
}
else{
traceExec('remove non mode PP',31);
containerHtml=this.container.containerHtml;
}
var suppMasque=(this.bModale?
"this.container.containerHtml.style.display = 'none';"
:'');
traceExec('remove supp Html de fen= '+this.titreFenetre,31);
containerHtml.removeChild(this.cadreExterne);
this.onClose();
}
CadreFenetre.prototype.basculeModePP=function(){
traceExec('basculeModePP entree this='+this.titreFenetre,31);
traceExec('basculeModePP svg ds container de TD-fille et zoneCentrale container',31);
this.container.svgTdZoneCentraleFille=this.containerHtml.parentNode;
this.container.svgZoneCentrale=this.container.containerHtml;
traceExec('basculeModePP svg H fille',31);
this.container.tailleMaxSvgHCentre=this.containerHtml.style.height;
traceExec('-10- maximise  this.container.tailleMaxSvgHCentre = this.containerHtml.style.height= '+this.container.tailleMaxSvgHCentre,76)
this.container.svgFenFille=this;
traceExec('basculeModePP masque zone centrale container',31);
this.container.containerHtml.style.display='none';
traceExec('basculeModePP marquage modePP = true',31);
this.modePP=true;
traceExec('basculeModePP deplact contenu fille ',31);
var td=this.container.containerHtml.parentNode;
var zoneCentraleFille=this.containerHtml;
td.appendChild(zoneCentraleFille);
traceExec('basculeModePP  nv pointeur + H conteuFenetre',31);
this.container.containerHtml=this.container.containerHtml=this.container.deco.tDecor.zoneCentrale=zoneCentraleFille;
this.setDimContainer(parseInt(this.container.svgZoneCentrale.style.height),null);
traceExec('basculeModePP  ->container.setModeDisplayContains()',31);
this.container.setModeDisplayContains();
traceExec('-11- basculeModePP contenu height= this.container.containerHtml.style.height= '+this.container.containerHtml.style.height,75);
traceExec('basculeModePP marquage container.filleTailleMax = true',31);
this.container.filleTailleMax=true;
this.container.fillesModePP=true;
traceExec('basculeModePP ->container.barreTitre.addScdName,addScdPanel',31);
this.container.barreTitre.addScdName(this.titreFenetre);
this.container.barreTitre.addScdPanel(this.container);
traceExec('basculeModePP sortie',31);
}
CadreFenetre.prototype.abandonModePP=function(){
traceExec('abandonModePP entree this='+this.titreFenetre,31);
var zoneCentraleFille=this.containerHtml;
traceExec('abandonModePP retablissement liens containerHtml + height et width',31);
this.containerHtml=this.containerHtml=this.deco.tDecor.zoneCentrale=this.svgZoneCentrale;
traceExec('-8- abandonModePP contenu mere height = zoneCentraleFille.style.height= '+this.containerHtml.style.height,75);
traceExec('abandonModePP retablissement mode block',31);
this.containerHtml.style.display='block';
traceExec('abandonModePP fen princ this.cadreExterne.style.height = '+this.cadreExterne.style.height,62);
traceExec('abandonModePP replacement Html fille ',31);
this.svgTdZoneCentraleFille.appendChild(zoneCentraleFille);
traceExec('abandonModePP retablissement hauteur fille= '+this.tailleMaxSvgHCentre,31);
zoneCentraleFille.style.height=this.tailleMaxSvgHCentre;
traceExec('-9- abandonModePP contenu fille height= this.tailleMaxSvgHCentre= '+zoneCentraleFille.style.height,75);
if(!this.modePP){
traceExec('abandonModePP svgFenFille.setModeDisplayContains()',31);
this.svgFenFille.setModeDisplayContains();
traceExec('abandonModePP supp des scds nom et panel',31);
this.barreTitre.removeScdPanel(this);
this.barreTitre.removeScdName();
if(this.RS)
this.svgFenFille.ReSize.lockReSize=false;
this.modePPMasque=false;
}
traceExec('abandonModePP demarquages',31);
this.svgFenFille.modePP=false;
this.filleTailleMax=false;
this.fillesModePP=false;
traceExec('abandonModePP sortie',31);
}
CadreFenetre.prototype.changeDisplayMode=function(mode){
if(mode==this.displayMode)return;
if(!mode)mode=(this.displayMode=='sheet'?'win':'sheet');
if(mode&&this.container.ctrlFenFi.managementMode!=mode){
this.container.ctrlFenFi.setManagtMode(mode);
return;
}
this.displayMode=mode;
this.paint();
if(mode=='sheet'){
this.barreTitre.style.display='none';
if(this.bStatusBar)
this.barreStatut.style.display='none';
this.maximize();
this.cadreExterne.style.border=0;
}
else{
this.barreTitre.style.display='block';
if(this.bStatusBar)
this.barreStatut.style.display='block';
this.oldSizePos();
this.cadreExterne.style.border="2px black solid";
}
}
CadreFenetre.prototype.placeIn=function(eltContainer)
{
if(eltContainer.containerHtml){
traceExec('placeIn container = obj Container"',62);
this.container=eltContainer;
this.typeContainer='CadreFenetre';
}
else
if(eltContainer.oContainer){
traceExec('placeIn container=html li? ? obj Container',62);
this.container=eltContainer.oContainer;
this.typeContainer='eltSansParent';
}
else{
traceExec('placeIn cr?ation dun objet Container',76);
this.container=new Container(eltContainer);
this.typeContainer='eltSansParent';
}
this.container.add(this.cadreExterne);
this.barreTitre.addPanelButtons();
if((this.container.managementMode=='sheet')
&&(this.displayMode=='win'))
this.changeDisplayMode('sheet');
traceExec('placeIn ->activeFen',25);
this.activeFen();
}
CadreFenetre.prototype.fillStatusBar=function(texteBarreStatut,defilement)
{
if(!this.bStatusBar)
return false;
var divTextContainer=this.barreStatut.firstChild;
divTextContainer.firstChild.nodeValue=texteBarreStatut;
this.barreStatut.scroll=false;
this.barreStatut.defilement=defilement;
if(defilement)
this.barreStatut.switchScrollStatusBarre(100,5);
}
CadreFenetre.prototype.reSize=function(nvWidth,nvHeight)
{
traceExec("reSize de ",this.titreFenetre,62);
traceExec('reSize(',nvWidth,', '+nvHeight+')',62);
var computeWidth=nvWidth||"auto";
var computeHeight=nvHeight||"auto";
this.computeLimits(nvWidth,nvHeight);
traceExec('reSize ap computeLimits this.limWidthMax= '+this.limWidthMax+' this.limHeightMax= '+this.limHeightMax,62);
if(computeWidth=='previous'){
traceExec('modifDim previous pW = '+this.cadreExterne.previousWidth,60);
computeWidth=parseInt(this.cadreExterne.previousWidth);
}
else if(computeWidth=='auto'){
var fils=this.containerHtml.childNodes[0];
var computeWidth=0;
while(fils!=null)
{
computeWidth=Math.max(computeWidth,
(getComputStyle(fils,'left')+getComputStyle(fils,'width')));
fils=fils.nextSibling;
}
computeWidth=computeWidth+4;
}
else if(computeWidth=='max'){
computeWidth=this.limWidthMax;
}
else if(computeWidth=='min'){
}
if(computeHeight=='previous'){
computeHeight=parseInt(this.cadreExterne.previousHeight);
traceExec('modifDim previous pH = '+this.cadreExterne.previousHeight,60);
}
else if(computeHeight=='auto'){
var fils=this.containerHtml.childNodes[0];
var computeHeight=0;
while(fils!=null)
{
computeHeight=Math.max(computeHeight,
(getComputStyle(fils,'top')+getComputStyle(fils,'height')));
fils=fils.nextSibling;
}
}
else if(computeHeight=='max'){
computeHeight=this.limHeightMax;
}
else if(computeHeight=='min'){
}
computeWidth=Math.min(computeWidth,this.limWidthMax);
compteHeight=Math.min(computeHeight,this.limHeightMax);
traceExec('modifDim width='+computeWidth,62);
traceExec('modifDim height='+computeHeight,62);
this.cadreExterne.style.width=computeWidth;
this.containerHtml.style.height=computeHeight;
this.setDimContainer(computeHeight,computeWidth);
traceExec('-12- reSize contenu height = computeHeight= '+this.containerHtml.style.height,75);
this.deco.majTirette(pixWidth(this.cadreExterne,'width'));
}
CadreFenetre.prototype.setHeight=function(hTotale){
var heightStatusBar=0;
if((this.bStatusBar)
&&(getComputStyleStr(this.barreStatut,'display')=='block'))
{heightStatusBar=getComputStyle(this.cadreExterne.childNodes[2],'height');
}
else
heightStatusBar=0;
var heightTitleBar=0;
if(getComputStyleStr(this.barreTitre,'display')=='block')
{
heightTitleBar=getComputStyle(this.cadreExterne.childNodes[0],'height');
}
this.containerHtml.style.height=hTotale-heightTitleBar-heightStatusBar-4;
traceExec('-13- setHeightheight = hTotale - heightTitleBar - heightStatusBar -4= '+this.containerHtml.style.height,75);
}
CadreFenetre.prototype.shift=function(deltaX,deltaY){
this.rePlace(getComputStyle(this.cadreExterne,'top',0)+deltaY,getComputStyle(this.cadreExterne,'left',0)+deltaX);
}
CadreFenetre.prototype.moveTo=function(top,left){
this.rePlace(top,left);
}
CadreFenetre.prototype.rePlace=function(top,left){
var wtop=(top!=null)?top+((this.displayMode=='sheet')?parseInt(this.container.ctrlFenFi.heightTabs)
:0)
:this.cadreExterne.previousTop;
var wleft=(left!=null)?left:this.cadreExterne.previousLeft;
this.cadreExterne.style.top=wtop;
this.cadreExterne.style.left=wleft;
}
CadreFenetre.prototype.savePlace=function(){
this.cadreExterne.previousTop=getComputStyle(this.cadreExterne,'top');
this.cadreExterne.previousLeft=getComputStyle(this.cadreExterne,'left');
}
CadreFenetre.prototype.saveSize=function(){
this.cadreExterne.previousWidth=getComputStyle(this.cadreExterne,'width');
this.cadreExterne.previousHeight=getComputStyle(this.containerHtml,'height');
traceExec('-?- saveSize this.cadreExterne.previousHeight = getComputStyle(this.containerHtml,"height")= '+this.cadreExterne.previousHeight,75);
}
CadreFenetre.prototype.computeLimits=function(nvWidth,nvHeight){
traceExec('computeLimits entree',62);
if(nvWidth=='previous')
this.limWidthMax=10000;
else{
var cadreExterne=this.cadreExterne;
if(cadreExterne.parentNode.tagName=='BODY'){
traceExec('computeLimits cadreExterne.parentNode.tagName == BODY',62);
this.limWidthMax=parseInt(cadreExterne.parentNode.scrollWidth);
traceExec('-14- computeLimits this.limWidthMax =parseInt(cadreExterne.parentNode.scrollWidth)= '+this.limWidthMax,77);
traceExec('computeLimits cadreExterne.parentNode.scrollWidth =this.limWidthMax=  '+this.limWidthMax,62);
}
else{
if(getComputStyleStr(cadreExterne.parentNode,'width')=="auto"){
traceExec('computeLimits cadreExterne.parentNode.currentStyle.width == "auto"',62);
traceExec('this.containerHtml.oContainer.className= '+this.container.cadreExterne.id,62);
traceExec('this.container.cadreExterne.style.width= '+this.container.cadreExterne.style.width,62);
traceExec('parseInt(this.deco.wBords)= '+parseInt(this.deco.wBords),62);
this.limWidthMax=parseInt(this.container.cadreExterne.style.width)
-parseInt(this.deco.diffExtInt);
traceExec('-14bis- computeLimits this.limWidthMax =parseInt(this.container.cadreExterne.style.width-  parseInt(this.deco.wBords) -6) = '+this.limWidthMax,77);
traceExec('-14bis- computeLimits  parseInt(this.deco.wBords) -6) = '+(parseInt(this.deco.wBords)-6),77);
}
else
this.limWidthMax=parseInt(cadreExterne.parentNode.style.width);
}
}
traceExec('computeLimits this.limWidthMax= '+this.limWidthMax,62);
if(nvHeight=='previous')
this.limHeightMax=10000;
else{
if(cadreExterne.parentNode.tagName=='BODY'){
this.limHeightMax=parseInt(cadreExterne.parentNode.scrollHeight);
traceExec('-14- computeLimits this.limHeightMax =parseInt(cadreExterne.parentNode.scrollHeight)= '+this.limHeightMax,75);
traceExec('computeLimits parent=body this.limHeightMax =parseInt(cadreExterne.parentNode.scrollHeight)'
+parseInt(cadreExterne.parentNode.scrollHeight),62);
}
else
this.limHeightMax=parseInt(cadreExterne.parentNode.style.height);
traceExec('-14bis- computeLimits this.limHeightMax =parseInt(cadreExterne.parentNode.style.height)= '+this.limHeightMax,75);
var heightStatusBar=0;
if((this.bStatusBar)
&&(getComputStyleStr(this.barreStatut,'display')=='block'))
heightStatusBar=getComputStyle(cadreExterne.childNodes[2],'height');
var heightBarreTitre=0;
var heightBordBas=0;
heightBordBas=parseInt(this.deco.hBordBas);
if(typeof document.addEventListener=="undefined")
test="this.deco.ligneTitre.style.display== 'block'";
else
test="this.deco.ligneTitre.style.display== 'table-row'";
if(test){
heightBarreTitre=parseInt(this.deco.hTitre)
traceExec('computeLimits prise en compte de la hut du titre',62);
}
traceExec('### heightBordBas= '+heightBordBas,62);
this.limHeightMax-=(heightBarreTitre+heightStatusBar+2+heightBordBas);
if(this.displayMode=='sheet'){
this.limHeightMax-=parseInt(this.container.ctrlFenFi.heightTabs);
}
traceExec('computeLimits HeightMax= '+this.limHeightMax,62);
traceExec('computeLimits WidthMax= '+this.limWidthMax,62);
}
traceExec('computeLimits this.limHeightMax= '+this.limHeightMax,62);
}
function TitleBar(decor,title,logo,btonsDim,bBtonClose,oConcerne){
this.oConcerne=oConcerne;
this.decor=decor;
this.decorLigneTitre=this.decor.ligneTitre;
if(logo)
decor.tDecor.divIco.replaceNode(logo);
if(title)
decor.tDecor.divNom.firstChild.nodeValue=title.nodeValue;
this.addPanelButtons=function(){
var tabRoute=new Array;
tabRoute[0]=new Array;
tabRoute[0]['Min']=3;
tabRoute[0]['Res']=1;
tabRoute[1]=new Array;
tabRoute[1]['Max']=4;
tabRoute[1]['Min']=2;
tabRoute[2]=new Array;
tabRoute[2]['Min']=3;
tabRoute[3]=new Array;
tabRoute[3]['Res']=1;
tabRoute[3]['Max']=0;
tabRoute[4]=new Array;
tabRoute[4]['Max']=0;
tabRoute.initState=1;
var automateActCoroll=function(state){
switch(state){
case 2:
traceExec('etat 2',62);
traceExec('automateActCoroll -> savePlace + saveSize fen '+this.oConcerne.titreFenetre,31);
this.oConcerne.savePlace();
this.oConcerne.saveSize();
this.transition('Min');
break;
case 4:
traceExec('etat 4',62);
this.oConcerne.savePlace();
this.oConcerne.saveSize();
this.transition('Max');
break;
}
}
var tabRouteGrpBton=new Array;
tabRouteGrpBton['Min-Max']=new Array;
tabRouteGrpBton['Min-Max']['Min']='Res-Max';
tabRouteGrpBton['Min-Max']['Max']='Min-Res';
tabRouteGrpBton['Res-Max']=new Array;
tabRouteGrpBton['Res-Max']['Res']='Min-Max';
tabRouteGrpBton['Res-Max']['Max']='Min-Res';
tabRouteGrpBton['Min-Res']=new Array;
tabRouteGrpBton['Min-Res']['Min']='Res-Max';
tabRouteGrpBton['Min-Res']['Res']='Min-Max';
tabRouteGrpBton.initState='Min-Max';
var strBtons;
var strPosBtonsLies='';
traceExec('btonsDim = '+btonsDim,62);
switch(btonsDim){
case '2:Min-Res-Max':
strBtons=' (Res[restaureTaille] / Min [minimise]) + Res[restaureTaille] / Max [maximise])';
strPosBtonsLies='0-1';
break;
case '1:Min-Res':
strPosBtonsLies='';
strBtons=' Min [minimise] / Res[restaureTaille]';
break;
case '1:Max-Res':
strPosBtonsLies='';
strBtons=' Max [maximise] /  Res[restaureTaille]';
break;
case '1:Min-Max':
strPosBtonsLies='';
strBtons=' Max [maximise] / Min [minimise]';
tabRoute.initState=0;
break;
case 0:
strPosBtonsLies='';
strBtons='';
break;
default:
strBtons=' (Res[restaureTaille] / Min [minimise]) + Res[restaureTaille] / Max [maximise])';
strPosBtonsLies='0-1';
break;
}
if(bBtonClose)
strBtons+='+ Close[fermeFen]';
this.ensBoutons=new ButtonPanel(
{
posBtonsLies:strPosBtonsLies
,strBtons:strBtons
}
,oConcerne
,'activeFen'
,this.decorLigneTitre
,tabRoute
,automateActCoroll
,tabRouteGrpBton
)
}
this.addScdName=function(scdName){
this.decorLigneTitre.addScdName(scdName);
}
this.removeScdName=function(){
this.decorLigneTitre.removeScdName();
}
this.removeScdPanel=function(){
this.ensBtonsFenFille.remove();
this.ensBtonsFenFille=null;
}
this.addScdPanel=function(oConcerne){
if(this.ensBtonsFenFille)
this.ensBtonsFenFille.oConcerne=oConcerne;
else{
var tabRouteGrpBton=new Array;
tabRouteGrpBton['Min-Max']=new Array;
tabRouteGrpBton.initState='Min-Max';
var automateActCoroll=function(state){}
var tabRoute=new Array;
tabRoute[0]=new Array;
tabRoute.initState=0;
var strBtons='Espace + WinsMin[abandonModePPEtMin] + WinsRes[abandonModePPEtRes]';
if(bBtonClose)
strBtons+='+ WinsClose[closeFenTop]'
this.ensBtonsFenFille=new ButtonPanel(
{
posBtonsLies:''
,strBtons:strBtons
,posFirstButton:3
}
,oConcerne
,'activeFen'
,this.decorLigneTitre
,tabRoute
,automateActCoroll
,tabRouteGrpBton
)
}
}
}
function StatusBar(txtInit,idBase,width)
{
var barreStatut=document.createElement('DIV');
barreStatut.className="barreStatut";
barreStatut.idObjComp=idBase||(StatusBar.prototype.nbInstance++);
barreStatut.id="barreStatut_"+barreStatut.idObjComp;
barreStatut.width=width||"";
barreStatut.switchScrollStatusBarre=commuteDefiltDsBarreStatut;
barreStatut.onmouseover=function(){
this.switchScrollStatusBarre(100,5);
}
barreStatut.onmouseout=function(){
this.switchScrollStatusBarre(100,5);
}
var texteBarreStatut=document.createElement('DIV');
texteBarreStatut.appendChild(document.createTextNode(txtInit));
texteBarreStatut.className='texteBarreStatut';
texteBarreStatut.idObjComp=barreStatut.idObjComp;
texteBarreStatut.id="texteBarreStatut_"+texteBarreStatut.idObjComp;
barreStatut.appendChild(texteBarreStatut);
return barreStatut;
}
StatusBar.prototype.nbInstance=0;
function commuteDefiltDsBarreStatut(speed,delta)
{if(!this.defilement)
return;
if(this.width==""){
var cadreExterne=document.getElementById("cadreExterne_"+this.idObjComp);
var width=parseInt(cadreExterne.style.width);
if(getComputStyleStr(cadreExterne,'borderStyle')!='none')
width=width
+2*getComputStyle(cadreExterne,'borderWidth');
if(getComputStyleStr(cadreExterne,'padding')!='0px')
width=width
+2*getComputStyle(cadreExterne,'padding');
}
else
width=this.width;
if(this.scroll)
{
this.scroll=false;
clearTimeout(this.ScrollIdTimeout);
}
else
{
var divTextContainer=this.firstChild;
this.scroll=true;
defiltText(divTextContainer.id,speed,delta,width);
}
}
function defiltText(containerId,speed,delta,width)
{var container=eval(containerId);
var nvPos=getComputStyle(container,'left')-delta;
var largText=400;
if(parseInt(largText)<-nvPos)
container.style.left=width;
else
container.style.left=nvPos;
if(container.parentNode.scroll)
container.parentNode.scrollIdTimeout=setTimeout("defiltText(\"" + containerId + "\","+speed+","+delta+","+width+")",speed);
}
rialto.widget.Button=function(top,left,title,alt,parent,objPar){
var src1="bigButtonOff";
var src2="bigButtonOn";
objParam={};
objParam.type="button";
objParam.top=top;
objParam.left=left;
this.base=rialto.widget.AbstractComponent;
this.base(objParam);
this.title=title;
this.enable=true;
this.alt=alt?alt:title;
if(objPar!=null){
if(rialto.lang.isBoolean(objPar.enable)){
this.enable=objPar.enable;
}
}
objParam=null;
objPar=null;
this.base=null;
var oThis=this;
this.textSize=Math.max(getTailleTexte(this.title,"textButton")+13,88);
this.divExt.style.height="18px";
this.divExt.style.top=this.top;
this.divExt.style.left=this.left;
this.divExt.className="test";
this.divExt.style.position=this.position;
this.divExt.style.width=this.textSize;
this.divExt.title=this.alt;
this.imgG=document.createElement("DIV")
this.imgG.className="leftEdgeButtonOff";
this.divCenter=document.createElement("DIV")
this.divCenter.className="centerButtonOff";
this.divCenter.style.width=this.textSize-8;
this._divTitle=document.createElement("DIV")
this._divTitle.className="textButton";
this._divTitle.innerHTML=this.title;
this._divTitleShadow=document.createElement("DIV");
this._divTitleShadow.className="shadowTextButton";
this._divTitleShadow.innerHTML=this.title;
this.imgD=document.createElement("DIV")
this.imgD.className="rightEdgeButtonOff";
this.divExt.appendChild(this.imgG);
this.divExt.appendChild(this.divCenter);
this.divCenter.appendChild(this._divTitleShadow);
this.divCenter.appendChild(this._divTitle);
this.divExt.appendChild(this.imgD);
this.divExt.onmouseout=function(e){
if(oThis.enable){
if(!e)e=window.event;
oThis.switchImage("Off");
this.style.cursor='default';
oThis.onmouseout(e);
}
};
this.divExt.onmouseover=function(e){
if(oThis.enable){
if(!e)e=window.event;
oThis.switchImage("On");
this.style.cursor='pointer';
oThis.onmouseover();
}
};
this.divExt.onclick=function(e){
if(!e)e=window.event;
if(oThis.enable){
oThis.onclick(e);
stopEvent(e);
}
};
if(!this.enable){this.setEnable(this.enable);}
if(parent){this.placeIn(parent);};
}
rialto.widget.Button.prototype=new rialto.widget.AbstractComponent;
rialto.widget.Button.prototype.switchImage=function(status){
this.imgG.className="leftEdgeButton"+status;
this.divCenter.className="centerButton"+status;
this.imgD.className="rightEdgeButton"+status;
}
rialto.widget.Button.prototype.inactive=function(){
rialto.deprecated('Button','inactive','setEnable(false)');
this.setEnable(false);
}
rialto.widget.Button.prototype.active=function(){
rialto.deprecated('Button','active','setEnable(true)');
this.setEnable(true);
}
rialto.widget.Button.prototype.setEnable=function(enable){
if(enable){
this._divTitleShadow.style.display='block';
this._divTitle.className="textButton";
this.switchImage("Off");
}
else{
this._divTitleShadow.style.display='none';
this._divTitle.className="textButtonDisa";
this.switchImage("Disa");
}
this.enable=enable;
}
rialto.widget.Button.prototype.setTitle=function(title){
if(this.alt=this.title){this.alt=title};
this.title=title;
this._divTitleShadow.innerHTML=title;
this._divTitle.innerHTML=title;
}
rialto.widget.Button.prototype.release=function(){
this.divExt.onmouseout=null;
this.divExt.onmouseover=null;
this.divExt.onclick=null;
}
rialto.widget.Radio=function(name,top,left,parent,group,text,checked,className){
var objParam=new Object;
objParam.name=name;
objParam.type="radio";
objParam.left=left;
objParam.top=top;
this.base=rialto.widget.AbstractComponent;
this.base(objParam);
this.base=null;
objParam=null;
this.className="libNormal";
this.checked=false;
this.tabindex=rialto.widget.Form.prototype.tabIndex++;
this.group=group;
this.text=text;
if(rialto.lang.isString(className)){
this.className=className;
}
if(rialto.lang.isBoolean(checked)){
this.checked=checked;
}
this.divExt.id=this.id+"_divExt";
this.divExt.style.position=this.position;
this.divExt.style.left=this.left+"px";
this.divExt.style.top=this.top+"px";
var oThis=this;
var wInnerHTML="";
wInnerHTML='<input type="radio" id="'+this.id+'" name="'+this.group+'" value="'+this.name+'"  />';
this.divExt.innerHTML+=wInnerHTML;
this.radio=this.divExt.firstChild;
this.radio.tabIndex=this.tabindex;
this.lib=new rialto.widget.Label("LIB1",2,20,this.divExt,this.text,this.className,{position:'absolute'});
this.divExt.style.width=this.lib.getTailleTexte()+20;
this.radio.onclick=function(){
oThis.onclick();
}
if(parent){this.placeIn(parent);};
}
rialto.widget.Radio.prototype=new rialto.widget.AbstractComponent;
rialto.widget.Radio.prototype.adaptToContext=function(){
this.radio.checked=this.checked;
}
rialto.widget.Radio.prototype.getCheck=function(){
return this.radio.checked;
}
rialto.widget.Radio.prototype.coche=function(){
rialto.deprecated('Radio','coche','setCheck(true)');
this.setCheck(true);
}
rialto.widget.Radio.prototype.decoche=function(){
rialto.deprecated('Radio','decoche','setCheck(false)');
this.setCheck(false);
}
rialto.widget.Radio.prototype.setCheck=function(check,boolC){
this.radio.checked=check;
this.checked=check;
}
rialto.widget.Radio.prototype.release=function(){
this.radio.onclick=null;
this.lib.remove();
}
rialto.widget.Calendar=function(objPar){
if(!objPar){var objPar={}};
objPar.type="calendar";
this.base=rialto.widget.AbstractComponent;
this.base(objPar);
this.dateMin=null;
this.dateMax=null;
this.bOpenOnLastDate=true;
this.bUkFormat=false;
this.popUpMode=false;
this.arrDay=new Array(31);
this.currentDate=rialto.date.toDay();
if(objPar!=null){
if(rialto.lang.isDate(objPar.dateMin)){
this.dateMin=objPar.dateMin;
}
if(rialto.lang.isDate(objPar.dateMax)){
this.dateMax=objPar.dateMax;
if(this.dateMin&&this.dateMax<this.dateMin){
var d=this.dateMin;
this.dateMin=this.dateMax;
this.dateMax=d;
}
}
if(rialto.lang.isDate(objPar.currentDate)){
this.currentDate=objPar.currentDate;
}
if(rialto.lang.isBoolean(objPar.bOpenOnLastDate)){
this.bOpenOnLastDate=objPar.bOpenOnLastDate;
}
if(rialto.lang.isBoolean(objPar.popUpMode)){
this.popUpMode=objPar.popUpMode;
}
if(rialto.lang.isBoolean(objPar.bUkFormat)){
this.bUkFormat=objPar.bUkFormat;
}
}
this._SpecialDate=new Array,
this.setCurrent();
this.createCalendar(objPar.parent);
objPar=null;
this.base=null;
}
rialto.widget.Calendar.prototype=new rialto.widget.AbstractComponent;
rialto.widget.Calendar.prototype._Holidays=new Array("01/01","01/05","08/05","14/07","15/08","01/11","11/11","25/12");
rialto.widget.Calendar.prototype._Month=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
rialto.widget.Calendar.prototype._Day=new Array('Mon','Tue','Wed','Thu','Fri','Sat','Sun');
rialto.widget.Calendar.prototype._LastDayInMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
rialto.widget.Calendar.prototype.DimanchePaques=false;
rialto.widget.Calendar.prototype.isDate=function(wDate){
return(wDate instanceof Date);
}
rialto.widget.Calendar.prototype.isHolidays=function(jf,mf){
var i=0
mf+=1;
for(var i in this._Holidays){
if(test=(((jf<10)?'0'+jf:jf)+'/'+((mf<10)?'0'+mf:mf))==this._Holidays[i++])return true;}
return false;
}
rialto.widget.Calendar.prototype.isWeekEnd=function(jwe){
return(((jwe==5)||(jwe==6))?true:false);
}
rialto.widget.Calendar.prototype.isToday=function(day){
var date1=new Date(this.currentYear,this.currentMonth,day);
return rialto.date.equals(date1,rialto.date.toDay());
}
rialto.widget.Calendar.prototype.isDisable=function(day){
var dTest=new Date(this.currentYear,this.currentMonth,day);
var check=false;
if(rialto.lang.isDate(this.dateMin)&&dTest<this.dateMin){check=true;}
if(rialto.lang.isDate(this.dateMax)&&dTest>this.dateMax){check=true;}
return check;
}
rialto.widget.Calendar.prototype.isPaques=function(pan){
this.DimanchePaques=true;
var b=pan-1900;
var c=pan%19;
var d=Math.floor((7*c+1)/19);
var e=(11*c+4-d)%29;
var f=Math.floor(b/4);
var g=(b+f+31-e)%7;
var date=25-e-g;
if(date>0){mois=4}
else{date=31+date;mois=3};
date=((date<10)?'0'+date:date);
this._Holidays.push(((date<10)?'0'+date:date)+'/'+((mois<10)?'0'+mois:mois));
date+=1;
if((date>31)&&(mois=3)){date=1;mois+=1}
this._Holidays.push(((date<10)?'0'+date:date)+'/'+((mois<10)?'0'+mois:mois));
date+=38;
while(date>31){var tt=0;date-=this._LastDayInMonth[mois-1+tt];tt++;mois+=1}
this._Holidays.push(((date<10)?'0'+date:date)+'/'+((mois<10)?'0'+mois:mois));
date+=10;
while(date>31){var tt=0;date-=this._LastDayInMonth[mois-1+tt];mois+=1}
this._Holidays.push(((date<10)?'0'+date:date)+'/'+((mois<10)?'0'+mois:mois));
}
rialto.widget.Calendar.prototype.setCurrent=function(){
this.currentDay=this.currentDate.getDate();
this.currentMonth=this.currentDate.getMonth();
this.currentYear=this.currentDate.getFullYear();
}
rialto.widget.Calendar.prototype.setSpecialDate=function(date,color,text){
this._SpecialDate.push([date,color,text]);
}
rialto.widget.Calendar.prototype.removeSpecialDate=function(){
this._SpecialDate=new Array;
}
rialto.widget.Calendar.prototype.isInSpecialDate=function(date){
for(var i=0;i<this._SpecialDate.length;i++){
if(rialto.lang.isDate(this._SpecialDate[i][0])){
if(rialto.date.equals(this._SpecialDate[i][0],date)){
return i;
}
}
else{
var inter=this._SpecialDate[i][0];
if(date>=inter[0]&&date<=inter[1]){
return i;
}
}
}
return -1;
}
rialto.widget.Calendar.prototype.setMonthYear=function(m,a){
if(m>11){
m=0;
a++;
}
if(m<0){
m=11;
a--;
}
this.currentMonth=m;
this.currentYear=a;
this.fillCalendar();
}
rialto.widget.Calendar.prototype.displayCalendar=function(top,left){
if(!this.bOpenOnLastDate){
this.setCurrent();
}
this.fillCalendar();
if(this.popUpMode){
this.liste.setPosTop(top);
this.liste.setPosLeft(left);
this.liste.affichezoneMenu();
}
}
rialto.widget.Calendar.prototype.createCalendar=function(parent){
var oThis=this;
this.divExt.id="divExt";
this.divExt.style.position="absolute";
this.divExt.style.zIndex=1000;
this.divExt.style.width=200;
this.divExt.onclick=function(e){
if(!e)e=window.event;
stopEvent(e);
}
oParent=this.divExt;
var divDeco=new objDiv3D('','cadreFenetreSansTirette','sansInnerHtml')
divDeco.createDiv3D(oParent);
this.header=document.createElement("DIV");
this.header.style.width='100%';
this.header.style.height='30px';
this.header.style.position='absolute';
this.header.style.top=0;
this.header.style.left=0;
this.divExt.appendChild(this.header);
oParent=this.header;
this.btnPreviousYear=new rialto.widget.Image("btonFirstDoctOff",5,5,oParent,"Previous year","btonFirstDoctOn",{position:'absolute'});
this.btnPreviousYear.onclick=function(){oThis.setMonthYear(oThis.currentMonth,oThis.currentYear-1);};
this.btnPreviousMonth=new rialto.widget.Image("leftArrowOff",25,5,oParent,"Previous month","leftArrowOn",{position:'absolute'});
this.btnPreviousMonth.onclick=function(){oThis.setMonthYear(oThis.currentMonth-1,oThis.currentYear)};
this.currentMonthYear=document.createElement("DIV");
this.currentMonthYear.className="Div_MoisEnCours";
this.header.appendChild(this.currentMonthYear);
this.btnNextMonth=new rialto.widget.Image("rightArrowOff",143,5,oParent,"Next month","rightArrowOn",{position:'absolute'});
this.btnNextMonth.onclick=function(){oThis.setMonthYear(oThis.currentMonth+1,oThis.currentYear)};
this.btnNextYear=new rialto.widget.Image("btonLastDoctOff",160,5,oParent,"Next year","btonLastDoctOn",{position:'absolute'});
this.btnNextYear.onclick=function(){oThis.setMonthYear(oThis.currentMonth,oThis.currentYear+1)};
if(this.popUpMode){
this.btnClose=new rialto.widget.Image("redCloseButtonOff",180,5,oParent,"Close","grayCloseButtonOn",{position:'absolute'});
this.btnClose.onclick=function(){oThis.closeCalendar();}
}
for(var j=0;j<7;j++){
var LibelleCelluleCalendar=document.createElement("DIV");
LibelleCelluleCalendar.id="Calendar-Jour";
LibelleCelluleCalendar.className="Calendar-Jour";
LibelleCelluleCalendar.style.left=(5+(j*25))+"px";
if(j!=6){LibelleCelluleCalendar.style.borderRight="1px solid #4AA5C9";}
this.header.appendChild(LibelleCelluleCalendar);
LibelleCelluleCalendar.innerHTML=this._Day[j];
}
this.zoneCalendar=document.createElement("DIV");
this.zoneCalendar.style.width='100%';
this.zoneCalendar.style.position='absolute';
this.zoneCalendar.style.top=50;
this.zoneCalendar.style.left=0;
this.divExt.appendChild(this.zoneCalendar);
if(this.popUpMode){
var obj={name:"MENU-CALENDAR",posFixe:true};
this.liste=new rialto.widget.simpleMenu(obj);
this.liste.add(this.divExt);
}
else{
if(parent){
this.divExt.style.top=this.top;
this.divExt.style.left=this.left;
this.placeIn(parent);
this.fillCalendar();
}
}
}
rialto.widget.Calendar.prototype.afterOnClick=function(day,oHtml){
this.currentDate=new Date(this.currentYear,this.currentMonth,day);
var clickDay=day<10?'0'+day:day;
var clickMonth=this.currentMonth+1<10?'0'+(this.currentMonth+1):this.currentMonth+1;
var clickYear=this.currentYear;
if(this.clickDiv){
this.setSytleOfOneDay(this.clickDiv);
}
if(oHtml){
this.setSytleOfOneDay(oHtml);
}
var strDate="/"+clickYear;
if(this.bUkFormat){
strDate=clickMonth+"/"+clickDay+strDate
}
else{
strDate=clickDay+"/"+clickMonth+strDate
}
this.onclick(strDate);
if(this.popUpMode){this.closeCalendar();}
}
rialto.widget.Calendar.prototype.onclick=function(dateSel){
}
rialto.widget.Calendar.prototype.closeCalendar=function(){
if(this.popUpMode){this.liste.fermezoneMenu();}
}
rialto.widget.Calendar.prototype.fillCalendar=function(){
var oThis=this;
this.zoneCalendar.innerHTML="";
text=this._Month[this.currentMonth]+" "+this.currentYear;
this.currentMonthYear.innerHTML=text;
this.firstDay=new Date(this.currentYear,this.currentMonth).getDay()-1;
if(rialto.date.isBissextile(this.currentYear)){this._LastDayInMonth[1]=29;}else{this._LastDayInMonth[1]=28;}
if(!this.DimanchePaques){this.isPaques(this.currentYear)};
var nbCol=Math.ceil((this.firstDay+this._LastDayInMonth[this.currentMonth])/7);
if(nbCol>5){
this.divExt.style.height=150;
}
else{
this.divExt.style.height=135;
}
var oThis=this;
for(s=0;s<nbCol;s++){
for(j=0;j<7;j++){
var day=7*s+j-this.firstDay+1;
var oneDay=document.createElement("DIV");
oneDay.className="Calendar-zoneprincipale";
oneDay.style.position="absolute";
oneDay.style.left=(5+(j*25))+"px";
oneDay.style.top=(s*15)+"px";
oneDay.style.width="25px";
oneDay.style.height="15px";
oneDay.borderStyle={};
if(s<nbCol){
oneDay.borderStyle.borderBottom="1px solid #4AA5C9";
oneDay.style.borderBottom="1px solid #4AA5C9";
}
if(j!=6){
oneDay.borderStyle.borderRight="1px solid #4AA5C9";
oneDay.style.borderRight="1px solid #4AA5C9";
}
this.zoneCalendar.appendChild(oneDay);
if(day>0&&day<=this._LastDayInMonth[this.currentMonth]){
oneDay.id=day;
oneDay.innerHTML=day;
this.arrDay[day]=oneDay;
oneDay.onclick=function(){
oThis.afterOnClick(this.id,this);
}
this.setSytleOfOneDay(oneDay);
if(day==this._LastDayInMonth[this.currentMonth])break;
}
}
}
oneDay=null;
}
rialto.widget.Calendar.prototype.setSytleOfOneDay=function(oneDay){
var day=oneDay.id;
var s=oneDay.style;
s.fontWeight="";
s.backgroundColor="";
s.width="25px";
s.height="15px";
s.borderTop="0px solid #4AA5C9";
s.borderLeft="0px solid #4AA5C9";
s.borderBottom="0px solid #4AA5C9";
s.borderRight="0px solid #4AA5C9";
s.color="#0069B3";
for(prop in oneDay.borderStyle){
s[prop]=oneDay.borderStyle[prop];
}
if(this.isDisable(day)){
s.color='#AAAAAA';
s.fontStyle='italic';
s.cursor='default';
}
else{
var date1=new Date(this.currentYear,this.currentMonth,day);
if(this.isWeekEnd(j)){
s.color="green";
}
if(this.isHolidays(day,this.currentMonth)){
s.color="red";
}
if(this.isToday(day)){
s.backgroundColor='#00CCFF';
}
if(rialto.date.equals(date1,this.currentDate)){
this.clickDiv=oneDay;
s.border='1px solid red';
s.height="13px";
s.width="23px";
s.fontWeight="bold";
}
ind=this.isInSpecialDate(date1);
if(ind!=-1){
s.backgroundColor=this._SpecialDate[ind][1];
oneDay.title=this._SpecialDate[ind][2];
}
}
}
rialto.widget.Calendar.prototype.release=function(){
this.divExt.onclick=null;
for(i=0;i<32;i++){
if(this.arrDay[i]){
this.arrDay[i].onclick=null;
this.arrDay[i]=null;
}
}
this.btnPreviousYear.remove();
this.btnPreviousYear.onclick=null;
this.btnPreviousMonth.remove();
this.btnPreviousMonth.onclick=null;
this.btnNextMonth.remove();
this.btnNextMonth.onclick=null;
this.btnNextYear.remove();
this.btnNextYear.onclick=null;
if(this.popUpMode){
this.liste.remove();
this.btnClose.remove();
this.btnClose.onclick=null;
}
}
rialto.widget.Calendar.prototype.getHtmlExt=function(){
return this.divExt;
}
rialto.widget.Checkbox=function(name,top,left,parent,text,checked,className){
var objParam=new Object;
objParam.name=name;
objParam.type="checkbox";
objParam.left=left;
objParam.top=top;
this.base=rialto.widget.AbstractComponent;
this.base(objParam);
objParam=null;
this.className="libelle1";
this.initChecked=false;
this.tabindex=rialto.widget.Form.prototype.tabIndex++;
this.text=text;
if(rialto.lang.isString(className)){
this.className=className;
}
if(rialto.lang.isBoolean(checked)){
this.initChecked=checked;
}
var oThis=this;
this.divExt.id=this.id+"_divExt";
this.divExt.style.position=this.position;
this.divExt.style.left=this.left+"px";
this.divExt.style.top=this.top+"px";
this.checkbox=document.createElement("INPUT");
this.checkbox.type="checkbox";
this.checkbox.id=this.id+"_Check";
this.checkbox.name=this.name;
this.checkbox.tabIndex=this.tabIndex;
this.divExt.appendChild(this.checkbox);
this.checkbox.onclick=function(){
oThis.checked=this.checked;
this.value=this.checked;
oThis.onclick();
};
this.lib=new rialto.widget.Label("LIB1",3,20,this.divExt,this.text,this.className,{position:'absolute'});
this.divExt.style.width=this.lib.getTailleTexte()+20;
if(parent){this.placeIn(parent);};
}
rialto.widget.Checkbox.prototype=new rialto.widget.AbstractComponent;
rialto.widget.Checkbox.prototype.adaptToContext=function(){
this.setCheck(this.initChecked,false);
}
rialto.widget.Checkbox.prototype.active=function(){
rialto.deprecated('Checkbox','active','setEnable(true)');
this.setEnable(true);
}
rialto.widget.Checkbox.prototype.inactive=function(){
rialto.deprecated('Checkbox','inactive','setEnable(false)');
this.setEnable(false);
}
rialto.widget.Checkbox.prototype.setEnable=function(enable){
if(enable){
this.checkbox.disabled=false;
}
else{
this.checkbox.disabled=true;
}
this.enable=enable;
}
rialto.widget.Checkbox.prototype.coche=function(boolC){
rialto.deprecated('Checkbox','coche(boolC)','setCheck(true,boolC)');
this.setCheck(true,boolC);
}
rialto.widget.Checkbox.prototype.decoche=function(boolC){
rialto.deprecated('Checkbox','decoche(boolC)','setCheck(false,boolC)');
this.setCheck(false,boolC);
}
rialto.widget.Checkbox.prototype.setCheck=function(check,boolC){
this.checkbox.checked=check
this.checked=check;
this.checkbox.value=check;
if(boolC)this.onclick();
}
rialto.widget.Checkbox.prototype.getCheck=function(){
return this.checkbox.checked;
}
rialto.widget.Checkbox.prototype.release=function(){
this.checkbox.onclick=null;
this.lib.remove();
}
rialto.widget.codeLabel=function(codeName,top,left,width,parent,objPar){
var objParam={
type:"codelib",
name:codeName,
left:left,
top:top,
width:width
}
this.base=rialto.widget.AbstractComponent;
this.base(objParam);
this.boolWithLabel=true;
this.url=null;
this.submitOnload=true;
this.arrPermValue=new Array;
this.codeWidth=40;
this.alwaysRefresh=false;
this.dataLoadOnce=false;
if(objPar!=null){
if(objPar.arrValue){
this.arrPermValue=objPar.arrValue;
}
if(rialto.lang.isBoolean(objPar.boolWithLabel)){
this.boolWithLabel=objPar.boolWithLabel;
}
if(objPar.url){
this.url=objPar.url;
}
if(rialto.lang.isBoolean(objPar.submitOnload)){
this.submitOnload=objPar.submitOnload;
}
if(rialto.lang.isBoolean(objPar.alwaysRefresh)){
this.alwaysRefresh=objPar.alwaysRefresh;
}
if(rialto.lang.isNumber(objPar.codeWidth)){
this.codeWidth=objPar.codeWidth!=0?objPar.codeWidth:40;
}
}
if(!this.boolWithLabel){
this.codeWidth=this.width-27;
}
objPar=null;
objParam=null;
this.base=null;
var oThis=this;
this.divExt.className='codeLibelle-divGen';
this.divExt.style.width=this.width;
this.divExt.style.top=this.top;
this.divExt.style.left=this.left;
this.code=new rialto.widget.Text(this.name,0,0,this.codeWidth,"A",this.divExt,{autoUp:false,position:'absolute'});
this.img=new rialto.widget.Image('pinkHelpButton',this.codeWidth,-2,this.divExt,"aide",'redHelpButton',{position:'absolute'});
if(this.boolWithLabel){
this.label=new rialto.widget.Text("LIB"+this.name,0,this.codeWidth+27,this.width-(this.codeWidth+27),"A",this.divExt,{disable:true,position:'absolute'});
this.label.setStyle({backgroundColor:'#E2F4FF'});
}
this.img.onclick=function(){
var fen=new FenRech(oThis,true);
};
if(this.url){
this.remote=new rialto.io.AjaxRequest({
url:this.url,
method:'get',
callBackObjectOnSuccess:this,
withWaitWindow:true,
onSuccess:this.refreshPermissiveValue
})
}
this.code.onblur=function(){
if(oThis.code.getValue()!=""){
if(this.wchanged){
oThis.checkValue();
}
}
}
if(parent){this.placeIn(parent);};
}
rialto.widget.codeLabel.prototype=new rialto.widget.AbstractComponent;
rialto.widget.codeLabel.prototype.release=function(){
this.code.remove();
this.img.remove();
this.img.onclick=null;
if(this.boolWithLabel){
this.label.remove();
}
}
rialto.widget.codeLabel.prototype.checkValue=function(){
if((this.url&&this.alwaysRefresh)||(this.url&&!this.dataLoadOnce)){
var pars="CODE="+this.getValue();
this.remote.load(pars);
}
else{
this.checkInPermissiveValue();
}
}
rialto.widget.codeLabel.prototype.checkInPermissiveValue=function(){
var ind=this.indexOf(this.getValue());
if(ind!=-1){
if(this.boolWithLabel){
this.label.setValue(this.arrPermValue[ind][1]);
}
this.code.removeAsRequired();
}
else{
if(this.boolWithLabel){
this.label.setValue("?");
}
info=new rialto.widget.Alert("Invalid code");
this.code.showAsRequired();
this.code.setFocus();
}
}
rialto.widget.codeLabel.prototype.indexOf=function(obj){
for(var i=0;i<this.arrPermValue.length;i++){
if(this.arrPermValue[i][0]==obj){
return i;
}
}
return -1;
}
rialto.widget.codeLabel.prototype.setPermissiveValue=function(arrPermValue){
this.arrPermValue=arrPermValue;
}
rialto.widget.codeLabel.prototype.getValue=function(){
return this.code.getValue();
}
rialto.widget.codeLabel.prototype.isNotEmpty=function(){
return(this.label.getValue()!="");
}
rialto.widget.codeLabel.prototype.setValue=function(code,libelle){
this.code.setValue(code);
if(this.boolWithLabel){
this.label.setValue(libelle);
}
this.code.removeAsRequired();
}
rialto.widget.codeLabel.prototype.refreshPermissiveValue=function(request){
var res=eval("("+request.responseText+")");
this.setPermissiveValue(res);
this.checkInPermissiveValue();
this.dataLoadOnce=true;
}
rialto.widget.codeLabel.prototype.checkOneValue=function(request){
var res=eval("("+request.responseText+")");
if(res.codeOk&&this.boolWithLabel){
this.label.setValue(res.label);
}
this.dataLoadOnce=true;
}
rialto.widget.codeLabel.prototype.active=function(){
rialto.deprecated('CodeLib','active','setEnable(true)');
this.setEnable(true);
}
rialto.widget.codeLabel.prototype.inactive=function(){
rialto.deprecated('CodeLib','inactive','setEnable(false)');
this.setEnable(false);
}
rialto.widget.codeLabel.prototype.setEnable=function(enable){
if(enable){
this.code.setEnable(true);
if(this.boolWithLabel){
this.label.setEnable(true);
this.label.setStyle({backgroundColor:'#E2F4FF'});
}
this.img.setEnable(true);
}
else{
this.setValue("","");
this.code.setEnable(false);
if(this.boolWithLabel){this.label.setEnable(false);}
this.img.setEnable(false);
}
this.enable=enable;
}
FenRech.prototype.nbreInstance=0;
function FenRech(refParent,sumitOnload){
this.id="FenRechCodeLib_"+FenRech.prototype.nbreInstance++;
rialto.session.reccord(this,this.id);
var oThis=this;
this.refParent=refParent;
this.fen=new rialto.widget.PopUp("fen",50,200,420,410,"","Help","transparent");
this.fen.onClose=function(){
oThis.remove();
}
this.CADRE1=new rialto.widget.Frame({name:'CADRE1',
top:10,left:10,width:375,height:45,
title:"code/label wanted",
dynamic:false,
open:true,
parent:this.fen}
);
var url=this.refParent.url;
var obj={boolWithFenWait:true,callBackObjectOnSuccess:this,onSuccess:this.refreshData}
this.FORM1=new rialto.widget.Form("FORM1",url,this.CADRE1,obj);
oParent=this.FORM1;
this.CODE=new rialto.widget.Text("CODE",10,5,260,"A",oParent,{position:'absolute'});
this.BRECH=new rialto.widget.Button(11,270,"Find","Find",oParent)
this.BRECH.onclick=function(){
if((oThis.refParent.url&&oThis.refParent.alwaysRefresh)||(oThis.refParent.url&&!oThis.refParent.dataLoadOnce)){
oThis.FORM1.submitForm();
}
else{
oThis.arrPermValue=oThis.refParent.arrPermValue
oThis.checkInPermissiveValue();
}
};
if(this.refParent.boolWithLabel){
tabEntete=["Code","Label"];
tabTypeCol=[["string",85],["string",205]];
}
else{
tabEntete=["Code"];
tabTypeCol=[["string",290]];
}
this.tableauRes=new rialto.widget.Grid(
{TabEntete:tabEntete,
name:"TabRvMvt",
top:65,
left:10,
height:310,
bNavig:false,
rang:12,
tabTypeCol:tabTypeCol,
objPar:{autoWidth:true},
parent:this.fen
});
this.tableauRes.onclick=function(indLigne,indCell)
{
oThis.code=this.tabData[indLigne][0];
oThis.lib=this.tabData[indLigne][1];
}
this.tableauRes.ondbleclick=function(indLigne,indCell)
{
var code=this.tabData[indLigne][0];
var lib=this.tabData[indLigne][1];
oThis.refParent.setValue(code,lib);
oThis.fen.close();
}
this.BENTR=new rialto.widget.Button(385,170,"Select","Select",this.fen)
this.BENTR.onclick=function(){
oThis.refParent.setValue(oThis.code,oThis.lib);
oThis.fen.close();
}
if(sumitOnload){
this.BRECH.onclick();
}
}
FenRech.prototype.checkInPermissiveValue=function(){
var text=this.CODE.getValue()
var arr=new Array;
if(text==""){
arr=this.refParent.arrPermValue;
}
else{
for(var i=0;i<this.refParent.arrPermValue.length;i++){
for(var j=0;j<this.refParent.arrPermValue[i].length;j++){
if(this.refParent.arrPermValue[i][j].indexOf(text)!=-1){
arr.push(this.refParent.arrPermValue[i]);
j=this.refParent.arrPermValue[i].length;
}
}
}
}
if(arr.length==0){
info=new rialto.widget.Alert("No code match");
}
this.tableauRes.fillGrid(arr);
}
FenRech.prototype.remove=function(request){
this.BRECH.onclick=null;
this.BENTR.onclick=null;
this.tableauRes.onclick=null;
this.tableauRes.ondbleclick=null;
this.CADRE1.remove();
this.BENTR.remove();
this.tableauRes.remove();
rialto.session.objects[this.id]=null;
}
FenRech.prototype.refreshData=function(request){
var res=eval("("+request.responseText+")");
this.arrPermValue=res;
this.tableauRes.fillGrid(this.arrPermValue);
this.refParent.arrPermValue=this.arrPermValue;
this.refParent.dataLoadOnce=true;
}
rialto.widget.Combo=function(tabData,name,top,left,width,parent,objPar)
{
var objParam=new Object;
objParam.name=name;
objParam.type="combo";
objParam.left=left;
objParam.top=top;
objParam.width=width;
if(objPar!=null){
objParam.position=objPar.position;
}
this.base=rialto.widget.AbstractComponent;
this.base(objParam);
this.enable=true;
this.suggest=true;
this.open=false;
this.heightItem=23;
if(objPar!=null){
if(rialto.lang.isBoolean(objPar.suggest)){
this.suggest=objPar.suggest;
}
if(rialto.lang.isBoolean(objPar.enable)){
this.enable=objPar.enable;
}
if(rialto.lang.isNumber(objPar.heightItem)){
this.heightItem=objPar.heightItem;
}
}
objPar=null;
objParam=null;
this.base=null;
this.currentIndex=-1;
var oThis=this;
this.divExt.id=this.id+"_divExt";
this.divExt.style.position=this.position;
this.divExt.style.width=this.width;
this.divExt.style.left=this.left+"px";
this.divExt.style.top=this.top+"px";
this.textValue=new rialto.widget.Text(this.name,0,0,'',"Hi",this.divExt);
this.text=new rialto.widget.Text(this.name+"_text",0,0,parseInt(this.width)-14,"A",this.divExt,{autoUp:false,position:'absolute'});
this.text.champs.className="combo-input";
this.text.champs.style.border="1px solid rgb(120,172,255)";
if(this.suggest){
this.text.champs.onkeyup=function(e){
if(!e)var e=window.event;
return oThis.checkKeyPress(e);
stopEvent(e);
}
this.text.champs.onkeypress=function(e){
if(!e)var e=window.event;
return true;
stopEvent(e);
};
}
this.text.champs.onblur=function(){
oThis.setOpen(false);
}
this.bouton=document.createElement("DIV");
this.img=new rialto.widget.Image("bigDownArrow",0,0,this.bouton,"open","",{position:'absolute'});
this.bouton.className="combo-bouton";
this.img.onclick=function(){
if(oThis.enable){
oThis.setOpen(!oThis.open);
}
}
this.divExt.appendChild(this.bouton);
var obj={name:"MENU-COMBO"
,posFixe:true
,width:parseInt(this.divExt.style.width)-4
,className:"combo-list"}
this.opslist=new rialto.widget.simpleMenu(obj);
this.opslist.onClose=function(){
oThis.setOpen(false);
}
this.opslist.onclick=function(item){
oThis.selInd(item.index);
}
this.opslist.onOver=function(item){
if(oThis.lastOver&&oThis.lastOver!=item){
oThis.lastOver.out();
}
oThis.lastOver=item;
oThis.currentIndex=item.index;
}
if(parent){this.placeIn(parent);};
if(!this.enable){
this.setEnable(false);
}
this.setData(tabData)
}
rialto.widget.Combo.prototype=new rialto.widget.AbstractComponent;
rialto.widget.Combo.prototype.release=function(){
this.text.champs.onkeypress=null;
this.text.champs.onkeyup=null;
this.text.champs.onblur=null;
this.opslist.onClose=null;
this.opslist.onclick=null;
this.opslist.onOver=null;
this.img.onclick=null;
this.img.remove();
this.text.remove();
this.textValue.remove();
this.opslist.remove();
}
rialto.widget.Combo.prototype.setData=function(tabData)
{
this.tabData=tabData;
this.initListItem=new Array();
this.currentListItem=new Array();
for(i=0;i<this.tabData.length;i++){
var item=new ComboItem(this.tabData[i][0],this.tabData[i][1]);
this.initListItem.push(item);
this.currentListItem.push(item);
}
}
rialto.widget.Combo.prototype.checkKeyPress=function(evt){
var keyCode=evt.keyCode?evt.keyCode:
evt.charCode?evt.charCode:
evt.which?evt.which:void 0;
if(keyCode==38||keyCode==40||keyCode==13){
if(!this.open){
this.prepareList();
this.setOpen(true);
}
switch(keyCode)
{
case 38:
if(this.currentIndex>0){
this.currentIndex-=1;
}
else{
this.currentIndex=0
}
if(this.lastOver){this.lastOver.out();}
this.lastOver=this.opslist.tabItem[this.currentIndex];
this.lastOver.over();
break;
case 40:
if(this.currentIndex<this.currentListItem.length-1){
this.currentIndex+=1;
};
if(this.lastOver){this.lastOver.out();}
this.lastOver=this.opslist.tabItem[this.currentIndex];
this.lastOver.over();
break;
case 13:
if(this.currentIndex>=0){
this.opslist.onclick(this.lastOver);
}
break;
default:
break;
}
return false;
}
else{
this.prepareList();
if(this.currentListItem.length>0)
{
this.setOpen(true);
}
else{
this.setOpen(false);
}
return true
}
}
rialto.widget.Combo.prototype.open=function(){
rialto.deprecated('Combo','open','setOpen(true)');
this.setOpen(true);
}
rialto.widget.Combo.prototype.close=function(){
rialto.deprecated('Combo','close','setOpen(false)');
this.setOpen(false);
}
rialto.widget.Combo.prototype.setOpen=function(open){
if(open){
this.displayList(this.currentListItem);
}
if(open==this.open){return;}
this.open=open;
if(open){
this.img.setImageReference("bigUpArrow");
this.opslist.setPosTop(compOffsetTop(this.divExt)+22);
this.opslist.setPosLeft(compOffsetLeft(this.divExt)+2);
this.opslist.affichezoneMenu(evt=null,heightCombo=22);
}
else{
this.img.setImageReference("bigDownArrow");
this.currentIndex=-1;
if(this.opslist.ouvert){this.opslist.fermezoneMenu();}
}
}
rialto.widget.Combo.prototype.prepareList=function()
{
this.currentListItem=new Array;
strSaisi=this.text.getValue().toLowerCase();
for(i=0;i<this.initListItem.length;i++){
if(this.initListItem[i].text.toLowerCase().indexOf(strSaisi)==0){
this.currentListItem.push(this.initListItem[i]);
}
}
}
rialto.widget.Combo.prototype.displayList=function(arr)
{
this.opslist.clear();
this.lastOver=null;
this.currentIndex=-1;
for(var i=0;i<arr.length;i++)
{
var obj={text:""+arr[i].text,height:this.heightItem,bNotOut:true}
var item=this.opslist.addItem(obj)
item.val=arr[i].value;
item.index=i;
}
}
rialto.widget.Combo.prototype.addItem=function(valeur,text)
{
var combItem=new ComboItem(valeur,text);
this.initListItem.push(combItem);
this.currentListItem.push(combItem);
}
rialto.widget.Combo.prototype.masque=function(){
rialto.deprecated('Combo','masque','setVisible(false)');
this.setVisible(false);
}
rialto.widget.Combo.prototype.affiche=function(){
rialto.deprecated('Combo','affiche','setVisible(true)');
this.setVisible(true);
}
rialto.widget.Combo.prototype.selLast=function(){
var indLast=this.initListItem.length-1;
this.selInd(indLast);
}
rialto.widget.Combo.prototype.selInd=function(ind){
if(ind>=0&&ind<this.currentListItem.length){
if(this.opslist.ouvert){this.setOpen(false);}
var text=this.currentListItem[ind].text;
var value=this.currentListItem[ind].value;
this.text.setValue(text);
this.textValue.setValue(value);
this.onclick(value,text);
}
}
rialto.widget.Combo.prototype.selFirst=function(){
this.selInd(0);
}
rialto.widget.Combo.prototype.selWithValue=function(value){
var ind=this.indexOf(value);
if(ind!=-1){
this.selInd(ind);
}
}
rialto.widget.Combo.prototype.selWithText=function(text){
var ind=this.indexOfText(text);
if(ind!=-1){
this.selInd(ind);
}
}
rialto.widget.Combo.prototype.indexOf=function(value){
for(i=0;i<this.initListItem.length;i++)
{
if(this.initListItem[i].value==value){
return i;
}
}
return -1;
}
rialto.widget.Combo.prototype.indexOfText=function(text){
for(i=0;i<this.initListItem.length;i++)
{
if(this.initListItem[i].text==text){
return i;
}
}
return -1;
}
rialto.widget.Combo.prototype.active=function(){
rialto.deprecated('Combo','active','setEnable(true)');
this.setEnable(true);
}
rialto.widget.Combo.prototype.inactive=function(){
rialto.deprecated('Combo','inactive','setEnable(false)');
this.setEnable(false);
}
rialto.widget.Combo.prototype.setEnable=function(enable){
if(enable){
this.text.setEnable(true);
}
else{
this.text.setEnable(false);
}
this.text.champs.className="combo-input";
this.text.champs.style.border="1px solid rgb(120,172,255)";
this.enable=enable;
}
rialto.widget.Combo.prototype.setFocus=function(){
this.text.setFocus();
}
rialto.widget.Combo.prototype.getSelValue=function(){
return this.textValue.getValue();
}
rialto.widget.Combo.prototype.getValue=function(){
return this.text.getValue();
}
rialto.widget.Combo.prototype.getSelText=function(){
return this.text.getValue();
}
rialto.widget.Combo.prototype.getText=function(ind){
if(ind>=0&&ind<this.initListItem.length)
return this.initListItem[ind].text
else return null
}
rialto.widget.Combo.prototype.getValue=function(ind){
if(ind>=0&&ind<this.initListItem.length)
return this.initListItem[ind].text
else return null
}
rialto.widget.Combo.prototype.onclick=function(value,text){}
function ComboItem(value,text){
this.text=text;
this.value=value;
}
function ButtonPanel(specs,oConcerne,fctActivOConcerne,decor,tabRoute,automate){
this.makeAction=automate;
this.tabRoute=tabRoute;
this.lastPlace=0;
this.decorDockBar=decor;
this.oConcerne=oConcerne;
this.fctActivOConcerne=fctActivOConcerne;
this.posFirstButton=specs.posFirstButton||0;
var posBtonsLies=specs.posBtonsLies;
var posBtonsLiesF=posBtonsLies.replace(/\s+/g,'')+'-';
this.posBtonLie=posBtonsLies.split('-');
if(specs.tBtons){
this.tBtons=specs.tBtons;
for(var i=0;i<this.tBtons.length;i++){
this.tBtons[i].inPanel(panel=this,posDsSerieBtonLie=this.posBtonLie[i]);
var opt=this.tBtons[i].lOptions.bottom();
do{
if(!this['bton'+opt]){
this['bton'+opt]=new Array;
}
this['bton'+opt].push(this.tBtons[i]);
}while(opt=this.tBtons[i].lOptions.next())
}
}
else{
var strBtons=specs.strBtons;
var sBtons=strBtons.replace(/\s+|\(|\)/g,'');
var tLstOpt=sBtons.split('+');
this.tBtons=new Array;
for(var i=0;i<tLstOpt.length;i++){
this.addOneBton(tLstOpt[i],i,this.posBtonLie[i]);
}
}
this.state=this.tabRoute.initState;
this.$displayLinkedBton();
}
ButtonPanel.prototype.remove=function(){
while(this.lastPlace!=-1){
this.tBtons[this.lastPlace].remove();
this.tBtons[this.lastPlace]=null;
this.lastPlace--;
}
}
ButtonPanel.prototype.addOneBton=function(spec,place,posDsSerieBtonsLies){
traceExec('addoneBton place='+place,62);
if(this.tBtons[place]!=null){
this.tBtons[place]=new ModalButton(spec,place,posDsSerieBtonsLies,this,
this.oConcerne,this.fctActivOConcerne,this.decorDockBar);
}
else{
while(place>(this.lastPlace+1)){
this.lastPlace++;
this.tBtons[this.lastPlace]=new ModalButton('espace',this.lastPlace,-1,this,
this.oConcerne,this.fctActivOConcerne,this.decorDockBar);
traceExec('this.lastPlace = '+this.lastPlace,62);
}
this.tBtons[place]=new ModalButton(spec,place,posDsSerieBtonsLies,this,
this.oConcerne,this.fctActivOConcerne,this.decorDockBar);
this.lastPlace=Math.max(place,this.lastPlace);
traceExec('this.lastPlace = '+this.lastPlace,62);
}
}
ButtonPanel.prototype.execTransition=function(transition,posClicDsSerieBtonLie){
while(transition!=null){
var nvState=this.tabRoute[this.state][transition];
if(nvState!=null){
this.state=nvState;
this.$displayLinkedBton(posClicDsSerieBtonLie);
transition=this.makeAction(this.state);
}
else
transition=null;
}
}
ButtonPanel.prototype.$displayLinkedBton=function(posClicDsSerieBtonLie){
var lOptLinked=this.tabRoute[this.state].lOpt;
if(lOptLinked){
for(var i=0;i<lOptLinked.length;i++){
this.decorDockBar.displayBton(this.posBtonLie[i],
lOptLinked[i],
(posClicDsSerieBtonLie==i)?'On':'Off');
this.tBtons[this.posBtonLie[i]].currentType=lOptLinked[i];
}
}
}
ButtonPanel.prototype.btonDispo=function(type){
if(!this['bton'+type])return null;
var i=0;
traceExec('recherche bton dispo type= '+type,62);
while((i<this['bton'+type].length)
&&(this['bton'+type][i].currentType!=type)){
traceExec('this[bton'+type+'['+i+'].currentType= '
+this['bton'+type][i].currentType
,62);
i++;
}
if(i==this['bton'+type].length)
return false;
else{
traceExec('dispo i= '+i,62)
traceExec('this[bton'+type+'['+i+'].currentType= '
+this['bton'+type][i].onclick
,62);
return this['bton'+type][i];
}
}
ButtonPanel.prototype.removeOneBton=function(place){
traceExec('removeOneBton place= '+place,62);
this.tBtons[place].remove();
this.tBtons[place]=null;
if(place==this.lastPlace){
this.lastPlace--;
while((this.lastPlace!=-1)
&&(this.tBtons[this.lastPlace].espace)){
traceExec('removeOneBton supp esp this.lastPlace= '+this.lastPlace,62);
this.tBtons[this.lastPlace].remove();
this.tBtons[this.lastPlace]=null;
this.lastPlace--;
traceExec('bcle this.lastPlace= '+this.lastPlace,62);
traceExec('bcle  this.tBtons[this.lastPlace]='+this.tBtons[this.lastPlace],62);
}
}
}
function ModalButton(listOptions,place,posDsSerieBtonsLies,panelBtons,oConcerne,fctActivOConcerne,decor,tabStateOpt){
this.decor=decor;
this.panel=panelBtons;
this.oConcerne=oConcerne;
this.fctActivOConcerne=fctActivOConcerne;
this.posDsSerieBtonsLies=posDsSerieBtonsLies;
this.place=place;
this.espace=false;
this.tabStateOpt=tabStateOpt;
traceExec('Btton entree liste opt= '+listOptions,62);
this.lOptions=new Pile(listOptions.split('/'));
this.lMethodes=new Array;
if(decor){
this.decalFirstButton=this.panel?(this.panel.posFirstButton||0):0;
var typeMeth=this.lOptions.bottom();
do{
var typeMethod=typeMeth.split('[');
var methode;
var bTriggerBefTransition=false;
if(typeMethod.length>1){
methode=typeMethod[1].replace(']','');
if(methode.charAt(0)=='-'){
bTriggerBefTransition=true;
methode=methode.substr(1);
}
}
var fct=methode||typeMethod;
var fct=(methode!='undefined')?methode:typeMethod[0];
var opt=typeMeth.replace(/\[.*\]|\//g,'');
this.boutonHtml=this.decor.addBton(place+this.decalFirstButton,opt);
this.lMethodes[opt]={fct:fct,bTriggerBefTransition:bTriggerBefTransition};
this.lOptions.replaceCurrentVal(opt);
this.currentType=opt;
if(this.panel){
if(!this.panel['bton'+opt]){
this.panel['bton'+opt]=new Array;
}
this.panel['bton'+opt].push(this);
}
traceExec('place '+place+' type '+this.currentType,63);
traceExec('meth['+opt+']= '+fct,62)
}while(typeMeth=this.lOptions.next())
this.lOptions.top();
}
else
alert('decor inex decor = '+decor);
this.boutonHtml.onmousedown=stopEvent;
this.boutonHtml.onmousemove=stopEvent;
this.boutonHtml.onmouseup=stopEvent;
if((this.lOptions.length()==1)
&&(this.lOptions.top().indexOf('Space')!=-1)){
this.espace=true;
traceExec(',,,,,,,,bton-espace pos = '+this.place,62);
}
if((this.lOptions.length()>1)
||(!this.espace)){
this.boutonHtml.oCiu=this;
this.boutonHtml.onclick=function(){
traceExec('ModalButton.boutonHtml onclick entree',31);
var oThis=this.oCiu;
oThis.bBtonActived=true;
if(oThis.panel)
oThis.panel.bBtonActived=true;
var svgCurrentType=oThis.currentType;
if(!oThis.oConcerne.active){
traceExec('ModalButton.boutonHtml onclick inactive -> activeFen',31);
if(oThis.fctActivOConcerne)
oThis.oConcerne[oThis.fctActivOConcerne]();
}
if(svgCurrentType==oThis.currentType){
traceExec('ModalButton.boutonHtml onclick -> traitButton',31);
this.exec();
}
oThis.bBtonActived=false;
if(oThis.panel)
oThis.panel.bBtonActived=false;
}
this.boutonHtml.exec=function(evt){
var oThis=this.oCiu;
var transition=evt||oThis.currentType;
var defFct=oThis.lMethodes[transition];
var fct=defFct.fct;
if(defFct.bTriggerBefTransition){
if(oThis.oConcerne[fct])
oThis.oConcerne[fct]();
else
if(fct)
eval(fct);
else
alert("Desol?, ce bouton n'a actuellement aucune action associ?e...\nhormis l'affichage de ce message. "
+"\n\n Il est sans doute inappropri? dans ce contexte");
}
if(!oThis.panel)
this.$$execTransition(transition);
else
oThis.panel.execTransition(transition,oThis.posDsSerieBtonsLies);
if(!defFct.bTriggerBefTransition){
if(oThis.oConcerne[fct])
oThis.oConcerne[fct]();
else
if(fct)
eval(fct);
else
alert("Desol?, ce bouton n'a actuellement aucune action associ?e...\nhormis l'affichage de ce message. "
+"\n\n Il est sans doute inappropri? dans ce contexte");
}
}
this.boutonHtml.traitButton=function(evt){
this.exec(evt);
}
this.boutonHtml.$$execTransition=function(transition){
var oThis=this.oCiu;
if(oThis.lOptions.length()>1){
var nvOpt;
if(oThis.tabStateOpt)
nvOpt=oThis.tabStateOpt[transition];
else
nvOpt=oThis.lOptions.next(true);
oThis.decor.displayBton(oThis.place,nvOpt,'on');
oThis.currentType=nvOpt;
}
}
this.boutonHtml.setCible=function(cible){
var oThis=this.oCiu;
if(!oThis.eltHtmlCmd){
oThis.eltHtmlCmd=cible;
oThis.idObjComp=oThis.eltHtmlCmd.idObjComp;
oThis.id="bouton_"+oThis.idObjComp;
}
else
oThis.eltHtmlCmd=cible;
}
}
}
ModalButton.prototype.inPanel=function(panel,posDsSerieBtonsLies){
this.panel=panel;
this.posDsSerieBtonsLies=posDsSerieBtonsLies;
}
ModalButton.prototype.remove=function(){
this.decor.remBton(this.place+this.decalFirstButton);
}
objMenuCont.prototype.nbreInstance=0;
function objMenuCont(name,width,objPar){
this.name=name;
this.id=name+"_"+(objMenuCont.prototype.nbreInstance++);
if(rialto.lang.isNumber(width)){
this.width=width;
}
else{
this.width='100%';
}
rialto.session.reccord(this,this.id);
this.avecImage=false;
this.position="absolute";
this.posFixe=false;
this.posTop=0;
this.posLeft=0;
this.className=null;
if(objPar!=null){
if(rialto.lang.isBoolean(objPar.avecImage)){
this.avecImage=objPar.avecImage;
}
if(rialto.lang.isStringIn(objPar.position,["static","absolute","relative"])){
this.position=objPar.position;
}
if(rialto.lang.isBoolean(objPar.posFixe)){
this.posFixe=objPar.posFixe;
}
if(rialto.lang.isNumber(objPar.posTop)){
this.posTop=objPar.posTop;
}
if(rialto.lang.isNumber(objPar.posLeft)){
this.posLeft=objPar.posLeft;
}
if(rialto.lang.isString(objPar.className,true)){
this.className=objPar.className;
}
}
}
objMenuCont.prototype.createMenu=function(parent){
this.DivGen=document.createElement("DIV");
this.DivGen.style.width=this.width;
this.DivGen.className="divMenu";
this.DivGen.style.position=this.position;
this.DivGen.style.overflow="hidden";
this.DivGen.id=this.name;
this.DivGen.style.display='none';
this.DivGen.style.zIndex=10000;
if(this.posFixe){
this.DivGen.style.top=this.posTop;
this.DivGen.style.left=this.posLeft;
this.DivGen.className="divMenuFixe";
}
if(this.className){
this.DivGen.className=this.className;
}
this.tabItem=new Array();
parent.appendChild(this.DivGen);
this.dansBody=false;
this.divCoche=document.createElement("DIV");
this.divCoche.className="coche";
this.divCoche.style.left="5px";
coche=document.createElement("IMG");
coche.src="images/imgTableau/coche.gif";
coche.style.display='inline';
this.divCoche.appendChild(coche);
}
objMenuCont.prototype.add=function(titre,actif,boolAvecCoche,boolCoche,img){
var oThis=this;
var item=new objItemMenu(this.width,titre,actif,boolAvecCoche,img);
var ind=this.tabItem.push(item)-1;
item.ind=ind;
item.DivGen.onclick=function(e){
if(this.oCiu.actif){
this.className="divItemOff";
oThis.itemClick(this.oCiu.ind);
stopEvent(e);
}
};
if(boolCoche){item.divImg.appendChild(this.divCoche);}
this.DivGen.appendChild(item.DivGen);
}
objMenuCont.prototype.itemClick=function(ind){
var item=this.tabItem[ind];
if(item.boolAvecCoche){item.divImg.appendChild(this.divCoche);}
this.masqueMenu();
this.itemClickApplicatif(ind);
}
objMenuCont.prototype.itemClickApplicatif=function(ind){
}
objMenuCont.prototype.activeItem=function(ind){
var item=this.tabItem[ind];
item.actif=true;
item.DivGen.className="divItemOff";
}
objMenuCont.prototype.inactiveItem=function(ind){
var item=this.tabItem[ind];
item.actif=false;
item.DivGen.className="divItemInactif";
}
objMenuCont.prototype.addSeparation=function(){
var sep=document.createElement("HR");
this.DivGen.appendChild(sep);
}
objMenuCont.prototype.afficheMenu=function(e){
if(objMenuCont.prototype.menuActif){
objMenuCont.prototype.menuActif.masqueMenu();
}
objMenuCont.prototype.menuActif=this;
this.DivGen.style.display='block';
if(!this.posFixe){
if(!e)var e=window.event;
if(this.dansBody==false){
document.body.appendChild(this.DivGen);
this.dansBody=true;
}
positionneSelonEvent(this.DivGen,e);
stopEvent(e);
}
}
objMenuCont.prototype.masqueMenu=function(e){
objMenuCont.prototype.menuActif=null;
if(!e)var e=window.event;
this.DivGen.style.display='none';
}
objMenuCont.prototype.changeTitre=function(ind,titre){
var item=this.tabItem[ind];
item.changeTitre(titre);
}
objMenuCont.prototype.remove=function(){
if(this.DivGen&&this.DivGen.childNodes){
for(var idx=0;idx<this.DivGen.childNodes.length;idx++){
var divGen=this.DivGen.childNodes[idx];
if(divGen.oCiu)
divGen.oCiu.remove();
divGen.onclick=null;
}
}
this.DivGen.parentNode.removeChild(this.DivGen);
rialto.session.objects[this.id]=null;
}
function objItemMenu(width,titre,actif,boolAvecCoche,img){
var oThis=this;
this.actif=actif;
this.titre=titre;
this.srcImg=img;
if(boolAvecCoche){this.boolAvecCoche=true}
else{this.boolAvecCoche=false}
this.DivGen=document.createElement("DIV");
this.DivGen.style.width=width;
this.DivGen.style.height='20px';
if(this.actif){
this.DivGen.className="divItemOff";
}
else{
this.DivGen.className="divItemInactif";
}
this.divImg=document.createElement("DIV");
this.divImg.style.width='25px';
this.divImg.style.height='20px';
this.divImg.className="imgItem";
if(this.srcImg&&!this.boolAvecCoche){
this.img=document.createElement("IMG");
this.img.style.display="inline";
this.img.src=this.srcImg;
this.divImg.appendChild(this.img);
}
this.DivGen.appendChild(this.divImg);
this.divTxt=document.createElement("DIV");
this.divTxt.style.height='20px';
this.divTxt.style.width=width-27;
this.divTxt.style.display='inline';
this.divTxt.className="textItem";
this.divTxt.appendChild(document.createTextNode(this.titre));
this.DivGen.appendChild(this.divTxt);
this.DivGen.oCiu=this;
this.DivGen.onmouseover=function(){
if(oThis.actif){
this.className+=" divItemOn";
}
else{
this.className+=" divItemInactifOn";
}
}
this.DivGen.onmouseout=function(){
if(oThis.actif){
this.className="divItemOff";
}
else{
this.className="divItemInactif";
}
}
}
objItemMenu.prototype.changeTitre=function(titre){
var text=document.createTextNode(titre);
this.divTxt.replaceChild(text,this.divTxt.firstChild);
}
objItemMenu.prototype.remove=function(){
this.DivGen.oCiu=null;
this.DivGen.onmouseover=null;
this.DivGen.onmouseout=null;
}
function setCookie(nom,valeur)
{
var dateJour=new Date();
var annee=dateJour.getYear();
var dateplusUnAn=new Date(dateJour.getYear()+1,dateJour.getMonth(),dateJour.getDate());
document.cookie=nom+"="+valeur+";expires="+dateplusUnAn.toGMTString();
}
function retrouveCookie(nom)
{
var valeur="";
var strCherher=nom+"=";
if(document.cookie.length>0){
place=document.cookie.indexOf(strCherher);
if(place!=-1){
debut=place+strCherher.length;
fin=document.cookie.indexOf(";",debut);
if(fin==-1){
fin=document.cookie.length;
}
valeur=document.cookie.substring(debut,fin);
}
}
return valeur;
}
var oDeplact=null;
var oReSizeCurs=null;
function partitionDiv(orientation,prop,div,colorOne,colorTwo){
this.orientation=orientation;
if(div.nodeName)
this.oHtmlPrinc=div.nodeName?div
:new cursPartieFixe(div.top,div.left,div.width.div.height);
if(!this.oHtmlPrinc.oCiu)
this.oHtmlPrinc.oCiu=new Array();
this.oHtmlPrinc.oCiu['splitter']=this;
this.barre=(orientation=='v')?new cursPartieMobile(0,0,'100%'
,partitionDiv.prototype.widthTirette,'red')
:new cursPartieMobile(0,0,partitionDiv.prototype.widthTirette,'100%','red');
this.barrePosPreDef=document.createElement('DIV');
this.barrePosPreDef.style.fontSize='0.5';
this.barrePosPreDef.style.position='absolute';
this.barrePosPreDef.style.top=(orientation=='h')?'33%':0;
this.barrePosPreDef.style.left=(orientation=='h')?0:'33%';
this.barrePosPreDef.style.width=(orientation=='h')?'100%':'33%';
this.barrePosPreDef.style.height=(orientation=='h')?'33%':'100%';
this.barrePosPreDef.style.backgroundColor='pink';
this.barre.appendChild(this.barrePosPreDef);
var oThis=this;
this.barrePosPreDef.onclick=function(){
oThis.fixeProp((this.basc=(this.basc==0)?0.8:0));
}
if(orientation=='v'){
this.one=new cursPartieFixe(0,0,
'100%',
prop*(parseInt(this.oHtmlPrinc.style.height)-parseInt(this.barre.style.height)),
colorOne);
this.two=new cursPartieFixe(parseInt(this.one.style.height)+parseInt(this.barre.style.height)
,0
,'100%'
,parseInt(this.oHtmlPrinc.style.height)
-parseInt(this.barre.style.height)
-parseInt(this.one.style.height)
,colorTwo);
}
else{
this.one=new cursPartieFixe(0,0,
prop*(pixWidthCurs(this.oHtmlPrinc)-parseInt(this.barre.style.width)),
'100%',
colorOne);
this.two=new cursPartieFixe(0
,parseInt(this.one.style.width)+parseInt(this.barre.style.width)
,pixWidthCurs(this.oHtmlPrinc)
-parseInt(this.barre.style.width)
-parseInt(this.one.style.width)
,'100%'
,colorTwo);
}
this.one.style.fontSize='0.5';
this.oHtmlPrinc.appendChild(this.one);
this.two.style.fontSize='0.5';
this.oHtmlPrinc.appendChild(this.two);
this.cursMob=new CurseurMobile(this.oHtmlPrinc,
this.barre,
{mobilite:'DragAndDrop',
orientation:orientation,
rectLim:null
},
prop);
this.base=AbstractCurseur;
this.base(prop);
this.handlerSplit=new CouplageCurseurs(prop);
this.handlerSplit.add(this.cursMob);
this.handlerSplit.add(this);
}
partitionDiv.prototype=new AbstractCurseur;
partitionDiv.prototype.nbInstances=0;
partitionDiv.prototype.widthTirette='4px';
partitionDiv.prototype.placeCurs=function(prop){
this.prop=(prop!=null)?prop:this.prop;
if(this.orientation=='v'){
this.one.style.height=Math.max(0,
this.prop*(pixHeightCurs(this.oHtmlPrinc)-parseInt(this.barre.style.height))
);
this.two.style.height=Math.max(0,
pixHeightCurs(this.oHtmlPrinc)
-parseInt(this.one.style.height)
-parseInt(this.barre.style.height));
this.two.style.top=parseInt(this.one.style.height)+parseInt(this.barre.style.height);
}
else{
this.one.style.width=Math.max(0,
this.prop*(pixWidthCurs(this.oHtmlPrinc)-parseInt(this.barre.style.width))
);
this.two.style.width=Math.max(0,
pixWidthCurs(this.oHtmlPrinc)
-parseInt(this.one.style.width)
-parseInt(this.barre.style.width)
);
this.two.style.left=parseInt(this.one.style.width)+parseInt(this.barre.style.width);
}
if(this.one.oCiu
&&this.one.oCiu['splitter']
&&this.one.oCiu['splitter'].orientation==this.orientation){
this.one.oCiu['splitter'].handler.majPosCurs();
}
if(this.two.oCiu
&&this.two.oCiu['splitter']
&&this.two.oCiu['splitter'].orientation==this.orientation){
this.two.oCiu['splitter'].handler.majPosCurs();
}
}
function cursPartieFixe(top,left,width,height,bckcol){
var oHtml=document.createElement('DIV');
oHtml.style.position='absolute';
oHtml.style.top=top||0;
oHtml.style.left=left||0;
oHtml.style.width=width||100;
oHtml.style.height=height||100;
oHtml.style.backgroundColor=bckcol||'green';
oHtml.id='cursPartieFixe_'+(++cursPartieFixe.prototype.nbInstances);
return oHtml;
}
cursPartieFixe.prototype.nbInstances=0;
function cursPartieMobile(top,left,width,height,bckcol){
var oHtml=document.createElement('DIV');
oHtml.className='cursAscenseurWin';
oHtml.style.position='absolute';
oHtml.style.top=top||0;
oHtml.style.left=left||0;
oHtml.style.width=width||'100px';
oHtml.style.height=height||'100px';
oHtml.style.border='1px black outset';
oHtml.style.fontSize='0.5';
oHtml.id='oMobile';
oHtml.id='cursPartieMobile_'+(++cursPartieMobile.prototype.nbInstances);
return oHtml;
}
cursPartieMobile.prototype.nbInstances=0;
function AbstractCurseur(prop){
this.prop=prop||0;
this.handler=null;
}
AbstractCurseur.prototype.placeIn=function(oHtml,top,left){
this.oHtmlPrinc.style.top=top;
this.oHtmlPrinc.style.left=left;
this.oHtmlPrinc.style.position='absolute';
oHtml.appendChild(this.oHtmlPrinc);
}
AbstractCurseur.prototype.synchro=function(cumulDelta,delta,posInit){
traceExec('synchro entree this.id= '+this.id+' appel de calculProp this.prop  = '+this.prop,10);
this.calculProp();
traceExec('synchro apres appel de calculProp this.prop= '+this.prop,10);
if(this.handler){
traceExec('synchro this.handler.id= '+this.handler.id,60);
traceExec('synchro appel de handler.majPosCurs',10);
this.handler.majPosCurs(this,true);
}
else
traceExec('synchro pas d appel de majPosCurs car pas de handler',10);
traceExec('synchro sortie',10);
}
AbstractCurseur.prototype.synchroDiff=function(){
if(this.handler){
this.calculProp();
this.handler.majPosCurs();
}
}
AbstractCurseur.prototype.fixeProp=function(prop,force){
if(this.handler){
this.handler.majPosCurs({prop:prop},force);
}
else{
this.placeCurs(prop);
}
}
AbstractCurseur.prototype.placeCurs=function(){
return;
}
AbstractCurseur.prototype.calculProp=function(){
return;
}
function CurseurCpleBton(limitDeplact,prop,btonUp,btonDown){
this.base=AbstractCurseur;
this.base(prop);
this.limitDeplact=limitDeplact;
this.val=limitDeplact.posRelI||0;
this.limitDeplact.amplitude=limitDeplact.ampl||100;
this.limitDeplact.circulaire=limitDeplact.circulaire||false;
this.limitDeplact.varDiscrete=limitDeplact.varDiscrete||false;
this.limitDeplact.nbVal=limitDeplact.nbVal||2;
this.limitDeplact.tabVal=limitDeplact.tabVal||null;
if(this.limitDeplact.varDiscrete
&&this.limitDeplact.nbVal){
this.limitDeplact.iPas=this.limitDeplact.amplitude/this.limitDeplact.nbVal;
this.limitDeplact.prctPas=1/this.limitDeplact.nbVal;
this.limitDeplact.index=0;
traceExec('this.limitDeplact.iPas='+this.limitDeplact.iPas,50);
}
traceExec('this.limitDeplact.varDiscrete'+((this.limitDeplact.varDiscrete==false)?' non discrete':' discrete'),10);
this.scroll=false;
this.oHtml=document.createElement('DIV');
this.oHtml.className='cursCpleBton';
this.oHtmlPrinc=this.oHtml;
this.oHtmlPrinc.id='curs_cple_bton_'+(++CurseurCpleBton.prototype.nbInstances);
this.oHtmlBtonPlus=btonUp?btonUp:document.createElement('DIV');
this.oHtmlBtonPlus.oCiu=this;
this.oHtmlBtonPlus.className=btonUp?'cursBton':'cursBtonUp';
this.oHtmlBtonPlus.id='curs_cple_bton_plus_'+CurseurCpleBton.prototype.nbInstances;
this.oHtmlBtonPlus.onmousedown=function(e){
if(!e)var e=window.event;
this.oCiu.scroll=true;
this.oCiu.displayProp();
this.oCiu.propUp();
stopEvent(e);
}
this.oHtmlBtonPlus.onmouseup=this.oHtmlBtonPlus.onmouseout=function(e){
if(!e)var e=window.event;
this.oCiu.scroll=false;
this.oCiu.displayProp();
stopEvent(e);
}
this.oHtmlBtonPlus.onmouseover=function(e){
if(!e)var e=window.event;
this.oCiu.displayProp();
}
this.oHtml.appendChild(this.oHtmlBtonPlus);
if(this.limitDeplact.oneBton)
this.limitDeplact.circulaire=true;
else{
this.oHtmlBtonMoins=btonDown?btonDown:document.createElement('DIV');
this.oHtmlBtonMoins.oCiu=this;
this.oHtmlBtonMoins.className=btonDown?'cursBton':'cursBtonDown';
this.oHtmlBtonMoins.id='curs_cple_bton_moins_'+CurseurCpleBton.prototype.nbInstances;
this.oHtmlBtonMoins.onmousedown=function(e){
if(!e)var e=window.event;
this.oCiu.scrollDown=true;
this.oCiu.displayProp();
this.oCiu.propDown();
stopEvent(e);
}
this.oHtmlBtonMoins.onmouseup=this.oHtmlBtonMoins.onmouseout=function(e){
if(!e)var e=window.event;
this.oCiu.scrollDown=false;
this.oCiu.displayProp();
stopEvent(e);
}
this.oHtmlBtonMoins.onmouseover=function(e){
if(!e)var e=window.event;
this.oCiu.displayProp();
}
this.oHtml.appendChild(this.oHtmlBtonMoins);
}
}
CurseurCpleBton.prototype=new AbstractCurseur;
CurseurCpleBton.prototype.nbInstances=0;
CurseurCpleBton.prototype.displayProp=function(){
}
CurseurCpleBton.prototype.propUp=function(id){
if(id){
var btonHtml=document.getElementById(id);
var oThis=btonHtml.oCiu;
}
else
{
oThis=this;
}
if(!oThis.limitDeplact.varDiscrete){
if(oThis.scroll){
oThis.val++;
oThis.val=(oThis.val>oThis.limitDeplact.amplitude)?(oThis.limitDeplact.circulaire?0
:oThis.limitDeplact.amplitude)
:oThis.val;
oThis.synchro();
oThis.scrollIdTimeout=setTimeout("CurseurCpleBton.prototype.propUp(\""+oThis.oHtmlBtonPlus.id+"\")",1);
}
else{
clearTimeout(oThis.scrollIdTimeout);
}
}
else{
if(!oThis.limitDeplact.tabVal){
traceExec('propUp: oThis.val='+oThis.val,50);
oThis.val=((oThis.val+oThis.limitDeplact.iPas)>oThis.limitDeplact.amplitude)?
(oThis.limitDeplact.circulaire?0
:oThis.val)
:(oThis.val+oThis.limitDeplact.iPas);
traceExec('propUp: nv oThis.val='+oThis.val,50);
}
else{
oThis.index=Math.min(oThis.index+1,oThis.limitDeplact.nbVal);
}
oThis.synchro();
}
}
CurseurCpleBton.prototype.propDown=function(id){
if(id){
var btonHtml=document.getElementById(id);
var oThis=btonHtml.oCiu;
}
else
{
oThis=this;
}
if(!oThis.limitDeplact.varDiscrete){
if(oThis.scrollDown){
oThis.val--;
oThis.val=(oThis.val<0)?(oThis.limitDeplact.circulaire?oThis.limitDeplact.amplitude
:0)
:oThis.val;
oThis.synchro();
oThis.scrollDownIdTimeout=setTimeout("CurseurCpleBton.prototype.propDown(\""+oThis.oHtmlBtonPlus.id+"\")",1);
}
else{
clearTimeout(oThis.scrollDownIdTimeout);
}
}
else
if(!oThis.limitDeplact.tabVal){
traceExec('propDown: oThis.val='+oThis.val,50);
oThis.val=((oThis.val-oThis.limitDeplact.iPas)<0)?
(oThis.limitDeplact.circulaire?(this.limitDeplact.amplitude-this.limitDeplact.iPas)
:oThis.val)
:(oThis.val-oThis.limitDeplact.iPas);
traceExec('propDown: nv oThis.val='+oThis.val,50);
}
else{
oThis.index=Math.max(oThis.index-1,0);
}
oThis.synchro();
}
CurseurCpleBton.prototype.placeCurs=function(prop){
this.prop=(prop!=null)?prop:this.prop;
if(!this.limitDeplact.varDiscrete)
this.val=this.limitDeplact.amplitude*this.prop;
else
if(!this.limitDeplact.tabVal){
traceExec('placeCurs: this.val='
+'this.prop('+this.prop
+') / this.prctPas=('+this.limitDeplact.prctPas+')',50);
traceExec('parseInt(this.prop / this.limitDeplact.prctPas)='
+parseInt(this.prop/this.limitDeplact.prctPas),50);
this.val=this.limitDeplact.amplitude*((parseInt(this.prop/this.limitDeplact.prctPas))*this.limitDeplact.prctPas);
traceExec('placeCurs: nv this.val='+this.val,50);
}
else{this.val='arevoir';
}
}
CurseurCpleBton.prototype.calculProp=function(){
if(!this.limitDeplact.varDiscrete)
this.prop=this.val/this.limitDeplact.amplitude;
else
if(!this.limitDeplact.tabVal){
traceExec('calculprop: this.prop='+this.prop,50);
this.prop=this.val/this.limitDeplact.amplitude;
traceExec('calculprop: nv this.prop='+this.prop,50);
}
else{this.prop='arevoir';
}
}
function CurseurMobile(oFixe,oMobile,descrVariation1,prop){
traceExec('CurseurMobile constructeur entree',76);
this.base=AbstractCurseur;
this.base(prop);
traceExec('CurseurMobile constructeur apres appel classe base',76);
this.id=this.idObjComp='CurseurMobile_'+CurseurMobile.prototype.nbInstances++;
this.oHtmlFixe=oFixe;
this.oHtmlMobile=oMobile;
this.oHtmlFixe.appendChild(this.oHtmlMobile);
if(!this.oHtmlMobile.oCiu)
this.oHtmlMobile.oCiu=new Array();
this.oHtmlMobile.oCiu[descrVariation1.mobilite]=this;
if(descrVariation1){
this.typeMobilite=descrVariation1.mobilite;
if(!descrVariation1.nonInteractif){
if(!descrVariation1)
descrVariation1=new Object;
descrVariation1.objetCibleEvt=this.oHtmlMobile;
traceExec('cursMob descrVariation1.objetCibleEvt= '+descrVariation1.objetCibleEvt.id,76);
descrVariation1.objetADeplacer=this.oHtmlMobile;
descrVariation1.objetADeformer=this.oHtmlMobile;
descrVariation1.cibleEvt={oHtml:this.oHtmlMobile}
this.comportMobile=eval(descrVariation1.mobilite);
traceExec('CurseurMobile affectation comport '+descrVariation1.mobilite,39);
this.comportMobile(descrVariation1);
this.afterMD=function(){this.DDCursTemoin=true;}
this.afterDD=function(){this.DDCursTemoin=false;}
}
}
traceExec('-> placeCurs this.id= '+this.id,76);
}
CurseurMobile.prototype=new AbstractCurseur;
CurseurMobile.prototype.nbInstances=0;
CurseurMobile.prototype.calculProp=function(){
traceExec('calculProp entree CurseurMobile.prop = '+this.prop,10);
if(this.typeMobilite=='DragAndDrop'){
traceExec('calculprop deb this.prop = '+this.prop,39);
if(this.limitDeplact.orientation=='h')
this.prop=(parseInt(this.oHtmlMobile.style.left)-this.limitDeplact.rectLim.left)
/((this.limitDeplact.rectLim.right-this.limitDeplact.rectLim.left)
-parseInt(this.oHtmlMobile.style.width));
else
if(this.limitDeplact.orientation=='v'){
traceExec('parseInt(this.oHtmlMobile.style.top) = '+parseInt(this.oHtmlMobile.style.top),10);
traceExec('this.limitDeplact.rectLim.top = '+this.limitDeplact.rectLim.top,10);
traceExec('this.limitDeplact.rectLim.bottom = '+this.limitDeplact.rectLim.bottom,10);
traceExec('parseInt(this.oHtmlMobile.style.height) = '+parseInt(this.oHtmlMobile.style.height),10);
var posTexte=Math.abs(this.limitDeplact.rectLim.top
-parseInt(this.oHtmlMobile.style.top));
this.prop=(posTexte==0)
?0
:posTexte
/((this.limitDeplact.rectLim.bottom-this.limitDeplact.rectLim.top)
-parseInt(this.oHtmlMobile.style.height)
-borderIfNecess(this.oHtmlMobile)
);
}
traceExec('calculProp ap calcul CurseurMobile.prop = '+this.prop,10);
if(this.complementProp){
this.prop=1-this.prop;
traceExec('calculProp rectification complt CurseurMobile.prop = '+this.prop,10);
}
traceExec('calculprop fin this.prop = '+this.prop,10);
}
else
if(this.typeMobilite=='ReSize'){
traceExec('calculProp ReSize this.limitReDim.orientation= '+this.limitReDim.orientation,60);
if(this.specs.orientation=='h')
this.prop=(parseInt(this.oHtmlMobile.style.width)-this.limitReDim.widthMin)
/(this.limitReDim.widthMax
-this.limitReDim.widthMin);
else
if(this.specs.orientation=='v'){
this.prop=(parseInt(this.oHtmlMobile.style.height)-this.limitReDim.heightMin)
/(this.limitReDim.heightMax
-this.limitReDim.heightMin);
traceExec('calculProp this.prop = '+this.prop,60);
}
else
if(this.specs.orientation=='2D')
this.prop=(parseInt(this.oHtmlMobile.style.width)-this.limitReDim.widthMin)
/(this.limitReDim.widthMax
-this.limitReDim.widthMin);
}
this.displayProp();
return this.prop;
}
CurseurMobile.prototype.displayProp=function(){
}
CurseurMobile.prototype.placeCurs=function(prop){
traceExec('placeCurs entree this.id= '+this.id+' prop= '+prop,10);
var propNorm=prop;
if(this.typeMobilite=='DragAndDrop'){
if(this.limitDeplact&&this.complementProp){
prop=1-prop;
traceExec('placeCurs prop modifie utilis?e pour calc= '+prop,10);
}
if((this.limitDeplact.orientation=='h')
||(this.limitDeplact.orientation=='2D')){
this.oHtmlMobile.style.left=(this.limitDeplact.rectLim.left
+((this.limitDeplact.rectLim.right-this.limitDeplact.rectLim.left)
-parseInt(this.oHtmlMobile.style.width))
*prop);
}
if((this.limitDeplact.orientation=='v')
||(this.limitDeplact.orientation=='2D')){
traceExec('placeCurs this.id= '+this.id,10);
traceExec('placeCurs this.limitDeplact.rectLim.bottom = '+this.limitDeplact.rectLim.bottom,10);
traceExec('placeCurs this.limitDeplact.rectLim.top = '+this.limitDeplact.rectLim.top,10);
traceExec('placeCurs this.oHtmlMobile.style.height = '+this.oHtmlMobile.style.height,10);
traceExec('placeCurs prop = '+prop,10);
traceExec('placeCurs avant calcul this.oHtmlMobile.style.top= '+this.oHtmlMobile.style.top,10);
this.oHtmlMobile.style.top=(this.limitDeplact.rectLim.top
+((this.limitDeplact.rectLim.bottom-this.limitDeplact.rectLim.top)
-parseInt(this.oHtmlMobile.style.height))
*prop);
traceExec('placeCurs ap calcul this.oHtmlMobile.style.top= '+this.oHtmlMobile.style.top,10);
}
}
else
if(this.typeMobilite=='ReSize'){
if(this.specs.orientation!='v'){
var amplMax=this.limitReDim.widthMax-this.limitReDim.widthMin;
var nvWidth=Math.floor((amplMax*prop)+this.limitReDim.widthMin);
if(this.limitReDim.centrage){
var diffLeft=Math.floor((nvWidth-parseInt(this.oHtmlMobile.style.width))/2);
this.oHtmlMobile.style.left=parseInt(this.oHtmlMobile.style.left)-(diffLeft);
this.oHtmlMobile.style.width=parseInt(this.oHtmlMobile.style.width)+(diffLeft*2);
}
else
this.oHtmlMobile.style.width=nvWidth;
}
if(this.specs.orientation!='h'){
var amplMax=this.limitReDim.heightMax-this.limitReDim.heightMin;
var nvHeight=Math.floor((amplMax*prop)+this.limitReDim.heightMin);
if(this.limitReDim.centrage){
var diffTop=Math.floor((nvHeight-parseInt(this.oHtmlMobile.style.height))/2);
this.oHtmlMobile.style.top=parseInt(this.oHtmlMobile.style.top)-diffTop;
this.oHtmlMobile.style.height=parseInt(this.oHtmlMobile.style.height)+(diffTop*2);
}
else
this.oHtmlMobile.style.height=nvHeight;
}
}
this.prop=propNorm;
traceExec('placeCurs sortie this.prop= '+this.prop,10);
}
CurseurMobile.prototype.placeIn=function(oHtml,top,left,position){
this.oHtmlFixe.style.top=top;
this.oHtmlFixe.style.left=left;
this.oHtmlFixe.style.position=position||'absolute';
oHtml.appendChild(this.oHtmlFixe);
}
function CouplageCurseurs(prop){
this.id='CouplageCurseurs_'+CouplageCurseurs.prototype.nbInstances++;
this.cursLies=new Array();
this.prop=prop||0;
}
CouplageCurseurs.prototype.nbELtsCouples=function(){
alert('reste '+this.cursLies.length+' elts');
return this.cursLies.length;
}
CouplageCurseurs.prototype.add=function(curs,bMajPosCurs,prop){
curs.handler=this;
rialto.array.add(this.cursLies,curs);
if(!bMajPosCurs)
curs.placeCurs(this.prop);
else
if(prop){
this.majPosCurs({prop:prop},'tous');
}
else{
this.majPosCurs(curs);
}
}
CouplageCurseurs.prototype.remove=function(curs){
curs.handler=null;
this.cursLies.remove(curs);
}
CouplageCurseurs.prototype.majPosCurs=function(cursRef,force){
traceExec('majPosCurs entree',10);
var forceMaj=cursRef?force||false:true;
this.prop=cursRef?cursRef.prop
:this.prop;
traceExec('majPosCurs couplageCurseurs.prop = '+this.prop,10);
for(var i=0;i<this.cursLies.length;i++){
traceExec('majPosCurs curs n? '+i+' '+this.cursLies[i].prop+' != ? '+this.prop,10);
if((this.cursLies[i].prop!=this.prop)
||(forceMaj=='tous')
||((forceMaj)
&&(this.cursLies[i]!=cursRef))){
traceExec('majPosCurs curs n? '+i+' ->placeCurs('+this.prop+')',10);
this.cursLies[i].placeCurs(this.prop);
}
}
}
CouplageCurseurs.prototype.nbInstances=0;
pixWidthCurs=function(oHtml){
var prc=1;
var nd=oHtml;
var percent=true;
do{
var ndstyle=nd.currentStyle?nd.currentStyle:nd.style;
var taille=ndstyle.width;
if(taille=="auto"){
i=1;
taille=100;
}
else
i=ndstyle.width.indexOf('%');
if(i==-1)
percent=false;
else
prc=prc*parseInt(taille)/100;
}while(percent&&(nd=nd.parentNode))
if((ndstyle.borderStyle!='none')
&&(ndstyle.borderStyle!=''))
tailleBord=parseInt(ndstyle.borderWidth);
else
tailleBord=0;
return(prc*(parseInt(taille)-tailleBord*2));
}
pixHeightCurs=function(oHtml){
var prc=1;
var nd=oHtml;
var percent=true;
do{
var ndstyle=nd.currentStyle?nd.currentStyle:nd.style;
var taille=ndstyle.height;
if(taille=="auto"){
i=1;
taille=100;
}
else
i=ndstyle.height.indexOf('%');
if(i==-1)
percent=false;
else
prc=prc*parseInt(taille)/100;
}while(percent&&(nd=nd.parentNode))
if((ndstyle.borderStyle!='none')
&&(ndstyle.borderStyle!=''))
tailleBord=parseInt(ndstyle.borderWidth);
else
tailleBord=0;
return(prc*(parseInt(taille)-tailleBord*2));
}
function dirDeplactElt(elt,width,height)
{
var dir="";
var xPRC,yPRC;
xPRC=window.event.offsetX;
yPRC=window.event.offsetY;
if(yPRC<5)
dir="n";
else if(yPRC>(height-5))
dir="s";
if(xPRC<5)
dir+="w";
else if(xPRC>(width-5))
dir+="e";
return dir;
}
var ENREG_DD=99;
var oDeplact=null;
var _ECN_ICONE_DD_DEF='icone_DD_def';
var SENSITIVEEDGEWIDTH_DEFAULT=0;
rialto.widgetBehavior.DDStdtLoadLimitsMoving
=function(){
if(this.movingLimits.bRectLim){
this.movingLimits.rectLim.bottom=eval(this.movingLimits.rectLim.bottomSpecs);
this.movingLimits.rectLim.right=eval(this.movingLimits.rectLim.rightSpecs);
this.movingLimits.rectLim.top=eval(this.movingLimits.rectLim.topSpecs);
this.movingLimits.rectLim.left=eval(this.movingLimits.rectLim.leftSpecs);
}
if(this.specs.ghost){
this.specs.ghost.top=eval(this.specs.ghost.topSpec);
this.specs.ghost.height=eval(this.specs.ghost.heightSpec);
}
traceExec('loadDyn Specs  top= '+this.movingLimits.rectLim.topSpecs
+' left= '+this.movingLimits.rectLim.leftSpecs
+' right= '+this.movingLimits.rectLim.rightSpecs
+' bottom= '+this.movingLimits.rectLim.bottomSpecs
,1);
traceExec('loadDyn top= '+this.movingLimits.rectLim.top
+' left= '+this.movingLimits.rectLim.left
+' right= '+this.movingLimits.rectLim.right
+' bottom= '+this.movingLimits.rectLim.bottom
,1);
}
rialto.widgetBehavior.DDStdtLoadParameters
=function(specs){
if(!specs)
specs=new Object;
this.specs=new Object;
if(!specs.oHtmlEvtTarget){
this.specs.oHtmlEvtTarget=new Array;
this.specs.oHtmlEvtTarget[0]=this;
}
else
if(!(specs.oHtmlEvtTarget instanceof Array)){
var woHtmlEvtTarget=specs.oHtmlEvtTarget;
this.specs.oHtmlEvtTarget=new Array;
this.specs.oHtmlEvtTarget[0]=woHtmlEvtTarget;
}
else
if(specs.oHtmlEvtTarget instanceof Array){
this.specs.oHtmlEvtTarget=specs.oHtmlEvtTarget;
}
else{
}
this.specs.oHtmlToMove=specs.oHtmlToMove?specs.oHtmlToMove:this;
this.specs.dragMood=(specs.dragMood!=null)?specs.dragMood
:specs.ghost?'ghostMove'
:'directMove';
this.specs.bSelectMark=(specs.bSelectMark!=null)?specs.bSelectMark
:true;
this.specs.bDynamicsMovingLimits=(specs.bDynamicsMovingLimits!=null)
?specs.bDynamicsMovingLimits:true;
this.specs.ghost=new Object;
if(this.specs.dragMood=='ghostMove'){
if(specs.ghost){
traceExec('avant this.specs.oHtmlToMove'+_rum.$getHeight(this.specs.oHtmlToMove),2);
this.specs.ghost.height=specs.ghost.height?specs.ghost.height
:'_rum.$getHeight(this.specs.oHtmlToMove)';
this.specs.ghost.top=specs.ghost.top?specs.ghost.top
:0;
this.specs.ghost.asChild=specs.ghost.asChild?specs.ghost.asChild
:false;
this.specs.ghost.aspect=specs.ghost.aspect||'cadre';
if((this.specs.ghost.aspect!='frame')
&&(this.specs.ghost.aspect!='rect')){
this.specs.ghost.bIcone=true;
if(this.specs.ghost.aspect=='icon'){
this.specs.ghost.aspect=_ECN_ICONE_DD_DEF
}
}
if(specs.ghost.bOnePixel)
this.specs.ghost.bOnePixel=specs.ghost.bOnePixel;
else{
this.specs.ghost.bOnePixel=this.specs.ghost.bIcone?true:false;
}
}
else{
this.specs.ghost.aspect='frame';
this.specs.ghost.top=0;
this.specs.ghost.height='_rum.$getHeight(this.specs.oHtmlToMove)';
this.specs.ghost.bOnePixel=false;
}
}
else{
this.specs.ghost=false;
this.specs.bSelectMark=false;
}
if(this.specs.bDynamicsMovingLimits){
this.specs.ghost.heightSpec=this.specs.ghost.height;
this.specs.ghost.topSpec=this.specs.ghost.top;
}
else{
this.specs.ghost.height=eval(this.specs.ghost.height);
this.specs.ghost.top=eval(this.specs.ghost.top);
}
this.specs.bMUpAction=(specs.bMUpAction!=null)?specs.bMUpAction:true;
this.specs.posRelI=new Object;
if(specs.posRelI){
this.specs.posRelI.top=specs.posRelI.top;
this.specs.posRelI.left=specs.posRelI.left;
}
this.specs.modCurs=new Object;
if(specs.modCursor){
this.specs.modCurs.avantDD=(specs.modCursor.avantDD!='undefined')?specs.modCursor.avantDD:true;
this.specs.modCurs.auClic=(specs.modCursor.auClic!='undefined')?specs.modCursor.auClic:true;
}
else{
this.specs.modCurs.avantDD=true;
this.specs.modCurs.auClic=true;
}
if(specs.magneticsGrid){
this.specs.magneticsGrid=new Object;
this.specs.magneticsGrid.widthCol=specs.magneticsGrid.widthCol||10;
this.specs.magneticsGrid.heightRow=specs.magneticsGrid.heightRow||10;
}
this.complementProp=specs.complementProp;
if(!specs.movingLimits)
specs.movingLimits={};
this.movingLimits=new Object;
this.movingLimits.bCircular=specs.movingLimits.bCircular||false;
this.movingLimits.orientation=specs.movingLimits.orientation?specs.movingLimits.orientation:'2D';
traceExec('specs.bRectLim avant affact de this.movingLimits.bRectLim = '+
specs.bRectLim,73);
this.movingLimits.bRectLim=(specs.bRectLim!=null)?specs.bRectLim:true;
this.movingLimits.rectLim=new Object;
var flagModSpecsMovingLimitsRectLim=false;
if(!specs.movingLimits.rectLim){
specs.movingLimits.rectLim={};
flagModSpecsMovingLimitsRectLim=true;
}
else{
for(var i in specs.movingLimits.rectLim){
}
this.movingLimits.bRectLim=true;
}
this.movingLimits.oHtmlRef=specs.movingLimits.oHtmlRef||this.specs.oHtmlToMove.parentNode;
if(this.movingLimits.bRectLim)
this.movingLimits.isWithLimitsDisplayed=true;
else
this.movingLimits.isWithLimitsDisplayed=false;
if(specs.magneticsGrid){
this.movingLimits.isWithLimitsDisplayed=true;
this.specs.magneticsGrid.bDisplayed=true;
}
if(specs.isWithLimitsDisplayed!=undefined)
this.movingLimits.isWithLimitsDisplayed=specs.isWithLimitsDisplayed;
if(!this.specs.bDynamicsMovingLimits){
this.movingLimits.rectLim.right=eval(specs.movingLimits.rectLim.right)
||_rum.$getWidth(this.movingLimits.oHtmlRef,borderLess=true);
this.movingLimits.rectLim.left=eval(specs.movingLimits.rectLim.left)||0;
}
else{
this.movingLimits.rectLim.rightSpecs=specs.movingLimits.rectLim.right
||'_rum.$getWidth ( this.movingLimits.oHtmlRef,borderLess=true)';
}
if(!this.specs.bDynamicsMovingLimits){
this.movingLimits.rectLim.bottom=eval(specs.movingLimits.rectLim.bottom)
||_rum.$getHeight(this.movingLimits.oHtmlRef,borderLess=true);
this.movingLimits.rectLim.top=eval(specs.movingLimits.rectLim.top)||0;
}
else{
this.movingLimits.rectLim.bottomSpecs=specs.movingLimits.rectLim.bottom
||'_rum.$getHeight(this.movingLimits.oHtmlRef,borderLess=true)';
this.movingLimits.rectLim.leftSpecs=specs.movingLimits.rectLim.left||0;
this.movingLimits.rectLim.topSpecs=specs.movingLimits.rectLim.top||0;
}
this.isWithMovingInfo=(specs.isWithMovingInfo!=undefined)?specs.isWithMovingInfo:false;
this.isWithMovingInParentInfo=(specs.isWithMovingInParentInfo!=undefined)?specs.isWithMovingInParentInfo:false;
if(specs.isWithMovingInParentInfo!=undefined)
this.isWithMovingInfo=true;
if(this.movingLimits){
if(this.movingLimits.rectLim){
}
}
if(this.movingLimits.orientation=='h'){
this.movingLimits.rectLim.topSpecs=
this.movingLimits.rectLim.top=(specs.posRelI?eval(specs.posRelI.top)
:0);
this.movingLimits.rectLim.bottomSpecs=
this.movingLimits.rectLim.bottom=
_rum.$getHeight(this.specs.oHtmlToMove)
+this.movingLimits.rectLim.top;
}
else
if(this.movingLimits.orientation=='v'){
this.movingLimits.rectLim.leftSpecs=
this.movingLimits.rectLim.left=(specs.posRelI?eval(specs.posRelI.left)
:0);
this.movingLimits.rectLim.rightSpecs=
this.movingLimits.rectLim.right=
_rum.$getWidth(this.specs.oHtmlToMove);
+this.movingLimits.rectLim.left;
}
this.specs.sensitiveEdgeWidth=specs.sensitiveEdgeWidth||SENSITIVEEDGEWIDTH_DEFAULT;
if(this.specs.posRelI.top!=null)
this.specs.oHtmlToMove.style.top=this.specs.posRelI.top;
if(this.specs.posRelI.left!=null)
this.specs.oHtmlToMove.style.left=this.specs.posRelI.left;
if(flagModSpecsMovingLimitsRectLim)
specs.movingLimits.rectLim=null;
}
rialto.widgetBehavior.constructorDragAndDrop
=function(specs){
if(!this.oCiu)this.oCiu=new Array();
this.oCiu['DragAndDrop']=this;
if(!this.oCiu['DragAndDrop'].loadSpecs){
this.oCiu['DragAndDrop'].loadSpecs=rialto.widgetBehavior.DDStdtLoadParameters;
}
this.oCiu['DragAndDrop'].loadSpecs(specs);
if(this.oCiu['DragAndDrop'].specs.bDynamicsMovingLimits){
if(!this.oCiu['DragAndDrop'].loadLimitsDyn)
this.oCiu['DragAndDrop'].loadLimitsDyn=rialto.widgetBehavior.DDStdtLoadLimitsMoving;
traceExec('before call loadLimitsDyn this.movingLimits.bRectLim = '+
this.movingLimits.bRectLim,73);
this.oCiu['DragAndDrop'].loadLimitsDyn();
}
var oCiu=this.oCiu['DragAndDrop'];
for(var i=0;i<oCiu.specs.oHtmlEvtTarget.length;i++){
oCiu.specs.oHtmlEvtTarget[i].dragAndDrop=true;
oCiu.specs.oHtmlEvtTarget[i].refObjSpecs=this;
if(!oCiu.specs.oHtmlEvtTarget[i].behavior){
oCiu.specs.oHtmlEvtTarget[i].behavior={};
}
if(!oCiu.specs.oHtmlEvtTarget[i].behavior['DD'])
oCiu.specs.oHtmlEvtTarget[i].behavior['DD']={};
oCiu.specs.oHtmlEvtTarget[i].behavior['DD'].running=false;
}
if(typeof document.addEventListener=="undefined"){
var tOCible=oCiu.specs.oHtmlEvtTarget;
for(var i=0;i<tOCible.length;i++){
tOCible[i].addHandler=addHandler;
tOCible[i].methodMouseDown=rialto.widgetBehavior.DragAndDropMouseDownHandler;
tOCible[i].addHandler(tOCible[i],'onmousedown','methodMouseDown');
tOCible[i].methodMouseMove=rialto.widgetBehavior.DragAndDropMouseMoveHandler;
tOCible[i].methodMouseUp=rialto.widgetBehavior.DragAndDropMouseUpHandler;
tOCible[i].addHandler(tOCible[i],'onmousemove','methodMouseMove');
tOCible[i].addHandler(tOCible[i],'onmouseup','methodMouseUp');
tOCible[i].methodDebDD=function(){window.status='debut du d?placement this.id='+this.id;};
tOCible[i].addHandler(tOCible[i],'onmousedown','methodDebDD');
tOCible[i].methodFinDD=function(){window.status='fin du d?placement';};
tOCible[i].addHandler(tOCible[i],'onmouseup','methodFinDD');
}
}
else{
if(!document.rialtoEnregtDragAndDrop){
document.rialtoEnregtDragAndDrop=true;
document.addEventListener("mousemove",rialto.widgetBehavior.DragAndDropMouseMoveHandler,false);
document.addEventListener("mouseup",rialto.widgetBehavior.DragAndDropMouseUpHandler,false);
document.addEventListener("mousedown",rialto.widgetBehavior.StopSelectDef,false);
document.addEventListener("mousedown",rialto.widgetBehavior.DragAndDropMouseDownHandler,false);
}
}
if(this.specs.ghost){
var ghostFrame=rialto.session.objects?rialto.session.objects['singleGhostFrame']:null;
if(ghostFrame==null){
rialto.session.objects['singleGhostFrame']=ghostFrame=document.createElement('DIV');
ghostFrame.id='singleGhostFrame';
ghostFrame.className='ghostDD_'+this.specs.ghost.aspect;
document.body.appendChild(ghostFrame);
}
}
this.extendToMissile=function(specs){
this.$$bh_Missile=Missile;
this.$$bh_Missile(specs);
}
}
rialto.widgetBehavior.createBehavior(
'DragAndDrop',
rialto.widgetBehavior.constructorDragAndDrop
);
rialto.widgetBehavior.DDtargetOrTargetChild=function(oHtml){
var div=oHtml;
while(div&&!div.dragAndDrop){
div=div.parentNode;
}
if(div&&div.dragAndDrop){
return div;
}
else
return null;
}
rialto.widgetBehavior.DDmodCursor=function(oHtml,direction,orientation,cible){
if(cible){
oHtml.style.cursor="move";
return;
}
if(direction==""){
}
else
if(orientation=='v')
{oHtml.style.cursor=direction+"-resize";
}
else
if(orientation=='h'){
oHtml.style.cursor=direction+"-resize";
}
else{
oHtml.style.cursor='move';
}
}
rialto.widgetBehavior.StopSelectDef=function(e){
stopDefault(e);
}
rialto.widgetBehavior.Missile
=function(specs){
var domain=specs.domainTargets;
var targets=specs.targets;
var domainUnauthorizedTarget=specs.unauthorizedTargets;
this.specs.targetChoice=specs.targetChoice||'';
this.specs.circularDropAuthorized=specs.circularDropAuthorized||false;
this.specs.dropTargets=true;
this.specs.domain=domain;
this.specs.targets=targets;
if(targets!=undefined){
if(!this.specs.domain){
alert('missile constructeur avec cible mais sans domain defini');
this.specs.domain='__domProv'+rialto.widgetBehavior.Missile.prototype.idDomainProv++;
alert('domain construit = '+this.specs.domain);
}
for(var i=0;i<targets.length;i++){
rialto.widgetBehavior.affect(targets[i],'Target',
{domain:this.specs.domain});
}
}
if(typeof domainUnauthorizedTarget=='string'){
this.specs.domainUnauthorizedTarget=domainUnauthorizedTarget;
}
else if(domainUnauthorizedTarget instanceof Array){
this.specs.domainUnauthorizedTarget='__domProv'+Missile.prototype.idDomainProv++;
var c;
for(var i=0;i<domainUnauthorizedTarget.length;i++){
c=domainUnauthorizedTarget[i];
rialto.widgetBehavior.affect(c,'Target',{domain:this.specs.domainUnauthorizedTarget});
}
}
}
rialto.widgetBehavior.Missile.prototype.idDomainProv=0;
rialto.widgetBehavior.createBehavior(
'Missile',
rialto.widgetBehavior.Missile,
'DragAndDrop'
);
rialto.widgetBehavior.baseTarget
=function(specs){
if(specs==undefined)specs={};
var oHtml=specs.oHtml;
var domain=specs.domain;
this.oHtml=oHtml||this;
if(!this.oHtml.id
||((typeof this.oHtml.id)=='undefined')){
this.oHtml.id=rialto.widgetBehavior.baseTarget.prototype.nbInstances++;
}
this.id=this.oHtml.id
this.domain=domain||'undef';;
var oSpecs;
if(!specs){
oSpecs=new Object;
}
else
oSpecs=specs;
this.specsTarg=new Object;
this.specsTarg.missileAsOnePixel=(oSpecs.missileAsOnePixel!=undefined)?
oSpecs.missileAsOnePixel
:true;
this.specsTarg.borderIsTarget=(oSpecs.borderIsTarget!=undefined)?
oSpecs.borderIsTarget
:true;
this.witnessOfDragHover=rialto.widgetBehavior.baseTarget.witnessOfDragHover;
_DDMgr.addTarget(this.oHtml,this.domain);
}
rialto.widgetBehavior.baseTarget.prototype.nbInstances=0;
rialto.widgetBehavior.baseTarget.witnessOfDragHover=function(display,isTargetsUnAuthorized){
if(this.witnessDragHover)return;
var iTopLeftBoundDivToMoveInVP=
_rum.$divInternalTopLeftInViewPort(this.oHtml);
var iTopBoundDivToMoveInVP=iTopLeftBoundDivToMoveInVP.top;
var iLeftBoundDivToMoveInVP=iTopLeftBoundDivToMoveInVP.left;
this.witnessDragHover=document.createElement('DIV');
this.ws=this.witnessDragHover.style;
if(isTargetsUnAuthorized)
this.witnessDragHover.className='dashed line redBorder';
else
this.witnessDragHover.className='dashed line greenBorder';
document.body.appendChild(this.witnessDragHover);
if(this.oHtml.nodeName=="BODY"){
_rum.$setSizeConformW3C(this.witnessDragHover,document.body);
this.ws.top=this.ws.left=0;
}
else
if(this.specsTarg.borderIsTarget){
this.ws.width=_rum.$getWidth(this.oHtml,borderLess=false);
this.ws.height=_rum.$getHeight(this.oHtml,borderLess=false);
_rum.$setSizeConformW3C(this.witnessDragHover);
this.ws.top=iTopBoundDivToMoveInVP-_rum.$$getBorderTopWidth(this.oHtml)
-_rum.$$getBorderTopWidth(this.witnessDragHover);
this.ws.left=iLeftBoundDivToMoveInVP-_rum.$$getBorderLeftWidth(this.oHtml)
-_rum.$$getBorderLeftWidth(this.witnessDragHover);
}
else{
this.ws.width=_rum.$getWidth(this.oHtml,borderLess=true);
this.ws.height=_rum.$getHeight(this.oHtml,borderLess=true);
this.ws.top=iTopBoundDivToMoveInVP-_rum.$$getBorderTopWidth(this.witnessDragHover);
this.ws.left=iLeftBoundDivToMoveInVP-_rum.$$getBorderLeftWidth(this.witnessDragHover);
}
if(display)
this.witnessDragHover.style.display='block';
else
this.witnessDragHover.style.display='none';
}
rialto.widgetBehavior.baseTarget.prototype.DDHover=function(missile,isTargetsUnAuthorized){
this.witnessOfDragHover(display=true,isTargetsUnAuthorized);
}
rialto.widgetBehavior.baseTarget.prototype.DDOuter=function(missile){
if(this.witnessDragHover){
document.body.removeChild(this.witnessDragHover);
this.witnessDragHover=null;
}
}
rialto.widgetBehavior.createBehavior(
'Target',
rialto.widgetBehavior.baseTarget
);
objDiv3D.prototype.nbreInstance=0;
function objDiv3D(titre,style,mode){
this.id=objDiv3D.prototype.nbreInstance++;
this.titre=titre?titre:"";
this.style=style?style:"default";
this.mode=mode||"avecInnerHtml";
}
objDiv3D.prototype.createDiv3D=function(parent,style){
this.divSup=document.createElement("DIV");
this.parent=parent;
this.tableau=document.createElement("TABLE");
this.tableau.className='tableau_Div3D';
var str='<TABLE class="tableau_Div3D" height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>';
str+='<TBODY>';
if(this.style=="simple"){
str+='<TR>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coinsupg.gif" height=9></TD>';
str+='<TD colspan="3" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/sup.gif" height=9></TD>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coinsupd.gif" height=9></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/g.gif">&nbsp;</TD>';
str+='<TD colspan="3" vAlign=top  background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><DIV id="'+this.id+'_DIVCONTENU"/></TD>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/d.gif">&nbsp;</TD>';
str+='</TR>';
str+='<TR>';
str+='<TD width=15 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coininfg.gif" height=15></TD>';
str+='<TD colspan="3" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/inf.gif" height=15><IMG height=15 src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/space15_15.gif" width=15></TD>';
str+='<TD width=15 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coininfd.gif" height=15></TD>';
str+='</TR>';
};
if(this.style=="default"){
str+='<TR>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coinsupg.gif" height=9></TD>';
str+='<TD colspan="3" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/sup.gif" height=9></TD>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coinsupd.gif" height=9></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD align="left" valign="top"><img src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/g.gif" width="15"  height="100%"></TD>';
str+='<TD height="15" width="19"  align=left background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><DIV id="'+this.id+'_DIVICONEG"/></TD>';
str+='<TD width="100%"  align=left vAlign=top background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><DIV id="'+this.id+'_DIVTITRE"/><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='<TD height="15" width="19" align=left vAlign=top background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><DIV id="'+this.id+'_DIVICONED"/></TD>';
str+='<TD valign="top"><img src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/d.gif" width="15"  height="100%"></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/g.gif"></TD>';
str+='<TD height="9" colspan="3" align=middle vAlign=top background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='<TD width=10 height="9" valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/d.gif"></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/g.gif">&nbsp;</TD>';
str+='<TD colspan="3" vAlign=top  background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><DIV id="'+this.id+'_DIVCONTENU"/></TD>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/d.gif">&nbsp;</TD>';
str+='</TR>';
str+='<TR>';
str+='<TD width=15 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coininfg.gif" height=15></TD>';
str+='<TD colspan="3" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/inf.gif" height=15><IMG height=15 src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/space15_15.gif" width=15></TD>';
str+='<TD width=15 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coininfd.gif" height=15></TD>';
str+='</TR>';
};
if(this.style=="treeview"){
str+='<TR>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coinsupg.gif" height=9></TD>';
str+='<TD colspan="3" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/sup.gif" height=9></TD>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coinsupd.gif" height=9></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD  align="left" valign="top"><img src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/g.gif" width="15" height="100%"></TD>';
str+='<TD height="15" width="19"  align=left background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><DIV id="'+this.id+'_DIVICONEG"/></TD>';
str+='<TD height="15" width="100%"  align=left vAlign=top background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><DIV id="'+this.id+'_DIVTITRE"/><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='<TD height="15" width="10" align=left vAlign=top background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><DIV id="'+this.id+'_DIVICONED"/></TD>';
str+='<TD  valign="top"><img src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/d.gif" width="15" height="100%"></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/g.gif"></TD>';
str+='<TD height="9" colspan="3" align=middle vAlign=top background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='<TD width=10 height="9" valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/d.gif"></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/g_blanc.gif">&nbsp;</TD>';
str+='<TD colspan="3" vAlign=top  background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond-blanc.gif"><DIV id="'+this.id+'_DIVCONTENU"/></TD>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/d_blanc.gif">&nbsp;</TD>';
str+='</TR>';
str+='<TR>';
str+='<TD width=15 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coininfg2.gif" height=15><IMG height=15 src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/space15_15.gif" width=15></TD>';
str+='<TD colspan="3" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/inf2.gif" height=15><IMG height=15 src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/space15_15.gif" width=15></TD>';
str+='<TD width=15 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coininfd2.gif" height=15><IMG height=15 src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/space15_15.gif" width=15></TD>';
str+='</TR>';
};
if(this.style=="fenetre"){
str+='<TR>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coinsupg.gif" height=9></TD>';
str+='<TD colspan="3" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/sup.gif" height=9></TD>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coinsupd.gif" height=9></TD>';
str+='</TR>';
str+='<TR height="20">';
str+='<TD align="left" valign="top"><img src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/g.gif" width="15"  height="100%"></TD>';
str+='<TD height="15" width="19"  align=left background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><DIV id="'+this.id+'_DIVICONEG"/></TD>';
str+='<TD width="100%"  align=left vAlign=top background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><DIV  id="'+this.id+'_DIVTITRE"/><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='<TD height="15" width="10" align=left vAlign=top background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><DIV id="'+this.id+'_DIVICONED"/></TD>';
str+='<TD valign="top""><img src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/d.gif" width="15"  height="100%"></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/g.gif"></TD>';
str+='<TD colspan="3"  height="5"  background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"></TD>';
str+='<TD width=10 height="9" valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/d.gif"></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/g.gif"></TD>';
str+='<TD colspan="3" height="3" width="100%" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fillet-separateur.gif"></TD>';
str+='<TD width=10 height="9" valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/d.gif"></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/g.gif">&nbsp;</TD>';
str+='<TD colspan="3" vAlign=top  background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond.gif"><DIV id="'+this.id+'_DIVCONTENU"/></TD>';
str+='<TD width=9 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/d.gif">&nbsp;</TD>';
str+='</TR>';
str+='<TR>';
str+='<TD width=15 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coininfg.gif" height=15></TD>';
str+='<TD colspan="3" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/inf.gif" height=15><IMG height=15 src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/space15_15.gif" width=15></TD>';
str+='<TD width=15 background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coininfd.gif" height=15></TD>';
str+='</TR>';
};
if(this.style=="fenetre2"){
str+='<TR>';
str+='<TD width=9 height=9 align="left" valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coin_haut_g.gif"><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='<TD height=9 colspan="3" valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/centre_haut.gif"></TD>';
str+='<TD width=10 height=9 valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coin_haut_d.gif"><IMG height=9 src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width=9></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD height="16" align="left" valign="top"><img src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/gauche_haut.gif" width="9"  height="100%"></TD>';
str+='<TD width="19" height="16"  align=left background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond-haut.gif"><DIV id="'+this.id+'_DIVICONEG"/></TD>';
str+='<TD width="849"  align=left vAlign=top background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond-haut.gif"><DIV id="'+this.id+'_DIVTITRE"/><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='<TD width="19" height="16" align=left vAlign=top background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond-haut.gif"><DIV id="'+this.id+'_DIVICONED"/></TD>';
str+='<TD valign="top"><img src="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/droite_haut.gif" width="9"  height="100%"></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coin_bas_g.gif"><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='<TD height="9" colspan="3" align=middle vAlign=top background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/centre_bas.gif"><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='<TD width=10 height="9" valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coin_bas_d.gif"><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD width=10 valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/gauche.gif">&nbsp;</TD>';
str+='<TD colspan="3"  vAlign=top background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/fond_bas.gif"><DIV id="'+this.id+'_DIVCONTENU"/></TD>';
str+='<TD valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/droite.gif"><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='</TR>';
str+='<TR>';
str+='<TD valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coin_trebas_g.gif"><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='<TD height=9 colspan="3" valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/centre_trebas.gif"><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='<TD height=9 valign="top" background="'+rialtoConfig.pathRialtoE+'images/imgDiv3D/coin_trebas_d.gif"><img src="'+rialtoConfig.pathRialtoE+'images/imgFenSimple/transparent.gif" width="9" height="9"></TD>';
str+='</TR>';
};
if(this.style=='simpleCadre'){
this.tDecor=document.createElement("TABLE");
this.tDecor.style.top=0;
this.tDecor.style.left=0;
this.tDecor.borderCollapse='collapse';
this.tDecor.cellPading=0;
this.tDecor.cellSpacing=0;
this.tDecor.style.width="100%";
this.tDecor.style.height="100%";
var tbody=document.createElement('TBODY');
var ligne=document.createElement('TR')
this.tDecor.csg=document.createElement('TD');
this.tDecor.csg.style.width=9;
this.tDecor.csg.style.height=15;
this.tDecor.csg.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/coinsupg.gif)";
ligne.appendChild(this.tDecor.csg);
this.tDecor.hs=document.createElement('TD');
this.tDecor.hs.style.width="auto";
this.tDecor.hs.style.height=15;
this.tDecor.hs.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/sup.gif)";
ligne.appendChild(this.tDecor.hs);
this.tDecor.csd=document.createElement('TD');
this.tDecor.csd.style.width=9;
this.tDecor.csd.style.height=15;
this.tDecor.csd.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/coinsupd.gif)";
ligne.appendChild(this.tDecor.csd);
tbody.appendChild(ligne);
ligne=document.createElement('TR')
this.tDecor.g=document.createElement('TD');
this.tDecor.g.style.width=9;
this.tDecor.g.style.height="100%";
this.tDecor.g.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/g.gif)";
ligne.appendChild(this.tDecor.g);
var fc=document.createElement('TD');
fc.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/fond.gif)";
this.tDecor.zoneCentrale=document.createElement('DIV');
fc.appendChild(this.tDecor.zoneCentrale);
ligne.appendChild(fc);
this.tDecor.d=document.createElement('TD');
this.tDecor.d.style.width=9;
this.tDecor.d.style.height="100%";
this.tDecor.d.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/d.gif)";
ligne.appendChild(this.tDecor.d);
tbody.appendChild(ligne);
ligne=document.createElement('TR')
this.tDecor.cig=document.createElement('TD');
this.tDecor.cig.style.width=13;
this.tDecor.cig.style.height=15;
this.tDecor.cig.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/coininfg.gif)";
ligne.appendChild(this.tDecor.cig);
this.tDecor.hi=document.createElement('TD');
this.tDecor.hi.style.height=15;
this.tDecor.hi.style.width="auto";
this.tDecor.hi.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/inf.gif)";
ligne.appendChild(this.tDecor.hi);
this.tDecor.cid=document.createElement('TD');
this.tDecor.cid.style.width=13;
this.tDecor.cid.style.height=15;
this.tDecor.cid.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/coininfd.gif)";
ligne.appendChild(this.tDecor.cid);
tbody.appendChild(ligne);
this.tDecor.appendChild(tbody);
}
else
if(this.style=='cadreFenetreSansTirette'){
this.tDecor=document.createElement("TABLE");
this.tDecor.style.top=0;
this.tDecor.style.left=0;
this.tDecor.borderCollapse='collapse';
this.tDecor.cellPading=0;
this.tDecor.cellSpacing=0;
this.tDecor.style.width="100%";
this.tDecor.style.height="100%";
var tbody=document.createElement('TBODY');
var ligne=document.createElement('TR')
this.tDecor.csgh=document.createElement('TD');
this.tDecor.csgh.style.width=9;
this.tDecor.csgh.style.height=8;
this.tDecor.csgh.style.background="url('"+rialtoConfig.pathRialtoE+"images/imgDiv3D/haut-g1.gif')";
ligne.appendChild(this.tDecor.csgh);
this.tDecor.hsh=document.createElement('TD');
this.tDecor.hsh.style.height='auto';
this.tDecor.hsh.style.background="url('"+rialtoConfig.pathRialtoE+"images/imgDiv3D/haut-centre.gif')";
ligne.appendChild(this.tDecor.hsh);
this.tDecor.csdh=document.createElement('TD');
this.tDecor.csdh.style.width=9;
this.tDecor.csdh.style.height=8;
this.tDecor.csdh.style.background="url('"+rialtoConfig.pathRialtoE+"images/imgDiv3D/haut-d1.gif')";
ligne.appendChild(this.tDecor.csdh);
tbody.appendChild(ligne);
var ligne=document.createElement('TR')
ligne.style.backgroundColor='white';
this.tDecor.csgb=document.createElement('TD');
this.tDecor.csgb.style.width=9;
this.tDecor.csgb.style.height=24;
this.tDecor.csgb.style.background="url('"+rialtoConfig.pathRialtoE+"images/imgDiv3D/haut-g2.gif')";
ligne.appendChild(this.tDecor.csgb);
this.tDecor.chh=document.createElement('TD');
this.tDecor.chh.style.width="auto";
this.tDecor.chh.background="url('"+rialtoConfig.pathRialtoE+"images/imgFenSimple/transparent.gif')";
ligne.appendChild(this.tDecor.chh);
this.tDecor.csdb=document.createElement('TD');
this.tDecor.csdb.style.width=9;
this.tDecor.csdb.style.height=24;
this.tDecor.csdb.style.background="url('"+rialtoConfig.pathRialtoE+"images/imgDiv3D/haut-d2.gif')";
ligne.appendChild(this.tDecor.csdb);
tbody.appendChild(ligne);
ligne=document.createElement('TR')
this.tDecor.g=document.createElement('TD');
this.tDecor.g.style.background="url('"+rialtoConfig.pathRialtoE+"images/imgDiv3D/gauche.gif')";
ligne.appendChild(this.tDecor.g);
var fc=document.createElement('TD');
fc.style.background="url('"+rialtoConfig.pathRialtoE+"images/imgDiv3D/fond.gif')";
this.tDecor.zoneCentrale=document.createElement('DIV');
fc.appendChild(this.tDecor.zoneCentrale);
ligne.appendChild(fc);
this.tDecor.d=document.createElement('TD');
this.tDecor.d.style.background="url('"+rialtoConfig.pathRialtoE+"images/imgDiv3D/droit.gif')";
ligne.appendChild(this.tDecor.d);
tbody.appendChild(ligne);
ligne=document.createElement('TR')
this.tDecor.cig=document.createElement('TD');
this.tDecor.cig.style.width=9;
this.tDecor.cig.style.background="url('"+rialtoConfig.pathRialtoE+"images/imgDiv3D/bas-gauche.gif')";
ligne.appendChild(this.tDecor.cig);
this.tDecor.hi=document.createElement('TD');
this.tDecor.hi.colspan=2;
this.tDecor.hi.style.height=12;
this.tDecor.hi.style.background="url('"+rialtoConfig.pathRialtoE+"images/imgDiv3D/bas_centre.gif')";
ligne.appendChild(this.tDecor.hi);
this.tDecor.cid=document.createElement('TD');
this.tDecor.cid.style.width=9;
this.tDecor.cid.style.background="url('"+rialtoConfig.pathRialtoE+"images/imgDiv3D/bas-droit.gif')";
ligne.appendChild(this.tDecor.cid);
tbody.appendChild(ligne);
this.tDecor.appendChild(tbody);
}
else
if(this.style=='dockBar_navigListe_Editeur'){
this.vueDockBarGen();
this.dockBar.img=new Array;
this.dockBar.img['First']='btonFirstDoct';
this.dockBar.img['Prev']='btonPrevDoct';
this.dockBar.img['Next']='btonNextDoct';
this.dockBar.img['Last']='btonLastDoct';
this.dockBar.img['Fin']='btonFinListe';
this.dockBar.img['NoPrev']='btonPrevDoctSob';
this.dockBar.img['NoNext']='btonNextDoctSob';
this.dockBar.img['Espace']='espaceSep';
}
else
if(this.style=='dockBar_reSize_Fenetre'){
this.vueDockBarGen();
this.dockBar.img=new Array;
this.dockBar.img['Min']='btonFenReduc';
this.dockBar.img['Max']='btonFenMax';
this.dockBar.img['Close']='btonFenFerm';
this.dockBar.img['Res']='btonFenRestaur';
this.dockBar.img['Espace']='espaceSep';
this.dockBar.img['WinsMin']='btonFenReduc';
this.dockBar.img['WinsRes']='btonFenRestaur';
this.dockBar.img['WinsClose']='btonFenFerm';
}
else
if(this.style=='FenetreAvecTirette'){
this.diffExtInt=22;
this.hTitre=32;
this.hBasCadre=12;
this.wBords=9+9;
this.hBordBas=12;
this.majTirette=function(width){
this.tDecor.divTirette.style.left=(width/2)
-(getComputStyle(this.tDecor.divTirette,'width')/2);
}
this.affTirette=function(){
this.tDecor.divTirette.style.display='block';
}
this.masqueTirette=function(){
this.tDecor.divTirette.style.display='none';
}
this.tDecor=document.createElement("TABLE");
this.tDecor.style.top=0;
this.tDecor.style.left=0;
this.tDecor.borderCollapse='collapse';
this.tDecor.cellPading=0;
this.tDecor.cellSpacing=0;
this.tDecor.style.width="100%";
this.tDecor.style.height="100%";
var tbody=document.createElement('TBODY');
this.tDecor.fLigne=document.createElement('TR')
this.tDecor.csgh=document.createElement('TD');
this.tDecor.csgh.style.width=9;
this.tDecor.csgh.style.height=8;
this.tDecor.csgh.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/haut-g1.gif)";
this.tDecor.fLigne.appendChild(this.tDecor.csgh);
this.tDecor.cTirette=document.createElement('TD');
this.tDecor.cTirette.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/haut-centre.gif)";
this.tDecor.divTirette=document.createElement('DIV');
this.tDecor.divTirette.style.width='83px';
this.tDecor.divTirette.style.height=6;
this.tDecor.divTirette.style.position='absolute';
this.tDecor.divTirette.style.left=0;
this.tDecor.divTirette.style.top=0;
this.tDecor.tirette=document.createElement('IMG');
this.tDecor.tirette.src=rialtoConfig.pathRialtoE+"images/imgDiv3D/tirette_popup.gif";
this.tDecor.tirette.style.height='19';
this.tDecor.divTirette.appendChild(this.tDecor.tirette);
this.tDecor.cTirette.appendChild(this.tDecor.divTirette);
this.tDecor.fLigne.appendChild(this.tDecor.cTirette);
this.tDecor.csdh=document.createElement('TD');
this.tDecor.csdh.style.width=9;
this.tDecor.csdh.style.height=8;
this.tDecor.csdh.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/haut-d1.gif)";
this.tDecor.fLigne.appendChild(this.tDecor.csdh);
tbody.appendChild(this.tDecor.fLigne);
var ligne=document.createElement('TR')
ligne.style.backgroundColor='white';
this.tDecor.csgb=document.createElement('TD');
this.tDecor.csgb.style.width=9;
this.tDecor.csgb.style.height=24;
this.tDecor.csgb.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/haut-g2.gif)";
ligne.appendChild(this.tDecor.csgb);
this.tDecor.cTabl=document.createElement('TD');
this.tDecor.cTabl.style.width="auto";
this.tBarreTitre=document.createElement("TABLE");
this.tBarreTitre.style.tableLayout="fixed";
this.tBarreTitre.style.top=0;
this.tBarreTitre.style.left=0;
this.tBarreTitre.borderCollapse='collapse';
this.tBarreTitre.cellPading=0;
this.tBarreTitre.cellSpacing=0;
this.tBarreTitre.style.width="100%";
var tbodyTitre=document.createElement('TBODY');
this.ligneTitre=document.createElement('TR');
this.tDecor.cIco=document.createElement('TD');
this.tDecor.cIco.style.width=20;
this.tDecor.cIco.style.height=19;
this.tDecor.divIco=document.createElement('DIV');
this.tDecor.divIco.style.width="20";
this.tDecor.divIco.style.height='19';
this.tDecor.divIco.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/icon_box2.gif)";
this.tDecor.cIco.appendChild(this.tDecor.divIco);
this.ligneTitre.appendChild(this.tDecor.cIco);
this.tDecor.cNom=document.createElement('TD');
this.tDecor.divNom=document.createElement('DIV');
this.tDecor.divNom.appendChild(document.createTextNode("Nom ? double rallonges de l'application"));
this.tDecor.divNom.className="titreFenetre";
this.tDecor.cNom.appendChild(this.tDecor.divNom);
this.ligneTitre.appendChild(this.tDecor.cNom);
this.tDecor.cSepApTitre=document.createElement('TD');
this.tDecor.cSepApTitre.style.width='20';
this.ligneTitre.cellAfterTittle=this.tDecor.cSepApTitre;
this.tDecor.divSepApTitre=document.createElement('DIV');
this.tDecor.cSepApTitre.appendChild(this.tDecor.divSepApTitre);
this.ligneTitre.appendChild(this.tDecor.cSepApTitre);
this.ligneTitre.img=new Array;
this.ligneTitre.img['Min']='btonFenReduc';
this.ligneTitre.img['Max']='btonFenMax';
this.ligneTitre.img['Close']='btonFenFerm';
this.ligneTitre.img['Res']='btonFenRestaur';
this.ligneTitre.img['Espace']='espaceSep';
this.ligneTitre.img['WinsMin']='btonFenReduc';
this.ligneTitre.img['WinsRes']='btonFenRestaur';
this.ligneTitre.img['WinsClose']='btonFenFerm';
this.ligneTitre.addScdName=function(scdName){
this.divNom.firstChild.nodeValue+=' - ['+scdName+']';
}
this.ligneTitre.removeScdName=function(){
var titrePrinc=this.divNom.firstChild.nodeValue.replace(/\s-\s\[.+\]/g,'');
this.divNom.firstChild.nodeValue=titrePrinc;
}
this.ligneTitre.displayBton=function(pos,type,mode){
traceExec('displayBton  pos= '+pos+' type= '+type+' mode= '+mode,61);
var div=this.lCellBtons[pos].firstChild;
if(!div.lImg[type])
alert('Aucun bouton de ce type enregistr? ? cette position');
else{
div.className=div.lImg[type]+mode;
div.currentType=type;
}
}
this.ligneTitre.remBton=function(pos){
this.removeChild(this.lCellBtons[pos]);
if(pos==(this.lCellBtons.length-1))
this.lCellBtons.length--;
}
this.ligneTitre.addBton=function(pos,type,img){
if(!this.lCellBtons){
this.lCellBtons=new Array;
}
if((this.lCellBtons.length-1)<pos){
var cSep;
for(var i=this.lCellBtons.length;i<pos;i++){
cSep=document.createElement('TD');
cSep.style.width='20';
var divSep=document.createElement('DIV');
cSep.appendChild(divSep);
this.lCellBtons[i]=cSep;
this.lCellBtons[i].espace=true;
this.appendChild(cSep);
}
this.lCellBtons[pos]=document.createElement('TD');
this.lCellBtons[pos].style.width='20';
var div=document.createElement('DIV');
if(type.indexOf('space')==-1){
var refImg=img?img:this.img[type];
div.className=refImg+'Off';
div.lImg=new Array;
div.lImg[type]=refImg;
div.currentType=type;
traceExec('div3D div.currentType= '+div.currentType+' type= '+type,61);
div.onmouseout=function(){
this.className=this.lImg[this.currentType]+'Off';
}
div.onmouseover=function(){
this.className=this.lImg[this.currentType]+'On';
}
}
this.lCellBtons[pos].appendChild(div);
this.appendChild(this.lCellBtons[pos]);
}
else{
if(type.indexOf('space')==-1){
var div=this.lCellBtons[pos].firstChild;
if(!div.lImg){
div.lImg=new Array;
div.onmouseout=function(){
this.className=this.lImg[this.currentType]+'Off';
}
div.onmouseover=function(){
this.className=this.lImg[this.currentType]+'On';
}
}
var refImg=img?img:this.img[type];
div.className=refImg+'Off';
div.lImg[type]=refImg;
div.currentType=type;
traceExec('div3D ++ div.currentType= '+div.currentType+' type= '+type,61);
}
}
return div;
}
tbodyTitre.appendChild(this.ligneTitre);
this.tBarreTitre.appendChild(tbodyTitre);
this.tDecor.cTabl.appendChild(this.tBarreTitre);
ligne.appendChild(this.tDecor.cTabl);
this.tDecor.csdb=document.createElement('TD');
this.tDecor.csdb.style.width=9;
this.tDecor.csdb.style.height=24;
this.tDecor.csdb.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/haut-d2.gif)";
ligne.appendChild(this.tDecor.csdb);
tbody.appendChild(ligne);
this.ligneCentre=document.createElement('TR')
this.tDecor.g=document.createElement('TD');
this.tDecor.g.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/gauche.gif)";
this.ligneCentre.appendChild(this.tDecor.g);
var fc=document.createElement('TD');
fc.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/fond.gif)";
this.tDecor.zoneCentrale=document.createElement('DIV');
fc.appendChild(this.tDecor.zoneCentrale);
this.ligneCentre.appendChild(fc);
this.tDecor.d=document.createElement('TD');
this.tDecor.d.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/droit.gif)";
this.ligneCentre.appendChild(this.tDecor.d);
tbody.appendChild(this.ligneCentre);
ligne=document.createElement('TR')
this.tDecor.cig=document.createElement('TD');
this.tDecor.cig.style.width=9;
this.tDecor.cig.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/bas-gauche.gif)";
ligne.appendChild(this.tDecor.cig);
this.tDecor.hi=document.createElement('TD');
this.tDecor.hi.colspan=2;
this.tDecor.hi.style.height=12;
this.tDecor.hi.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/bas_centre.gif)";
ligne.appendChild(this.tDecor.hi);
this.tDecor.cid=document.createElement('TD');
this.tDecor.cid.style.width=9;
this.tDecor.cid.style.background="url("+rialtoConfig.pathRialtoE+"images/imgDiv3D/bas-droit.gif)";
ligne.appendChild(this.tDecor.cid);
tbody.appendChild(ligne);
this.tDecor.appendChild(tbody);
}
if(this.mode=='sansInnerHtml'){
if(this.parent)
this.parent.appendChild(this.tDecor);
return;
}
str+='</TBODY>';
str+='</TABLE>';
this.parent.innerHTML+=str;
this.DivIconeG=document.getElementById(this.id+"_DIVICONEG");
this.DivIconeD=document.getElementById(this.id+"_DIVICONED");
if(this.DivIconeD){this.DivIconeD.style.position="absolute";}
this.DivTitre=document.getElementById(this.id+"_DIVTITRE");
if(this.DivTitre){
this.DivTitre.className="div3D_DivTitre";
if(this.titre!=""){
this.DivTitre.appendChild(document.createTextNode(this.titre));
}
}
this.DivContenu=document.getElementById(this.id+"_DIVCONTENU");
}
objDiv3D.prototype.vueDockBarGen=function(){
this.tDecor=document.createElement("TABLE");
this.tDecor.style.tableLayout="fixed";
this.tDecor.style.top=0;
this.tDecor.style.left=0;
this.tDecor.borderCollapse='collapse';
this.tDecor.cellPading=0;
this.tDecor.cellSpacing=0;
this.tDecor.style.height="100%";
var tBody=document.createElement('TBODY');
this.dockBar=document.createElement('TR')
this.dockBar.setImgOpt=function(tAssocImgOpt){
this.dockBar.img=tAssocImgOpt;
}
this.dockBar.displayBton=function(pos,type,mode){
traceExec('displayBton  pos= '+pos+' type= '+type+' mode= '+mode,61);
var div=this.lCellBtons[pos].firstChild;
if(!div.lImg[type]){
alert('Aucun bouton de ce type ('+type+') enregistr? ? cette position ('+pos+')');
}
else{
div.className=div.lImg[type]+mode;
div.currentType=type;
}
}
this.dockBar.remBton=function(pos){
this.removeChild(this.lCellBtons[pos]);
if(pos==(this.lCellBtons.length-1))
this.lCellBtons.length--;
}
this.dockBar.addBton=function(pos,type,img){
if(!this.lCellBtons){
this.lCellBtons=new Array;
}
if((this.lCellBtons.length-1)<pos){
var cSep;
for(var i=this.lCellBtons.length;i<pos;i++){
cSep=document.createElement('TD');
cSep.style.width='20';
var divSep=document.createElement('DIV');
cSep.appendChild(divSep);
this.lCellBtons[i]=cSep;
this.lCellBtons[i].espace=true;
this.appendChild(cSep);
}
this.lCellBtons[pos]=document.createElement('TD');
this.lCellBtons[pos].style.width='20';
var div=document.createElement('DIV');
if(type.indexOf('space')==-1){
var refImg=img?img:this.img[type];
div.className=refImg+'Off';
div.lImg=new Array;
div.lImg[type]=refImg;
div.currentType=type;
traceExec('div3D div.currentType= '+div.currentType+' type= '+type,61);
div.onmouseout=function(){
this.className=this.lImg[this.currentType]+'Off';
}
div.onmouseover=function(){
this.className=this.lImg[this.currentType]+'On';
}
}
this.lCellBtons[pos].appendChild(div);
this.appendChild(this.lCellBtons[pos]);
}
else{
if(type.indexOf('space')==-1){
var div=this.lCellBtons[pos].firstChild;
if(!div.lImg){
div.lImg=new Array;
div.onmouseout=function(){
this.className=this.lImg[this.currentType]+'Off';
}
div.onmouseover=function(){
this.className=this.lImg[this.currentType]+'On';
}
}
var refImg=img?img:this.img[type];
div.className=refImg+'Off';
div.lImg[type]=refImg;
div.currentType=type;
traceExec('div3D ++ div.currentType= '+div.currentType+' type= '+type,61);
}
}
return div;
}
tBody.appendChild(this.dockBar);
this.tDecor.appendChild(tBody);
}
function DockBar(direction){
this.dir=direction||'';
if(this.dir=='H')this.dir='';
this.dockBar=this;
this.oHtml=document.createElement('DIV');
this.oHtml.className='dockBar';
this.lCell=new Array;
this.setImgOpt=function(tAssocImgOpt){
this.img=tAssocImgOpt;
}
this.replaceBton=function(pos,type,img){
}
this.clearBton=function(pos,type,img){
}
this.addBton=function(pos,type,img){
if(!this.lCell['Btons']){
this.lCell['Btons']=new Array;
}
var div=this.lCell['Btons'][pos];
if(!div){
div=this.lCell['Btons'][pos]=document.createElement('DIV');
this.oHtml.appendChild(div);
div.lImg=new Array;
var oThis=this;
div.onmouseout=function(){
this.className='buttonDB'+oThis.dir+' '+this.lImg[this.currentType]+'Off';
}
div.onmouseover=function(){
this.className='buttonDB'+oThis.dir+' '+this.lImg[this.currentType]+'On';
}
}
var refImg=img?img:this.img[type];
div.className='buttonDB'+this.dir+' '+refImg+'Off';
div.lImg[type]=refImg;
div.currentType=type;
return div;
}
this.addLibel=function(libel,pos,width,bBorder){
if(!this.lCell['Libels']){
this.lCell['Libels']=new Array;
}
var div=this.lCell['Libels'][pos];
if(!div){
div=this.lCell['Libels'][pos]=document.createElement('DIV');
this.oHtml.appendChild(div);
}
else{
div.removeChild(div.firstChild);
}
div.text=libel;
div.bBorder=bBorder;
div.appendChild(document.createTextNode(div.text));
div.className='libelDB'+this.dir+(bBorder?' DB_border':'');
if(width){
div.style.width=width;
div.style.overflow='hidden';
}
div.replaceText=function(text){
this.text=text;
if(this.firstChild)
this.replaceChild(window.document.createTextNode(this.text),this.firstChild);
else
this.appendChild(window.document.createTextNode(this.text));
this.noHidden();
}
div.noHidden=function(){
this.className=this.className.replace(/\s*masqueElt\s*/g,'');
}
div.hidden=function(){
div.className+=' masqueElt';
}
return div;
}
this.displayBton=function(pos,type,mode){
traceExec('displayBton  pos= '+pos+' type= '+type+' mode= '+mode,61);
var div=this.lCell['Btons'][pos];
if(!div){
alert('Aucun bouton enregistr? ? cette position (ou avec cette d?nomination)('+pos+')');
}
else
if(!div.lImg[type]){
alert('Aucun bouton de ce type ('+type+') enregistr? ? cette position ('+pos+')');
}
else{
div.className='buttonDB'+this.dir+' '+div.lImg[type]+mode;
div.currentType=type;
}
}
this.img=new Array;
this.img['First']='btonFirstDoct';
this.img['Prev']='btonPrevDoct';
this.img['Next']='btonNextDoct';
this.img['Last']='btonLastDoct';
this.img['Fin']='btonFinListe';
this.img['NoPrev']='btonPrevDoctSob';
this.img['NoNext']='btonNextDoctSob';
this.img['NoFirst']='btonFirstDoctSob';
this.img['NoFin']='btonFinListeSob';
this.img['Espace']='espaceSep';
}
DockBar.prototype.placeIn=function(oHtmlParent){
oHtmlParent.appendChild(this.oHtml);
}
if((typeof ria)=='undefined')
ria=rialto;
if((typeof ria.utils)=='undefined')
ria.utils={};
ria.utils.event={};
ria.utils.event.genericAddEvent=function(oHtml,e,handler){
if(oHtml.attachEvent)
oHtml.attachEvent("on"+e,handler);
else
oHtml.addEventListener(e,handler,false);
};
ria.utils.event.genericRemoveEvent=function(oHtml,e,handler){
if(oHtml.detachEvent)
oHtml.detachEvent("on"+e,handler);
else
oHtml.removeEventListener(e,handler,false);
};
function stopEvent(e)
{
if(!e)var e=window.event;
if(e.stopPropagation)e.stopPropagation();
else e.cancelBubble=true;
if(e.preventDefault)e.preventDefault();
else e.returnValue=false;
}
function stopDefault(e)
{
if(!e)var e=window.event;
if(e.preventDefault)
e.preventDefault();
else
e.returnValue=false;
}
function propageEvent(e){
if(!e)var e=window.event;
if(!e.stopPropagation)
e.cancelBubble=false;
if(e.preventDefault)e.preventDefault();
else e.returnValue=false;
}
function addHandler(oHtml,typeEvt,handler,oThis){
if(!oHtml.tHandler)
oHtml.tHandler=new Array();
if(!oHtml.tHandler[typeEvt])
oHtml.tHandler[typeEvt]=new Array();
oHtml.tHandler[typeEvt][oHtml.tHandler[typeEvt].length]={fct:handler,oThis:oThis};
var fct='{';
for(var i=0;i<oHtml.tHandler[typeEvt].length;i++)
if(oHtml.tHandler[typeEvt][i].oThis)
fct+=oHtml.tHandler[typeEvt][i].fct+'(e,this);';
else
fct+='this.'+oHtml.tHandler[typeEvt][i].fct+'(e);';
fct+='}';
oHtml[typeEvt]=new Function('e',fct);
}
DirDeplact=function(oHtml,e,height,width,margeSens,exclusionMarge,specOrientation)
{
var limOrientation=specOrientation||oHtml.dirRS;
traceExec('dirdeplact margeSens= '+margeSens,75);
margeSens=margeSens||0;
traceExec('limOrientation = '+limOrientation,76);
traceExec('DirDeplact -entree-',58);
traceExec('oHtml.id= '+oHtml.id,58);
traceExec(' -- test/zone sensible='+(exclusionMarge?'centre':'marge'),58);
traceExec(' -- larg. marge = '+margeSens,58);
traceExec(' -- height = '+height+' width= '+width+' limOrientation= '+limOrientation,58);
traceExec('oHtml.style.border= '+oHtml.style.border,58);
traceExec('oHtml.style.borderLeftWidth= '+oHtml.style.borderLeftWidth,58);
traceExec('oHtml.style.borderTopWidth= '+oHtml.style.borderTopWidth,58);
var dir="";
var xy=_rum.$eventTopLeftInDiv(e);
var xPRC=xy.left;
var yPRC=xy.top;
traceExec(' -- pos Rel Curs x='+xPRC+' y='+yPRC,75);
traceExec('margeSens = '+margeSens,75);
traceExec(' -- limites width:'+width+' height:'+height,75);
if(exclusionMarge){
if((margeSens!=0)
&&(
(xPRC<margeSens)
||(xPRC>(width-margeSens))
||(yPRC<margeSens)
||(yPRC>(height-margeSens)))
)
dir=''
else{
if(limOrientation=='h')
dir='w';
else
if(limOrientation=='v')
dir='n';
else
dir='x';
}
}
else{
if(limOrientation!='h')
if(yPRC<margeSens)
dir="n";
else if(yPRC>(height-margeSens))
dir="s";
if(limOrientation!='v')
if(xPRC<margeSens)
dir+="w";
else if(xPRC>(width-margeSens))
dir+="e";
traceExec('(width - margeSens) = '+(width-margeSens),58);
}
window.status=(exclusionMarge?'interne ':'marge ')+'height='+height+' width= '+width+' marge = '+margeSens+" xPRC= "+xPRC+" yPRC= "+yPRC+" dir= "+dir;
traceExec(' -- dir retourn?e= '+dir,58);
return dir;
}
rialto.widget.Form=function(formName,url,parent,objPar){
var objParam={
type:"form",
name:formName
}
this.base=rialto.widget.AbstractContainer;
this.base(objParam);
this.action=url;
this.url=url;
this.autoSubmit=true;
this.imgBtonSubmit=null;
this.idCont=null;
this.boolWithFenWait=true;
this.boolAsynch=true;
this.method="get";
this.boolIframe=false;
this.canBeCancel=true;
if(objPar){
if(objPar.imgBtonSubmit){
this.imgBtonSubmit=objPar.imgBtonSubmit;
}
if(rialto.lang.isBoolean(objPar.autoSubmit)){
this.autoSubmit=objPar.autoSubmit;
}
if(rialto.lang.isStringIn(objPar.method,["post","get"])){
this.method=objPar.method;
}
if(rialto.lang.isBoolean(objPar.boolWithFenWait)){
this.boolWithFenWait=objPar.boolWithFenWait;
}
if(rialto.lang.isBoolean(objPar.boolAsynch)){
this.boolAsynch=objPar.boolAsynch;
}
if(objPar.idCont){
this.idCont=objPar.idCont;
var primCar=this.url.indexOf("?")!=-1?'&':'?';
this.url+=primCar+'FENID='+objPar.idCont;
}
if(rialto.lang.isBoolean(objPar.canBeCancel)){
this.canBeCancel=objPar.canBeCancel;
}
if(rialto.lang.isBoolean(objPar.boolIframe)){
this.boolIframe=objPar.boolIframe;
}
if(objPar.onSuccess){
this.onSuccess=objPar.onSuccess;
}
if(objPar.callBackObjectOnSuccess){
this.callBackObjectOnSuccess=objPar.callBackObjectOnSuccess;
}
}
var oThis=this;
this.formulaire=document.createElement("FORM");
this.formulaire.style.position="relative";
this.formulaire.method=this.method;
if(!this.boolIframe){
this.remote=new rialto.io.AjaxRequest({
url:this.url,
method:this.method,
callBackObjectOnSuccess:this.callBackObjectOnSuccess,
withWaitWindow:this.boolWithFenWait,
canBeCancel:this.canBeCancel,
onSuccess:this.onSuccess
})
}
if(this.autoSubmit){
this.formulaire.onkeypress=function(evt){
if(!evt){evt=window.event;}
var key=evt.keyCode?evt.keyCode:
evt.charCode?evt.charCode:
evt.which?evt.which:void 0;
if(key==13){
document.onselectstart=new Function("return false")
oThis.submitForm();
return false;
}
}
}
if(this.imgBtonSubmit){
this.imgBtonSubmit.oCiu=this;
this.affComportBtonSubmit();
}
if(parent){this.placeIn(parent);};
objPar=null;
objParam=null;
}
rialto.widget.Form.prototype=new rialto.widget.AbstractContainer;
rialto.widget.Form.prototype.tabIndex=1;
rialto.widget.Form.prototype.nbReq=0;
rialto.widget.Form.prototype.release=function(imgBtonSubmit){
this.formulaire.onkeypress=null;
if(this.imgBtonSubmit){
if(this.imgBtonSubmit.remove){this.imgBtonSubmit.remove()};
this.imgBtonSubmit.oCiu=null;
this.imgBtonSubmit.onclick=null;
}
}
rialto.widget.Form.prototype.addBtonSubmit=function(imgBtonSubmit){
this.imgBtonSubmit=imgBtonSubmit;
this.imgBtonSubmit.oCiu=this;
this.affComportBtonSubmit();
}
rialto.widget.Form.prototype.affComportBtonSubmit=function(){
this.imgBtonSubmit.onclick=function(){
this.oCiu.submitForm();
}
}
rialto.widget.Form.prototype.getHtmlExt=function(){
return this.formulaire;
}
rialto.widget.Form.prototype.getHtmlCont=function(){
return this.formulaire;
}
rialto.widget.Form.prototype.buildQueryString=function(){
var qs=''
for(e=0;e<this.formulaire.elements.length;e++){
var elmt=this.formulaire.elements[e];
if(elmt.name!=''){
if(elmt.type=="radio"&&elmt.checked==true){
qs+='&'+elmt.name+'='+escape(elmt.value)
}
else{
if(elmt.type!="radio"){
qs+='&'+elmt.name+'='+escape(elmt.value)
}
}
}
}
if(qs!=''){qs=qs.substring(1);}
return qs;
}
rialto.widget.Form.prototype.resetForm=function(){
this.formulaire.reset();
}
rialto.widget.Form.prototype.submitForm=function(){
if(this.onSubmitForm()){
if(this.boolAsynch){
if(!this.boolIframe){
this.remote.load(this.buildQueryString());
}
else{
var idExtReq=++rialto.widget.Form.prototype.nbReq;
if(!this.iframe){
this.iframe=new objFrame("ifr",0,0,0,0);
this.iframe.create(this.formulaire);
}
var primCar=this.url.indexOf("?")!=-1?'&':'?';
this.lastURL=this.url+primCar+this.buildQueryString();
alert(this.lastURL);
this.iframe.load(this.lastURL);
if(this.boolWithFenWait){
this.fenWait=new objFenWait("TRAITEMENT EN COURS",this.lastURL,this.idCont,idExtReq)
}
}
}
else{
this.formulaire.action=this.action;
this.formulaire.submit();
}
this.afterSubmitForm();
}
}
rialto.widget.Form.prototype.onSubmitForm=function(){return true;}
rialto.widget.Form.prototype.afterSubmitForm=function(){return true;}
rialto.widget.Form.prototype.setURL=function(url){
this.url=url;
if(this.idCont){
var primCar=this.url.indexOf("?")!=-1?'&':'?';
this.url+=primCar+'FENID='+this.idCont;
}
}
rialto.widget.Frame=function(objPar){
this.base=rialto.widget.AbstractContainer;
objPar.type="frame";
this.base(objPar);
this.title="Frame";
this.printTitle=this.title;
this.dynamic=false;
this.open=true;
this.boolPrint=false;
this.boolMaxi=false;
this.autoResizeContenu=false;
this.autoResizeParent=false;
this.autoResizableH=false;
this.autoResizableW=false;
if(rialto.lang.isBoolean(objPar.dynamic)){
this.dynamic=objPar.dynamic;
}
if(rialto.lang.isBoolean(objPar.open)){
this.open=objPar.open;
}
if(rialto.lang.isString(objPar.title)){
this.title=objPar.title;
this.titrePrint=this.title;
}
if(rialto.lang.isString(objPar.printTitle)){
this.printTitle=objPar.printTitle;
}
if(rialto.lang.isBoolean(objPar.autoResizeContenu)){
this.autoResizeContenu=objPar.autoResizeContenu;
}
if(rialto.lang.isBoolean(objPar.autoResizeParent)){
this.autoResizeParent=objPar.autoResizeParent;
this.autoResizableH=this.autoResizeParent;
}
if(rialto.lang.isBoolean(objPar.boolPrint)){
this.boolPrint=objPar.boolPrint;
}
if(rialto.lang.isBoolean(objPar.boolMaxi)){
this.boolMaxi=objPar.boolMaxi;
}
var oThis=this;
this.divExt.style.top=this.top;
this.divExt.style.left=this.left;
this.divExt.style.width=this.width;
this.divExt.style.height=this.height;
this.divExt.style.position=this.position;
this.divExt.style.backgroundColor="#F3F3F3";
this.divExt.id=this.name;
this.cadre=document.createElement("DIV");
this.cadre.id=this.id;
this.cadre.name=this.name;
this.cadre.style.position="relative";
this.cadre.className="div-cadre";
this.cadre.style.width='100%';
this.divExt.appendChild(this.cadre);
if(objPar.parent){this.placeIn(objPar.parent);};
objPar=null;
}
rialto.widget.Frame.prototype=new rialto.widget.AbstractContainer;
rialto.widget.Frame.prototype.adaptToContext=function(){
if(this.autoResizableH){
this.divExt.style.height=this.getNewParentHeight()-this.divExt.offsetTop;
}
else{
this.divExt.style.height=this.height;
}
if(this.autoResizableW){
this.divExt.style.width=this.getNewParentWidth()-this.divExt.offsetLeft;
}
else{
this.divExt.style.width=this.width;
}
if(this.dynamic==true){
this.cadre.style.height=this.divExt.offsetHeight-this.cadre.offsetTop;
}
else{
this.cadre.style.height='100%';
}
this.oldHeight=this.divExt.offsetHeight;
this.oldWidth=this.divExt.offsetWidth;
var oThis=this;
if(this.dynamic){
this.cadre.style.top=25;
this.toolBar=new rialto.widget.ToolBar({width:"100%",parent:this.divExt});
this.toolBar.ondbleclick=function(){
oThis.setDisplay(!oThis.open);
}
this.labelTitle=new rialto.widget.Label("",3,10,this.toolBar,this.title,"div-titlecbig");
ob={position:'relative',boolFloatRight:true}
if(this.open==false){
this.cadre.style.display="none";
this.divExt.style.height=25;
this.BTN=new rialto.widget.Image("moreButtonOff",0,2,this.toolBar,"Open the frame","moreButtonOn",ob);
}
else
{
this.cadre.style.display="block";
this.BTN=new rialto.widget.Image("lessButtonOff",0,2,this.toolBar,"Close the frame","lessButtonOn",ob);
}
this.BTN.onclick=function(){
oThis.setDisplay(!oThis.open);
};
if(this.boolMaxi){
this.bMAX=new rialto.widget.Image("maxButtonOff",-5,2,this.toolBar,"Maximise/minimise the frame","maxButtonOn",ob);
this.max=false;
this.bMAX.onclick=function(){
oThis.maximize();
};
}
if(this.boolPrint){
this.bPrint=new rialto.widget.Image("printButtonOff",-10,2,this.toolBar,"Print the content","printButtonOn",ob);
this.bPrint.onclick=function(){
oThis.print();
};
}
}
else{
this.cadre.style.border="1px outset white";
if(!window.event){
this.cadre.style.borderTopColor="gray";
this.cadre.style.borderLeftColor="gray";
}
this.labelTitle=new rialto.widget.Label("",-8,5,this.divExt,this.title,"div-titlecsmall",{position:'absolute'});
}
}
rialto.widget.Frame.prototype.release=function(){
if(this.dynamic){
this.BTN.onclick=null;
if(this.boolMaxi){
this.boolMaxi.onclick=null;
}
if(this.boolPrint){
this.boolPrint.onclick=null;
}
this.toolBar.ondbleclick=null;
}
}
rialto.widget.Frame.prototype.getHtmlDD=function(){
if(this.dynamic){return this.toolBar.divExt}
else{return this.divExt;}
}
rialto.widget.Frame.prototype.getHtmlRZ=function(){
return this.cadre;
}
rialto.widget.Frame.prototype.getHtmlImp=function(){
return this.cadre;
}
rialto.widget.Frame.prototype.getHtmlCont=function(){
return this.cadre;
}
rialto.widget.Frame.prototype.addButton=function(objImage){
objImage.getHtmlExt().style.position='relative';
objImage.placeIn(this.DivBTN);
}
rialto.widget.Frame.prototype.print=function(){
if(this.cadre.childNodes.length==1){
if(this.cadre.childNodes[0].oCiu){
if(this.cadre.childNodes[0].oCiu.print){
this.filsAImprimer=this.cadre.childNodes[0].oCiu;
}
}
}
if(this.filsAImprimer){
this.filsAImprimer.printTitle=this.printTitle;
this.filsAImprimer.print();
}
else{
var widthGlobal=document.body.clientWidth;
var heightGlobal=document.body.clientHeight;
this.fenImp=window.open(rialtoConfig.pathRialtoE+'printTab.html','IMPRESSION',"height="+heightGlobal+",width="+widthGlobal+",top=0,left=0,scrollbars,resizable,toolbar,menubar");
var obj=this.getHtmlImp();
this.inner=obj.innerHTML;
this.rempFenImp();
}
}
rialto.widget.Frame.prototype.rempFenImp=function(){
var obj={titre:this.printTitle,divInner:this.inner};
if(this.fenImp.rempPage){
this.fenImp.rempPage(obj);
}
else{
window.setTimeout("rialto.session.objects[\""+this.id+"\"].rempFenImp()",50);
}
}
rialto.widget.Frame.prototype.maximize=function(){
if(!this.open){
this.setDisplay(true);
}
if(this.max==false){
this.bMAX.setImageReference("minButtonOff","minButtonOn")
this.BTN.setVisible(false);
this.divExt.style.top=0;
this.divExt.style.left=0;
this.divExt.style.width='100%';
this.divExt.style.height='100%';
this.divExt.style.position='absolute';
var delta=this.parent.offsetHeight-this.divExt.offsetHeight-10;
}
else{
this.bMAX.setImageReference("maxButtonOff","maxButtonOn")
this.BTN.setVisible(true);
this.divExt.style.top=this.top;
this.divExt.style.left=this.left;
this.divExt.style.width=this.width;
this.divExt.style.height=this.height;
this.divExt.style.position=this.position;
}
this.max=!this.max;
this.updateSize(delta);
}
rialto.widget.Frame.prototype.updateSize=function(){
this.divExt.style.overflow='hidden';
this.cadre.style.overflow='hidden';
if(this.autoResizableH){
this.updateHeight();
}
if(this.autoResizableW){
this.updateWidth();
}
this.cadre.style.overflow='auto';
this.divExt.style.overflow='auto';
}
rialto.widget.Frame.prototype.updateWidth=function(){
if(this.open==true){
if(this.autoResizableW){
var tailleCalc=parseInt(this.getNewParentWidth());
this.divExt.style.width=tailleCalc-this.divExt.offsetLeft;
this.cadre.style.height=tailleCalc-this.divExt.offsetLeft-this.cadre.offsetLeft;
this.resizeChilds(true,false);
}
}
}
rialto.widget.Frame.prototype.updateHeight=function(){
if(this.open==true){
if(this.autoResizableH){
alert("this.getNewParentHeight:"+this.getNewParentHeight());
alert("this.divExt.offsetTop:"+this.divExt.offsetTop);
alert("this.cadre.offsetTop:"+this.cadre.offsetTop);
traceExec("*********** updateHeight:"+this.id,1);
traceExec("Avant Calcul this.cadre.style.height:"+this.cadre.style.height+" this.divExt.style.height:"+this.divExt.style.height,1);
traceExec("this.getNewParentHeight:"+this.getNewParentHeight()+" this.divExt.offsetTop:"+this.divExt.offsetTop,1);
traceExec("this.cadre.offsetTop:"+this.cadre.offsetTop,1);
var tailleCalc=parseInt(this.getNewParentHeight());
this.divExt.style.height=tailleCalc-this.divExt.offsetTop;
this.cadre.style.height=tailleCalc-this.divExt.offsetTop-this.cadre.offsetTop;
traceExec("Apres Calcul this.cadre.style.height:"+this.cadre.style.height+" this.divExt.style.height:"+this.divExt.style.height,1);
this.resizeChilds(false,true);
}
}
}
rialto.widget.Frame.prototype.resizeContenu=function(){
if(this.autoResizeContenu&&this.autoResizeParent==false){
if(this.cadre.childNodes.length>0){
taillelim=0;
for(var i=0;i<this.cadre.childNodes.length;i++){
fils=this.cadre.childNodes[i];
tailleLimFils=fils.offsetTop+fils.offsetHeight;
if(tailleLimFils>taillelim){taillelim=tailleLimFils;}
}
if(taillelim<parseInt(this.height)-this.cadre.offsetTop){
this.cadre.style.height=taillelim;
this.divExt.style.height=this.cadre.offsetHeight+this.cadre.offsetTop+'px';
}
else{
this.divExt.style.height=this.height;
if(this.dynamic==true){
this.cadre.style.height=Math.max(0,this.divExt.offsetHeight-this.cadre.offsetTop)+'px';
}
else{
this.cadre.style.height='100%';
}
}
this.resizePereFrere();
}
}
}
rialto.widget.Frame.prototype.getContenuHeight=function(){
return parseInt(this.cadre.style.height);
}
rialto.widget.Frame.prototype.setDisplay=function(open){
if(open){
if(this.autoResizeParent){
this.divExt.style.height=this.getNewParentHeight();
}
else{
this.divExt.style.height=this.height;
}
this.cadre.style.display='block';
if(this.autoResizeParent){
this.updateSize();
}
else{
if(this.autoResizeContenu){this.resizeContenu();}
this.resizeChilds();
}
this.BTN.setImageReference("lessButtonOff","lessButtonOn")
this.BTN.alt="Close the frame";
}
else{
this.cadre.style.display='none';
this.divExt.style.height=25;
this.BTN.setImageReference("moreButtonOff","moreButtonOn")
this.BTN.alt="Open the frame";
}
this.open=open;
if(this.inContainer){
this.inContainer.resizeChilds(false,true);
}
this.$$activeContent();
this.onSetDisplay(this.open);
}
rialto.widget.Frame.prototype.setTitle=function(newTitle){
this.labelTitle.setText(newTitle);
}
rialto.widget.Frame.prototype.onSetDisplay=function(open){
}
rialto.widget.GoogleCalendar=function(objPar){
objPar.type="googlecalendar";
this.base=rialto.widget.Calendar;
this.base(objPar);
}
rialto.widget.GoogleCalendar.prototype=new rialto.widget.Calendar;
rialto.widget.GoogleCalendar.prototype.loadSpecialDate=function(url,color){
this.color=color?color:'#99CCFF';
this.remote=new rialto.io.AjaxRequest({
url:"/rialto/serverSideProxy?URL="+url,
withWaitWindow:true,
callBackObjectOnSuccess:this,
onSuccess:this.refreshSpecialDate
})
this.remote.load("");
}
rialto.widget.GoogleCalendar.prototype.refreshSpecialDate=function(request){
try{
var xmlDoc=request.responseXML;
var arr=xmlDoc.getElementsByTagName("entry");
for(var i=0;i<arr.length;i++){
var entry=arr[i];
var nodeTitle=entry.getElementsByTagName("title")[0];
var titleValue=nodeTitle.firstChild.nodeValue;
if(rialtoConfig.userAgentIsIE){
var nodeDate=entry.getElementsByTagName("gd:when")[0];
}
else{
var nodeDate=entry.getElementsByTagName("when")[0];
}
if(nodeDate){
var startTime=nodeDate.getAttribute("startTime");
var endTime=nodeDate.getAttribute("endTime");
startTime=startTime.substr(0,4)+startTime.substr(5,2)+startTime.substr(8,2);
endTime=endTime.substr(0,4)+endTime.substr(5,2)+endTime.substr(8,2);
}
else{
var nodeDate=entry.getElementsByTagName("summary")[0];
var nodeDateValue=nodeDate.firstChild.nodeValue;
var arrD=nodeDateValue.split(" ");
var startTime=rialto.string.replace(arrD[1],"-","");
var j=2;
while(arrD[j]!="to"){j+=1};
var endTime=arrD[j+1];
if(endTime.indexOf("-")!=-1){
endTime=rialto.string.replace(endTime,"-","");
}
else{
endTime=startTime;
}
}
var dstarTime=rialto.date.setDateFromYYYYMMDD(startTime);
var dendTime=rialto.date.setDateFromYYYYMMDD(endTime);
this.setSpecialDate([dstarTime,dendTime],this.color,titleValue);
}
this.fillCalendar();
}
catch(error){
alert(error);
}
}
rialto.widget.Grid=function(objPar){
this.base=rialto.widget.AbstractComponent;
objPar.type="grid";
this.base(objPar);
this.base=null;
this.WIDTHSEP=3;
this.navigation=false;
this.tabData=new Array();
this.tabEntete=objPar.TabEntete;
this.NbreCol=objPar.TabEntete.length;
this.NbreLig=0;
this.rang=15;
this.autoResizeContenu=false;
this.autoResizeParent=false;
this.cellActive=false;
this.sortable=true;
this.multiSelect=false;
this.lineHeight=16;
this.decalage=0;
this.boolPrint=true;
this.switchable=true;
this.actifClic=true;
this.titrePrint="TABLEAU DE RESULTAT";
this.writable=false;
this.widthLastCell=20;
this.indLineClic=-1;
if(rialto.lang.isBoolean(objPar.bNavig)){
this.navigation=objPar.bNavig;
}
if(rialto.lang.isBoolean(objPar.cellActive)){
this.cellActive=objPar.cellActive;
}
if(rialto.lang.isBoolean(objPar.sortable)){
this.sortable=objPar.sortable;
}
if(rialto.lang.isBoolean(objPar.multiSelect)){
this.multiSelect=objPar.multiSelect;
}
if(rialto.lang.isNumber(objPar.lineHeight)){
this.lineHeight=objPar.lineHeight;
}
if(rialto.lang.isNumber(objPar.rang)){
this.rang=objPar.rang;
}
if(rialto.lang.isNumber(objPar.widthLastCell)){
this.widthLastCell=objPar.widthLastCell;
}
if(rialto.lang.isBoolean(objPar.actifClic)){
this.actifClic=objPar.actifClic;
}
if(rialto.lang.isBoolean(objPar.boolPrint)){
this.boolPrint=objPar.boolPrint;
}
if(rialto.lang.isBoolean(objPar.switchable)){
this.switchable=objPar.switchable;
}
if(rialto.lang.isString(objPar.printTitle)){
this.printTitle=objPar.printTitle;
}
if(rialto.lang.isBoolean(objPar.autoResizeContenu)){
this.autoResizeContenu=objPar.autoResizeContenu;
}
if(rialto.lang.isBoolean(objPar.autoResizeParent)){
this.autoResizeParent=objPar.autoResizeParent;
this.autoResizableH=this.autoResizeParent;
}
if(rialto.lang.isBoolean(objPar.writable)){
this.writable=objPar.writable;
this.lineHeight=Math.max(20,parseInt(this.lineHeight));
}
this.tabTypeCol=new Array();
if(objPar.tabTypeCol){
this.tabTypeCol=objPar.tabTypeCol;
}
else{
for(var i=0;i<this.NbreCol;i++){
this.tabTypeCol.push(["string",100]);
}
}
this.width=((this.NbreCol-1)*parseInt(this.WIDTHSEP))+40+this.widthLastCell;
for(var i=0;i<this.NbreCol;i++){
this.width+=this.tabTypeCol[i][1];
}
this.widthMin=this.width;
var line,cell;
var oThis=this;
this.divExt.id=this.id+"_divExt";
this.divExt.style.top=this.top;
this.divExt.style.left=this.left;
this.divExt.style.width=this.width+"px";
this.divExt.style.position=this.position;
if(this.switchable||this.navigation){
this.Div_nav=document.createElement("DIV");
this.Div_nav.id=this.id+"_Div_nav";
this.Div_nav.className="Div_nav";
this.Div_nav.style.height="24px";
this.Div_nav.style.display='none';
this.divExt.appendChild(this.Div_nav);
this.arrG=new rialto.widget.Image("leftEdgeRoundDashBoard",0,1,this.Div_nav,"","",{position:'absolute'});
this.arrD=new rialto.widget.Image("rightEdgeRoundDashBoard",255,1,this.Div_nav,"","",{position:'absolute'});
this.Div_navBoutTexte=document.createElement("DIV");
this.Div_navBoutTexte.id=this.id+"_Div_nav";
this.Div_navBoutTexte.style.position="absolute";
this.Div_navBoutTexte.style.left="22px";
this.Div_navBoutTexte.style.width="243px";
this.Div_navBoutTexte.style.height="24px";
this.Div_navBoutTexte.style.backgroundColor="#DFECF3";
this.Div_nav.appendChild(this.Div_navBoutTexte);
Parent=this.Div_navBoutTexte;
this.bouFirst=new rialto.widget.Image("btonFirstDoctOff",0,5,Parent,this.rang+" premiers","btonFirstDoctOn",{position:'absolute'});
this.bouFirst.onclick=function(){oThis.firstN();};
this.bouFirst.setVisible(false);
this.boutPrevious=new rialto.widget.Image("leftArrowOff",20,5,Parent,this.rang+" pr?c?dents","leftArrowOn",{position:'absolute'});
this.boutPrevious.onclick=function(){oThis.previousN();};
this.boutPrevious.setVisible(false);
this.Div_text=document.createElement("DIV");
this.Div_text.className="Div_text";
this.Div_text.id=this.id+"_Div_text";
this.Div_navBoutTexte.appendChild(this.Div_text);
this.boutNext=new rialto.widget.Image("rightArrowOff",190,5,Parent,this.rang+" prochains","rightArrowOn",{position:'absolute'});
this.boutNext.onclick=function(){oThis.nextN();};
this.boutNext.setVisible(false);
this.boutLast=new rialto.widget.Image("btonLastDoctOff",210,5,Parent,this.rang+" derniers","btonLastDoctOn",{position:'absolute'});
this.boutLast.onclick=function(){oThis.lastN();};
this.boutLast.setVisible(false);
if(this.navigation){this.Div_nav.style.display='block';}
}
this.tableauEntete=document.createElement("DIV");
this.tableauEntete.id=this.id+"tableEntete";
this.tableauEntete.style.width='100%';
this.tableauEntete.style.height=this.lineHeight+'px';
this.tableauEntete.position="relative";
this.divExt.appendChild(this.tableauEntete);
this.tableauHTML=document.createElement("DIV");
this.divExt.appendChild(this.tableauHTML);
this.tableauHTML.style.width='100%';
this.tableauHTML.style.fontSize="0";
this.tableauHTML.style.overflow='auto';
this.tableauHTML.id=this.id+"tableData";
this.tableauHTML.position="relative";
this.arrowUp=document.createElement("IMG");
this.arrowUp.src=rialtoConfig.pathRialtoE+"images/imgTableau/upsimple.png";
this.arrowUp.className="arrow";
this.arrowDown=document.createElement("IMG");
this.arrowDown.src=rialtoConfig.pathRialtoE+"images/imgTableau/downsimple.png";
this.arrowDown.className="arrow";
this.divCoche=document.createElement("DIV");
this.divCoche.className="coche";
coche=document.createElement("IMG");
coche.src=rialtoConfig.pathRialtoE+"images/imgTableau/coche.gif";
this.divCoche.appendChild(coche);
this.cellSep=document.createElement("DIV");
this.cellSep.className='cellSep';
this.cellSep.style.width=this.WIDTHSEP;
this.cellSep.style.height=this.lineHeight+'px';
this.cellSep.style.backgroundImage="url('"+rialtoConfig.pathRialtoE+"images/imgTableau/fillet.gif')";
line=document.createElement("DIV");
line.style.height=this.lineHeight+'px';
line.style.width=this.width-20+'px';
cell=document.createElement("DIV");
cell.style.width="8px";
cell.style.height=this.lineHeight+'px';
cell.className="cellEntete";
cell.type="cell";
img=document.createElement("IMG");
img.src=rialtoConfig.pathRialtoE+"images/imgTableau/bordbleu_g.gif";
img.style.position="relative";
img.style.height="100%";
img.style.width="100%";
cell.appendChild(img);
line.appendChild(cell);
for(var j=0;j<this.NbreCol;j++)
{
cell=document.createElement("DIV");
cell.id=this.id+"_CellEntete_"+j;
cell.className="cellEntete";
cell.style.backgroundColor="#DFECF3";
cell.style.width=this.tabTypeCol[j][1]+"px";
cell.ind=j;
var div=document.createElement("DIV");
div.className="DivTexEntete";
div.title=this.tabEntete[j];
div.innerHTML=this.tabEntete[j];
cell.appendChild(div);
line.appendChild(cell)
if(this.sortable){
cell.onclick=function(){
oThis.triColonne(this.ind);
oThis.refreshGrid();
}
}
cellSep=this.cellSep.cloneNode(true);
line.appendChild(cellSep);
cellSep.oCiu=this;
this.oCiu=this;
this.heightVisibleCol=function(){
var temp=Math.min(parseInt(this.oCiu.getRealHeight())
,parseInt(this.oCiu.divExt.offsetHeight)
-(this.oCiu.navigation?parseInt(this.oCiu.Div_nav.style.height)
:0));
return temp;
}
rialto.widgetBehavior.affect(cellSep
,'DragAndDrop'
,{
ghost:{
aspect:'rect'
,top:0
,height:'this.oCiu.heightVisibleCol()'
}
,bSelectMark:false
,isWithLimitsDisplayed:false
,movingLimits:{
orientation:'h'
,rectLim:{
left:'parseInt(this.previousSibling.firstChild.offsetLeft)'
+' + 12 + parseInt(this.previousSibling.offsetLeft)'
,right:'parseInt(this.parentNode.offsetWidth)-20'}
}
}
);
cellSep.synchroDDMup=function(mod,posI){
var c=this.previousSibling;
c.style.width=Math.max(10,parseInt(c.style.width)+mod.left);
oThis.reDimColTabData(c.ind,mod.left);
}
}
this.DerCell=document.createElement("DIV");
this.DerCell.id=this.id+"_Cell"+j;
this.DerCell.className="cellEntete";
this.DerCell.style.backgroundColor="#DFECF3";
this.DerCell.style.width=this.widthLastCell;
line.appendChild(this.DerCell);
cell=document.createElement("DIV");
cell.className="cellEntete";
cell.style.width="8px";
cell.style.height=this.lineHeight+'px';
img=document.createElement("IMG");
img.src=rialtoConfig.pathRialtoE+"images/imgTableau/bordbleu_d.gif";
img.style.position="absolute";
img.style.height="100%";
img.style.width="100%";
cell.appendChild(img);
line.appendChild(cell);
this.tableauEntete.appendChild(line);
if(this.switchable){
var ind=this.tableauEntete.childNodes[0].childNodes.length-1;
this.tableauEntete.childNodes[0].childNodes[ind].style.display='none';
this.DerCell.style.width=parseInt(this.DerCell.style.width)+8;
this.imgBascule=new rialto.widget.Image(rialtoConfig.pathRialtoE+"images/imgTableau/bt_bascul_off.gif",8,0,this.DerCell,"Changer le type d'affichage",rialtoConfig.pathRialtoE+"images/imgTableau/bt_bascul_on.gif",{position:'absolute'});
this.imgBascule.onclick=function(){
oThis.switchDisplayMode();
}
}
if(objPar.parent){this.placeIn(objPar.parent);};
this.menuContex=new objMenuCont("men1",220);
this.menuContex.createMenu(this.divExt);
this.menuContex.add("Select",false,false,false,rialtoConfig.pathRialtoE+"images/Entoure.gif");
this.menuContex.addSeparation();
this.menuContex.add("Switch display mode",this.switchable,false,false,rialtoConfig.pathRialtoE+"images/imgTableau/bt_bascul_off.gif");
if(this.boolPrint){this.menuContex.add("Print",true,false,false,rialtoConfig.pathRialtoE+"images/imTreeview/icone_compte_rendu.gif");}
this.divExt.oncontextmenu=function(e){
oThis.menuContex.srcEvent=null;
oThis.menuContex.inactiveItem(0);
oThis.menuContex.afficheMenu(e);
}
this.menuContex.itemClickApplicatif=function(ind){
if(ind==0){
if(oThis.menuContex.srcEvent!=null){
oThis.menuContex.srcEvent.onclick();
}
return true;
}
if(ind==1){
oThis.switchDisplayMode();
return true;
}
if(ind==2){
oThis.print();
return true;
}
}
objPar=null;
}
rialto.widget.Grid.prototype=new rialto.widget.AbstractComponent;
rialto.widget.Grid.prototype.onmouseover=function(){}
rialto.widget.Grid.prototype.onmouseout=function(){}
rialto.widget.Grid.prototype.print=function(){
var widthGlobal=document.body.clientWidth;
var heightGlobal=document.body.clientHeight;
this.fenImp=window.open(rialtoConfig.pathRialtoE+'printTab.html','IMPRESSION',"height="+heightGlobal+",width="+widthGlobal+",top=0,left=0,scrollbars,resizable,toolbar,menubar");
this.rempFenImp();
}
rialto.widget.Grid.prototype.rempFenImp=function(){
if(this.fenImp.rempPage){
var obj=this.getInfoPrint();
this.fenImp.rempPage(obj);
}
else{
window.setTimeout("rialto.session.objects[\""+this.id+"\"].rempFenImp()",50);
}
}
rialto.widget.Grid.prototype.getInfoPrint=function(){
var obj=new Object;
obj.strEntete=new String;
obj.strEntete=this.tabEntete.join("$");
obj.tabEntete=this.tabEntete;
obj.strEntete=rialto.string.formatHTTP(obj.strEntete);
obj.titre=this.titrePrint;
obj.NBCOL=this.tabEntete.length;
obj.NbreLig=this.NbreLig;
obj.tabData=this.tabData;
return obj;
}
rialto.widget.Grid.prototype.adaptToContext=function(){
var oThis=this;
if(this.autoResizableH){
this.divExt.style.height=this.getNewParentHeight()-this.divExt.offsetTop;
}
else{
this.divExt.style.height=this.height;
}
if(this.autoResizableW){
this.divExt.style.width=this.getNewParentWidth()-this.divExt.offsetLeft;
}
else{
this.divExt.style.width=this.width;
}
this.tableauHTML.style.height=Math.max(0,this.divExt.offsetHeight-this.tableauHTML.offsetTop)+'px';
this.rang=Math.floor((parseInt(this.height)-24)/this.lineHeight)-1;
if(this.autoResizeContenu&&!this.autoResizeParent){
this.resizeContenu();
}
if(this.autoResizableW){
this.updateWidth();
}
if(this.navigation){
ria.utils.measures.$centerW(this.Div_nav);
}
}
rialto.widget.Grid.prototype.reDimColTabData=function(indCol,modDim){
this.divExt.style.overflow='hidden';
this.width=parseInt(this.width)+modDim;
this.divExt.style.width=this.width+"px";
this.tableauEntete.childNodes[0].style.width=parseInt(this.tableauEntete.childNodes[0].style.width)+modDim;
this.tabTypeCol[indCol][1]+=modDim;
for(var i=0;i<this.tableauHTML.childNodes.length;i++){
var line=this.tableauHTML.childNodes[i];
if(line.sTexte){
line.sTexte.style.width=this.width-20;
}
cell=document.getElementById(this.id+"_CellTab_"+i+"_"+indCol);
cell.style.width=parseInt(cell.style.width)+modDim;
}
if(this.autoResizableW){
this.updateWidth();
}
if(this.navigation){
ria.utils.measures.$centerW(this.Div_nav);
}
this.divExt.style.overflow='';
if(!rialtoConfig.userAgentIsIE&&!this.navigation){
this.setVisible(false);
this.setVisible(true);
}
};
rialto.widget.Grid.prototype.updateSize=function(delta){
this.divExt.style.overflow='hidden';
if(this.autoResizableH||this.autoResizeContenu){
this.updateHeight();
}
if(this.autoResizableW){
this.updateWidth();
}
this.divExt.style.overflow='auto';
}
rialto.widget.Grid.prototype.updateWidth=function(){
if(this.autoResizableW){
var tailleCalc=parseInt(this.getNewParentWidth())-2;
var delta=tailleCalc-this.width-this.left;
var deltaReel=0;
var delta=tailleCalc-this.width-this.left;
if(delta>0&&(this.width+delta)>this.widthMin){
var deltaReel=delta;
}
else{
if(delta<0){
var deltaMax=parseInt(this.DerCell.style.width)-20;
var deltaReel=-(Math.min(-delta,deltaMax));
}
}
if(deltaReel!=0){
this.width+=deltaReel;
this.divExt.style.width=this.width;
this.tableauEntete.childNodes[0].style.width=this.width-20;
this.widthLastCell+=deltaReel;
this.DerCell.style.width=this.widthLastCell;
if(this.imgBascule){
this.imgBascule.setLeft(this.widthLastCell-20);
}
for(var i=0;i<this.tableauHTML.childNodes.length;i++){
var line=this.tableauHTML.childNodes[i];
if(line.sTexte){
line.sTexte.style.width=this.width-28;
}
ind=this.tableauHTML.childNodes[i].childNodes.length-2;
derCol=this.tableauHTML.childNodes[i].childNodes[ind];
derCol.style.width=this.widthLastCell;
}
if(this.navigation){
ria.utils.measures.$centerW(this.Div_nav);
}
}
}
}
rialto.widget.Grid.prototype.updateHeight=function(){
if(this.autoResizableH){
var tailleCalc=parseInt(this.getNewParentHeight());
this.divExt.style.height=tailleCalc-this.divExt.offsetTop;
this.tableauHTML.style.height=tailleCalc-this.divExt.offsetTop-this.tableauHTML.offsetTop;
if(this.navigation){
this.rang=Math.floor(parseInt(this.tableauHTML.style.height)/this.lineHeight);
if(this.tabData.length>0){
this.debInd=0;
this.finInd=Math.min(this.debInd+this.rang,this.NbreLig);
this.refreshGrid();
}
}
else{
this.rang=Math.floor((parseInt(this.divExt.style.height)-24)/this.lineHeight)-1;
}
}
}
rialto.widget.Grid.prototype.resizeContenu=function(){
if(this.autoResizeContenu&&!this.autoResizeParent){
tailleR=this.getRealHeight();
if(tailleR<parseInt(this.height)){
tailleNavig=0;
if(this.navigation){
tailleNavig=this.Div_nav.offsetHeight;
}
this.divExt.style.height=tailleR+tailleNavig;
this.tableauHTML.style.height=tailleR+'px';
}
else{
this.divExt.style.height=this.height;
this.tableauHTML.style.height=Math.max(0,this.divExt.offsetHeight-this.tableauHTML.offsetTop)+'px';
}
this.resizePereFrere();
}
}
rialto.widget.Grid.prototype.getRealHeight=function(){
traceExec('this.lineHeight= '+this.lineHeight
+' *this.NbreLig)= '+this.NbreLig
+' this.tableauEntete.offsetHeight= '+this.tableauEntete.offsetHeight,14);
return(this.lineHeight*this.NbreLig)+this.tableauEntete.offsetHeight;
}
rialto.widget.Grid.prototype.switchDisplayMode=function(){
if(this.switchable){
if(this.navigation){
this.navigation=false;
this.Div_nav.style.display='none';
this.tableauHTML.style.height=parseInt(this.tableauHTML.style.height)+parseInt(this.Div_nav.style.height);
}
else{
this.navigation=true;
this.tableauHTML.style.height=parseInt(this.tableauHTML.style.height)-parseInt(this.Div_nav.style.height);
this.Div_nav.style.display='block';
ria.utils.measures.$centerW(this.Div_nav);
}
this.resizeContenu();
if(this.tabData.length>0){
this.debInd=0;
if(!this.navigation){
this.finInd=this.NbreLig;
}
else{
this.finInd=Math.min(this.rang,this.NbreLig);
}
this.refreshGrid();
}
}
}
rialto.widget.Grid.prototype.setText=function(text){
this.Div_text.innerHTML=text;
}
rialto.widget.Grid.prototype.effacelines=function(titre,forSubmit){
rialto.deprecated('Grid','effacelines','deleteLines');
this.deleteLines(titre,forSubmit);
}
rialto.widget.Grid.prototype.deleteLines=function(titre,forSubmit){
this.indLigneClic=-1;
var dataLines=this.tableauHTML.childNodes;
for(var lnIdx=0;lnIdx<dataLines.length;lnIdx++){
var dataLine=dataLines[lnIdx];
if(dataLine.img){
dataLine.img.onclick=null;
dataLine.img=null;
}
dataLine.onmouseout=null;
dataLine.onmouseover=null;
for(var colIdx=0;colIdx<dataLine.childNodes.length;colIdx++){
var dataItem=dataLine.childNodes[colIdx];
dataItem.onclick=null;
dataItem.oncontextmenu=null;
dataItem.ondblclick=null;
dataItem.onmouseout=null;
dataItem.onmouseover=null;
}
}
this.tableauHTML.innerHTML="";
if(this.navigation){
this.setText(titre);
this.bouFirst.setVisible(false);
this.boutPrevious.setVisible(false);
this.boutNext.setVisible(false);
this.boutLast.setVisible(false);
}
}
rialto.widget.Grid.prototype.initTab=function(){
this.deleteLines();
this.tabData=new Array;
}
rialto.widget.Grid.prototype.findLine=function(col,valCol){
var ret=-1;
var trouve=false;
var i=0;
var val;
while(i<this.NbreLig&&!trouve){
val=this.tabData[i][col];
if(val==valCol){
ret=i;
trouve=true;
}
else{i++;}
}
return ret
}
rialto.widget.Grid.prototype.deleteOneLine=function(ind){
this.tabData.splice(ind,1);
this.fillGrid(this.tabData);
}
rialto.widget.Grid.prototype.fillGrid=function(TabData,ind,boolOrder){
this.NbreLig=TabData.length;
if(this.NbreLig>=100&&this.switchable&&!this.navigation){
this.switchDisplayMode();
}
this.tabData=new Array();
this.tabData=(this.tabData.concat(TabData));
this.deleteLines();
this.indLineClic=-1;
for(var i=0;i<this.NbreLig;i++){
this.initLine(i);
}
this.debInd=0;
if(!this.navigation){
this.finInd=this.NbreLig;
}
else{
this.finInd=Math.min(this.rang,this.NbreLig);
}
if(this.sortable){
if(!ind)ind=0;
this.triColonne(ind,boolOrder);
}
this.refreshGrid();
this.updateSize();
}
rialto.widget.Grid.prototype.initLine=function(ind){
this.tabData[ind].sel=false;
this.tabData[ind].sTexte=null;
var cellProp=new Array;
for(var j=0;j<this.NbreCol+1;j++){
cellProp[j]={sel:false,objPar:null,obStyle:null};
}
this.tabData[ind].cellProp=cellProp;
}
rialto.widget.Grid.prototype.refreshGrid=function(){
if(this.navigation){
this.majZoneNavigation();
}
var tabINNERHTML=new Array();
for(var i=this.debInd;i<this.finInd;i++)
{
tabINNERHTML.push(this.addLineWithINNER(i));
}
this.tableauHTML.innerHTML=tabINNERHTML.join('');
this.updateLineCell();
}
rialto.widget.Grid.prototype.updateLineCell=function(){
var oThis=this;
for(var i=0;i<this.tableauHTML.childNodes.length;i++){
line=this.tableauHTML.childNodes[i];
tab=line.id.split("_");
indL=tab[tab.length-1];
line.type="line";
line.sel=false;
line.ind=indL;
if(this.tabData[indL].sel){this.selNode(indL,0);}
if(!this.cellActive){
line.onmouseout=function(){oThis.afterMouseout(this);};
line.onmouseover=function(){oThis.afterMouseover(this);};
}
for(var j=1;j<line.childNodes.length;j+=2){
if(line.childNodes[j].id.indexOf(this.id+"_CellTab_")!=-1){
cell=line.childNodes[j];
tab=cell.id.split("_");
indL=tab[tab.length-2];
indC=tab[tab.length-1];
cell.ind=indC;
cell.indL=indL;
cell.type="cell";
cell.sel=false;
if(this.tabData[indL].cellProp[indC].objPar!=null){
this.addObjectInCell(indL,indC,this.tabData[indL].cellProp[indC].objPar);
}
if(this.tabData[indL].cellProp[indC].sel){this.selNode(indL,indC);}
if(this.tabData[indL].cellProp[indC].obStyle!=null){
var obStyle=this.tabData[indL].cellProp[indC].obStyle;
this.setStyle(indL,indC,obStyle);
}
if(this.actifClic){
cell.onclick=function(){
var tab=this.id.split("_");
indC=tab[tab.length-1];
indL=tab[tab.length-2];
oThis.afterOnClick(indL,indC,true);
};
cell.oncontextmenu=function(e){
var e=e?e:window.event;
oThis.oncontextmenu(this,e);
};
cell.ondblclick=function(){
var tab=this.id.split("_");
indC=tab[tab.length-1];
indL=tab[tab.length-2];
oThis.afterOnDbleClick(indL,indC,true);
};
}
if(this.cellActive){
cell.onmouseout=function(){oThis.afterMouseout(this);};
cell.onmouseover=function(){oThis.afterMouseover(this);};
}
}
}
}
}
rialto.widget.Grid.prototype.addOneLine=function(tabLine){
var oThis=this;
this.NbreLig+=1;
if(!this.tabData){
this.tabData=new Array;
}
i=this.tabData.push(tabLine)-1;
this.initLine(i);
var idL=this.id+"_LineTab_"+i;
var divLigne=document.createElement("DIV");
divLigne.id=idL;
divLigne.type="line";
divLigne.sel=false;
divLigne.ind=idL;
divLigne.className="grid_line";
divLigne.style.height=this.lineHeight+"px";
var divCellDec=document.createElement("DIV");
divCellDec.className="cellDec";
divLigne.appendChild(divCellDec);
if(!this.cellActive){
divLigne.onmouseout=function(){oThis.afterMouseout(this);};
divLigne.onmouseover=function(){oThis.afterMouseover(this);};
}
if(i%2==1){
var img=document.createElement("IMG");
img.className="imgCell";
img.src=rialtoConfig.pathRialtoE+"images/imgTableau/bordblanc_g.gif"
divCellDec.appendChild(img);
for(var j=0;j<this.NbreCol;j++)
{
idC=this.id+"_CellTab_"+i+"_"+j;
var divCell=document.createElement("DIV");
divCell.id=idC;
divCell.className="cellData";
divCell.style.background="#FBFBFB";
divCell.style.width=this.tabTypeCol[j][1]+"px";
divCell.ind=idC;
divCell.indL=idL;
divCell.type="cell";
divCell.sel=false;
if(this.cellActive){
divCell.onmouseout=function(){oThis.afterMouseout(this);};
divCell.onmouseover=function(){oThis.afterMouseover(this);};
}
if(this.actifClic){
divCell.onclick=function(){
var tab=this.id.split("_");
indC=tab[tab.length-1];
indL=tab[tab.length-2];
oThis.afterOnClick(indL,indC,true);
};
divCell.oncontextmenu=function(e){
var e=e?e:window.event;
oThis.oncontextmenu(this,e);
};
divCell.ondblclick=function(){
var tab=this.id.split("_");
indC=tab[tab.length-1];
indL=tab[tab.length-2];
oThis.afterOnDbleClick(indL,indC,true);
};
}
var divText=document.createElement("DIV");
divText.id=idC;
divText.className="DivTexData";
divText.title=this.tabData[i][j];
divText.innerHTML=this.tabData[i][j];
divCell.appendChild(divText);
divLigne.appendChild(divCell);
var divCellSep=document.createElement("DIV");
divCellSep.className="cellSep";
divLigne.appendChild(divCellSep);
}
idC=this.id+"_CellTab_"+i+"_"+this.NbreCol;
var divCell=document.createElement("DIV");
divCell.id=idC;
divCell.className="cellData";
divCell.style.background="#FBFBFB";
divCell.style.width=this.widthLastCell+"px";
divLigne.appendChild(divCell);
divCellDec=document.createElement("DIV");
divCellDec.className="cellDec";
var img=document.createElement("IMG");
img.className="imgCell";
img.src=rialtoConfig.pathRialtoE+"images/imgTableau/bordblanc_d.gif"
divCellDec.appendChild(img);
divLigne.appendChild(divCellDec);
}
else{
for(var j=0;j<this.NbreCol;j++)
{
idC=this.id+"_CellTab_"+i+"_"+j;
var divCell=document.createElement("DIV");
divCell.id=idC;
divCell.className="cellData";
divCell.style.width=this.tabTypeCol[j][1]+"px";
divCell.ind=idC;
divCell.indL=idL;
divCell.type="cell";
divCell.sel=false;
if(this.cellActive){
divCell.onmouseout=function(){oThis.afterMouseout(this);};
divCell.onmouseover=function(){oThis.afterMouseover(this);};
}
if(this.actifClic){
divCell.onclick=function(){
var tab=this.id.split("_");
indC=tab[tab.length-1];
indL=tab[tab.length-2];
oThis.afterOnClick(indL,indC,true);
};
divCell.oncontextmenu=function(e){
var e=e?e:window.event;
oThis.oncontextmenu(this,e);
};
divCell.ondblclick=function(){
var tab=this.id.split("_");
indC=tab[tab.length-1];
indL=tab[tab.length-2];
oThis.afterOnDbleClick(indL,indC,true);
};
}
var divText=document.createElement("DIV");
divText.id=idC;
divText.className="DivTexData";
divText.title=this.tabData[i][j];
divText.innerHTML=this.tabData[i][j];
divCell.appendChild(divText);
divLigne.appendChild(divCell);
var divCellSep=document.createElement("DIV");
divCellSep.className="cellSep";
divLigne.appendChild(divCellSep);
}
idC=this.id+"_CellTab_"+i+"_"+this.NbreCol;
var divCell=document.createElement("DIV");
divCell.id=idC;
divCell.className="cellData";
divCell.style.width=this.widthLastCell+"px";
divLigne.appendChild(divCell);
divCellDec=document.createElement("DIV");
divCellDec.className="cellDec";
divLigne.appendChild(divCellDec);
}
this.tableauHTML.appendChild(divLigne);
return i;
}
rialto.widget.Grid.prototype.addLineWithINNER=function(i){
var idL=this.id+"_LineTab_"+i;
var tabTemp=new Array();
tabTemp.push('<DIV ID="'+idL+'" style="height:'+this.lineHeight+'px;" class="grid_line">');
tabTemp.push('<DIV type="cell" class="cellDec">');
if(i%2==1){
tabTemp.push('<IMG  class="imgCell" src="'+rialtoConfig.pathRialtoE+'images/imgTableau/bordblanc_g.gif"></IMG>');
tabTemp.push('</DIV>');
for(var j=0;j<this.NbreCol;j++)
{
idC=this.id+"_CellTab_"+i+"_"+j;
tabTemp.push('<DIV ID="'+idC+'" style="background:#FBFBFB;width:'+this.tabTypeCol[j][1]+'px;" class="cellData"><DIV title="'+this.tabData[i][j]+'" class="DivTexData">'+this.tabData[i][j]+'</DIV></DIV>');
tabTemp.push('<DIV class="cellSep"></DIV>');
}
idC=this.id+"_CellTab_"+i+"_"+this.NbreCol;
tabTemp.push('<DIV  ID="'+idC+'" class="cellData" style="background:#FBFBFB;width:'+this.widthLastCell+'px;"></DIV>');
tabTemp.push('<DIV type="cell" class="cellDec">');
tabTemp.push('<IMG class="imgCell" src="'+rialtoConfig.pathRialtoE+'images/imgTableau/bordblanc_d.gif"></IMG>');
tabTemp.push('</DIV>');
}
else{
tabTemp.push('</DIV>');
for(var j=0;j<this.NbreCol;j++)
{
idC=this.id+"_CellTab_"+i+"_"+j;
tabTemp.push('<DIV ID="'+idC+'"  style="width:'+this.tabTypeCol[j][1]+'px;" class="cellData"><DIV title="'+this.tabData[i][j]+'" class="DivTexData">'+this.tabData[i][j]+'</DIV></DIV>');
tabTemp.push('<DIV class="cellSep"></DIV>');
}
idC=this.id+"_CellTab_"+i+"_"+this.NbreCol;
tabTemp.push('<DIV  ID="'+idC+'" class="cellData" style="width:'+this.widthLastCell+'px;"></DIV>');
tabTemp.push('<DIV type="cell" class="cellDec"></DIV>');
}
tabTemp.push('</DIV>');
return tabTemp.join('');
}
rialto.widget.Grid.prototype.majZoneNavigation=function(){
if(this.rang<this.NbreLig){
var text=(this.debInd+1)+"-"+(this.finInd)+" (total:"+(this.NbreLig)+")";
if(!this.bouFirst.visible){
this.bouFirst.setVisible(true);
this.boutPrevious.setVisible(true);
this.boutNext.setVisible(true);
this.boutLast.setVisible(true);
}
this.bouFirst.setAlt(this.rang+" first");
this.boutPrevious.setAlt(this.rang+" previous");
this.boutNext.setAlt(this.rang+" next");
this.boutLast.setAlt(this.rang+" last");
}
else{
var text="1-"+this.NbreLig;
if(this.bouFirst.visible){
this.bouFirst.setVisible(false);
this.boutPrevious.setVisible(false);
this.boutNext.setVisible(false);
this.boutLast.setVisible(false);
}
}
this.setText(text);
}
rialto.widget.Grid.prototype.addText=function(nIndex,texte,objStyle,boolSur){
var oThis=this;
var line=this.tableauHTML.childNodes[nIndex];
this.tableauHTML.childNodes[nIndex].style.height=parseInt(this.tableauHTML.childNodes[nIndex].style.height)+19;
var divTexte=document.createElement("DIV");
divTexte.appendChild(document.createTextNode(texte));
divTexte.style.width=this.width-28;
if(boolSur){
divTexte.className="subTexte";
this.tableauHTML.childNodes[nIndex].insertBefore(divTexte,this.tableauHTML.childNodes[nIndex].firstChild)
}
else{
divTexte.className="sousTexte";
if(nIndex%2==1){
divTexte.style.background="#FBFBFB";
}
else{
divTexte.style.background="#F3F3F3";
}
this.srcPlus=rialtoConfig.pathRialtoE+"images/imTreeview/icT/plus.gif";
this.srcMoins=rialtoConfig.pathRialtoE+"images/imTreeview/icT/minus.gif";
this.tableauHTML.childNodes[nIndex].img=document.createElement("IMG");
this.tableauHTML.childNodes[nIndex].childNodes[this.tableauHTML.childNodes[nIndex].childNodes.length-1].appendChild(this.tableauHTML.childNodes[nIndex].img)
this.tableauHTML.childNodes[nIndex].img.src=this.srcMoins;
this.tableauHTML.childNodes[nIndex].img.div=divTexte;
this.tableauHTML.childNodes[nIndex].img.plus=false;
this.tableauHTML.childNodes[nIndex].img.nIndex=nIndex;
this.tableauHTML.childNodes[nIndex].img.onclick=function(){
var nIndex=this.nIndex;
if(this.plus){
this.src=oThis.srcMoins;
oThis.tableauHTML.childNodes[nIndex].style.height=parseInt(oThis.tableauHTML.childNodes[nIndex].style.height)+19;
this.div.style.display='block';
this.plus=false;
}
else{
this.src=oThis.srcPlus;
this.div.style.display='none';
oThis.tableauHTML.childNodes[nIndex].style.height=parseInt(oThis.tableauHTML.childNodes[nIndex].style.height)-19;
this.plus=true;
}
stopEvent();
}
divTexte.style.position="absolute";
divTexte.style.top=this.lineHeight;
this.tableauHTML.childNodes[nIndex].appendChild(divTexte)
}
for(prop in objStyle){
eval("divTexte.style."+prop+"=objStyle."+prop);
if(prop=="height"){
this.tableauHTML.childNodes[nIndex].style.height=parseInt(this.lineHeight)+parseInt(objStyle.height);
}
}
this.tabData[this.tableauHTML.childNodes[nIndex].ind].sTexte={texte:texte,objStyle:objStyle,boolSur:boolSur}
this.tableauHTML.childNodes[nIndex].sTexte=divTexte;
}
rialto.widget.Grid.prototype.removeText=function(indL,boolDansJS){
var line=document.getElementById(this.id+"_LineTab_"+indL);
if(line){
line.removeChild(line.sTexte);
if(line.img){line.removeChild(line.img);}
line.sTexte=null;
line.style.height=this.lineHeight;
}
if(boolDansJS){
this.tabData[indL].sTexte=null;
}
}
rialto.widget.Grid.prototype.setCellText=function(indL,indC,text){
this.tabData[indL][indC]=text;
var cell=document.getElementById(this.id+"_CellTab_"+indL+"_"+indC);
if(cell){
var i=0;
divText=cell.childNodes[i];
while(divText.className!="DivTexData"&&i<cell.childNodes.length){
i+=1;
divText=cell.childNodes[i];
}
divText.innerHTML=text;
}
}
rialto.widget.Grid.prototype.getCellText=function(indL,indC){
return this.tabData[indL][indC];
}
rialto.widget.Grid.prototype.getLineIndex=function(node){
tab=node.id.split("_");
if(node.id.indexOf(this.id+"_CellTab_")){
indL=tab[tab.length-2];
}
else{
indL=tab[tab.length-1];
}
return indL
}
rialto.widget.Grid.prototype.getCellIndex=function(node){
tab=node.id.split("_");
if(node.id.indexOf(this.id+"_CellTab_")){
return tab[tab.length-1];
}
}
rialto.widget.Grid.prototype.setStyle=function(indL,indC,obStyle){
if(indC!=-1){
if(obStyle){
if(this.tabData[indL].cellProp[indC].obStyle!=null){
oldObStyle=this.tabData[indL].cellProp[indC].obStyle;
for(prop in oldObStyle){
if(obStyle[prop]==null){
obStyle[prop]=oldObStyle[prop];
}
}
}
this.tabData[indL].cellProp[indC].obStyle=obStyle;
}
else{
var obStyle=this.tabData[indL].cellProp[indC].obStyle;
}
var cell=document.getElementById(this.id+"_CellTab_"+indL+"_"+indC);
if(cell){
for(prop in obStyle){
try{
cell.style[prop]=obStyle[prop];
}
catch(erreur){}
}
}
}
else{
for(var j=0;j<(this.NbreCol+1);j++){this.setStyle(indL,j,obStyle);}
}
}
rialto.widget.Grid.prototype.disableLine=function(indL,indC){
if(indC!=-1){
var cell=document.getElementById(this.id+"_CellTab_"+indL+"_"+indC);
if(cell){
cell.onclick=function(){};
cell.ondblclick=function(){};
cell.onmouseover=function(){stopEvent();};
cell.onmouseout=function(){stopEvent();};
}
}
else{
var line=document.getElementById(this.id+"_LineTab_"+indL);
if(line){
for(var j=0;j<this.NbreCol;j++){
var cell=document.getElementById(this.id+"_CellTab_"+indL+"_"+j);
cell.onclick=function(){};
cell.ondblclick=function(){};
}
line.onmouseover=function(){};
line.onmouseout=function(){};
}
}
}
rialto.widget.Grid.prototype.addObjectInCell=function(indL,indC,objPar){
this.tabData[indL].cellProp[indC].objPar=objPar;
var cell=document.getElementById(this.id+"_CellTab_"+indL+"_"+indC);
if(cell){
if(objPar.placeIn){
objPar.placeIn(cell)
}
else{
cell.appendChild(objPar);
}
}
}
rialto.widget.Grid.prototype.removeObjectFromCell=function(indL,indC,objPar){
this.tabData[indL].cellProp[indC].objPar=null;
var cell=document.getElementById(this.id+"_CellTab_"+indL+"_"+indC);
if(cell){
cell.removeChild(objPar);
}
}
rialto.widget.Grid.prototype.release=function(){
var titleLine=this.tableauEntete.childNodes[0];
for(var colIdx=0;colIdx<titleLine.childNodes.length;colIdx++){
var titleItem=titleLine.childNodes[colIdx];
titleItem.onclick=null;
titleItem.oCiu=null;
if(titleItem.dd){
titleItem.dd=null;
titleItem.synchroDDMup=null;
DragAndDrop.release(titleItem);
}
titleItem=null;
}
this.deleteLines();
if(this.Div_nav){
this.arrG.remove();
this.arrG.onclick=null;
this.arrD.remove();
this.arrD.onclick=null;
this.bouFirst.remove();
this.bouFirst.onclick=null;
this.boutPrevious.remove();
this.boutPrevious.onclick=null;
this.boutNext.remove();
this.boutNext.onclick=null;
this.boutLast.remove();
this.boutLast.onclick=null;
}
if(this.imgBascule){
this.imgBascule.onclick=null;
this.imgBascule.remove();
this.imgBascule=null;
}
this.menuContex.remove();
this.menuContex.itemClickApplicatif=null;
this.menuContex=null;
this.divExt.oncontextmenu=null;
}
rialto.widget.Grid.prototype.nextN=function(){
if(this.debInd+this.rang<this.NbreLig){
this.debInd+=this.rang;
if(this.debInd+this.rang<=this.NbreLig){this.finInd=this.debInd+this.rang}
else{this.finInd=this.NbreLig}
this.refreshGrid();
}
}
rialto.widget.Grid.prototype.previousN=function(){
if(this.debInd>=this.rang){
this.finInd=this.debInd;
this.debInd-=this.rang;
this.refreshGrid();
}
}
rialto.widget.Grid.prototype.firstN=function(){
this.debInd=0;
if(this.NbreLig<this.rang){this.finInd=this.NbreLig}
else{this.finInd=this.rang}
this.refreshGrid();
}
rialto.widget.Grid.prototype.lastN=function(){
if(this.NbreLig>=this.rang){
var reste=this.NbreLig%this.rang;
if(reste!=0){
this.debInd=this.NbreLig-reste;
}
else{
this.debInd=this.NbreLig-this.rang;
}
this.finInd=this.NbreLig;
this.refreshGrid();
}
}
rialto.widget.Grid.prototype.triColonne=function(ind,boolOrder){
if(this.oldColCLic!=null){
if(this.oldColCLic.ind==ind&&boolOrder==null){
boolOrder=!this.oldColCLic.boolOrder
}
var cell=document.getElementById(this.id+"_CellEntete_"+this.oldColCLic.ind);
cell.removeChild(this.arrowEnCours);
}
var cell=document.getElementById(this.id+"_CellEntete_"+ind);
var type=this.tabTypeCol[ind][0];
this.tabData.sort(compareTwoColumns(ind,boolOrder,type));
if(boolOrder){
this.arrowEnCours=this.arrowUp;
}
else{
this.arrowEnCours=this.arrowDown;
}
cell.appendChild(this.arrowEnCours);
this.oldColCLic={ind:ind,boolOrder:boolOrder};
}
function compareTwoColumns(nCol,bDescending,sType){
var c=nCol;
if(bDescending){triDesc=1;}
else{triDesc=-1;}
if(sType=="number")
{
return function(n1,n2){
return(parseInt(n1[c])-parseInt(n2[c]))*triDesc;
};
}
if(sType=="date")
{
return function(n1,n2){
var tab=n1[c].split("/");
var date1=new Date(tab[2],tab[1],tab[0]);
tab=n2[c].split("/");
var date2=new Date(tab[2],tab[1],tab[0]);
if(date1>=date2)
return -1*triDesc
if(date2>date1)
return 1*triDesc
return 0
};
}
if(sType=="string")
{
return function(n1,n2){
if(n1[c]>=n2[c])
return -1*triDesc
if(n1[c]<n2[c])
return 1*triDesc
return 0
};
}
}
rialto.widget.Grid.prototype.afterMouseover=function(node){
if(!node.sel){
node.style.color="black";
this.onmouseover(node);
}
}
rialto.widget.Grid.prototype.afterMouseout=function(node){
if(!node.sel){
node.style.color="";
if(node.type!="line"){
if(this.tabData[node.indL].cellProp[node.ind].obStyle!=null){
this.setStyle(node.indL,node.ind);
}
}
this.onmouseout(node);
}
}
rialto.widget.Grid.prototype.oncontextmenu=function(node,e){
this.menuContex.srcEvent=node;
this.menuContex.activeItem(0);
this.menuContex.afficheMenu(e);
}
rialto.widget.Grid.prototype.afterOnDbleClick=function(indLine,indCell){
if(this.indLineClic!=indLine||(this.indLineClic==indLine&&this.indCellClic!=indCell)){
this.deselNode(this.indLineClic,this.indCellClic);
this.selNode(indLine,indCell)
}
if(this.writable){
var oThis=this;
var node=document.getElementById(this.id+"_CellTab_"+indLine+"_"+indCell);
node.onkeypress=function(evt){
if(!evt)var evt=window.event;
var keyCode=evt.keyCode?evt.keyCode:
evt.charCode?evt.charCode:
evt.which?evt.which:void 0;
if(keyCode==9||keyCode==13||keyCode==27||keyCode==38||keyCode==40){
bDecalLine=false;
bDecalCell=false;
iDecal=0;
bReset=false;
switch(keyCode){
case 9:
iDecal=evt.shiftKey?-1:1;
bDecalCell=true;
break;
case 13:
break;
case 27:
bReset=true;
break;
case 38:
bDecalLine=true;
iDecal=-1;
break;
case 40:
bDecalLine=true;
iDecal=1
break;
}
oThis.afterCellEdit(indLine,indCell,oThis.getCellText(indLine,indCell),oThis.text.getValue(),bDecalLine,bDecalCell,iDecal,bReset)
return false;
}
}
if(this.tabTypeCol[indCell][2]){
this.text=new rialto.widget.Combo(this.tabTypeCol[indCell][2],"gridCombo",0,0,node.offsetWidth-4,node,{suggest:false});
this.text.selWithText(this.tabData[indLine][indCell]);
}
else{
if(this.tabTypeCol[indCell][0]=="date"){
var type="D";
}
else{
if(this.tabTypeCol[indCell][0]=="number"){
var type="N";
}
else{
var type="A";
}
}
this.text=new rialto.widget.Text("Gridtext",0,0,node.offsetWidth-4,type,node);
this.text.setValue(this.tabData[indLine][indCell]);
}
this.text.setFocus();
}
this.ondbleclick(indLine,indCell);
}
rialto.widget.Grid.prototype.afterCellEdit=function(indLine,indCell,oldVal,newVal,bDecalLine,bDecalCell,iDecal,bReset){
var bResetA=!this.onCellEdit(indLine,indCell,oldVal,newVal);
if(!bReset&&!bResetA){
this.setCellText(indLine,indCell,newVal);
this.onCellWrite(indLine,indCell,newVal);
}
this.text.remove();
this.text=null;
var nouvCell=indCell;
var nouvLine=indLine;
var bOpenNextCell=false;
if(bDecalCell){
bOpenNextCell=true;
nouvCell=parseInt(indCell)+iDecal;
if(nouvCell>=this.NbreCol){
nouvCell=0;
}
else{
if(nouvCell<0){
nouvCell=this.NbreCol-1;
}
}
}
if(bDecalLine){
bOpenNextCell=true;
nouvLine=parseInt(indLine)+iDecal;
if(nouvLine>=this.tableauHTML.childNodes.length){
nouvLine=0;
}
else{
if(nouvLine<0){
nouvLine=this.tableauHTML.childNodes.length-1;
}
}
}
if(bOpenNextCell){
this.afterOnDbleClick(nouvLine,nouvCell);
}
}
rialto.widget.Grid.prototype.afterOnClick=function(indLine,indCell,boolAction){
if(this.cellActive){
var node=document.getElementById(this.id+"_CellTab_"+indLine+"_"+indCell);
}
else{
var node=document.getElementById(this.id+"_LineTab_"+indLine);
}
if(this.multiSelect){
if(node.sel){
this.deselNode(indLine,indCell)
if(boolAction){
this.onDeclickApplicatif(indLine,indCell);
}
}
else{
this.selNode(indLine,indCell)
if(boolAction){
this.onclick(indLine,indCell);
}
}
}
else{
if(this.indLineClic!=-1){
if((!this.cellActive&&this.indLineClic!=indLine)||
(this.cellActive&&(this.indLineClic!=indLine||(this.indLineClic==indLine&&this.indCellClic!=indCell))))
{
this.deselNode(this.indLineClic,this.indCellClic);
this.selNode(indLine,indCell)
if(boolAction){
this.onclick(indLine,indCell);
}
}
}
else{
this.selNode(indLine,indCell)
if(boolAction){
this.onclick(indLine,indCell);
}
}
}
}
rialto.widget.Grid.prototype.selNode=function(indLine,indCell){
if(this.cellActive){
var node=document.getElementById(this.id+"_CellTab_"+indLine+"_"+indCell);
}
else{
var node=document.getElementById(this.id+"_LineTab_"+indLine);
}
node.sel=true;
if(node.type=="line"){
var cellCoche=node.childNodes[1]
this.tabData[indLine].sel=true;
}
else{
var cellCoche=node
this.tabData[indLine].cellProp[indCell].sel=true;
}
divCoche=this.divCoche.cloneNode(true);
cellCoche.insertBefore(divCoche,cellCoche.firstChild);
node.style.border="1px solid #0099CC";
node.style.color="#0099FF";
this.indLineClic=indLine;
this.indCellClic=indCell;
}
rialto.widget.Grid.prototype.deselNode=function(indLine,indCell){
if(this.cellActive){
var node=document.getElementById(this.id+"_CellTab_"+indLine+"_"+indCell);
}
else{
var node=document.getElementById(this.id+"_LineTab_"+indLine);
}
if(node){
node.sel=false;
node.style.border="";
node.style.fontWeight='';
node.style.color="";
if(node.type=="line"){
var cellCoche=node.childNodes[1]
for(var j=0;j<this.NbreCol;j++){
objS=this.tabData[indLine].cellProp[j].obStyle;
if(objS!=null){this.setStyle(indLine,j);}
}
}
else{
if(indLine%2!=0){
node.style.background="#FBFBFB";
}
var cellCoche=node;
objS=this.tabData[indLine].cellProp[indCell].obStyle;
if(objS!=null){this.setStyle(indLine,indCell);}
}
if(cellCoche.childNodes.length>0){cellCoche.removeChild(cellCoche.firstChild)};
}
if(!this.cellActive){
this.tabData[indLine].sel=false;
}
else{
this.tabData[indLine].cellProp[indCell].sel=false;
}
this.indLineClic=-1;
if(this.text){
if(this.text.type=="combo"){
var val=this.text.getSelText();
}
else{
var val=this.text.getValue();
}
this.afterCellEdit(indLine,indCell,this.getCellText(indLine,indCell),val,false,false,0,false)
}
}
rialto.widget.Grid.prototype.unselectLine=function(){
if(this.indLineClic!=-1){
this.deselNode(this.indLineClic,this.indCellClic);
}
}
rialto.widget.Grid.prototype.clickLine=function(indLine,indCell){
this.afterOnClick(indLine,indCell,true);
}
rialto.widget.Grid.prototype.clickNext=function(){
ind=parseInt(this.indLineClic)+1;
if(this.navigation){
if(ind>=this.finInd){
this.nextN();
}
}
else{
if(ind>this.NbreLig-1){
ind=0;
}
}
this.afterOnClick(ind,this.indCellClic,true);
}
rialto.widget.Grid.prototype.clickPrevious=function(){
ind=parseInt(this.indLineClic)-1;
if(this.navigation){
if(ind<this.debInd){
this.previousN();
}
}
else{
if(ind<0){
ind=this.NbreLig-1;
}
}
this.afterOnClick(ind,this.indCellClic,true);
}
rialto.widget.Grid.prototype.clickLast=function(){
if(this.navigation){this.lastN();}
this.afterOnClick(parseInt(this.NbreLig)-1,this.indCellClic,true)
}
rialto.widget.Grid.prototype.clickFirst=function(){
if(this.navigation){this.firstN();}
this.afterOnClick(0,this.indCellClic,true)
}
rialto.widget.Grid.prototype.ondbleclick=function(indLine,indCell){
}
rialto.widget.Grid.prototype.onclick=function(indLine,indCell){
}
rialto.widget.Grid.prototype.onCellEdit=function(indLine,indCell,oldVal,newVal){
return true
}
rialto.widget.Grid.prototype.onCellWrite=function(indLine,indCell,newVal){
}
rialto.widget.Grid.prototype.onDeclickApplicatif=function(indLine,indCell){
}
rialto.widget.GridTree=function(objPar){
objPar.type="Gridtreeview";
objPar.switchable=false;
objPar.sortable=false;
objPar.lineHeight=23;
this.base=rialto.widget.AbstractComponent;
this.base(objPar);
var oThis=this;
this.grid=new rialto.widget.Grid(objPar);
this.grid.getInfoPrint=function(){
var obj=new Object;
obj.strEntete=new String;
obj.strEntete=this.tabEntete.join("$");
obj.tabEntete=this.tabEntete;
obj.strEntete=rialto.string.formatHTTP(obj.strEntete);
obj.titre=this.titrePrint;
obj.NBCOL=this.tabEntete.length;
obj.NbreLig=this.NbreLig;
var arrTemp=new Array;
for(var i=0;i<this.tabData.length;i++){
arrTemp[i]=new Array;
arrTemp[i][0]=this.tabData[i][this.NbreCol];
for(var j=1;j<this.tabData[i].length;j++){
arrTemp[i][j]=this.tabData[i][j];
}
}
obj.tabData=arrTemp;
return obj;
}
this.tree=new rialto.widget.Tree({name:'treeGrid',
top:'21',
left:'20',
width:parseInt(this.grid.tabTypeCol[0][1],10)-25,
height:objPar.height,
parent:this.grid.tableauEntete,
boolSelActive:false,
rootOpen:true,
withRoot:false,
withT:false,
position:'absolute'}
);
this.tree.divExt.style.overflow='hidden';
this.nodeRoot=this.tree.createAndAddNode(this.tree.id,{name:'nodeR',
sText:'',
sIcon:'',
sIcon2:'',
onclick:"",
open:true,
reload:false,
url:"",
typeInfo:''}
);
this.nodeRoot.oCiu=this;
}
rialto.widget.GridTree.prototype.addNodeLine=function(nodeP,text,open,tabData){
var lineNode=new rialto.widget.LineNode(this,text,nodeP.open,tabData);
if(!nodeP){nodeP=this.nodeRoot}
nodeP.icon=rialtoConfig.pathRialtoE+"images/imTreeview/pict_synthetik_off.gif";
nodeP.icon2=rialtoConfig.pathRialtoE+"images/imTreeview/pict_synthetik_off.gif";
nodeP.addNode(lineNode.node);
return lineNode.node;
}
rialto.widget.LineNode=function(parent,text,open,tabData){
this.parent=parent;
this.node=new rialto.widget.TreeNode({name:'node1',
sText:text,
sIcon:'images/imTreeview/puce.gif',
sIcon2:'',
onclick:"",
open:open,
reload:false,
url:"",
typeInfo:''});
this.node.divText.className+=" ligne";
if(!tabData){
var tabData=new Array;
for(var i=0;i<this.parent.grid.NbreCol;i++){
tabData.push("");
}
}
tabData.push(this.node.text);
this.node.indL=this.parent.grid.addOneLine(tabData);
this.line=document.getElementById(this.parent.grid.id+"_LineTab_"+this.node.indL);
this.node.oCiu=this;
var oThis=this;
this.node.toggle=function(){
traceExec("toggle",1);
if(this.hasChild()){
if(this.open){
this.DIVCONTENU.style.display='none';
this.open=false;
}
else{
this.DIVCONTENU.style.display='block';
this.open=true;
}
this.displayChilds(this.open);
this.changeIcone();
}
}
this.node.displayChilds=function(isVisible){
if(this.hasChild()){
for(var i=0;i<this.arrChildNode.length;i++){
var node=this.arrChildNode[i];
var line=node.oCiu.line;
if(isVisible){
line.style.display='block';
}
else{
line.style.display='none';
}
node.displayChilds(isVisible);
}
}
}
}
rialto.widget.LineNode.prototype.getLine=function(indL){
return document.getElementById(this.parent.grid.id+"_LigneTab_"+this.node.indL);
}
objFrame.prototype.nbreInstance=0;
function objFrame(name,top,left,width,height,bAffiche){
this.name=name;
this.id=name+"_"+(objFrame.prototype.nbreInstance++);
if(!bAffiche){
this.top=0;this.left=0;this.width=0;this.height=0;
this.visibility="hidden";
}
else{
this.visibility="visible";
this.top=top;this.left=left;this.width=width;this.height=height;
}
this.visibility="visible";
this.top=200;this.left=200;this.width=200;this.height=200;
}
objFrame.prototype.create=function(parent){
rialto.session.reccord(this,this.id);
var oThis=this;
this.frame=document.createElement('iframe');
this.frame.style.position="absolute";
this.frame.style.visibility=this.visibility;
this.frame.style.top=this.top;
this.frame.style.left=this.left;
this.frame.style.width=this.width;
this.frame.style.border="0px solid black";
this.frame.style.backgroundColor="white";
this.frame.style.height=this.height;
this.frame.id=this.id+"IFRAME";
this.frame.name=this.id+"IFRAME";
this.frame.src="";
this.frame.oCiu=this;
if(parent){
this.placeIn(parent);
}
else{
document.body.appendChild(this.frame);
};
}
objFrame.prototype.masque=function(){
this.frame.style.width=0;
this.frame.style.height=0;
}
objFrame.prototype.placeIn=function(parent){
if(parent.add){
parent.add(this.frame);
}
else{
parent.appendChild(this.frame);
}
this.parent=this.frame.parentNode;
}
objFrame.prototype.remplit=function(inner){
fr=document.getElementById(this.id+"IFRAME");
fr.contentWindow.document.write(inner);
}
objFrame.prototype.reload=function(inner){
fr=document.getElementById(this.id+"IFRAME");
fr.contentWindow.document.location.reload();
}
objFrame.prototype.load=function(url){
if(url!=null){
this.url=String(url);
this.IFrameDoc=this.frame.contentWindow.document;
this.IFrameDoc.location.replace(this.url);
}
}
objFrame.prototype.masque=function(){
this.frame.style.visibility='hidden'
}
objFrame.prototype.affiche=function(){
this.frame.style.visibility='visible'
}
objFrame.prototype.trace=function(){
}
objFrame.prototype.getObjHtml=function(){
return this.frame;
}
objFrame.prototype.delFrame=function(parent){
this.parent.removeChild(this.frame)
}
rialto.widget.Image
=function(imageOut,left,top,parent,alternateText,imageOn,objParam){
if(arguments.length==0)return;
this.base=rialto.widget.AbstractComponent;
var objPar=(typeof objParam!="undefined")?objParam:{};
objPar.type='image'+imageOut;
objPar.left=left;
objPar.top=top;
this.base(objPar);
this.imgOn=this.ImgRef=imageOut;
if(imageOn&&imageOn!=""){this.ImgRef2=imageOn;}
this.alt=alternateText;
this.display="block";
this.enable=true;
this.avecLim=false;
this.imageDisabled=imageOut;
this.boolFloatRight=false;
this.boolFloatLeft=false;
this.onclick=null;
if(objPar!=null){
if(objPar.imageDisabled!=null){
this.imageDisabled=objPar.imageDisabled;
}
if(rialto.lang.isBoolean(objPar.boolFloatRight)){
this.boolFloatRight=objPar.boolFloatRight;
}
if(rialto.lang.isBoolean(objPar.boolFloatLeft)){
this.boolFloatLeft=objPar.boolFloatLeft;
}
}
if(this.boolFloatLeft||this.boolFloatRight){
this.position="relative";
}
objPar=null;
objParam=null;
this.base=null;
var oThis=this;
this.divExt.style.position=this.position;
this.divExt.style.display=this.display;
this.divExt.style.left=this.left+"px";
this.divExt.style.top=this.top+"px";
this.divExt.className="img-div";
this.divExt.style.width='auto';
this.divExt.style.height='auto';
if(this.boolFloatLeft)
this.divExt.style[ATTRFLOAT]='left';
if(this.boolFloatRight)
this.divExt.style[ATTRFLOAT]='right';
if(this.alt!=null)
this.divExt.title=this.alt;
this.divExt.onmouseout=function(e){
if(oThis.enable){
if(!e)e=window.event;
oThis.$$loadImage();
oThis.onmouseout(e);
}
};
this.divExt.onselectstart=function(){return false};
this.divExt.onmousemove=function(e){
if(oThis.avecLim){
if(!e)e=window.event;
this.onmouseover(e);
}
};
this.divExt.onmouseover=function(e){
if(!e)e=window.event;
if(oThis.verifLimReac(e)){
if(oThis.enable){
if(oThis.onclick){
this.style.cursor="pointer";
}
else{
this.style.cursor="default";
}
if(oThis.ImgRef2){
oThis.$$loadImage(altImg=true);
}
}
else{
this.style.cursor="default";
}
oThis.onmouseover();
}
else{
this.onmouseout(e);
}
stopEvent(e);
};
this.divExt.onclick=function(e){
if(!e)e=window.event;
if(oThis.verifLimReac(e)){
if(oThis.enable&&oThis.onclick){
oThis.onclick(e);
stopEvent(e);
}
}
};
this.divExt.ondblclick=function(e){
if(!e)e=window.event;
if(oThis.verifLimReac(e)){
if(oThis.enable){
oThis.ondbleclick(e);
stopEvent(e);
}
}
};
this._imgDiv=document.createElement("DIV");
this._imgImg=document.createElement("IMG");
this.$$loadImage();
this.divExt.appendChild(this._img);
this._img.onerror=function(evt){
alert('pb de chargt d 1 image dans l obj js image de ref : '+this.src);
}
if(parent!=null){this.placeIn(parent);};
}
rialto.widget.Image.prototype=new rialto.widget.AbstractComponent;
rialto.widget.Image.prototype.getHtmlDD=function(){
return this._img;
}
rialto.lang.extend(rialto.widget.Image,
{
$$loadImage:function(bAlt){
var wImgRef;
if(!this.enable){
if(this.imageDisabled)
wImgRef=this.imageDisabled;
else
return;
}
else
if(!bAlt)
wImgRef=this.ImgRef;
else
wImgRef=this.ImgRef2;
if(wImgRef.indexOf(".")!=-1){
this._imgDiv.style.display='none';
this._imgImg.style.display='block';
this._imgImg.src=wImgRef;
this._img=this._imgImg;
}
else{
this._imgImg.style.display='none';
this._imgDiv.style.display='block';
this._imgDiv.className=wImgRef;
this._img=this._imgDiv;
}
}
,
$changeImages:function(imageOut,imageOver,imageDisabled){
if(imageOut!=null)
this.imgOn=this.ImgRef=imageOut;
if(imageOver!=null)
this.ImgRef2=imageOver;
if(imageDisabled!=null)
this.imageDisabled=imageDisabled;
this.$$loadImage();
}
,
setLimReac:function(x,y,delX,delY){
this.x=x;
this.y=y;
this.delX=delX;
this.delY=delY;
this.avecLim=true;
},
verifLimReac:function(e){
if(this.avecLim){
if(window.event){
var evX=parseInt(e.offsetX)
var evY=parseInt(e.offsetY)
}
else{
var evX=parseInt(e.layerX)
var evY=parseInt(e.layerY)
}
return((evX>=this.x&&evX<=(this.x+this.delX))&&(evY>=this.y&&evY<=(this.y+this.delY)))
}
else{
return true
}
},
setImageReference:function(imageOut,imageOver){
this.$changeImages(imageOut,imageOver);
},
setImages:function(imageOut,imageOver,imageDisabled){
this.$changeImages(imageOut,imageOver,imageDisabled);
},
setAlt:function(alt){
this.alt=alt;
this._img.title=alt;
},
masqueImage:function(){
rialto.deprecated('rialto.widget.Image','masqueImage','setVisible(false)');
this.setVisible(false);
},
afficheImage:function(){
rialto.deprecated('rialto.widget.Image','afficheImage','setVisible(true)');
this.setVisible(true);
},
setVisible:function(visible){
var oHtml=this.getHtmlExt();
if(visible){
oHtml.style.display='block';
this._img.style.display=this.display;
}
else{
oHtml.style.display='none';
}
this.visible=visible;
},
inactive:function(){
rialto.deprecated('rialto.widget.Image','inactive','setEnable(false)');
this.setEnable(false);
},
active:function(){
rialto.deprecated('rialto.widget.Image','active','setEnable(true)');
this.setEnable(true);
},
setEnable:function(enable){
this.enable=enable;
this.$changeImages(null,null,this.imageDisabled);
},
clignote:function(){
if(this.imgOn==this.ImgRef){
this.imgOn=this.ImgRef2
}
else{
this.imgOn=this.ImgRef
}
this._img.className=this.imgOn;
this.Tclignote=window.setTimeout("rialto.session.objects[\""+this.id+"\"].clignote()",500);
},
arreteClignote:function(){
this.imgOn=this.ImgRef;
this._img.className=this.ImgRef;
if(this.Tclignote){window.clearTimeout(this.Tclignote);};
}
,
release:function(){
this.divExt.onmouseout=null;
this.divExt.onselectstart=null;
this.divExt.onmousemove=null;
this.divExt.onmouseover=null;
this.divExt.onclick=null;
this.divExt.ondblclick=null;
this._img.onerror=null;
this.$changeImages=null;
this.onclick=null;
}
}
);
rialto.widget.Text=function(name,top,left,width,datatype,parent,objPar){
var objParam=new Object;
objParam.name=name;
objParam.type="text";
objParam.left=left;
objParam.top=top;
objParam.width=width;
if(objPar!=null){objParam.position=objPar.position;}
this.base=rialto.widget.AbstractComponent;
this.base(objParam);
if(rialto.lang.isStringIn(datatype,['T','P','A','N','I','D','H','Hi'])){
this.datatype=datatype;
}
else{
this.datatype='A';
}
if(this.datatype=='P'){
this.inputType="password";
}
else{
if(this.datatype=="Hi"){
this.inputType="hidden";
}
else{this.inputType="text";}
}
this.autoUp=false;
this.isRequired=false;
this.disable=false;
this.nbchar=50;
this.rows=5;
this.initValue=null;
this.wvalue="";
this.accessKey="";
this.tabIndex=rialto.widget.Form.prototype.tabIndex++;
if(objPar){
if(rialto.lang.isNumber(objPar.nbchar)){
this.nbchar=objPar.nbchar;
}
if(rialto.lang.isBoolean(objPar.autoUp)){
this.autoUp=objPar.autoUp;
}
if(rialto.lang.isBoolean(objPar.disable)){
this.disable=objPar.disable;
}
if(rialto.lang.isBoolean(objPar.isRequired)){
this.isRequired=objPar.isRequired;
}
if(rialto.lang.isNumber(objPar.rows)){
this.rows=objPar.rows;
}
if(rialto.lang.isString(objPar.initValue)){
this.initValue=objPar.initValue;
}
if(rialto.lang.isString(objPar.accessKey,true)){
this.accessKey=objPar.accessKey;
}
if(rialto.lang.isNumber(objPar.tabIndex)){
this.tabIndex=objPar.tabIndex;
}
}
objPar=null;
objParam=null;
var oThis=this;
this.divExt.id=this.id+"_DivGen";
this.divExt.style.position=this.position;
this.divExt.style.left=this.left+"px";
this.divExt.style.top=this.top+"px";
this.divExt.style.width=this.width;
this.divExt.style.height=20;
this.divExt.className="champs-div";
var strInner="";
if(this.datatype=="T"){
strInner="<TEXTAREA  name='"+this.name+"'/>";
}
else{
strInner="<input type='"+this.inputType+"' name='"+this.name+"'/>";
}
this.divExt.innerHTML=strInner;
if(parent){this.placeIn(parent);};
}
rialto.widget.Text.prototype=new rialto.widget.AbstractComponent;
rialto.widget.Text.prototype.adaptToContext=function(){
var oThis=this;
this.champs=this.divExt.childNodes[0];
if(this.datatype=="T"){
this.champs.style.border="1px solid rgb(120,172,255)";
this.champs.rows=this.rows;
}
else{
this.champs.style.border="1px inset rgb(212,208,200)";
}
this.champs.tabIndex=this.tabIndex;
this.champs.maxlength=this.nbchar;
this.champs.accessKey=this.accessKey;
this.champs.style.width='100%';
if(this.initValue){
this.setValue(this.initValue);
}
this.champs.setAttribute("autocomplete","off");
if(this.datatype=="N"){
this.champs.className="champs-num";
}
else if(this.datatype=="A"){
this.champs.className="champs-alpha";
}
else if(this.datatype=="I"){
this.autoUp=false;
this.champs.className="champs-dossier";
this.divExt.style.width=80;
this.champs.style.width=80;
this.champs.size=10;
this.champs.maxlength=10;
}
else if(this.datatype=="D"){
this.autoUp=false;
this.champs.className="champs-date";
this.divExt.style.width=115;
this.champs.style.width=80;
this.champs.size=10;
this.champs.maxlength=10;
this.hlpimg=new rialto.widget.Image('pinkHelpButton',80,-2,this.divExt,"Afficher le calendrier",'redHelpButton',{position:'absolute'});
this.hlpimg.onclick=function(e){
if(!e)e=window.event
oThis.openCalendar(e);
}
}
else if(this.datatype=="H"){
this.autoUp=false;
this.champs.className="champs-alpha";
this.divExt.style.width=40;
this.champs.style.width=40;
this.champs.size=5;
this.champs.maxlength=5;
}
if(this.disable){
this.setEnable(false);
}
if(this.isRequired){
champsAs=document.createElement("DIV");
champsAs.innerHTML="*";
champsAs.style.position="absolute";
champsAs.style.top=0;
champsAs.style.left=-7;
champsAs.style.color="red";
this.divExt.appendChild(champsAs);
}
if(this.isRequired){
champsAs=document.createElement("DIV");
champsAs.innerHTML="*";
champsAs.style.position="absolute";
champsAs.style.top=0;
champsAs.style.left=-7;
champsAs.style.color="red";
this.divExt.appendChild(champsAs);
}
if(this.datatype!="Hi"){
this.champs.onkeypress=function(e){
if(!e)var e=window.event;
return oThis.checkKeyPress(e);
};
this.champs.onmousedown=function(e){
if(!e)var e=window.event;
stopEvent(e);
};
this.champs.onfocus=function(e){
if(!e)var e=window.event;
oThis.afterOnFocus();
};
this.champs.onblur=function(e){
if(!e)var e=window.event;
oThis.afterOnBlur();
};
this.champs.onclick=function(){
this.focus();
return true;
}
this.champs.ondbleclick=function(){
this.select();
return true;
}
}
}
rialto.widget.Text.prototype.release=function(){
this.divExt.onselectstar=null;
this.champs.onkeypress=null;
this.champs.onfocus=null;
this.champs.onblur=null;
this.champs.onclick=null;
this.champs.ondbleclic=null;
if(this.datatype=="D"){
this.hlpimg.onclick=null;
this.hlpimg.remove();
if(this.calendar){
this.calendar.onclick=null;
this.calendar.remove();
}
}
}
rialto.widget.Text.prototype.setStyle=function(obStyle){
for(prop in obStyle){
try{
this.champs.style[prop]=obStyle[prop];
}
catch(erreur){}
}
}
rialto.widget.Text.prototype.openCalendar=function(e){
var othis=this;
if(!this.calendar){
this.calendar=new rialto.widget.Calendar({popUpMode:true});
this.calendar.onclick=function(date){
othis.setValue(date);
othis.setFocus();
}
}
var top=compOffsetTop(this.divExt)+27;
var left=compOffsetLeft(this.divExt)-90;
if(left<0){left=0;}
this.calendar.displayCalendar(top,left);
}
rialto.widget.Text.prototype.checkKeyPress=function(evt){
var boolCancel=false;
boolReplaceKey=false;
var keyCode=evt.keyCode?evt.keyCode:
evt.charCode?evt.charCode:
evt.which?evt.which:void 0;
var key;
if(keyCode){
key=String.fromCharCode(keyCode);
}
if(evt.altKey){return true;}
if(evt.ctrlKey){return true;}
if(keyCode==9||(keyCode==37)||(keyCode==39)||(keyCode==46)||keyCode==8){
return true
};
if(keyCode==13&&this.datatype!="T"){
this.champs.blur();
return this.blurOK
}
if(this.datatype=='I'){
boolCancel="0123456789-".indexOf(key)==-1
}
if(this.autoUp==true){
var newKey=key.toUpperCase();
if(newKey!=key){
boolReplaceKey=true;
key=newKey;
}
}
if(this.datatype=='N'){
boolCancel="0123456789".indexOf(key)==-1
}
if(this.datatype=='D'){
boolCancel="0123456789/".indexOf(key)==-1
}
if(this.datatype=='H'){
if("0123456789:".indexOf(key)==-1){
boolCancel=true
}
else{
if(key==":"&&this.champs.value.length!=2){
boolCancel=true;
}
}
}
if(keyCode&&window.event&&!window.opera){
if(boolCancel){
return false;
}
else if(boolReplaceKey){
window.event.keyCode=key.charCodeAt();
if(window.event.preventDefault){
window.event.preventDefault();
}
return true;
}
else{
return true;
}
}
else if(typeof this.champs.setSelectionRange!='undefined'){
if(boolCancel){
if(evt.preventDefault){
evt.preventDefault();
}
return false;
}
else if(boolReplaceKey){
if(evt.preventDefault){
evt.preventDefault();
}
var oldSelectionStart=this.champs.selectionStart;
var oldSelectionEnd=this.champs.selectionEnd;
this.champs.value=
this.champs.value.substring(0,oldSelectionStart)+
key+
this.champs.value.substring(oldSelectionEnd);
this.champs.setSelectionRange(oldSelectionStart+key.length,
oldSelectionStart+key.length);
return false;
}
else{
return true;
}
}
else if(boolCancel){
if(evt.preventDefault){
evt.preventDefault();
}
return false;
}
else{
return true;
}
}
rialto.widget.Text.prototype.afterOnFocus=function(){
document.onselectstart=function(){return true};
this.champs.select();
this.blurOK=true;
this.wchanged=false;
this.onfocus();
}
rialto.widget.Text.prototype.displayMessage=function(str,boolSetFoc){
var oThis=this;
info=new rialto.widget.Alert(str);
if(boolSetFoc){
info.onclose=function(){
oThis.setValue("");
oThis.champs.focus();
}
info=null;
}
}
rialto.widget.Text.prototype.afterOnBlur=function(){
if(this.champs.value!=""){
this.champs.value=rialto.string.trim(this.champs.value);
if(this.datatype=='N'&&this.champs.value!=""){
if(!rialto.lang.isNumber(this.champs.value)){
this.displayMessage("MUST BE A NUMBER",true);
this.blurOK=false;
}
}
if(this.datatype=='D'&&this.champs.value!=""){
if(!this.checkDate()){
this.displayMessage("Date is not correct, format must be: DD/MM/YYYY",true);
this.blurOK=false;
}
}
if(this.datatype=='H'&&this.champs.value!=""){
if(!this.checkHour()){
this.displayMessage("Hour is not correct, format must be: HH:MM",true);
this.blurOK=false;
}
}
if(this.datatype=='I'&&this.champs.value!=""){
var wDoss=this.champs.value;
var wPos=wDoss.indexOf("-");
var wPre="";
var wSuf="";
if(wPos==-1){
if(wDoss.length<=5){
wPre=new Date().getYear().toString();
wSuf=wDoss;
window.status="1: "+wPre+":"+wSuf;
}
else{
wPre=wDoss.substring(0,4);
wSuf=wDoss.substring(4,wDoss.length);
}
}
else{
wPre=wDoss.substring(0,wPos);
wSuf=wDoss.substring(wPos+1,wDoss.length);
}
if(wPre==""){wPre=new Date().getYear().toString();}
if(wPre.length==1){wPre=("200"+wPre);}
if(wPre.length==2&&wPre<"30"){wPre=("20"+wPre);}
if(wPre.length==2&&wPre>="30"){wPre=("19"+wPre);}
if(wPre.length==3&&wPre<"030"){wPre=("2"+wPre);}
if(wPre.length==3&&wPre>="030"){wPre=("1"+wPre);}
if(wSuf.length<5){
var wPad="";
for(var wI=wSuf.length;wI<=4;wI++){
wPad=(wPad+"0");
}
wSuf=(wPad+wSuf);
}
if(wPre.length!=4||wSuf.length!=5){
this.displayMessage("Num?ro de dossier invalide, format utilisable: AA-NNNNN",true);
this.blurOK=false;
}
else{
this.champs.value=(wPre+"-"+wSuf);
}
}
document.onselectstart=function(){return false};
if(this.datatype!='P'){this.champs.title=this.champs.value;}
this.wchanged=(this.wvalue!=this.champs.value)
this.wvalue=this.champs.value;
if(this.wchanged&&this.blurOK){
this.blurOK=this.onblur();
}
this.removeAsRequired();
}
else{
this.blurOK=this.onblur();
if(this.isRequired){
this.showAsRequired();
this.blurOK=false;
}
}
}
rialto.widget.Text.prototype.onblur=function(){
return true;
}
rialto.widget.Text.prototype.hasChanged=function(){
return this.wchanged;
}
rialto.widget.Text.prototype.checkHour=function(){
strHour=this.champs.value;
strHour=rialto.string.replace(strHour,":","");
switch(strHour.length){
case 1:
h=parseInt(strHour);
m=0;
break;
case 2:
if(parseInt(strHour.substring(0,1))==0){
h=parseInt(strHour.substring(1,2));
}
else{
h=parseInt(strHour);
}
m=0;
break;
case 4:
if(parseInt(strHour.substring(0,1))==0){
h=parseInt(strHour.substring(1,2));
}
else{
h=parseInt(strHour.substring(0,2));
}
m=parseInt(strHour.substring(2,4));
break;
default:
return false
break;
}
strHour=h<10?"0"+h:h;
strHour+=":"+(m<10?"0"+m:m);
if(h<=24&&m<=60){
this.champs.value=strHour;
return true;
}
else{return false;}
}
rialto.widget.Text.prototype.checkDate=function(){
var oDate=new Date();
strDate=this.champs.value;
var curMonth=oDate.getMonth()+1;
curMonth=(curMonth<10)?'0'+curMonth:curMonth
var curYear=oDate.getFullYear();
strDate=rialto.string.replace(strDate,"/","");
switch(strDate.length){
case 1:
strDate="0"+strDate+"/"+curMonth+"/"+curYear;
break;
case 2:
strDate=strDate+"/"+curMonth+"/"+curYear;
break;
case 3:
strDate=strDate.slice(0,2)+"/0"+strDate.charAt(2)+"/"+curYear;
break;
case 4:
strDate=strDate.slice(0,2)+"/"+strDate.slice(2,4)+"/"+curYear;
break;
case 6:
strDate=strDate.slice(0,2)+"/"+strDate.slice(2,4)+"/20"+strDate.slice(4,6);
break;
case 8:
strDate=strDate.slice(0,2)+"/"+strDate.slice(2,4)+"/"+strDate.slice(4,8);
break;
default:
return false
break;
}
if(rialto.date.isDate(strDate)){
this.setValue(strDate);
return true;
}
else{return false;}
}
rialto.widget.Text.prototype.setFocus=function(){
this.champs.focus();
}
rialto.widget.Text.prototype.getValue=function(){
return this.champs.value;
}
rialto.widget.Text.prototype.setValue=function(text){
this.champs.value=text;
this.wvalue=text;
if(this.datatype!='P'){this.champs.title=text;}
}
rialto.widget.Text.prototype.active=function(){
rialto.deprecated('Text','active','setEnable(true)');
this.setEnable(true);
}
rialto.widget.Text.prototype.inactive=function(){
rialto.deprecated('Text','inactive','setEnable(false)');
this.setEnable(false);
}
rialto.widget.Text.prototype.setEnable=function(enable){
if(enable){
this.champs.style.color="black";
this.champs.disabled=false;
this.champs.style.backgroundColor="white";
this.champs.style.border="1px inset rgb(212,208,200)";
if(this.datatype=="D"){this.hlpimg.setEnable(true);}
}
else{
this.champs.disabled=true;
this.champs.style.color="gray";
this.champs.style.backgroundColor="#DDDDDD";
if(this.datatype=="D"){this.hlpimg.setEnable(false);}
}
this.enable=enable;
}
rialto.widget.Text.prototype.showAsRequired=function(){
this.champs.style.border="1px solid red";
}
rialto.widget.Text.prototype.removeAsRequired=function(){
this.champs.style.border="1px inset rgb(212,208,200)";
}
rialto.widget.Label=function(name,top,left,parent,text,className,objPar){
var objParam=new Object;
objParam.name=name;
objParam.type="label";
objParam.left=left;
objParam.top=top;
if(objPar!=null){objParam.position=objPar.position;}
this.base=rialto.widget.AbstractComponent;
this.base(objParam);
objPar=null;
objParam=null;
this.text=text;
if(className!=''&&className!=null){
this.className=className;
}
else{
this.className="libNormal";
}
var oThis=this;
this.divExt.id=this.id+"_DivGen";
this.divExt.style.position=this.position;
this.divExt.style.left=this.left+"px";
this.divExt.style.top=this.top+"px";
this.divExt.style.width=this.getTailleTexte()+"px";
this.divExt.className=this.className;
this.divExt.style.overflow='hidden';
this.divExt.style.textOverflow="ellipsis";
this.divExt.style.whiteSpace="nowrap";
this.divExt.title=this.text;
this.divExt.innerHTML=this.text;
if(parent){this.placeIn(parent);};
}
rialto.widget.Label.prototype=new rialto.widget.AbstractComponent;
rialto.widget.Label.prototype.getTailleTexte=function(wText){
var text=wText?wText:this.text;
return getTailleTexte(text,this.className);
}
rialto.widget.Label.prototype.changeLibelle=function(text){
rialto.deprecated('Label','changeLibelle','setText');
this.setText(text);
}
rialto.widget.Label.prototype.setText=function(text){
this.text=text;
this.divExt.innerHTML=this.text;
this.divExt.title=this.text;
this.divExt.style.width=this.getTailleTexte()+"px";
}
rialto.widget.Label.prototype.masqueLibelle=function(){
rialto.deprecated('Label','masqueLibelle','setVisible(false)');
this.setVisible(false);
this.masque=true;
}
rialto.widget.Label.prototype.afficheLibelle=function(){
rialto.deprecated('Label','afficheLibelle','setVisible(true)');
this.setVisible(true);
this.masque=false;
}
rialto.widget.Label.prototype.active=function(){
rialto.deprecated('Label','active','setEnable(true)');
this.setEnable(true);
}
rialto.widget.Label.prototype.inactive=function(){
rialto.deprecated('Label','inactive','setEnable(false)');
this.setEnable(false);
}
rialto.widget.Label.prototype.setEnable=function(enable){
if(enable){
this.divExt.className=this.className;
}
else{
this.divExt.className+=" inactif";
}
this.enable=enable;
}
$$fx=window.getComputedStyle?true:false;
if((typeof ria)=='undefined')
ria=rialto;
if((typeof ria.utils)=='undefined')
ria.utils={};
ria.utils.measures={};
ria.utils.measures.$getHeight=function(oHtml,bBorderLess,bNotAlreadyInDoct){
if(bNotAlreadyInDoct)
alert('not yet implemented');
else{
return ria.utils.measures.$$getHeightInDoct(oHtml,bBorderLess);
}
}
ria.utils.measures.$$getHeightInDoct=function(oHtml,bBorderLess){
var wH;
if(oHtml.nodeName=="BODY")
wH=document.body.clientHeight;
else
wH=(oHtml.offsetHeight||parseInt(oHtml.style.height));
var b=0;
if(bBorderLess){
b-=ria.utils.measures.$$getBorderTopWidth(oHtml);
b-=ria.utils.measures.$$getBorderBottomWidth(oHtml);
}
return(wH+b);
}
ria.utils.measures.$$getBorderTopWidth=function(oHtml){
if(!oHtml)return 0;
if((oHtml.nodeName=='BODY')
||(oHtml.nodeName=='#document'))
return 0;
var topEdge=0;
if(!window.getComputedStyle){
if(((oHtml.style.borderTopStyle!='none')
&&(oHtml.style.borderTopStyle!=''))
||(oHtml.currentStyle
&&(oHtml.currentStyle.borderTopStyle!='none')
&&(oHtml.currentStyle.borderTopStyle!=''))
)
topEdge=parseInt(oHtml.style.borderTopWidth)
||parseInt(oHtml.currentStyle.borderTopWidth);
}
else{
if((window.getComputedStyle(oHtml,null).getPropertyValue('border-top-style')!='none')
&&(window.getComputedStyle(oHtml,null).getPropertyValue('border-top-style')!='')){
if(window.getComputedStyle(oHtml,null).getPropertyValue('border-top-width'))
topEdge=parseInt(window.getComputedStyle(oHtml,null).getPropertyValue('border-top-width'));
}
}
return topEdge;
}
ria.utils.measures.$$getBorderBottomWidth=function(oHtml){
if(!oHtml)return 0;
if((oHtml.nodeName=='BODY')
||(oHtml.nodeName=='#document'))
return 0;
var bottomEdge=0;
if(!window.getComputedStyle){
if(((oHtml.style.borderBottomStyle!='none')
&&(oHtml.style.borderBottomStyle!=''))
||(oHtml.currentStyle
&&(oHtml.currentStyle.borderBottomStyle!='none')
&&(oHtml.currentStyle.borderBottomStyle!=''))
)
bottomEdge=parseInt(oHtml.style.borderBottomWidth)
||parseInt(oHtml.currentStyle.borderBottomWidth);
}
else{
if((window.getComputedStyle(oHtml,null).getPropertyValue('border-bottom-style')!='none')
&&(window.getComputedStyle(oHtml,null).getPropertyValue('border-bottom-style')!='')){
if(window.getComputedStyle(oHtml,null).getPropertyValue('border-bottom-width'))
bottomEdge=parseInt(window.getComputedStyle(oHtml,null).getPropertyValue('border-bottom-width'));
}
}
return bottomEdge;
}
ria.utils.measures.$$getBorderRightWidth=function(oHtml){
if(!oHtml)return 0;
if((oHtml.nodeName=='BODY')
||(oHtml.nodeName=='#document'))
return 0;
var rightEdge=0;
if(!window.getComputedStyle){
if(((oHtml.style.borderRightStyle!='none')
&&(oHtml.style.borderRightStyle!=''))
||(oHtml.currentStyle
&&(oHtml.currentStyle.borderRightStyle!='none')
&&(oHtml.currentStyle.borderRightStyle!=''))
)
rightEdge=parseInt(oHtml.style.borderRightWidth)
||parseInt(oHtml.currentStyle.borderRightWidth);
}
else{
if((window.getComputedStyle(oHtml,null).getPropertyValue('border-right-style')!='none')
&&(window.getComputedStyle(oHtml,null).getPropertyValue('border-right-style')!='')){
if(window.getComputedStyle(oHtml,null).getPropertyValue('border-right-width'))
rightEdge=parseInt(window.getComputedStyle(oHtml,null).getPropertyValue('border-right-width'));
}
}
return rightEdge;
}
ria.utils.measures.$$getBorderLeftWidth=function(oHtml){
if(!oHtml)return 0;
if((oHtml.nodeName=='BODY')
||(oHtml.nodeName=='#document'))
return 0;
var leftEdge=0;
if(!window.getComputedStyle){
if(((oHtml.style.borderLeftStyle!='none')
&&(oHtml.style.borderLeftStyle!=''))
||(oHtml.currentStyle
&&(oHtml.currentStyle.borderLeftStyle!='none')
&&(oHtml.currentStyle.borderLeftStyle!=''))
)
leftEdge=parseInt(oHtml.style.borderLeftWidth)
||parseInt(oHtml.currentStyle.borderLeftWidth);
}
else{
if((window.getComputedStyle(oHtml,null).getPropertyValue('border-left-style')!='none')
&&(window.getComputedStyle(oHtml,null).getPropertyValue('border-left-style')!='')){
if(window.getComputedStyle(oHtml,null).getPropertyValue('border-left-width'))
leftEdge=parseInt(window.getComputedStyle(oHtml,null).getPropertyValue('border-left-width'));
}
}
return leftEdge;
}
ria.utils.measures.$setHeightConformW3C=function(oHtml,oHtmlRef){
if(oHtmlRef){
if(window.getComputedStyle){
oHtml.style.height=_rum.$getHeight(oHtmlRef);
-_rum.$$getBorderTopWidth(oHtml)
-_rum.$$getBorderBottomWidth(oHtml);
}
else{
oHtml.style.height=_rum.$getHeight(oHtmlRef);
}
}
if(!window.getComputedStyle){
oHtml.style.height=_rum.$getHeight(oHtml)
+ria.utils.measures.$$getBorderTopWidth(oHtml)
+ria.utils.measures.$$getBorderBottomWidth(oHtml);
}
return(parseInt(oHtml.style.height));
}
ria.utils.measures.$setWidthConformW3C=function(oHtml,oHtmlRef){
if(oHtmlRef){
if(window.getComputedStyle){
oHtml.style.width=_rum.$getWidth(oHtmlRef)
-_rum.$$getBorderLeftWidth(oHtml)
-_rum.$$getBorderRightWidth(oHtml);
}
else{
oHtml.style.width=_rum.$getWidth(oHtmlRef);
}
}
if(!window.getComputedStyle){
oHtml.style.width=_rum.$getWidth(oHtml)
+ria.utils.measures.$$getBorderLeftWidth(oHtml)
+ria.utils.measures.$$getBorderRightWidth(oHtml);
}
return(parseInt(oHtml.style.width));
}
ria.utils.measures.$setSizeConformW3C=function(oHtml,oHtmlRef){
ria.utils.measures.$setHeightConformW3C(oHtml,oHtmlRef);
ria.utils.measures.$setWidthConformW3C(oHtml,oHtmlRef);
}
ria.utils.measures.$getWidth=function(oHtml,bBorderLess,bNotAlreadyInDoct){
if(bNotAlreadyInDoct)
alert('not yet implemented, impossible with IE ?');
else{
return ria.utils.measures.$$getWidthInDoct(oHtml,bBorderLess);
}
}
ria.utils.measures.$$getWidthInDoct=function(oHtml,bBorderLess){
var wW;
if(oHtml.nodeName=="BODY")
wW=document.body.clientWidth;
else
wW=(oHtml.offsetWidth||parseInt(oHtml.style.width));
var b=0;
if(bBorderLess){
b-=ria.utils.measures.$$getBorderLeftWidth(oHtml);
b-=ria.utils.measures.$$getBorderRightWidth(oHtml);
}
return(wW+b);
}
ria.utils.measures.$getStyle=function(oHtml,style){
var s;
if(window.getComputedStyle)
s=window.getComputedStyle(oHtml,null)[style];
else
s=oHtml.style[style]
||oHtml.currentStyle[style];
return s;
}
ria.utils.measures.$centerW=function(oHtml){
Pw=oHtml.parentNode.offsetWidth/2;
Ow=oHtml.offsetWidth/2;
oHtml.style.left=(Pw-Ow)+"px";
}
ria.utils.measures.$divInternalTopLeftInViewPort=
ria.utils.measures.$internalPosInViewPort=function(oHtml){
var topLeftExtern=ria.utils.measures.$posInViewPort(oHtml);
return{top:(topLeftExtern.top+_rum.$$getBorderTopWidth(oHtml)),
left:(topLeftExtern.left+_rum.$$getBorderLeftWidth(oHtml))
};
}
ria.utils.measures.$divTopLeftInViewPort=
ria.utils.measures.$posInViewPort=function(oHtml){
var x=y=0;
while(oHtml
&&(oHtml.nodeName!='BODY')
&&(oHtml.nodeName!='#document')
){
x=x
+oHtml.offsetLeft
+ria.utils.measures.$$getBorderLeftWidth(oHtml.parentNode)
-oHtml.scrollLeft;
y=y
+oHtml.offsetTop
+ria.utils.measures.$$getBorderTopWidth(oHtml.parentNode)
-oHtml.scrollTop;
oHtml=oHtml.offsetParent;
}
return{left:x
,top:y};
}
ria.utils.measures.$divTopLeftInDiv=function(oHtml){
var x=y=0;
x=oHtml.offsetLeft
+ria.utils.measures.$$getBorderLeftWidth(oHtml.parentNode);
y=oHtml.offsetTop
+ria.utils.measures.$$getBorderTopWidth(oHtml.parentNode);
return{left:x
,top:y};
}
ria.utils.measures.$eventTopLeftInViewPort=function(e){
if(!e)var e=window.event;
return{top:e.clientY
,left:e.clientX
}
}
ria.utils.measures.$eventTopLeftInDiv=
ria.utils.measures.$offsetPosInDiv=function(e){
var oHtmlSource=
(e.target?e.target:e.srcElement);
var left;
if(e.offsetX!=undefined){
left=e.offsetX
+ria.utils.measures.$$getBorderLeftWidth(oHtmlSource);
}
else{
left=e.layerX;
}
var top;
if(e.offsetY!=undefined){
top=e.offsetY
+ria.utils.measures.$$getBorderTopWidth(oHtmlSource);
}
else{
top=e.layerY;
}
return{top:top,left:left};
}
ria.utils.$placeInViewPort=function(oHtml,basePointSpecs,shift){
var top=(basePointSpecs.top!=undefined)?basePointSpecs.top:basePointSpecs.clientY;
var left=(basePointSpecs.left!=undefined)?basePointSpecs.left:basePointSpecs.clientX;
var heightAvailable=-1;
var rightSpace=document.body.clientWidth-left;
var bottomSpace=document.body.clientHeight-top;
if(rightSpace<oHtml.offsetWidth){
oHtml.style.left=document.body.scrollLeft+left-oHtml.offsetWidth;
}
else{
oHtml.style.left=document.body.scrollLeft+left;
}
if(oHtml.offsetHeight>bottomSpace){
if(oHtml.offsetHeight<(top-3-(shift||0))){
oHtml.style.top=document.body.scrollTop
+top-oHtml.offsetHeight
-3
-(shift||0);
}
else{
if(top>bottomSpace){
heightAvailable=top-9-(shift||0);
oHtml.style.top=3;
}
else{
heightAvailable=bottomSpace-3;
oHtml.style.top=document.body.scrollTop+top;
}
}
}
else{
oHtml.style.top=document.body.scrollTop+top;
}
return heightAvailable;
}
_r=ria;
_ru=ria.utils;
_rum=ria.utils.measures;
function getTailleTexte(wText,className){
div=document.createElement("DIV");
div.innerHTML=wText;
div.className=className;
div.style.position='absolute';
div.style.top=150;
div.style.left=150;
div.style.width='auto';
div.style.visibility='hidden';
div.style.whiteSpace='nowrap';
document.body.appendChild(div);
width=div.offsetWidth+0;
document.body.removeChild(div);
return width;
}
function positionneSelonEvent(eltApos,e){
var droite=document.body.clientWidth-e.clientX;
var bas=document.body.clientHeight-e.clientY;
if(droite<eltApos.offsetWidth){
eltApos.style.left=document.body.scrollLeft+e.clientX-eltApos.offsetWidth;
}
else{
eltApos.style.left=document.body.scrollLeft+e.clientX;
}
if(bas<eltApos.offsetHeight){
eltApos.style.top=document.body.scrollTop+e.clientY-eltApos.offsetHeight;
}
else{
eltApos.style.top=document.body.scrollTop+e.clientY;
}
}
function positionneSelonPosFournie(eltApos,top,left,height){
var heightAvailable=-1;
var droite=document.body.clientWidth-left;
var bas=document.body.clientHeight-top;
if(droite<eltApos.offsetWidth){
eltApos.style.left=document.body.scrollLeft+left-eltApos.offsetWidth;
}
else{
eltApos.style.left=document.body.scrollLeft+left;
}
traceExec('top= '+top+' bas= '+bas+' eltApos.offsetHeight= '+eltApos.offsetHeight,1);
if(eltApos.offsetHeight>bas){
if(eltApos.offsetHeight<top){
eltApos.style.top=document.body.scrollTop
+top-eltApos.offsetHeight
-3
-(height||0);
}
else{
if(top>bas){
heightAvailable=top-9-(height||0);
eltApos.style.top=3;
}
else{
heightAvailable=bas-3;
eltApos.style.top=document.body.scrollTop+top;
}
}
}
else{
eltApos.style.top=document.body.scrollTop+top;
}
return heightAvailable;
}
pixWidth=function(oHtml,sansBordure){
if(oHtml.pixWidth){
return oHtml.pixWidth();
}
var prc=1;
var nd=oHtml;
var percent=true;
var nivRemontee=0;
do{
if(nd.nodeName=="BODY"){
return(prc*parseInt(document.body.clientWidth));
}
var ndstyle=nd.currentStyle?nd.currentStyle:nd.style;
var taille=ndstyle.width;
if(taille=="auto"){
i=1;
taille=100;
}
else
i=ndstyle.width.indexOf('%');
if(i==-1)
percent=false;
else{
prc=prc*parseInt(taille)/100;
nivRemontee+=1;
}
}while(percent&&(nd=nd.parentNode))
if((nivRemontee>0)
&&(ndstyle.borderStyle!='none')
&&(ndstyle.borderStyle!=''))
tailleBord=parseInt(ndstyle.borderWidth);
else
tailleBord=0;
if(sansBordure)
if(parseInt(oHtml.style.borderWidth))
tailleBord+=parseInt(oHtml.style.borderWidth);
return(prc*(parseInt(taille)-tailleBord*2));
}
pixHeight=function(oHtml,sansBordure){
traceExec('pixHeight entree sansBordure= '+sansBordure,20);
if(sansBordure
&&(!window.getComputedStyle))
sansBordure=true;
else
sansBordure=false;
traceExec('pixHeightsansBordure= '+sansBordure,20);
var taille,tailleBord=0;
var prc=1;
if(!oHtml)alert('ds pixHeight argt  oHtml undef');
if(oHtml.pixHeight){
traceExec('pixHeight utilisation de la fct surcharg?e pour oHtml.id= '+oHtml.id,20);
taille=oHtml.pixHeight();
}
else{
var nd=oHtml;
var percent=true;
var nivRemontee=0;
do{
if(nd.nodeName=="BODY"){
taille=document.body.clientHeight;
percent=false;
traceExec('pixHeight  body sortie',1);
}
else{
traceExec('pixHeight nd.id='+nd.id+' taille= '+getComputStyleStr(nd,"height"),20);
var taille=getComputStyleStr(nd,'height');
if(taille=="auto"){
i=1;
taille=100;
}
else
i=taille.indexOf('%');
if(i==-1)
percent=false;
else{
prc=prc*parseInt(taille)/100;
nivRemontee+=1;
traceExec('nivRemontee = '+nivRemontee,20);
}
if(sansBordure)
tailleBord+=getBorderWidth(nd);
}
}while(percent&&(nd=nd.parentNode))
}
traceExec('pixHeight nivRemontee= '+nivRemontee+' prc= '+prc+' taille= '+taille+' tailleBord= '+tailleBord,20);
traceExec('pixHeight sortie',20);
return(prc*(parseInt(taille)-tailleBord*2));
}
compOffsetParent=function(oHtml){
var offsetTop=0;
while(oHtml){
offsetTop+=oHtml.offsetTop;
oHtml=oHtml.offsetParent;
}
return offsetTop;
}
compOffsetTop=function(oHtml){
var offsetTop=0;
while(oHtml){
offsetTop+=oHtml.offsetTop;
oHtml=oHtml.offsetParent;
}
return offsetTop;
}
compOffsetLeft=function(oHtml){
var offsetLeft=0;
while(oHtml){
offsetLeft+=oHtml.offsetLeft;
oHtml=oHtml.offsetParent;
}
return offsetLeft;
}
compOffsetHeight=function(oHtml){
var offsetHeight=0;
while(oHtml){
offsetHeight+=oHtml.offsetHeight;
oHtml=oHtml.offsetParent;
}
return offsetHeight;
}
pixTop=function(oHtml){
var prc=1;
var nd=oHtml;
var percent=true;
var i;
i=nd.style.top.indexOf('%');
if(i==-1)
percent=false;
else
prc=prc*parseInt(nd.style.top)/100;
return((prc==1)?(parseInt(nd.style.top)||0)
:(prc*pixHeight(nd))
);
}
pixLeft=function(oHtml){
var prc=1;
var nd=oHtml;
var percent=true;
i=nd.style.left.indexOf('%');
if(i==-1)
percent=false;
else
prc=prc*parseInt(nd.style.left)/100;
return((prc==1)?(parseInt(nd.style.left)||0)
:(prc*pixWidth(nd))
);
}
nvPixLeft=function(oHtml){
var prc;
i=oHtml.style.left.indexOf('%');
if(i==-1)
prc=1
else
prc=parseInt(oHtml.style.left)/100;
return((prc==1)?(parseInt(oHtml.style.left)||0)
:(prc*pixWidth(oHtml.parentNode))
);
}
oldpixTop=function(oHtml){
var prc=1;
var nd=oHtml;
var percent=true;
var i;
do{
i=nd.style.top.indexOf('%');
if(i==-1)
percent=false;
else
prc=prc*parseInt(nd.style.top)/100;
}while(percent&&(nd=nd.parentNode))
return((prc==1)?(parseInt(nd.style.top)||0)
:(prc*parseInt(nd.style.height))
);
}
oldpixLeft=function(oHtml){
var prc=1;
var nd=oHtml;
var percent=true;
do{
i=nd.style.left.indexOf('%');
if(i==-1)
percent=false;
else
prc=prc*parseInt(nd.style.left)/100;
}while(percent&&(nd=nd.parentNode))
return((prc==1)?(parseInt(nd.style.left)||0)
:(prc*parseInt(nd.style.width))
);
}
function replace(strCible,strRech,strRempla)
{
var array;
var s=new String(strCible);
if(s!=''){
array=s.split(strRech);
}
s="";
for(i=0;i<array.length;i++){
s+=array[i]+strRempla;
}
s=s.substring(0,s.length-strRech.length-1);
return s;
}
function delOHtmlCiu(id){
var cible;
if(id!=null){
if(id.target)
cible=id.target;
else
cible=document.getElementById(id);
}
else
cible=this;
if(cible.deletePossible()){
cible.remove();
}
else
setTimeout("delObjHtmlCiu(\""+ cible.id +"\")",200);
}
rialto.widget.simpleMenu=function(objPar){
if(!objPar){objPar={};}
objPar.name="menu";
objPar.height=0;
if(!objPar.width){
objPar.width=200;
}
this.base=rialto.widget.AbstractComponent;
this.base(objPar);
this.posFixe=false;
this.posTop=0;
this.posLeft=0;
this.avecCoche=false;
if(objPar!=null){
if(objPar.name){
this.name=objPar.name;
}
if(rialto.lang.isNumber(objPar.width)){
this.width=objPar.width;
}
if(rialto.lang.isBoolean(objPar.posFixe)){
this.posFixe=objPar.posFixe;
}
if(rialto.lang.isNumber(objPar.posTop)){
this.posTop=objPar.posTop;
}
if(rialto.lang.isNumber(objPar.posLeft)){
this.posLeft=objPar.posLeft;
}
if(rialto.lang.isString(objPar.className,true)){
this.className=objPar.className;
}
if(rialto.lang.isBoolean(objPar.avecCoche)){
this.avecCoche=objPar.avecCoche;
}
}
var oThis=this;
this.tabItem=new Array;
this.arrChildMenu=new Array;
this.zoneMasque=document.createElement('DIV');
this.zoneMasque.style.display='none';
this.zoneMasque.style.width='100%';
this.zoneMasque.style.height='100%';
this.zoneMasque.style.zIndex=10000;
this.zoneMasque.className='ecranMasquetransparent';
this.zoneMasque.style.display='none';
document.body.appendChild(this.zoneMasque);
this.zoneMasque.onclick=function(e){
oThis.fermezoneMenu();
}
this.zoneMasque.oncontextmenu=function(e){
oThis.fermezoneMenu();
}
this.divExt=document.createElement("DIV");
this.divExt.className=this.className;
this.zoneMasque.appendChild(this.divExt);
this.divExt.style.width=this.width;
this.divExt.style.position="absolute";
this.ouvert=false;
this.divExt.style.visibility='hidden';
this.isMenufils=false;
}
rialto.widget.simpleMenu.prototype=new rialto.widget.AbstractComponent;
rialto.widget.simpleMenu.prototype.nbreInstance=0;
rialto.widget.simpleMenu.prototype.release=function(){
for(var i=0;i<this.tabItem.length;i++){
this.tabItem[i].remove();
}
this.zoneMasque.onclick=null;
this.zoneMasque.oncontextmenu=null;
this.divExt.parentNode.removeChild(this.divExt);
this.zoneMasque.parentNode.removeChild(this.zoneMasque);
rialto.session.objects[this.id]=null;
}
rialto.widget.simpleMenu.prototype.setPosLeft=function(left){
this.posLeft=left;
this.divExt.style.left=this.posLeft;
}
rialto.widget.simpleMenu.prototype.setPosTop=function(top){
this.posTop=top;
this.divExt.style.top=this.posTop;
}
rialto.widget.simpleMenu.prototype.setWidth=function(width){
this.width=width;
this.divExt.style.width=width;
for(var i=0;i<this.tabItem.length;i++){
this.tabItem[i].setWidth(this.width);
}
}
rialto.widget.simpleMenu.prototype.setHeight=function(height){
this.height=height;
this.divExt.style.height=height;
}
rialto.widget.simpleMenu.prototype.setClassName=function(classname){
this.divExt.className=classname;
}
rialto.widget.simpleMenu.prototype.clear=function(){
for(var i=0;i<this.tabItem.length;i++){
this.tabItem[i].remove();
}
this.divExt.innerHTML="";
this.tabItem=new Array;
for(var i=0;i<this.arrChildMenu.length;i++){
this.zoneMasque.removeChild(this.arrChildMenu[i].divExt);
}
this.arrChildMenu=new Array;
}
rialto.widget.simpleMenu.prototype.add=function(obj){
this.divExt.appendChild(obj);
}
rialto.widget.simpleMenu.prototype.addItem=function(objPar){
var oThis=this;
objPar.width=this.width;
var item=new rialto.widget.simpleMenuItem(objPar);
var ind=this.tabItem.push(item);
item.parMenu=this;
item.ind=ind-1
this.add(item.divExt);
if(item.menuFils){
this.addMenuFils(item.menuFils)
}
return item;
}
rialto.widget.simpleMenu.prototype.addMenuFils=function(objMenuFils){
objMenuFils.isMenufils=true;
objMenuFils.menuPere=this;
this.arrChildMenu.push(objMenuFils);
this.arrChildMenu=this.arrChildMenu.concat(objMenuFils.arrChildMenu);
objMenuFils.posFixe=true;
this.zoneMasque.appendChild(objMenuFils.divExt);
for(var i=0;i<objMenuFils.arrChildMenu.length;i++){
this.zoneMasque.appendChild(objMenuFils.arrChildMenu[i].divExt);
}
if(objMenuFils.zoneMasque){
document.body.removeChild(objMenuFils.zoneMasque);
objMenuFils.zoneMasque=null;
}
}
rialto.widget.simpleMenu.prototype.addSeparation=function(){
var oThis=this;
divExt=document.createElement("DIV");
divExt.style.position="relative";
divExt.style.width=this.width;
divExt.style.height=10;
divExt.innerHTML="<HR/>";
divExt.onmouseover=function(e){
if(!e)var e=window.event;
if(oThis.menuFilsActif){
oThis.menuFilsActif.fermezoneMenu();
oThis.menuFilsActif="";
}
stopEvent(e);
}
this.add(divExt);
}
rialto.widget.simpleMenu.prototype.fermezoneMenu=function(){
for(var i=0;i<this.arrChildMenu.length;i++){
this.arrChildMenu[i].fermezoneMenu();
}
this.divExt.style.visibility='hidden';
this.divExt.style.height='';
if(this.divExt.saveWidth!=undefined){
this.divExt.style.width=this.divExt.saveWidth;
}
if(!this.isMenufils){this.zoneMasque.style.display='none';}
this.ouvert=false;
this.onClose();
}
rialto.widget.simpleMenu.prototype.affichezoneMenu=function(e,shift){
if(!this.isMenufils)
{this.zoneMasque.style.display='block';}
var base=this.posFixe?{top:this.posTop,left:this.posLeft}
:e;
var heightAvailable=_ru.$placeInViewPort(this.divExt,base,shift);
if(heightAvailable>0){
this.divExt.style.overflow='auto';
this.divExt.style.height=heightAvailable;
}
this.ouvert=true;
if(this.isMenufils){
this.menuPere.menuFilsActif=this;
}
this.divExt.style.visibility='visible';
}
rialto.widget.simpleMenu.prototype.clickItem=function(item){
if(this.avecCoche){
item.imgG.style.background="url(images/imgTableau/coche.gif)";
}
this.onclick(item);
}
rialto.widget.simpleMenu.prototype.onOverItem=function(item){
if(this.menuFilsActif){
this.menuFilsActif.fermezoneMenu();
this.menuFilsActif="";
}
this.onOver(item);
}
rialto.widget.simpleMenu.prototype.onClose=function(){
}
rialto.widget.simpleMenu.prototype.onOver=function(item){
}
rialto.widget.simpleMenu.prototype.onOut=function(item){
}
rialto.widget.simpleMenu.prototype.onclick=function(item){
}
rialto.widget.simpleMenuItem=function(objPar){
this.text="";
this.srcG="";
this.srcD="";
this.clOver="itemMenuOn";
this.clOut="itemMenuOff";
this.enable=true;
this.width=100;
this.height=23;
this.boolcoche=false;
this.bNotOut=false;
this.menuFils="";
if(objPar){
if(rialto.lang.isString(objPar.text)){
this.text=objPar.text;
}
if(objPar.srcG){
this.srcG=objPar.srcG;
}
if(objPar.srcD){
this.srcD=objPar.srcD;
}
if(objPar.clOver){
this.clOver=objPar.clOver;
}
if(objPar.clOut){
this.clOut=objPar.clOut;
}
if(rialto.lang.isBoolean(objPar.enable)){
this.enable=objPar.enable;
}
if(rialto.lang.isNumber(objPar.width)){
this.width=objPar.width;
}
if(rialto.lang.isNumber(objPar.height)&&objPar.height>0){
this.height=objPar.height;
}
if(rialto.lang.isBoolean(objPar.boolcoche)){
this.boolcoche=objPar.boolcoche;
}
if(rialto.lang.isBoolean(objPar.bNotOut)){
this.bNotOut=objPar.bNotOut;
}
if(objPar.menuFils){
this.menuFils=objPar.menuFils;
this.menuFils.item=this;
this.srcD=rialtoConfig.pathRialtoE+"images/fleches/flecheD23-19.gif";
}
}
var oThis=this;
this.divExt=document.createElement("DIV");
this.divExt.style.position="relative";
this.divExt.style.width=this.width;
this.divExt.style.height=this.height;
this.decal=0;
if(this.srcG||this.boolcoche){
this.decal=19;
this.imgG=document.createElement("DIV");
this.imgG.className="imgItemMenu";
this.imgG.style.background="url("+this.srcG+")";
this.divExt.appendChild(this.imgG);
}
this.divText=document.createElement("DIV");
this.divText.className="itemText";
this.divText.style[ATTRFLOAT]='left';
this.divText.innerHTML=this.text;
this.divText.title=this.text;
this.divExt.appendChild(this.divText);
if(this.srcD){
this.decal+=19;
this.imgD=document.createElement("DIV");
this.imgD.style.background="url("+this.srcD+")";
this.imgD.className="imgItemMenu";
this.divExt.appendChild(this.imgD);
}
this.divText.style.width=this.width-this.decal;
this.divExt.onmouseover=function(e){
if(!e)var e=window.event;
oThis.over(e);
}
if(!this.bNotOut){
this.divExt.onmouseout=function(e){
if(!e)var e=window.event;
oThis.out(e);
}
}
this.divExt.onclick=function(e){
this.className=oThis.clOut;
if(!e)var e=window.event;
oThis.parMenu.clickItem(oThis);
}
}
rialto.widget.simpleMenuItem.prototype.remove=function(){
this.divExt.parentNode.removeChild(this.divExt);
this.divExt.onmouseover=null;
this.divExt.onmouseout=null;
this.divExt.onclick=null;
}
rialto.widget.simpleMenuItem.prototype.setWidth=function(width){
this.width=width;
this.divExt.style.width=this.width;
this.divText.style.width=this.width-this.decal;
}
rialto.widget.simpleMenuItem.prototype.over=function(e){
this.divExt.className=this.clOver;
this.parMenu.onOverItem(this);
if(this.menuFils){
this.menuFils.setPosTop(compOffsetTop(this.imgD)+2);
this.menuFils.setPosLeft(compOffsetLeft(this.imgD)+10);
this.menuFils.affichezoneMenu(e);
}
}
rialto.widget.simpleMenuItem.prototype.out=function(e){
this.divExt.className=this.clOut;
this.parMenu.onOut(this);
}
rialto.widget.simpleMenuItem.prototype.changeTitre=function(titre){
this.text=titre;
this.divText.innerHTML=this.text;
}
rialto.widget.simpleMenuItem.prototype.setStyle=function(obStyle){
for(prop in obStyle){
try{
this.divText.style[prop]=obStyle[prop];
}
catch(erreur){}
}
this.obStyle=obStyle;
}
rialto.widget.SimpleWindow=function(objPar){
this.base=rialto.widget.AbstractContainer;
objPar.type="SimpleWindow";
this.base(objPar);
this.icone=rialtoConfig.pathRialtoE+"images/imgFenSimple/picto-gr_default.gif"
this.title="Window";
this.style="fenetre";
this.autoResizeParent=true;
this.autoResizableH=true;
this.autoResizableW=true;
if(rialto.lang.isString(objPar.title)){
this.title=objPar.title;
}
if(rialto.lang.isString(objPar.icone)){
this.icone=rialtoConfig.pathRialtoE+objPar.icone;
}
if(rialto.lang.isString(objPar.icone)){
this.icone=rialtoConfig.pathRialtoE+objPar.icone;
}
if(rialto.lang.isStringIn(objPar.style,["default","fenetre"])){
this.style=objPar.style;
}
if(rialto.widget.SimpleWindow.prototype.openWindow){
rialto.widget.SimpleWindow.prototype.openWindow.setVisible(false);;
}
this.divExt.style.top=this.top||"0"
this.divExt.style.left=this.left||"0";
this.divExt.style.position=this.position;
this.divExt.style.width=this.width||"100%";
this.divExt.style.height=this.height||"100%";
this.divExt.style.overflow='hidden';
if(objPar.parent&&!this.bWithoutPlaceIn){
this.placeIn(objPar.parent);
};
objPar=null;
}
rialto.widget.SimpleWindow.prototype=new rialto.widget.AbstractContainer;
rialto.widget.SimpleWindow.prototype.arrOpenWidow=new Array();
rialto.widget.SimpleWindow.prototype.openWindow=null;
rialto.widget.SimpleWindow.prototype.adaptToContext=function(parent){
this.divExt.style.height=this.getNewParentHeight();
var oThis=this;
oParent=this.divExt;
this.deco=new objDiv3D(this.title,this.style);
this.deco.createDiv3D(oParent);
this.DivIcone=this.deco.DivIconeG;
this.DivIcone.className="FenDivIcone";
this.icoFen=new rialto.widget.Image(this.icone,0,0,this.DivIcone);
this.divTitle=this.deco.DivTitre;
this.divTitle.className="FenDivTitre";
this.contenuFenetre=document.createElement("DIV");
this.divExt.appendChild(this.contenuFenetre);
this.contenuFenetre.style.top=50;
this.contenuFenetre.style.left=15;
this.contenuFenetre.style.height=this.getNewParentHeight()-65+'px';
this.contenuFenetre.style.width=this.getNewParentWidth()-30+'px';
this.contenuFenetre.style.position="absolute";
this.contenuFenetre.style.overflow='auto';
this.btnClose=new rialto.widget.Image("btonFenFermOff",-20,0,this.deco.DivIconeD,"Fermer la fenetre","btonFenFermOn");
this.btnClose.onclick=function(){oThis.closeWindow();}
rialto.widget.SimpleWindow.prototype.arrOpenWidow.push(this);
this.activeFen();
}
rialto.widget.SimpleWindow.prototype.release=function(){
this.btnClose.onclick=null;
if(rialto.widget.SimpleWindow.prototype.openWindow==this){
rialto.widget.SimpleWindow.prototype.openWindow=null;
}
}
rialto.widget.SimpleWindow.prototype.getHtmlCont=function(){
return this.contenuFenetre;
}
rialto.widget.SimpleWindow.prototype.updateSize=function(){
this.contenuFenetre.style.overflow='hidden';
if(this.autoResizableH||this.autoResizeContenu){
this.updateHeight();
}
if(this.autoResizableW){
this.updateWidth();
}
this.contenuFenetre.style.overflow='auto';
}
rialto.widget.SimpleWindow.prototype.updateWidth=function(){
this.contenuFenetre.style.overflow='hidden';
var tailleCalc=this.getNewParentWidth();
this.divExt.style.width=tailleCalc;
this.contenuFenetre.style.width=tailleCalc-30;
this.resizeChilds(true,false);
this.contenuFenetre.style.overflow='auto';
}
rialto.widget.SimpleWindow.prototype.updateHeight=function(){
this.contenuFenetre.style.overflow='hidden';
var tailleCalc=parseInt(this.getNewParentHeight());
this.divExt.style.height=tailleCalc;
this.contenuFenetre.style.height=tailleCalc-65;
this.resizeChilds(false,true);
this.contenuFenetre.style.overflow='auto';
}
rialto.widget.SimpleWindow.prototype.closeFen=function(){
rialto.deprecated('SimpleWindow','closeFen','closeWindow');
this.closeWindow();
}
rialto.widget.SimpleWindow.prototype.closeWindow=function(){
rialto.array.remove(rialto.widget.SimpleWindow.prototype.arrOpenWidow,this);
rialto.widget.SimpleWindow.prototype.openWindow=null;
this.onClose();
this.remove();
if(rialto.widget.SimpleWindow.prototype.arrOpenWidow.length>0){
rialto.widget.SimpleWindow.prototype.arrOpenWidow[rialto.widget.SimpleWindow.prototype.arrOpenWidow.length-1].activeFen();
}
}
rialto.widget.SimpleWindow.prototype.activeFen=function(){
if(rialto.widget.SimpleWindow.prototype.openWindow!=this){
if(rialto.widget.SimpleWindow.prototype.openWindow){
rialto.widget.SimpleWindow.prototype.openWindow.setVisible(false);
}
this.divExt.style.display='block';
this.updateSize();
rialto.widget.SimpleWindow.prototype.openWindow=this;
this.$$activeContent();
this.onfocus();
}
}
rialto.widget.SimpleWindow.prototype.masque=function(){
rialto.deprecated('SimpleWindow','masque','setVisible(false)');
this.setVisible(false);
}
rialto.widget.SimpleWindow.prototype.demasque=function(){
rialto.deprecated('SimpleWindow','demasque','setVisible(true)');
this.setVisible(true);
}
rialto.widget.SimpleWindow.prototype.setVisible=function(visible){
var oHtml=this.getHtmlExt();
if(visible){
rialto.widget.SimpleWindow.prototype.openWindow=this;
oHtml.style.display='block';
this.updateSize();
}
else{
rialto.widget.SimpleWindow.prototype.openWindow=null;
oHtml.style.display='none';
this.onblur();
}
this.visible=visible;
}
rialto.widget.SimpleWindow.prototype.setTitle=function(newtitle){
this.divTitle.replaceChild(document.createTextNode(newtitle),this.divTitle.firstChild);
this.onSetTitle(newtitle);
}
rialto.widget.SimpleWindow.prototype.onSetTitle=function(newtitle){
}
rialto.widget.SimpleWindow.prototype.onClose=function(){
}
function SingletonCD(contexte){
if(contexte){
if(this.constructor.prototype.nbInstances==undefined)
this.constructor.prototype.nbInstances=new Array;
if(this.constructor.prototype.nbInstances[contexte]==undefined)
this.constructor.prototype.nbInstances[contexte]=0;
if(this.constructor.prototype.nbInstances[contexte]!=0)
return rialto.session.objects.singletonCDs[contexte];
else{
this.constructor.prototype.nbInstances[contexte]++;
if(rialto.session.objects==undefined)
rialto.session.objects=new Object;
if(rialto.session.objects.singletonCDs==undefined)
rialto.session.objects.singletonCDs=new Array;
if(rialto.session.objects.singletonCDs[contexte]==undefined)
rialto.session.objects.singletonCDs[contexte]=new Object;
rialto.session.objects.singletonCDs[contexte]=this;
return null;
}
}
else{
if(this.constructor.prototype.nbInstances==undefined)
this.constructor.prototype.nbInstances=0;
if(this.constructor.prototype.nbInstances!=0)
return rialto.session.objects[this];
else{
this.constructor.prototype.nbInstances++;
if(rialto.session.objects==undefined){rialto.session.objects=new Array;}
rialto.session.objects[this]=this;
return null;
}
}
}
function recupSingletonCD(ctxt){
return 'this.recupInst = SingletonCD;  this.recupInst(\''+ctxt+'\'); '
}
function recupSingleton(){
return 'this.recupInst = SingletonCD;  this.recupInst(); '
}
function classTestCD(ctxt){
alert('ctxt= '+ctxt);
if(instanceUnique=eval(recupSingletonCD(ctxt)))
return instanceUnique;
alert('creation de l\' unique objet,instance de classTestCD dans le contexte '+ctxt);
this.id='ID_InstanceUniqueClassTestCD_'+ctxt;
}
function classTestCD2(ctxt){
this.recupInst=SingletonCD;
if(instDejaCree=this.recupInst(ctxt))
return instDejaCree;
alert('creation de l\' unique objet,instance de classTestCD2 dans le contexte '+ctxt);
this.id='ID_instanceUniqueClassTestCD2_'+ctxt;
}
classTestCD.prototype=new classTestCD3;
function classTestCD3(){
this.attr1='essai derivation';
}
function SingletonCD(contexte){
if(contexte){
if(this.constructor.prototype.nbInstances==undefined)
this.constructor.prototype.nbInstances=new Array;
if(this.constructor.prototype.nbInstances[contexte]==undefined)
this.constructor.prototype.nbInstances[contexte]=0;
if(this.constructor.prototype.nbInstances[contexte]!=0)
return rialto.session.objects.singletonCDs[contexte];
else{
this.constructor.prototype.nbInstances[contexte]++;
if(rialto.session.objects==undefined)
rialto.session.objects=new Object;
if(rialto.session.objects.singletonCDs==undefined)
rialto.session.objects.singletonCDs=new Array;
if(rialto.session.objects.singletonCDs[contexte]==undefined)
rialto.session.objects.singletonCDs[contexte]=new Object;
rialto.session.objects.singletonCDs[contexte]=this;
return null;
}
}
else{
if(this.constructor.prototype.nbInstances==undefined)
this.constructor.prototype.nbInstances=0;
if(this.constructor.prototype.nbInstances!=0)
return rialto.session.objects[this];
else{
this.constructor.prototype.nbInstances++;
if(rialto.sessionw.objects==undefined){rialto.session.objects=new Array;}
rialto.session.objects[this]=this;
return null;
}
}
}
function recupSingletonCD(ctxt){
return 'this.recupInst = SingletonCD;  this.recupInst(\''+ctxt+'\'); '
}
function recupSingleton(){
return 'this.recupInst = SingletonCD;  this.recupInst(); '
}
function classTestCD(ctxt){
alert('ctxt= '+ctxt);
if(instanceUnique=eval(recupSingletonCD(ctxt)))
return instanceUnique;
alert('creation de l\' unique objet,instance de classTestCD dans le contexte '+ctxt);
this.id='ID_InstanceUniqueClassTestCD_'+ctxt;
}
function classTestCD2(ctxt){
this.recupInst=SingletonCD;
if(instDejaCree=this.recupInst(ctxt))
return instDejaCree;
alert('creation de l\' unique objet,instance de classTestCD2 dans le contexte '+ctxt);
this.id='ID_instanceUniqueClassTestCD2_'+ctxt;
}
classTestCD.prototype=new classTestCD3;
function classTestCD3(){
this.attr1='essai derivation';
}
rialto.widget.Splitter=function(objPar)
{
this.base=rialto.widget.AbstractContainer;
objPar.type="splitter";
this.base(objPar);
this.prop=0.5;
this.orientation='h';
this.autoResizableH=true;
this.autoResizableW=true;
this.style='normal';
this.withImg=false;
this.overflow='hidden';
this.reverseClose=false;
this.modeLim='%';
this.limInf=0;
this.limSup=1;
this.tailleCurs=4;
if(rialto.lang.isNumber(objPar.prop)&&objPar.prop>=0&&objPar.prop<=1){
this.prop=objPar.prop;
}
if(rialto.lang.isStringIn(objPar.orientation,['v','h'])){
this.orientation=objPar.orientation;
}
if(rialto.lang.isBoolean(objPar.autoResizeContenu)){
this.autoResizeContenu=objPar.autoResizeContenu;
}
if(rialto.lang.isBoolean(objPar.autoResizeParent)){
this.autoResizeParent=objPar.autoResizeParent;
this.autoResizableH=this.autoResizeParent;
}
if(rialto.lang.isBoolean(objPar.autoResizableH)){
this.autoResizableH=objPar.autoResizableH;
}
if(rialto.lang.isBoolean(objPar.autoResizableW)){
this.autoResizableW=objPar.autoResizableW;
}
if(rialto.lang.isStringIn(objPar.style,['normal','3D'])){
this.style=objPar.style;
}
if(rialto.lang.isStringIn(objPar.overflow,["auto","hidden"])){
this.overflow=objPar.overflow;
}
if(rialto.lang.isStringIn(objPar.modeLim,["%","abs"])){
this.modeLim=objPar.modeLim;
}
if(this.modeLim=='%'){
if(rialto.lang.isNumber(objPar.limInf)&&objPar.limInf>=0&&objPar.limInf<=1){
this.limInf=objPar.limInf;
}
if(rialto.lang.isNumber(objPar.limSup)&&objPar.limSup>=0&&objPar.limSup<=1){
this.limSup=objPar.limSup;
}
}
else{
if(rialto.lang.isNumber(objPar.limInf)){
this.limInf=objPar.limInf;
}
if(rialto.lang.isNumber(objPar.limSup)){
this.limSup=objPar.limSup;
}
}
if(rialto.lang.isBoolean(objPar.reverseClose)){
this.reverseClose=objPar.reverseClose;
}
if(rialto.lang.isBoolean(objPar.withImg)){
this.withImg=objPar.withImg;
}
if(rialto.lang.isNumber(objPar.tailleCurs)){
this.tailleCurs=objPar.tailleCurs;
}
this.$$createSpliter(objPar.parent);
}
rialto.widget.Splitter.prototype=new rialto.widget.AbstractContainer;
rialto.widget.Splitter.prototype.onresizeDiv1=function(oldH,oldW,newH,newW){
};
rialto.widget.Splitter.prototype.onresizeDiv2=function(oldH,oldW,newH,newW){
};
rialto.widget.Splitter.prototype.$$createSpliter=function(parent){
var oThis=this;
this.divExt.style.top=this.top;
this.divExt.style.left=this.left;
this.divExt.style.width=this.width;
this.divExt.style.height=this.height;
this.divExt.style.position=this.position;
this.divExt.style.overflow="hidden";
this.divExt.id="splitter";
this.div1=document.createElement("DIV");
this.div1.className="Spliter-div1";
this.div1.style.overflow=this.overflow;
this.divExt.appendChild(this.div1);
this.div1.oCiu=this;
this.div2=document.createElement("DIV");
this.div2.className="Spliter-div2";
this.div2.style.overflow=this.overflow;
this.divExt.appendChild(this.div2);
this.div2.oCiu=this;
this.Divcurs=document.createElement("DIV");
this.Divcurs.className="Spliter-Divcurs";
this.divExt.appendChild(this.Divcurs);
this.Boutcurs=document.createElement("DIV");
this.Boutcurs.id="boucurseur";
this.Boutcurs.className="Spliter-Boutcurs";
if(this.withImg){
this.img=document.createElement("IMG");
this.img.src=rialtoConfig.pathRialtoE+"images/tirette_"+this.orientation+".gif";
this.Boutcurs.appendChild(this.img);
}
else{
this.Boutcurs.style.background='#0099CC'
if(this.orientation=='v'){
this.Divcurs.style.borderTop="1px solid white";
this.Divcurs.style.borderBottom="1px solid black";
}
else{
this.Divcurs.style.borderLeft="1px solid white";
this.Divcurs.style.borderRight="1px solid black";
}
this.Divcurs.style.background="#BBBBBB";
this.img=this.Boutcurs
}
this.Divcurs.appendChild(this.Boutcurs);
this.Boutcurs.onmouseover=function(){
oThis.Boutcurs.style.cursor="pointer";
if(oThis.withImg){
oThis.img.src=rialtoConfig.pathRialtoE+"images/tirette_"+oThis.orientation+"_on.gif";
}
else{
this.style.background='#00CCFF'
}
}
this.Boutcurs.onmouseout=function(){
if(oThis.withImg){
oThis.img.src=rialtoConfig.pathRialtoE+"images/tirette_"+oThis.orientation+".gif";
}
else{
this.style.background='#0099CC'
}
}
if(parent){this.placeIn(parent)};
}
rialto.widget.Splitter.prototype.release=function(){
this.div1.oCiu=null;
this.div2.oCiu=null;
this.Boutcurs.onmouseover=null;
this.Boutcurs.onmouseout=null;
this.img.onmousedown=null;
this.afterDD=null;
this.afterClic=null;
}
rialto.widget.Splitter.prototype.masqueContenuDiv2=function(){
var nd=this.div2.firstChild;
var ndSuiv=null;
while(nd){
ndSuiv=nd.nextSibling;
if(nd.oCiu
&&nd.oCiu.setVisible)
nd.oCiu.setVisible(false);
else
nd.parentNode.removeChild(nd);
nd=ndSuiv;
}
}
rialto.widget.Splitter.prototype.getHtmlDD=function(){
return this.img;
}
rialto.widget.Splitter.prototype.adaptToContext=function(){
var oThis=this;
if(this.orientation=='v'){
this.Divcurs.style.width="100%";
this.Divcurs.style.height=this.tailleCurs;
ria.utils.measures.$setHeightConformW3C(this.Divcurs);
this.Boutcurs.style.height=this.tailleCurs;
this.Boutcurs.style.left="40%";
this.Boutcurs.style.width='20%';
this.div1.style.width="100%";
this.div2.style.width="100%";
}
else{
this.Divcurs.style.height="100%";
this.Divcurs.style.width=this.tailleCurs;
ria.utils.measures.$setWidthConformW3C(this.Divcurs);
this.Boutcurs.style.top="40%";
this.Boutcurs.style.width=this.tailleCurs;
this.Boutcurs.style.height='20%';
this.div1.style.height="100%";
this.div2.style.height="100%";
}
if(this.autoResizableH){
this.divExt.style.height=this.getNewParentHeight()-this.divExt.offsetTop;
}
else{
this.divExt.style.height=this.height;
}
if(this.autoResizableW){
this.divExt.style.width=this.getNewParentWidth()-this.divExt.offsetLeft;
}
else{
this.divExt.style.width=this.width;
}
if(this.style=="3D"){
var oParent=this.div1;
this.div3D1=new objDiv3D();
this.div3D1.createDiv3D(oParent);
oParent=this.div2;
this.div3D2=new objDiv3D();
this.div3D2.createDiv3D(oParent);
}
if(!this.parent.oCiu){
this.parent.oCiu=new Array();
}
this.parent.oCiu['splitter']=this;
this.img.onmousedown=function(e){
stopDefault(e);
}
rialto.widgetBehavior.affect(this
,'DragAndDrop'
,{oHtmlToMove:this.Divcurs
,oHtmlEvtTarget:this.img
,ghost:{aspect:'rect'
,asChild:true}
,bSelectMark:false
,isWithLimitsDisplayed:false
,movingLimits:{orientation:oThis.orientation}
}
);
this.afterDD=function(){
this.div1.style.overflow='hidden';
this.div2.style.overflow='hidden';
if(oThis.withImg){
oThis.img.src=rialtoConfig.pathRialtoE+"images/tirette_"+oThis.orientation+".gif";
}
else{
oThis.Boutcurs.style.background='#0099CC'
}
if(this.orientation=='v'){
prop=parseInt(this.Divcurs.style.top)
/(this.divExt.offsetHeight
-parseInt(this.Divcurs.style.height));
this.fixeProp(prop,false);
}
else{
prop=parseInt(this.Divcurs.style.left)
/(this.divExt.offsetWidth
-parseInt(this.Divcurs.style.width));
this.fixeProp(prop,false);
}
this.div1.style.overflow=this.overflow;
this.div2.style.overflow=this.overflow;
}
this.afterClic=function(){
if(this.reduce){
this.reduce=false;
this.fixeProp(this.oldProp,false);
}
else{
this.oldProp=this.prop;
this.reduce=true;
if(this.reverseClose){this.fixeProp(1,false);}
else{this.fixeProp(0,false);}
}
}
this.fixeProp();
}
rialto.widget.Splitter.prototype.adaptAfterContainerChange=function(){
this.fixeProp();
}
rialto.widget.Splitter.prototype.modDim=function(dHeight,impactPart){
dHeight=parseInt(dHeight);
if(!dHeight)return;
impactPart+='';
if('012'.indexOf(impactPart)==-1){
return;}
var newHeight=this.divExt.offsetHeight+dHeight;
var newProp;
this.divExt.style.height=newHeight;
newProp=this.$$getNewProp({height:newHeight
,dHeight:dHeight
,part:impactPart});
this.fixeProp(newProp,false);
}
rialto.widget.Splitter.prototype.$$getNewProp=function(specs){
var prop=this.prop;
var hGlob=specs.height;
var dHeight=specs.dHeight;
var part=specs.part;
if(part==1)
prop=(parseInt(this.Divcurs.style.top)+dHeight)
/(this.divExt.offsetHeight
-parseInt(this.Divcurs.style.height));
else
if(part==2)
prop=(parseInt(this.Divcurs.style.top)-dHeight)
/(this.divExt.offsetHeight
-parseInt(this.Divcurs.style.height));
return prop;
}
rialto.widget.Splitter.prototype.updateSize=function(){
this.div1.style.overflow='hidden';
this.div2.style.overflow='hidden';
if(this.autoResizableH){
this.updateHeight();
}
if(this.autoResizableW){
this.updateWidth();
}
this.div1.style.overflow=this.overflow;
this.div2.style.overflow=this.overflow;
}
rialto.widget.Splitter.prototype.updateWidth=function(){
var tailleCalc=parseInt(this.getNewParentWidth());
this.divExt.style.width=tailleCalc;
if(this.orientation=='v'){
this.div1.style.width=tailleCalc;
this.div2.style.width=tailleCalc;
}
this.fixeProp(this.prop,true)
this.resizeChilds(true,false);
}
rialto.widget.Splitter.prototype.updateHeight=function(){
var tailleCalc=parseInt(this.getNewParentHeight());
this.divExt.style.height=tailleCalc;
if(this.orientation=='h'){
this.div1.style.height=tailleCalc;
this.div2.style.height=tailleCalc;
}
this.fixeProp(this.prop,true)
this.resizeChilds(false,true);
}
rialto.widget.Splitter.prototype.fixeProp=function(prop,boolMajT){
var oldProp=this.prop;
if(prop!=null){this.prop=prop}
if(this.modeLim=='%'){
if(this.prop<this.limInf){this.prop=this.limInf;}
if(this.prop>this.limSup){this.prop=this.limSup;}
}
else{
if((this.prop*parseInt(this.divExt.offsetHeight))<this.limInf)
this.prop=(this.limInf+1)/parseInt(this.divExt.offsetHeight);
else
if((this.prop*parseInt(this.divExt.offsetHeight))>(parseInt(this.divExt.offsetHeight)-this.limInf))
this.prop=(parseInt(this.divExt.offsetHeight)-this.limInf-1)/parseInt(this.divExt.offsetHeight);
}
if(this.orientation=='v'){
var tailleDispo=this.divExt.offsetHeight-this.Divcurs.offsetHeight;
var tailleDiv1=Math.floor(this.prop*(tailleDispo));
var tailleDiv2=tailleDispo-tailleDiv1;
this.div1.style.height=tailleDiv1;
this.Divcurs.style.top=parseInt(this.div1.style.height);
this.div2.style.top=parseInt(this.Divcurs.style.top)+this.Divcurs.offsetHeight;
this.div2.style.height=tailleDiv2;
}
else{
var tailleDispo=this.divExt.offsetWidth-this.Divcurs.offsetWidth;
var tailleDiv1=Math.floor(this.prop*(tailleDispo));
var tailleDiv2=tailleDispo-tailleDiv1;
this.div1.style.width=tailleDiv1;
this.Divcurs.style.left=parseInt(this.div1.style.width);
this.div2.style.left=parseInt(this.Divcurs.style.left)+this.Divcurs.offsetWidth;
this.div2.style.width=tailleDiv2;
}
this.onresizeDiv2(this.currHeightDiv2,this.currWidthDiv2,this.div2.offsetHeight,this.div2.offsetWidth);
this.onresizeDiv1(this.currHeightDiv1,this.currWidthDiv1,this.div1.offsetHeight,this.div1.offsetWidth);
this.currHeightDiv1=this.div1.offsetHeight;
this.currWidthDiv1=this.div1.offsetWidth;
this.currHeightDiv2=this.div2.offsetHeight;
this.currWidthDiv2=this.div2.offsetWidth;
if(!boolMajT){this.resizeChilds();}
}
function getComputStyleIf(oHtml,dim,def){
if(!oHtml
||(!window.getComputedStyle
&&!oHtml.currentStyle)
||(getComputStyleStr(oHtml,'display')=='none')){
return 0;
}
else
return getComputStyle(oHtml,dim,def);
}
function getComputStyle(oHtml,dim,def){
if(def){
return(window.getComputedStyle)?parseInt(window.getComputedStyle(oHtml,null)[dim]||def)
:parseInt(oHtml.currentStyle[dim]||def)
}
else{
return(window.getComputedStyle)?parseInt(window.getComputedStyle(oHtml,null)[dim])
:parseInt(oHtml.currentStyle[dim]);
}
}
function getComputStyleStr(oHtml,dim,def){
if(def){
return(window.getComputedStyle?window.getComputedStyle(oHtml,null)[dim]||def
:oHtml.currentStyle[dim]||def);
}
else{
return(window.getComputedStyle?window.getComputedStyle(oHtml,null)[dim]
:oHtml.currentStyle[dim]);
}
}
getBorderStyle=function(oHtml){
var bBorder;
if(!window.getComputedStyle){
traceExec('nd.currentStyle.borderWidth = '+oHtml.currentStyle.borderWidth,20);
bBorder=((getComputStyleStr(oHtml,'borderStyle')!='none')
&&(getComputStyleStr(oHtml,'borderStyle')!=''));
traceExec('getComputStyleStr(oHtml,borderStyle)= '+getComputStyleStr(oHtml,'borderStyle'),20);
}
else
bBorder=(getComputStyle(oHtml,'borderTopWidth')!=0);
traceExec('getBorderStyle= '+bBorder,20);
return bBorder;
}
getBorderWidth=function(oHtml){
return(window.getComputedStyle)?parseInt(window.getComputedStyle(oHtml,null)['borderTopWidth'])
:getBorderStyle(oHtml)
?parseInt(oHtml.currentStyle['borderWidth'])
:0;
}
borderIfNecess=function(oHtml){
return((window.getComputedStyle)?
(parseInt(window.getComputedStyle(oHtml,null)['borderTopWidth'])
+parseInt(window.getComputedStyle(oHtml,null)['borderBottomWidth']))
:0);
}
ATTRFLOAT=(!window.getComputedStyle)?'styleFloat':'cssFloat';
if(!rialto.effect)rialto.effect={};
rialto.effect.opacity=function(oHtml,level){
oHtml.style.filter="alpha(opacity:"+(level*100)+")";
oHtml.style.opacity=level;
}
function execAfterLoad(id,fct,cdtion){
var oThis;
oHtml=document.getElementById(id);
traceExec('execAfterLoad id= '+id+' fct= '+fct,76);
if(!cdtion){
if(oHtml){
oThis=oHtml.oCiu;
traceExec('execAfterLoad oHtml.id= '+oHtml.id,76);
traceExec('execAfterLoad oHtml.oCiu= '+oHtml.oCiu,76);
traceExec('execAfterLoad oHtml.oCiu.id= '+oHtml.oCiu.id,76);
eval('oThis.'+fct+'()');
}
else
setTimeout("execAfterLoad(\""+ id +"\",\""+fct+"\")",2);
}
else
if(oHtml){
oThis=oHtml.oCiu;
cdtionVerifiee=eval('oThis.'+cdtion+'()');
if(cdtionVerifiee)
eval('oThis.'+fct+'()');
else
setTimeout("execAfterLoad(\""+ id +"\",\""+fct+"\",\""+cdtion+"\")",2);
}
else
setTimeout("execAfterLoad(\""+ id + "\",\"" + fct + "\",\"" + cdtion + "\")",2);
}
function execAfterLoad_2(id,fct){
var oThis;
var oHtml;
if(id!=null){
oHtml=document.getElementById(id);
if(oHtml){
oThis=oHtml.oCiu;
traceExec('charge',20);
}
}
else{
oThis=this;
}
if(oHtml){
alert(oThis.idObjComp+' '+fct);
eval('oThis.'+fct+'()');
}
else{
setTimeout("execAfterLoad_2(\""+ id +"\",\""+fct+"\")",2);
}
}
function execAfter(bool,val,fct,oThis){
traceExec('execAfter val= '+val+' bool= '+bool+' fct= '+fct,74);
var oCiu;
if(oThis)
oCiu=oThis;
else{
oCiu=this;
}
traceExec('execAfter val = '+eval('oCiu.'+bool),74);
var cdtion='oCiu.'+bool+' == '+val;
if(eval(cdtion)){
eval('oCiu.'+fct+'()');
}
else{
traceExec('execAfter oCiu = '+oCiu,74);
var fct='execAfter("'+bool+'","'+val+'","'+fct+'",'+oCiu+' )';
setTimeout(fct,2);
}
}
rialto.widget.TabFolder=function(objPar){
this.base=rialto.widget.AbstractContainer;
objPar.type="tabFolder";
this.base(objPar);
this.widthTabName=100;
this.autoResizeContenu=false;
this.autoResizeParent=false;
this.autoRedimTab=false;
this.isClosable=true;
this.draggableItem=false;
if(rialto.lang.isBoolean(objPar.autoResizeContenu)){
this.autoResizeContenu=objPar.autoResizeContenu;
}
if(rialto.lang.isBoolean(objPar.autoResizeParent)){
this.autoResizeParent=objPar.autoResizeParent;
this.autoResizableH=this.autoResizeParent;
}
if(rialto.lang.isBoolean(objPar.autoRedimTab)){
this.autoRedimTabt=objPar.autoRedimTab;
}
if(rialto.lang.isBoolean(objPar.isClosable)){
this.isClosable=objPar.isClosable;
}
if(rialto.lang.isBoolean(objPar.draggableItem)){
this.draggableItem=objPar.draggableItem;
}
if(rialto.lang.isNumber(objPar.widthTabName)){
this.widthTabName=objPar.widthTabName;
}
var oThis=this;
this.divExt.style.top=this.top;
this.divExt.style.left=this.left;
this.divExt.style.height=this.height;
this.divExt.style.width=this.width;
this.divExt.style.position=this.position;
this.divExt.style.backgroundColor="#F3F3F3";
this.divExt.style.overflow='hidden';
var oThis=this;
this.divOnglet=document.createElement("DIV");
this.divOnglet.id="DIV_ONGLETS";
this.divOnglet.style.height='21px';
this.divOnglet.style.width='100%';
this.divExt.appendChild(this.divOnglet);
this.divContenuGlobal=document.createElement("DIV");
this.divContenuGlobal.id="DIV_CONTENUGLOBAL";
this.divContenuGlobal.style.border="1px solid #6D94AB";
this.divExt.appendChild(this.divContenuGlobal);
this.arrTabItem=new Array();
this.fenVisible=new Object;
this.fenVisible.indDeb=0;
this.fenVisible.indFin=0;
this.fenVisible.tailleFen=0;
this.swapInProgress=false;
if(objPar.parent){this.placeIn(objPar.parent);};
objPar=null;
this.lefTitre=0;
this.divImg=document.createElement("DIV");
this.divImg.className="divImg";
this.divImg.style.display='none';
this.divOnglet.appendChild(this.divImg);
if(!this.autoRedimTab){
var obj={name:"MENU-ONGLET",className:"ong-opslist"};
this.liste=new rialto.widget.simpleMenu(obj);
ob={position:'relative',boolFloatRight:true}
if(this.isClosable){
this.btnClose=new rialto.widget.Image("crossCloseOff",-2,3,this.divImg,"Fermer l'onglet courant","crossCloseOn",ob);
this.btnClose.onclick=function(){
oThis.removeTabItem(oThis.indActiveTab);
}
}
ob={position:'relative',boolFloatRight:true,imageDisabled:"leftArrowGroundlessOff"}
this.MC=new rialto.widget.Image("tabListOff",-8,3,this.divImg,"Choose another tab","tabListOn",ob);
this.MC.setVisible(false);
this.MC.onclick=function(e){
var ev=e||window.event;
oThis.displayMenu(ev);
};
ob={position:'relative',boolFloatRight:true,imageDisabled:"rightArrowGroundlessOff"}
this.next=new rialto.widget.Image("rightArrowOff",-11,3,this.divImg,"next tab","rightArrowOn",ob);
this.next.setVisible(false);
this.next.onclick=function(){
if(!oThis.swapInProgress)oThis.moveOneTab(1);
};
ob={position:'relative',boolFloatRight:true,imageDisabled:"leftArrowGroundlessOff"}
this.previous=new rialto.widget.Image("leftArrowOff",-14,3,this.divImg,"previous tab","leftArrowOn",ob);
this.previous.setVisible(false);
this.previous.onclick=function(){
if(!oThis.swapInProgress)oThis.moveOneTab(-1);
};
}
}
rialto.widget.TabFolder.prototype=new rialto.widget.AbstractContainer;
rialto.widget.TabFolder.prototype.getHtmlCont=function(){
return this.divContenuGlobal;
}
rialto.widget.TabFolder.prototype.adaptToContext=function(){
if(this.autoResizableH){
this.divExt.style.height=this.getNewParentHeight()-this.divExt.offsetTop;
}
if(this.autoResizableW){
this.divExt.style.width=this.getNewParentWidth()-this.divExt.offsetLeft;
}
else{
this.divExt.style.width=this.width;
}
this.divContenuGlobal.style.height=this.divExt.offsetHeight-this.divContenuGlobal.offsetTop-10+'px';
}
rialto.widget.TabFolder.prototype.updateSize=function(){
this.divContenuGlobal.style.overflow='hidden';
if(this.autoResizableH){
this.updateHeight();
}
if(this.autoResizableW){
this.updateWidth();
}
this.divContenuGlobal.style.overflow='auto';
}
rialto.widget.TabFolder.prototype.updateWidth=function(){
if(this.open==true){
if(this.autoResizableW){
var tailleCalc=parseInt(this.getNewParentWidth());
this.divExt.style.width=tailleCalc-this.divExt.offsetLeft;
this.resizeChilds(true,false);
}
}
}
rialto.widget.TabFolder.prototype.updateHeight=function(){
if(this.open==true){
if(this.autoResizableH){
var tailleCalc=parseInt(this.getNewParentHeight());
this.divExt.style.height=tailleCalc-this.divExt.offsetTop;
this.divContenuGlobal.style.height=tailleCalc-this.divContenuGlobal.offsetTop-10+'px';
this.resizeChilds(false,true);
this.redimTitreOnglet();
}
}
}
rialto.widget.TabFolder.prototype.moveOneTab=function(nbreTab){
if(nbreTab>0){
this.ongAaug=this.arrTabItem[this.fenVisible.indFin+1];
this.ongAdim=this.arrTabItem[this.fenVisible.indDeb];
indongADim=this.fenVisible.indDeb;
}
else{
this.ongAaug=this.arrTabItem[this.fenVisible.indDeb-1];
this.ongAdim=this.arrTabItem[this.fenVisible.indFin];
indongADim=this.fenVisible.indFin;
}
this.fenVisible.indDeb+=nbreTab;
this.fenVisible.indFin+=nbreTab;
this.ongAaug.setWidth(0);
this.ongAaug.displayTitle();
if(this.indActiveTab==indongADim){
this.activeTab(indongADim+nbreTab);
}
this.majImages();
this.swapEffect()
}
rialto.widget.TabFolder.prototype.swapEffect=function(oldDelai){
this.swapInProgress=true;
if(!oldDelai){delai=100;}
else{delai=oldDelai/10;}
if(parseInt(this.ongAdim.titreOnglet.style.width)>20){
this.ongAdim.changeWidth(-20);
this.ongAaug.changeWidth(+20);
this.time=window.setTimeout("rialto.session.objects['"+this.id+"'].swapEffect("+delai+");",delai);
}
else{
this.ongAdim.setWidth(this.widthTabName);
this.ongAdim.setVisible(false);
this.ongAaug.setWidth(this.widthTabName);
this.swapInProgress=false;
}
}
rialto.widget.TabFolder.prototype.activeTab=function(nOnglet){
if(this.arrTabItem.length<nOnglet){
alert('pas d\'onglet n?'+nOnglet);
}
else{
var onglet=this.arrTabItem[nOnglet];
if(onglet.enable){
if(!this.autoRedimTab){
this.setTabVisible(nOnglet);
}
onglet.activeOnglet();
this.indActiveTab=nOnglet;
}
}
}
rialto.widget.TabFolder.prototype.replaceAfterDD=function(tab,place,sens){
if(place==this.arrTabItem.length-1){
this.divOnglet.appendChild(tab.titreOnglet);
}
else{
if(sens){
placeInser=place+1;
}
else{
placeInser=place;
}
this.divOnglet.insertBefore(tab.titreOnglet,this.arrTabItem[placeInser].titreOnglet);
}
var oldPlace=rialto.array.indexOf(this.arrTabItem,tab);
this.arrTabItem.splice(oldPlace,1);
rialto.array.insert(this.arrTabItem,place,tab);
this.activeTab(place);
}
rialto.widget.TabFolder.prototype.addTabItem=function(titre,enable){
var onglet=new rialto.widget.TabItem(titre,this,enable);
if(this.isClosable){
if(this.arrTabItem.length==0){
this.divImg.style.display='block';
}
}
var ind=this.arrTabItem.push(onglet);
onglet.placeIn(this.divContenuGlobal);
this.divOnglet.appendChild(onglet.titreOnglet);
this.redimTitreOnglet(true);
var oThis=this;
if(this.draggableItem){
rialto.widgetBehavior.affect(onglet.titreOnglet
,'DragAndDrop'
,{
oHtmlEvtTarget:onglet.div
,ghost:{aspect:'rect'}
,bSelectMark:false
,bMUpAction:false
,isWithLimitsDisplayed:false
,movingLimits:{orientation:'h'}
}
);
onglet.titreOnglet.afterDD=function(dTop,dLeft){
var indInit=rialto.array.indexOf(oThis.arrTabItem,onglet);
var decal=parseInt(dLeft/(oThis.widthTabName));
var nvPlace=indInit+decal;
if(nvPlace>oThis.fenVisible.indFin){
nvPlace=oThis.fenVisible.indFin;
}
else{
if(nvPlace<0){
nvPlace=0;
}
}
oThis.replaceAfterDD(onglet,nvPlace,(decal>0));
};
onglet.titreOnglet.afterClic=function(){
oThis.activeTab(rialto.array.indexOf(oThis.arrTabItem,onglet));
};
}
else{
onglet.titreOnglet.onclick=function(){
oThis.activeTab(rialto.array.indexOf(oThis.arrTabItem,onglet));
};
}
this.activeTab(ind-1);
return onglet;
}
rialto.widget.TabFolder.prototype.isVisible=function(nOnglet){
return(nOnglet>=this.fenVisible.indDeb&&nOnglet<=this.fenVisible.indFin)
}
rialto.widget.TabFolder.prototype.setTabVisible=function(nOnglet){
if(!this.isVisible(nOnglet)){
if(nOnglet<this.fenVisible.indDeb){
this.fenVisible.indDeb=nOnglet
this.fenVisible.indFin=this.fenVisible.indDeb+this.fenVisible.tailleFen-1;
}
else{
this.fenVisible.indFin=nOnglet
this.fenVisible.indDeb=this.fenVisible.indFin-this.fenVisible.tailleFen+1;
}
this.majZoneVisible();
}
}
rialto.widget.TabFolder.prototype.decalFenVisible=function(nbreTab){
this.fenVisible.indDeb+=nbreTab;
this.fenVisible.indFin=this.fenVisible.indDeb+this.fenVisible.tailleFen-1;
this.majZoneVisible();
if(!this.isVisible(this.indActiveTab)){
this.activeTab(this.fenVisible.indDeb);
}
}
rialto.widget.TabFolder.prototype.majZoneVisible=function(nOnglet){
for(var i=0;i<this.arrTabItem.length;i++){
this.arrTabItem[i].setVisible(false);
}
for(var i=this.fenVisible.indDeb;i<=this.fenVisible.indFin;i++){
var onglet=this.arrTabItem[i];
if(i==this.indActiveTab){
onglet.setVisible(true);
}
else{
onglet.displayTitle();
}
}
this.majImages();
}
rialto.widget.TabFolder.prototype.removeTabItem=function(nOnglet){
onglet=this.arrTabItem[nOnglet];
onglet.onClose();
rialto.array.remove(this.arrTabItem,onglet);
onglet.remove();
if(nOnglet==this.indActiveTab){
this.redimTitreOnglet(true);
if(this.arrTabItem.length>0){
this.activeTab(this.arrTabItem.length-1);
}
}
else{
if(bOnglet<this.indActiveTab){this.indActiveTab-=1}
this.redimTitreOnglet();
}
if(this.isClosable){
if(this.arrTabItem.length==0){
this.divImg.style.display='none';
}
}
}
rialto.widget.TabFolder.prototype.redimTitreOnglet=function(bDisplayEnd){
tailleTot=(this.arrTabItem.length)*this.widthTabName;
if(this.autoRedimTab){
if(tailleTot>this.divOnglet.offsetWidth-20){
taille=Math.floor((this.divOnglet.offsetWidth-20)/this.arrTabItem.length);
for(i=0;i<this.arrTabItem.length;i++){
this.arrTabItem[i].setWidth(Math.max(0,taille));
}
}
}
else{
if(tailleTot>this.divOnglet.offsetWidth-60){
this.fenVisible.tailleFen=parseInt((this.divOnglet.offsetWidth-60)/this.widthTabName);
}
else{
this.fenVisible.tailleFen=this.arrTabItem.length;
}
if(bDisplayEnd){
this.fenVisible.indFin=this.arrTabItem.length-1;
this.fenVisible.indDeb=this.fenVisible.indFin-this.fenVisible.tailleFen+1;
this.majZoneVisible();
}
else{
this.fenVisible.indDeb=0;
this.fenVisible.indFin=this.fenVisible.indDeb+this.fenVisible.tailleFen-1;
this.setTabVisible(this.indActiveTab);
}
this.majImages();
}
}
rialto.widget.TabFolder.prototype.release=function(e,shift){
if(this.liste){
this.liste.remove();
}
if(this.btnClose){
this.btnClose.onclick=null;
}
if(this.MC){
this.MC.onclick=null;
}
if(this.next){
this.next.onclick=null;
}
if(this.previous){
this.previous.onclick=null;
}
}
rialto.widget.TabFolder.prototype.displayMenu=function(e,shift){
var oThis=this;
var width=0;
divVisible=document.createElement("DIV");
divVisible.className="ong-Fenvisible";
divVisible.style.height=parseInt(this.fenVisible.tailleFen)*22;
divVisible.style.top=this.fenVisible.indDeb*23;
divTirette=document.createElement("DIV");
divTirette.className="tabListIndex";
divTirette.style.position="absolute";
divVisible.appendChild(divTirette);
divTirette.style.top=((this.fenVisible.tailleFen*22)/2)-15;
this.liste.clear();
this.liste.add(divVisible);
this.liste.onclick=function(item){
oThis.activeTab(item.ind);
}
this.liste.onOver=function(item){
divTirette.ind=item.ind;
}
for(var i=0;i<this.arrTabItem.length;i++)
{
var objStyle=new Object;
width=Math.max(width,getTailleTexte(this.arrTabItem[i].title));
var obj={text:this.arrTabItem[i].title
,heigth:22
,clOver:"ong-hilite"
,clOut:"ong-item"
}
if(this.isVisible(i)){
objStyle.fontWeight='bold';
if(i==this.indActiveTab){
objStyle.color='#F7891E';
}
}
if(!this.arrTabItem[i].enable){
objStyle.color='#AAAAAA';
objStyle.fontWeight='normal';
objStyle.fontStyle='italic';
}
var item=this.liste.addItem(obj)
item.setStyle(objStyle);
}
tailleBord=0;
if(!window.event){
tailleBord=2;
}
this.liste.setWidth(width+20-tailleBord);
divVisible.style.width=parseInt(width+20-tailleBord);
divTirette.style.left=parseInt(divVisible.style.width)-tailleBord;
rialto.widgetBehavior.affect(divTirette
,'DragAndDrop'
,{
oHtmlToMove:divVisible
,bSelectMark:false
,isWithLimitsDisplayed:false
,movingLimits:{orientation:'v'}
,magneticsGrid:{heightRow:23}
}
);
divTirette.afterDD=function(dTop,dLeft){
var decal=parseInt(dTop/22);
oThis.decalFenVisible(decal);
oThis.liste.fermezoneMenu();
};
divTirette.afterClic=function(){
oThis.liste.fermezoneMenu();
oThis.activeTab(this.ind);
};
var ev=e||window.event;
this.liste.affichezoneMenu(ev,shift);
}
rialto.widget.TabFolder.prototype.majImages=function(){
if(!this.autoRedimTab){
if(this.fenVisible.tailleFen==this.arrTabItem.length){
if(!this.isClosable){
this.divImg.style.display='none';
}
else{
this.previous.setVisible(false);
this.next.setVisible(false);
this.MC.setVisible(false);
this.divImg.style.width=17;
}
}
else{
if(!this.isClosable){
this.divImg.style.width=60;
this.divImg.style.display='block';
}
else{
this.divImg.style.width=70;
}
this.previous.setVisible(true);
this.next.setVisible(true);
this.MC.setVisible(true);
if(this.fenVisible.indDeb==0){
this.previous.setEnable(false);
}
else{
this.previous.setEnable(true);
}
if(this.fenVisible.indFin==this.arrTabItem.length-1){
this.next.setEnable(false);
}
else{
this.next.setEnable(true);
}
}
}
}
rialto.widget.TabItem=function(title,parentonglet,enable){
var objParam=new Object;
this.base=rialto.widget.AbstractContainer;
objParam.type="tabitem";
this.base(objParam);
this.enable=enable!=null?enable:true;
this.autoResizeParent=parentonglet.autoResizeParent;
this.parentOnglet=parentonglet;
var oThis=this;
this.title=title;
this.titreOnglet=document.createElement("DIV");
this.titreOnglet.title=title;
this.titreOnglet.id="DIV_ONGLET";
this.titreOnglet.style.width=this.parentOnglet.widthTabName+"px";
this.titreOnglet.className="tabTitleDivOn";
this.imgG=document.createElement("DIV")
this.imgG.className="leftEdgeTabOn";
this.textDiv=document.createElement("DIV")
this.textDiv.className="tabTitleTextOn";
this.textDiv.style.width=this.parentOnglet.widthTabName-5;
this.textDiv.innerHTML=this.title;
this.imgD=document.createElement("DIV")
this.imgD.className="rightEdgeTabOn";
this.titreOnglet.appendChild(this.imgG);
this.titreOnglet.appendChild(this.textDiv);
this.titreOnglet.appendChild(this.imgD);
this.contenuOnglet=document.createElement("DIV");
this.contenuOnglet.id='tabItem_'+rialto.widget.TabItem.prototype.nbInstances++;
this.contenuOnglet.className="ContenuOnglet";
this.setVisible(false);
this.contenuOnglet.oCiu=this;
this.contenuOnglet.onmousemove=function(){
return true;
}
this.setEnable(this.enable);
}
rialto.widget.TabItem.prototype=new rialto.widget.AbstractContainer;
rialto.widget.TabItem.prototype.nbInstances=0;
rialto.widget.TabItem.prototype.setEnable=function(enable){
if(enable){
this.titreOnglet.style.fontStyle='';
}
else{
this.titreOnglet.style.fontStyle='italic';
}
this.enable=enable;
}
rialto.widget.TabItem.prototype.setVisible=function(visible){
if(visible){
this.titreOnglet.style.display='block';
this.contenuOnglet.style.display='block';
}
else{
this.titreOnglet.style.display='none';
this.contenuOnglet.style.display='none';
}
this.visible=visible;
}
rialto.widget.TabItem.prototype.displayTitle=function(){
this.titreOnglet.style.display='block';
this.visible=true;
}
rialto.widget.TabItem.prototype.changeWidth=function(delta){
if(delta==0){
this.titreOnglet.style.width=0;
}
else{
this.titreOnglet.style.width=Math.max(0,parseInt(this.titreOnglet.style.width)+delta);
}
}
rialto.widget.TabItem.prototype.setWidth=function(width){
this.titreOnglet.style.width=Math.max(0,width);
this.textDiv.style.width=Math.max(0,width-5);
}
rialto.widget.TabItem.prototype.updateSize=function(){
this.contenuOnglet.style.overflow='hidden';
if(this.autoResizableH){
this.updateHeight();
}
if(this.autoResizableW){
this.updateWidth();
}
this.contenuOnglet.style.overflow="auto";
}
rialto.widget.TabItem.prototype.updateWidth=function(){
if(this.visible){
var tailleCalc=parseInt(this.getNewParentWidth());
this.contenuOnglet.style.width=tailleCalc;
this.resizeChilds(true,false);
}
}
rialto.widget.TabItem.prototype.updateHeight=function(){
if(this.visible){
var tailleCalc=parseInt(this.getNewParentHeight());
this.contenuOnglet.style.height=tailleCalc;
this.resizeChilds(false,true);
}
}
rialto.widget.TabItem.prototype.getHtmlExt=function(){
return this.contenuOnglet;
}
rialto.widget.TabItem.prototype.getHtmlCont=function(){
return this.contenuOnglet;
}
rialto.widget.TabItem.prototype.onClose=function(){
}
rialto.widget.TabItem.prototype.activeOnglet=function(){
if(this.enable){
if(this.parentOnglet.currentActiveTab!=this){
if(this.parentOnglet.currentActiveTab){
oldOng=this.parentOnglet.currentActiveTab;
oldOng.desactiveOnglet();
}
this.parentOnglet.currentActiveTab=this;
this.imgG.className='leftEdgeTabOn';
this.textDiv.className='tabTitleTextOn';
this.imgD.className='rightEdgeTabOn';
this.titreOnglet.className='tabTitleDivOn';
this.contenuOnglet.style.display='block';
this.$$activeContent();
if(this.autoResizeParent){this.parentOnglet.updateSize();}
}
}
}
rialto.widget.TabItem.prototype.desactiveOnglet=function(){
this.contenuOnglet.style.display='none';
this.imgG.className='leftEdgeTabOff';
this.textDiv.className='tabTitleTextOff';
this.imgD.className='rightEdgeTabOff';
this.titreOnglet.className='tabTitleDivOff';
if(this.parentOnglet.currentActiveTab==this){this.parentOnglet.currentActiveTab=null;}
}
rialto.widget.TabItem.prototype.release=function(){
if(this.parentOnglet.currentActiveTab==this){this.parentOnglet.currentActiveTab=null;};
this.titreOnglet.parentNode.removeChild(this.titreOnglet);
this.contenuOnglet.oCiu=null;
this.contenuOnglet.onmousemove=null;
if(this.titreOnglet.DD){
this.titreOnglet.DD=null;
this.titreOnglet.afterDD=null;
this.titreOnglet.afterClic=null;
this.titreOnglet.onclick=null;
DragAndDrop.release(this.titreOnglet);
}
}
rialto.widget.ToolBar=function(objPar){
this.base=rialto.widget.AbstractContainer;
objPar.type="toolbar";
this.base(objPar);
if(objPar){
}
var oThis=this;
this.divExt.style.top=this.top;
this.divExt.style.left=this.left;
this.divExt.style.width=this.width;
this.divExt.style.position="absolute";
this.divExt.className="toolBarDiv";
this.imgG=document.createElement("DIV")
this.imgG.className="leftEdgeToolbar";
this.imgD=document.createElement("DIV")
this.imgD.className="rightEdgeToolbar";
this.divExt.appendChild(this.imgG);
this.divExt.appendChild(this.imgD);
if(objPar.parent){this.placeIn(objPar.parent);};
this.divExt.ondblclick=function(e){
var ev=e?e:window.event;
oThis.ondbleclick(ev);
};
objPar=null;
}
rialto.widget.ToolBar.prototype=new rialto.widget.AbstractContainer;
rialto.widget.ToolBar.prototype.addText=function(top,left,text,classname){
var textWidth=getTailleTexte(text,"libelle1");
var div=document.createElement("DIV");
div.className="libelle1";
div.style.top=2;
div.style[ATTRFLOAT]='left';
div.style.position='relative';
div.style.width=textWidth;
div.innerHTML=text;
this.divExt.appendChild(div);
return div;
}
rialto.widget.ToolBar.prototype.addSpace=function(){
var div=document.createElement("DIV");
div.style.width=20;
div.style.height="100%";
div.style[ATTRFLOAT]='left';
div.style.position='relative';
this.divExt.appendChild(div);
}
rialto.widget.ToolBar.prototype.addSeparation=function(){
var div=document.createElement("DIV");
div.className="cellSep";
div.style[ATTRFLOAT]='left';
div.style.position='relative';
this.divExt.appendChild(div);
}
rialto.widget.ToolBar.prototype.addMenu=function(title,menu){
var oThis=this;
div=this.addText('','',title);
div.onmouseover=function(){
this.style.height=parseInt(this.offsetHeight)-2;
this.style.border="1px solid cyan";
}
div.onmouseout=function(){
this.style.border=null;
this.style.height=parseInt(this.offsetHeight)+2;
}
div.onclick=function(){
menu.setPosTop(compOffsetTop(oThis.divExt)+22);
menu.setPosLeft(compOffsetLeft(oThis.divExt)+2);
menu.affichezoneMenu(evt=null,heightCombo=22);
}
this.addSpace();
}
rialto.widget.ToolBar.prototype.addButton=function(obj){
ob={position:'relative',boolFloatLeft:true}
var but=new rialto.widget.Image("printButtonOff",0,2,this,"Print the content","printButtonOn",ob);
this.addSpace();
return but;
}
rialto.widget.ToolBar.prototype.release=function(){
this.divExt.ondblclick=null;
var childDivs=this.divExt.childNodes;
for(var lnIdx=0;lnIdx<childDivs.length;lnIdx++){
var childDiv=childDivs[lnIdx];
childDiv.onmouseover=null;
childDiv.onmouseout=null;
childDiv.onclick=null;
}
}
function Dashboard(specs,traceLevel){
tracelevel=traceLevel||1;
var lAttrSpecs="title#height#isZoneEval#topOpenZone#callBackRun#width#top#";
var title='Unit Test';
var height=450;
var width=550;
var isZoneEval=false;
var topOpenZone=5;
var callBackRun=function(){return;};
var top=20;
var tAttrSpecs=new Array();
tAttrSpecs=lAttrSpecs.split('#');
tAttrSpecs.pop();
for(var i=0;i<tAttrSpecs.length;i++){
attr=tAttrSpecs[i];
instr=attr+'=specs?(specs.'+attr+'?specs.'+attr+':'+attr+'):'+attr+';';
eval(instr);
}
var fr=new rialto.widget.Frame({name:'Dashboard',top:top,left:500,width:width,height:height,title:title,dynamic:true,
draggable:true,
parent:document.body});
fr.placeInTop();
fr.setStyle({border:'1px outset white'});
var libelHdle=document.createElement('DIV');
var txt=document.createTextNode('Title is a handle : You can move me anywhere in the viewPort');
libelHdle.appendChild(txt);
fr.add(libelHdle);
if(isZoneEval){
fr.add(document.createElement('BR'));
var libelEvalField=document.createElement('SPAN');
var txt=document.createTextNode('method ');
libelEvalField.appendChild(txt);
fr.add(libelEvalField);
var selectObj=document.createElement('SELECT');
selectObj.onchange=function(e){
alert('ok');
}
selectObj.style.width=100;
selectObj.style.left=150;
fr.add(selectObj);
var libelSepar=document.createElement('SPAN');
libelSepar.appendChild(document.createTextNode('.'));
fr.add(libelSepar);
var selectMethod=document.createElement('SELECT');
selectMethod.style.width=150;
fr.add(selectMethod);
fr.add(document.createElement('BR'));
var libelEvalField=document.createElement('SPAN');
var txt=document.createTextNode('arguments ');
libelEvalField.appendChild(txt);
fr.add(libelEvalField);
var libelSepar=document.createElement('SPAN');
libelSepar.appendChild(document.createTextNode('('));
fr.add(libelSepar);
var argtsMethodInputField=document.createElement('INPUT');
argtsMethodInputField.style.width=300;
argtsMethodInputField.onclick=function(){
this.focus();
}
fr.add(argtsMethodInputField);
var libelSepar=document.createElement('SPAN');
libelSepar.appendChild(document.createTextNode(')'));
fr.add(libelSepar);
var evalCall=document.createElement('BUTTON');
evalCall.text='run';
evalCall.value='run';
evalCall.nodeValue='run';
evalCall.title='run';
evalCall.onclick=function(){
alert(img1.masqueImage);
alert('clic'+' obj= '+selectObj.value);
var instr=selectObj.value+'.'+'masqueImage'
+'('
+''
+')';
alert(instr);
eval(instr);
}
fr.add(evalCall);
selectObj.onblur=function(){
alert('ok');
}
fr.topOpenZone=55;
fr.addRefObj=function(objName){
var itemSelectObj=document.createElement('OPTION');
itemSelectObj.value=objName;
itemSelectObj.text=objName;
selectObj.appendChild(itemSelectObj);
}
}
else
fr.topOpenZone=topOpenZone;
var topT=parseInt(height)-350+fr.topOpenZone;
var removeTrace=new rialto.widget.Button(topT+20,320,"reset Trace","reset");
removeTrace.onclick=function(e){
divTrace.oHtml.parentNode.removeChild(divTrace.oHtml);
runTrace();
}
fr.add(removeTrace);
var traceOb=new rialto.widget.Button(topT+20,220,"Objects added","objects");
traceOb.onclick=function(e){
treeview();
for(obj in rialto.session.objects){
traceExec("obj:"+obj+" obj.name:"+rialto.session.objects[obj].name+" obj.id:"+rialto.session.objects[obj].id,1);
}
}
fr.add(traceOb);
var runTest=new rialto.widget.Button(topT+20,120,"run Test","run");
runTest.onclick=function(e){
if(callBackRun)
callBackRun();
}
fr.add(runTest);
var runTrace=function(){
divTrace=new layer(topT+50,
25,
width-50,
310-fr.topOpenZone-40,
'gray');
fr.add(divTrace.oHtml);
initTrace(tracelevel,{traceMode:'oneLevel'},null,divTrace.oHtml);
traceExec('tracking test OK',1);
}
runTrace();
traceExec('tracking test OK',1);
rialto.debug=fr;
return fr;
}
function treeview()
{
var tr=new rialto.widget.Frame(
{name:'Treeview',top:20,left:500,width:400,height:600,title:"Treeview",dynamic:true}
);
tr.setDraggable(true);
tr.placeIn(document.body);
tr.setStyle({border:'1px outset white'});
treeDossier=new Tree({name:'treeDossier',top:10,left:10,width:350,height:170,boolSelActive:false,rootOpen:true,withRoot:true,withT:true,parent:tr});
nodeRoot=treeDossier.createAndAddNode(treeDossier.id,{name:'nodeRoot',sText:'OBJECT',sIcon:'images/imTreeview/icone_agenda_ferme.gif',sIcon2:'images/imTreeview/icone_agenda_ouvert.gif',onclick:"",open:true});
for(obj in rialto.session.objects){
var node=treeDossier.createAndAddNode(nodeRoot.id,{name:'node1',sText:rialto.session.objects[obj].name,sIcon:'images/imTreeview/puce.gif',sIcon2:'',onclick:"editObj('"+obj+"')",open:true});
traceExec("obj:"+obj+" obj.name:"+rialto.session.objects[obj].name+" obj.id:"+rialto.session.objects[obj].id,1);
}
node2=treeDossier.createAndAddNode(nodeRoot.id,{name:'node2',sText:'Tabs',sIcon:'images/imTreeview/puce.gif',sIcon2:'',onclick:"",open:true});
}
function editObj(objId)
{
var tr=new rialto.widget.Frame(
{name:'Treeview',top:20,left:500,width:400,height:600,title:"Grid",dynamic:true}
);
tr.setDraggable(true);
tr.placeIn(document.body);
tr.setStyle({border:'1px outset white'});
oTableau=new rialto.widget.Grid({top:20,left:15,height:530,TabEntete:["ID","Type","Value"],name:'oTableau',parent:tr,bNavig:false,rang:12,tabTypeCol:[["string",80],["string",100],["date",100]],cellActive:false,sortable:true,multiSelect:false,lineHeight:16,boolPrint:true,basculable:true,actifClic:true,autoWidth:true,writable:false});
var obj=rialto.session.objects[objId];
obj.getHtmlExt().style.border="1px solid red";
var tab=new Array;
for(prop in obj){
var arr=[""+prop,typeof obj[prop],obj[prop]];
tab.push(arr);
}
oTableau.fillGrid(tab);
}
function layer(top,left,width,height,color)
{
this.id="cste";
this.oHtml=document.createElement('DIV');
this.oHtml.className='zoneColoree';
this.oHtml.style.position='absolute';
this.oHtml.style.top=top;
this.oHtml.style.left=left;
this.oHtml.style.width=width;
this.oHtml.style.height=height;
this.oHtml.style.backgroundColor=color;
}
function traceExec(msg,niv){
var oTrace=document.getElementById("__trace__");
if(oTrace&&rialto.config.isDebug){
if(!niv
||(oTrace.oCiu.justeUnNiveau&&(niv==oTrace.oCiu.niveau))
||(!oTrace.oCiu.justeUnNiveau
&&!oTrace.oCiu.niveauInf
&&(niv<=oTrace.oCiu.niveau))
||(!oTrace.oCiu.justeUnNiveau
&&oTrace.oCiu.niveauInf
&&(niv<=oTrace.oCiu.niveau)
&&(niv>=oTrace.oCiu.niveauInf))
){
var brk=document.createElement('BR');
oTrace.appendChild(brk);
var brk2=document.createElement('BR');
oTrace.appendChild(brk2);
var oText=document.createTextNode(niv+' '+msg);
oTrace.appendChild(oText);
}
}
}
function initTrace(niv,mode,nivInf,div)
{
trace=new layer(300,10,300,400,"lightblue");
trace.oHtml.id="__trace__";
trace.oHtml.style.border="1px solid black";
trace.oHtml.style.fontSize="70%";
trace.oHtml.style.fontFamily="verdana";
trace.oHtml.style.overflow='auto';
trace.oHtml.style.zIndex=100000;
trace.oHtml.oCiu=this;
this.niveau=niv||10;
if(nivInf)
this.niveauInf=nivInf;
else
this.niveauInf=0;
this.justeUnNiveau=mode?((mode.traceMode=='oneLevel')?true:false)
:false;
var texteInit=this.justeUnNiveau
?'beginning of the tracking limited to the level '+this.niveau
:(this.niveauInf==0)
?"begin Tracking; all level until  "+this.niveau
:"begin Tracking; all level between "+this.niveauInf+" and "+this.niveau;
var txtNode=document.createTextNode(texteInit);
trace.oHtml.appendChild(txtNode);
if(div){
trace.oHtml.style.top=0;
trace.oHtml.style.left=0;
trace.oHtml.style.width='100%';
trace.oHtml.style.height='100%';
div.appendChild(trace.oHtml);
}
else
document.body.appendChild(trace.oHtml);
}
rialto.widget.Tree=function(objPar){
objPar.type="treeview";
this.base=rialto.widget.AbstractComponent;
this.base(objPar);
var oThis=this;
this.rootOpen=true;
this.boolSelActive=true;
this.withRoot=true;
this.withT=true;
this.autoResizableH=false;
this.autoResizableW=false;
this.draggableNode=false;
if(rialto.lang.isBoolean(objPar.boolSelActive)){
this.boolSelActive=objPar.boolSelActive;
}
if(rialto.lang.isBoolean(objPar.withT)){
this.withT=objPar.withT;
}
if(rialto.lang.isBoolean(objPar.rootOpen)){
this.rootOpen=objPar.rootOpen;
}
if(rialto.lang.isBoolean(objPar.withRoot)){
this.withRoot=objPar.withRoot;
}
if(rialto.lang.isBoolean(objPar.autoResizableH)){
this.autoResizableH=objPar.autoResizableH;
}
if(rialto.lang.isBoolean(objPar.autoResizableW)){
this.autoResizableW=objPar.autoResizableW;
}
if(rialto.lang.isBoolean(objPar.draggableNode)){
this.draggableNode=objPar.draggableNode;
}
this.divExt.style.top=this.top;
this.divExt.style.left=this.left;
this.divDD=document.createElement("DIV");
this.divDD.className="treeDivDD";
this.divExt.style.className="Tree_DIVSUP";
this.divExt.style.position=this.position;
this.divExt.style.overflow='auto';
this.divExt.id=this.name;
if(objPar.rootNode){this.addRoot(objPar.rootNode)};
if(objPar.parent){this.placeIn(objPar.parent);};
objPar=null;
}
rialto.widget.Tree.prototype=new rialto.widget.AbstractComponent;
rialto.widget.Tree.prototype.release=function(){
if(this.rootNode){
  if(this.rootNode.img2){this.rootNode.img2.onclick=null;}
  this.rootNode.remove();
}
}
rialto.widget.Tree.prototype.adaptToContext=function(parent){
if(this.autoResizableH){
this.divExt.style.height=this.getNewParentHeight()-this.divExt.offsetTop;
}
else{
this.divExt.style.height=this.height;
}
if(this.autoResizableW){
this.divExt.style.width=this.getNewParentWidth()-this.divExt.offsetLeft;
}
else{
this.divExt.style.width=this.width;
}
traceExec("this.divExt.style.height:"+this.divExt.style.height,1);
traceExec("this.divExt.style.width:"+this.divExt.style.width,1);
}
rialto.widget.Tree.prototype.addRoot=function(rootNode){
var oThis=this;
this.rootNode=rootNode;
this.divExt.appendChild(this.rootNode.divExt);
this.rootNode.refTree=this;
this.rootNode.root=true;
this.rootNode.divText.style.top="5px";
this.rootNode.img1.style.diplay="none";
this.rootNode.img2.style.left="0px";
this.rootNode.divText.style.left="24px";
this.rootNode.DIVFILLE.style.left='0';
this.rootNode.DIVCONTENU.style.display='block';
this.rootNode.open=true;
this.rootNode.changeIcone();
if(!this.withRoot){
this.rootNode.divExt.removeChild(this.rootNode.DIVENTETE);
}
else{
this.rootNode.img1.style.display='none';
this.rootNode.DIVT.style.display='none';
this.rootNode.img2.onclick=function(e){oThis.rootNode.toggle();}
}
}
rialto.widget.Tree.prototype.updateSize=function(){
if(this.autoResizableH){
this.updateHeight();
}
if(this.autoResizableW){
this.updateWidth();
}
}
rialto.widget.Tree.prototype.updateWidth=function(){
var tailleCalc=parseInt(this.getNewParentWidth());
this.divExt.style.width=tailleCalc-this.divExt.offsetLeft;
}
rialto.widget.Tree.prototype.updateHeight=function(){
var tailleCalc=parseInt(this.getNewParentHeight());
this.divExt.style.height=tailleCalc-this.divExt.offsetTop;
}
rialto.widget.Tree.prototype.exist=function(node,nodeId){
stat={trouve:false,nd:null};
if(node.id==nodeId)
{
stat={trouve:true,nd:node}
}
else{
var i=0;
while(i<node.arrChildNode.length&&!stat.trouve)
{
stat=this.exist(node.arrChildNode[i],nodeId);
i++;
}
}
return stat;
}
rialto.widget.Tree.prototype.findValue=function(node,val){
stat={trouve:false,nd:null};
if(node.val==val)
{
stat={trouve:true,nd:node}
}
else{
var i=0;
while(i<node.arrChildNode.length&&!stat.trouve)
{
stat=this.findValue(node.arrChildNode[i],val);
i++;
}
}
return stat;
}
rialto.widget.Tree.prototype.addNode=function(node,nodeIdParent){
if(nodeIdParent==this.id){
this.addRoot(node);
}
else{
var resRech=this.exist(this.rootNode,nodeIdParent);
if(resRech.trouve){
resRech.nd.addNode(node);
}
else{
alert("not find "+node.text+" in "+nodeIdParent);
}
}
}
rialto.widget.Tree.prototype.createAndAddNode=function(nodeId,objPar){
var node=new rialto.widget.TreeNode(objPar);
this.addNode(node,nodeId);
return node
}
rialto.widget.Tree.prototype.setStyle=function(obStyle){
for(prop in obStyle){
try{
this.divExt.style[prop]=obStyle[prop];
}
catch(erreur){}
}
}
rialto.widget.Tree.prototype.getRoot=function(){
return this.rootNode;
}
rialto.widget.Tree.prototype.onclick=function(node){
}
rialto.widget.Tree.prototype.createCol=function(nodeDep,typeInfo){
var collection=new Array();
this.examineBranche(nodeDep,typeInfo,collection);
collection.inCourCol=0;
collection.isFirst=function(ind){
return ind==0;
}
collection.isLast=function(ind){
return ind==(this.length-1);
}
collection.clickFirst=function(){
var node=this[0];
node.click();
this.inCourCol=0;
}
collection.clickLast=function(){
var node=this[this.length-1];
node.click();
this.inCourCol=this.length-1;
}
collection.clickNext=function(){
if(this.inCourCol!=this.length-1){
var node=this[this.inCourCol+1];
node.click();
this.inCourCol+=1;
}
}
collection.clickPrevious=function(){
if(this.inCourCol!=0){
var node=this[this.inCourCol-1];
node.click();
this.inCourCol-=1;
}
}
return collection;
}
rialto.widget.Tree.prototype.examineBranche=function(node,typeInfo,collection){
if(node.typeInfo==typeInfo){
collection.push(node);
}
for(var i=0;i<node.arrChildNode.length;i++){
this.examineBranche(node.arrChildNode[i],typeInfo,collection);
}
}
btwN=0;
rialto.widget.TreeNode=function(objPar){
objPar.type="treenode";
this.base=rialto.widget.AbstractComponent;
this.base(objPar);
var oThis=this;
this.arrChildNode=new Array();
this.typeInfo="node";
this.text="node";
this.icon=rialtoConfig.pathRialtoE+"images/imTreeview/pict_synthetik_off.gif";
this.icon2=this.icon;
this._onclick="this.toggle();"
this.open=true;
this.reload=false;
this.url="";
this.srcPlus=rialtoConfig.pathRialtoE+"images/imTreeview/icT/L.gif";
this.srcMoins=rialtoConfig.pathRialtoE+"images/imTreeview/icT/L.gif";
this.draggable=false;
if(rialto.lang.isString(objPar.typeInfo)){
this.typeInfo=objPar.typeInfo;
}
if(rialto.lang.isString(objPar.sText)){
this.text=objPar.sText;
}
if(rialto.lang.isString(objPar.sIcon,true)){
this.icon=rialtoConfig.pathRialtoE+objPar.sIcon;
this.icon2=this.icon;
}
if(rialto.lang.isString(objPar.sIcon2,true)){
this.icon2=rialtoConfig.pathRialtoE+objPar.sIcon2;
}
if(rialto.lang.isString(objPar.onclick,true)){
this._onclick=objPar.onclick;
}
if(rialto.lang.isBoolean(objPar.open)){
this.open=objPar.open;
}
if(rialto.lang.isBoolean(objPar.reload)){
this.reload=objPar.reload;
}
if(rialto.lang.isString(objPar.url,true)){
this.url=objPar.url;
}
this.divExt.className="divTree";
this.DIVENTETE=document.createElement("DIV");
this.DIVENTETE.style.height='23px';
this.DIVENTETE.style.position='relative';
this.DIVENTETE.style.overflow='hidden';
this.DIVCONTENU=document.createElement("DIV");
this.DIVCONTENU.className="divTree";
if(rialto.config.userAgentIsIE){this.DIVCONTENU.style.height='0px'};
this.img1=document.createElement("DIV");
this.img1.className="imgTreeview";
this.DIVENTETE.appendChild(this.img1);
this.img1.onclick=function(e){
if(!e)var e=window.event;
oThis.toggle();
stopEvent(e);
}
this.img2=document.createElement("DIV");
this.img2.style.backgroundImage="url('"+this.icon+"')";
this.img2.className="imgTreeview";
this.img2.style.left=19;
this.img2.onclick=function(){oThis.click();}
this.DIVENTETE.appendChild(this.img2);
this.divText=document.createElement("DIV");
this.divText.className="DivText";
this.divText.style.left=40;
this.divText.innerHTML=this.text;
this.divText.title=this.text;
this.DIVENTETE.appendChild(this.divText);
this.divText.onclick=function(){oThis.click();}
this.DIVT=document.createElement("DIV");
this.DIVT.style.display="none";
this.DIVT.style.position='absolute';
this.DIVT.style.width='19px';
this.DIVT.style.height='100%';
this.DIVT.style.background="url('"+rialtoConfig.pathRialtoE+"images/imTreeview/icT/I.gif') repeat";
this.DIVCONTENU.appendChild(this.DIVT);
this.DIVFILLE=document.createElement("DIV");
this.DIVFILLE.style.left='19px';
this.DIVFILLE.style.position='relative';
this.DIVFILLE.style.overflow='hidden';
this.DIVFILLE.style.width='90%';
this.DIVCONTENU.appendChild(this.DIVFILLE);
this.DIVCONTENU.style.display='none';
this.divExt.appendChild(this.DIVENTETE);
this.divExt.appendChild(this.DIVCONTENU);
if(this.reload){
this.noeudReload=new rialto.widget.TreeNode({sText:"Loading...",sIcon:"images/imTreeview/find.small.gif"});
this.addNode(this.noeudReload);
}
objPar=null;
}
rialto.widget.TreeNode.prototype=new rialto.widget.AbstractComponent;
rialto.widget.TreeNode.prototype.release=function(){
this.img1.onclick=null;
this.img2.onclick=null;
this.divText.onclick=null;
this.divText.oCiu=null;
this.DIVENTETE.oCiu=null;
this.DIVENTETE.DDOuter=null;
this.DIVENTETE.DDHover=null;
this.DIVENTETE.receiveAfterDrop=null;
this.DIVENTETE.afterClic=null;
oThis=null;
}
rialto.widget.TreeNode.prototype.addTargetBehavior=function(){
var oThis=this;
rialto.widgetBehavior.affect(this.DIVENTETE,'Target',{missileAsOnePixel:true,
domain:'tree.node'});
this.DIVENTETE.oCiu=this;
this.DIVENTETE.DDOuter=function(missile){
oThis.refTree.divDD.style.display='none';
oThis.divText.style.backgroundColor="";
}
this.DIVENTETE.DDHover=function(missile){
var top=missile.top;
if(!this.oCiu.open){this.oCiu.toggle();}
if(top>5&&top<18&&oThis.hasChild()){
this.insert='add';
oThis.refTree.divDD.style.display='none';
oThis.divText.style.backgroundColor="#99CCFF";
}
else{
oThis.divText.style.backgroundColor="";
if(top<5){
this.insert='before';
oThis.refTree.divDD.style.top=0;
}
else{
this.insert='after';
oThis.refTree.divDD.style.top=23;
}
oThis.refTree.divDD.style.display='block';
oThis.divExt.appendChild(oThis.refTree.divDD);
}
}
this.DIVENTETE.receiveAfterDrop=function(missile){
oThis.refTree.divDD.style.display='none';
var resRech=oThis.refTree.exist(missile.oHtml.oCiu,oThis.id);
if(!resRech.trouve){
if(this.oCiu!=missile.oHtml.oCiu){
if(this.insert=='add'){
oThis.addNode(missile.oHtml.oCiu);
}
else{
if(this.insert=='before'){
oThis.insertBefore(missile.oHtml.oCiu);
}
else{
oThis.insertAfter(missile.oHtml.oCiu);
}
}
oThis.onDropIn();
}
}
}
}
rialto.widget.TreeNode.prototype.onDropIn=function(){
}
rialto.widget.TreeNode.prototype.addDDBehavior=function(){
var oThis=this;
this.DIVENTETE.oCiu=this;
this.addTargetBehavior();
rialto.widgetBehavior.affect(this.DIVENTETE,'Missile',
{bMUpAction:false,
bRectLim:false,
ghost:{bIcone:true,aspect:'icon'},
domainTargets:'tree.node'
,targetChoice:'firstIsBetter'
});
this.DIVENTETE.afterClic=function(e){
oThis.click();
};
this.bDD=true;
}
rialto.widget.TreeNode.prototype.reloadNode=function(url){
var i=url.indexOf("?");
if(i==-1){
url+='?TREEID='+this.refTree.id+'&NODEID='+this.id;
}
else{
url+='&TREEID='+this.refTree.id+'&NODEID='+this.id;
}
this.remote=new rialto.io.AjaxRequest({
url:url,
callBackObjectOnSuccess:this,
onSuccess:this.refreshReloadNode
})
this.remote.load("");
this.reload=false;
this._onclick="this.toggle();"
if(!this.open){this.toggle();}
}
rialto.widget.TreeNode.prototype.refreshReloadNode=function(request){
try{
this.removeNode(this.noeudReload.id);
var colNode=eval("("+request.responseText+")");
for(var i=0;i<colNode.arrNode.length;i++){
var node=new rialto.widget.TreeNode(colNode.arrNode[i].objPar);
this.addNode(node);
}
}catch(e){alert(e)};
}
rialto.widget.TreeNode.prototype.click=function(){
this.selNode();
eval(this._onclick);
var stopClick;
stopClick=this.onclick();
if(!stopClick)
this.refTree.onclick(this);
}
rialto.widget.TreeNode.prototype.toggle=function(){
var oThis=this;
if(this.hasChild()){
if(this.open){
this.DIVCONTENU.style.display='none';
this.open=false;
}
else{
this.DIVCONTENU.style.display='block';
this.open=true;
if(this.reload){
if(this.url){
this.reloadNode(this.url);
}
else{
eval(this.click);
}
}
}
this.changeIcone();
}
}
rialto.widget.TreeNode.prototype.setText=function(sText){
this.text=sText;
this.divText.innerHTML=this.text;
}
rialto.widget.TreeNode.prototype.selNode=function(){
if(this.refTree.boolSelActive){
if(this.refTree.currentSelNode!=null&&this.refTree.currentSelNode!=this){
this.refTree.currentSelNode.deSelNode();
}
this.refTree.currentSelNode=this;
if(this.hasChild()){
this.divText.className+=" NodeSel";
}
else{
this.divText.className+=" textSel";
}
}
}
rialto.widget.TreeNode.prototype.deSelNode=function(){
if(this.refTree.boolSelActive){
this.divText.className="DivText";
if(this.refTree.currentSelNode!=null&&this.refTree.currentSelNode==this){
this.refTree.currentSelNode=null;
}
}
}
rialto.widget.TreeNode.prototype.hasChild=function(){
if(this.arrChildNode.length==0){return false;}
else{return true;}
}
rialto.widget.TreeNode.prototype.existChild=function(nodeID){
trouve=false;
i=0;
ind=-1;
while(!trouve&&i<this.arrChildNode.length){
var node=this.arrChildNode[i];
if(node.id==nodeID){
trouve=true;
ind=i;
}
i+=1;
}
return ind;
}
rialto.widget.TreeNode.prototype.baseRemove=rialto.widget.AbstractComponent.prototype.remove;
rialto.widget.TreeNode.prototype.remove=function(bFromContainer){
for(var i=0;i<this.arrChildNode.length;i++){
this.arrChildNode[i].remove(bFromContainer);
}
this.baseRemove(bFromContainer);
}
rialto.widget.TreeNode.prototype.removeNode=function(id,bjustHTML){
var ind=this.existChild(id);
if(ind!=-1){
var node=this.arrChildNode.splice(ind,1)[0];
var decal=node.divExt.offsetHeight;
if(node==this.refTree.currentSelNode){
node.deSelNode();
}
if(bjustHTML){
this.DIVFILLE.removeChild(node.divExt);
}
else{
node.remove();
}
if(this.hasChild()){
var lastNode=this.last();
lastNode.changeIcone();
}
else{
this.changeIcone();
}
}
}
rialto.widget.TreeNode.prototype.updateParentH=function(decal){
var parent=this.fatherNode;
while(parent){
parent.DIVFILLE.style.height=parseInt(parent.DIVFILLE.style.height)+decal;
parent=parent.fatherNode;
}
}
rialto.widget.TreeNode.prototype.afterAdd=function(){
this.refTree=this.fatherNode.refTree;
if(this.refTree.draggableNode&&!this.bDD){
this.addDDBehavior();
}
this.changeIcone();
for(var i=0;i<this.arrChildNode.length;i++){
var node=this.arrChildNode[i];
node.afterAdd();
}
}
rialto.widget.TreeNode.prototype.addNode=function(node){
if(node.fatherNode){
node.fatherNode.removeNode(node.id,true);
}
node.fatherNode=this;
this.arrChildNode.push(node);
this.DIVFILLE.appendChild(node.divExt);
if(this.open){
this.DIVCONTENU.style.display='block';
}
else{
this.DIVCONTENU.style.display='none';
}
if(this.refTree){
node.afterAdd();
if(this.hasChild()&&this.arrChildNode.length>1){
var beforelastNode=this.last().previous();
beforelastNode.changeIcone();
}
else{
this.changeIcone();
}
}
}
rialto.widget.TreeNode.prototype.insertBefore=function(node){
if(node.fatherNode){node.fatherNode.removeNode(node.id,true);}
node.fatherNode=this.fatherNode;
ind=rialto.array.indexOf(this.fatherNode.arrChildNode,this);
if(ind!=-1){
rialto.array.insert(this.fatherNode.arrChildNode,ind,node);
this.fatherNode.DIVFILLE.insertBefore(node.divExt,this.divExt);
}
if(this.fatherNode.refTree){
node.afterAdd();
}
}
rialto.widget.TreeNode.prototype.insertAfter=function(node){
if(this.isLast()){
this.fatherNode.addNode(node);
}
else{
var nodeP=this.next();
if(nodeP!=node){
nodeP.insertBefore(node);
}
}
}
rialto.widget.TreeNode.prototype.changeIcone=function(){
this.DIVT.style.display='none';
if(!this.refTree.withT){
if(this.hasChild()){
this.srcPlus=rialtoConfig.pathRialtoE+"images/imTreeview/icT/plus.gif";
this.srcMoins=rialtoConfig.pathRialtoE+"images/imTreeview/icT/minus.gif";
}
}
else{
if(this.isLast()||(this.isLast()&&this.isFirst())){
if(this.hasChild()){
this.srcPlus=rialtoConfig.pathRialtoE+"images/imTreeview/icT/Lplus.gif";
this.srcMoins=rialtoConfig.pathRialtoE+"images/imTreeview/icT/Lminus.gif";
}
else{
this.srcPlus=rialtoConfig.pathRialtoE+"images/imTreeview/icT/L.gif";
this.srcMoins=rialtoConfig.pathRialtoE+"images/imTreeview/icT/L.gif";
}
}
else{
if(this.hasChild()){
this.srcPlus=rialtoConfig.pathRialtoE+"images/imTreeview/icT/Tplus.gif";
this.srcMoins=rialtoConfig.pathRialtoE+"images/imTreeview/icT/Tminus.gif";
this.DIVT.style.display='block';
}
else{
this.srcPlus=rialtoConfig.pathRialtoE+"images/imTreeview/icT/T.gif";
this.srcMoins=rialtoConfig.pathRialtoE+"images/imTreeview/icT/T.gif";
}
}
}
if(this.open){
this.img1.style.background="url('"+this.srcMoins+"')";
this.img2.style.background="url('"+this.icon2+"')";
}
else{
this.img1.style.background="url('"+this.srcPlus+"')";
this.img2.style.background="url('"+this.icon+"')";
}
if(!this.refTree.withT){
if(this.hasChild()){
this.img1.style.visibility='visible';
}
else{
this.img1.style.visibility='hidden';
}
}
else{
this.img1.style.visibility='visible';
}
}
rialto.widget.TreeNode.prototype.isLast=function(){
if(!this.root){
return(this.fatherNode.arrChildNode[this.fatherNode.arrChildNode.length-1]==this);
}
else{return true};
}
rialto.widget.TreeNode.prototype.isFirst=function(){
if(!this.root){
return(this.fatherNode.arrChildNode[0]==this);
}
else{return true};
}
rialto.widget.TreeNode.prototype.first=function(){
if(this.hasChild()){
return(this.arrChildNode[0]);
}
else{return null};
}
rialto.widget.TreeNode.prototype.last=function(){
if(this.hasChild()){
return(this.arrChildNode[this.arrChildNode.length-1]);
}
else{return null};
}
rialto.widget.TreeNode.prototype.next=function(){
if(!this.root){
var index=rialto.array.indexOf(this.fatherNode.arrChildNode,this);
if(index<this.fatherNode.arrChildNode.length-1){
return this.fatherNode.arrChildNode[index+1];
}
else{return null};
}
else{return null};
}
rialto.widget.TreeNode.prototype.previous=function(){
if(!this.root){
var index=rialto.array.indexOf(this.fatherNode.arrChildNode,this);
if(index>0){
return this.fatherNode.arrChildNode[index-1];
}
else{return null};
}
else{return null};
}
rialto.widget.TreeNode.prototype.onclick=function(){
}
rialto.widget.TreeNode.prototype.onclickActionCommuneBefClic=function(){
}
rialto.widget.TreeNode.prototype.setStyle=function(obStyle){
for(prop in obStyle){
try{
this.divText.style[prop]=obStyle[prop];
}
catch(erreur){}
}
}
objFenWait.prototype.nbre=0;
function objFenWait(libel,url,idCont,idExtReq){
objFenWait.prototype.nbre=0;
rialto.session.objects["fenWait"]=this;
var oThis=this;
this.titre=libel;
widthGlobal=document.body.clientWidth;
heightGlobal=document.body.clientHeight;
var top=(heightGlobal/2)-60;
var left=(widthGlobal/2)-100;
if(url){
i=url.indexOf("?");
if(idCont){
this.urlStopServ=(i==-1)?url:url.substr(0,i);
this.urlStopServ=this.urlStopServ
+'?METHOD=STOP'
+'&FENID='+idCont
+'&IDEXTREQ='+idExtReq
}
else{
this.urlStopServ+='?METHOD=STOP';
}
}
if(objFenWait.prototype.fen){
this.fen=objFenWait.prototype.fen;
this.divLib=objFenWait.prototype.divLib;
this.text=objFenWait.prototype.text;
this.suffFond=objFenWait.prototype.suffFond;
this.fen.moveTo(top,left);
this.fen.reafficheFen();
this.BANN=objFenWait.prototype.BANN;
this.BANN.oCiu=this;
if(this.BANN.iframe){
this.BANN.iframe.masque();
traceExec('this.BANN.iframe.frame.style.width = '+this.BANN.iframe.frame.style.width,1);
traceExec('this.BANN.iframe.frame.style.height = '+this.BANN.iframe.frame.style.height,1);
}
}
else{
this.fen=new rialto.widget.Dialog("fen",top,left,200,90,""," ","transparent");
this.divLib=document.createElement("DIV");
this.divLib.className="libelle1";
this.divLib.style.position="absolute";
this.divLib.style.top="5px";
this.divLib.style.left="25px";
this.divLib.style.width="100%";
this.text=document.createTextNode(libel);
this.divLib.appendChild(this.text);
this.fen.add(this.divLib);
this.img=document.createElement("IMG");
this.img.src=rialtoConfig.pathRialtoE+"images/sablier.gif";
this.img.style.position="absolute";
this.img.style.height='35px';
this.img.style.width='27px';
this.img.style.left='75px';
this.img.style.top='22px';
this.fen.add(this.img);
var wBtn=50;
var hBtn=60;
this.BANN=new rialto.widget.Button(hBtn,wBtn,"ANNULER");
this.BANN.oCiu=this;
this.BANN.requete=function(){
var url=this.oCiu.urlStopServ;
if(!this.iframe){
this.iframe=new objFrame("ifr",0,0,0,0,hidden=true);
this.iframe.create(window.document);
}
traceExec('objFenWait.requete iframe.load url= '+url,1);
this.iframe.load(url);
}
this.BANN.onclick=function(){
this.oCiu.stopEnCours=true;
this.requete();
};
this.fen.add(this.BANN.getObjHtml());
objFenWait.prototype.fen=this.fen;
objFenWait.prototype.suffFond=this.suffFond;
objFenWait.prototype.divLib=this.divLib;
objFenWait.prototype.text=this.text;
objFenWait.prototype.BANN=this.BANN;
}
this.patiente();
}
objFenWait.prototype.patiente=function(){
var str="";
objFenWait.prototype.nbre+=1;
if(objFenWait.prototype.nbre>5){objFenWait.prototype.nbre=0;}
for(i=0;i<objFenWait.prototype.nbre;i++){
str+=".";
}
this.divLib.removeChild(this.divLib.firstChild);
str=this.titre+" "+str;
this.text=document.createTextNode(str);
this.divLib.appendChild(this.text);
this.time=window.setTimeout("rialto.session.objects[\"fenWait\"].patiente()",500);
}
objFenWait.prototype.arrete=function(modeStop){
if(this.stopEnCours&&(!modeStop))return;
this.stopEnCours=false;
if(rialto.session.objects["fenWait"]){
window.clearTimeout(rialto.session.objects["fenWait"].time);
rialto.session.objects["fenWait"].fen.masqueFen();
rialto.session.objects["fenWait"]=null;
}
}
rialto.widget.FenetreModale=function(nomFenFi
,top,left,width,height
,contenu,titreFenetre
,bWithBtonClose
,bMobile,bReDim
,suffFond
,modeAffContenu
,bWithSB
,zonesCtrlees
,oCiuLie
,modeMasque
)
{
if(arguments.length==0)return;
this.bModale=true;
var suffFond=suffFond||'gris';
this.suffFond=suffFond;
var masque;
masque=rialto.session?(rialto.session.masque?rialto.session.masque:null)
:null;
this.emprise=new Array;
if(!zonesCtrlees)
this.emprise[0]=window.document.body;
else
if(!zonesCtrlees instanceof Array)
this.emprise[0]=zonesCtrlees;
else
this.emprise=zonesCtrlees;
this.comportVerrouillage=MasqueZones;
masque=this.comportVerrouillage(suffFond,this.emprise,oCiuLie,modeMasque);
this.base=CadreFenetre;
this.base(nomFenFi,top,left,width,height,'auto'
,contenu,titreFenetre
,masque
,bWithSB
,0
,bWithBtonClose
,bMobile,bReDim
,modeAffContenu);
if(bMobile)
this.comportMobileFen();
if(bReDim)
this.comportReDimFen();
}
rialto.widget.FenetreModale.prototype=new CadreFenetre;
rialto.widget.FenetreModale.prototype.baseRemove=CadreFenetre.prototype.remove;
rialto.widget.FenetreModale.prototype.remove=function(){
this.baseRemove();
}
rialto.widget.PopUp=function(nomFenFi
,top,left,width,height
,contenu,titreFenetre
,suffFond
,modeContainer
,bSansBtonClose
,oCiuLie)
{
if(arguments.length==0)return;
this.typeFen='PopUp';
this.base=rialto.widget.FenetreModale;
this.base(nomFenFi,
top,left,width,height,
contenu,titreFenetre,
!bSansBtonClose,
true,false
,suffFond||'Gris'
,modeContainer
,false
,window.document.body
,oCiuLie
,'strict'
);
var activationEnd=rialto.widget.PopUp.prototype.afterActive;
var inactivationEnd=rialto.widget.PopUp.prototype.afterInactive;
this.arrChild=new Array;
}
rialto.widget.PopUp.prototype=new rialto.widget.FenetreModale;
rialto.widget.PopUp.prototype.baseRemove=CadreFenetre.prototype.remove;
rialto.widget.PopUp.prototype.remove=function(){
this.baseRemove();
if((this.container.nbElts()==0)
||((this.container.nbElts()==1)
&&(this.container.eltActif().reserve))
){
this.container.containerHtml.style.display='none';
}
for(var i=0;i<this.arrChild.length;i++){
if(this.arrChild[i].remove){
this.arrChild[i].remove(true);
}
}
}
rialto.widget.PopUp.prototype.afterActive=function(){
if(this.masque)
this.cadreExterne.removeChild(this.masque);
this.$$activeContent();
}
rialto.widget.PopUp.prototype.$$activeContent=rialto.widget.AbstractContainer.prototype.$$activeContent;
rialto.widget.PopUp.prototype.afterInactive=function(){
this.comportVerrouillage=MasqueZones;
this.masque=this.comportVerrouillage('transparent',this.cadreExterne);
}
rialto.widget.PopUp.prototype.reafficheFen=function(){
this.reserve=false;
this.cadreExterne.style.display='block';
this.eltContainer.className='ecranMasque'+this.suffFond;
this.eltContainer.style.display='block';
}
rialto.widget.PopUp.prototype.display=rialto.widget.PopUp.prototype.reafficheFen;
rialto.widget.PopUp.prototype.masqueFen=function(){
this.reserve=true;
this.cadreExterne.style.display='none';
this.eltContainer.style.display='none';
}
rialto.widget.PopUp.prototype.hidden=rialto.widget.PopUp.prototype.masqueFen;
rialto.widget.Dialog=function(nomFenFi
,top,left,width,height
,contenu,titreFenetre
,suffFond
,modeContainer
,emprise
,oCiuLie
)
{
if(arguments.length==0)return;
this.typeFen='Dialog';
this.base=rialto.widget.PopUp;
this.base(nomFenFi
,top,left,width,height
,contenu,titreFenetre
,suffFond||'Gris'
,modeContainer
,true
,emprise
,oCiuLie
);
}
rialto.widget.Dialog.prototype=new rialto.widget.PopUp;
rialto.widget.FenetreTop=function(nomFenFi,
top,left,width,height,
contenu,titreFenetre,bWithSB,
typePanelBtons,
bMobile,bReDim,
modeAffContenu,
bWithoutBtonClose,
optionsMode
)
{
traceExec('FenetreTop modeAffContenu= '+modeAffContenu,75);
if(arguments.length==0)return;
this.base=CadreFenetre;
this.base(nomFenFi,
top,left,width,height,'auto',contenu,titreFenetre,"_fenPrinc_",bWithSB,
typePanelBtons||'stdt',
!bWithoutBtonClose,
bMobile,bReDim,modeAffContenu,optionsMode);
document.onMouseDown=function(e){
stopDefault(e);
}
if(bMobile)
this.comportMobileFen();
if(bReDim)
this.comportReDimFen();
}
rialto.widget.FenetreTop.prototype=new CadreFenetre;
rialto.widget.Fenetre=function(nomFenFi
,top,left,width,height,heightExtern
,contenu,titreFenetre
,eltContainer
,bMobile,bReDim
,typePanelBtons
,bWithSB
,modeAffContenu
,optionsMode)
{
if(arguments.length==0)return;
this.base=CadreFenetre;
this.base(nomFenFi
,top,left,width,height,heightExtern
,contenu,titreFenetre
,eltContainer
,bWithSB
,typePanelBtons||'stdt'
,true
,bMobile,bReDim,modeAffContenu,optionsMode);
if(bMobile)
this.comportMobileFen();
if(bReDim)
this.comportReDimFen();
}
rialto.widget.Fenetre.prototype=new CadreFenetre;
rialto.widget.FenetreAjustExt=function(nomFenFi
,contenu,titreFenetre
,eltContainer
,bWithBtonMinMax
,bWithoutBtonClose
,modeAffContenu
,optionsMode)
{
if(arguments.length==0)return;
this.base=rialto.widget.Fenetre;
this.base(nomFenFi,
0,0,'100%','100%','100%',
contenu,titreFenetre,
eltContainer
,false,false
,bWithBtonMinMax?'1:Min-Max':'0'
,false
,modeAffContenu
,optionsMode
);
}
rialto.widget.FenetreAjustExt.prototype=new rialto.widget.Fenetre;
rialto.widget.objFenData=function(width,height,divData,titre){
var oThis=this;
widthGlobal=document.body.clientWidth;
heightGlobal=document.body.clientHeight;
var top=(heightGlobal/2)-120;
var left=(widthGlobal/2)-100;
this.fen=new rialto.widget.PopUp("fen",top,left,width,height,"",titre,"transparent");
this.divData=divData;
this.divData.className="libNormal";
this.divData.style.width=width-25;
this.divData.style.height=height-35;
this.divData.style.border="1px outset white";
this.divData.style.position="absolute";
this.divData.style.overflow="auto";
this.divData.style.top=5;
this.fen.add(this.divData);
this.fen.onClose=function(){oThis.onclose();};
var wBtn=parseInt(width)/2-50;
var hBtn=height-25;
this.BQUIT=new rialto.widget.Button(hBtn,wBtn,"Fermer","Fermer la fenetre");
this.BQUIT.onclick=function(){
oThis.onclose();
this.fen.closeFen();
};
this.BQUIT.fen=this.fen;
this.fen.add(this.BQUIT);
}
rialto.widget.objFenData.prototype.onclose=function(){
}
rialto.widget.Alert=function(mess){
this.message=mess;
var oThis=this;
widthGlobal=document.body.clientWidth;
heightGlobal=document.body.clientHeight;
var top=(heightGlobal/2)-120;
var left=(widthGlobal/2)-100;
this.width=getTailleTexte(mess)+40
if(this.width<200){this.width=200;};
this.fen=new rialto.widget.PopUp("fen",top,left,this.width,50,this.message,"Information","transparent");
var wBtn=parseInt(this.width)/2-57;
var hBtn=25;
this.BQUIT=new rialto.widget.Button(hBtn,wBtn,"Close","close the window");
this.BQUIT.onclick=function(){
oThis.onclose();
this.fen.closeFen();
};
this.BQUIT.fen=this.fen;
this.fen.add(this.BQUIT.getHtmlExt());
}
rialto.widget.Alert.prototype.onclose=function(){
}
rialto.onLoad=function(){
if(rialto.loaded){
return;
}
rialto.loaded=true;
rialto.session.oParameters=rialto.url.getObjectParameter();
rialto.appearence.initSkin();
if(rialto.config.isDebug
&&!rialto.config.isTestVersion){
fr=new Dashboard({title:'DEBUG WINDOW'});
initTrace(1,{traceMode:'oneLevel'},null,divTrace.oHtml);
}
__boot();
}
rialto.onUnLoad=function(){
rialto.session.removeAll();
return true;
}
if(rialtoConfig.userAgentIsIE){
if(document.body){
ria.utils.event.genericAddEvent(document.body,"readystatechange",rialto.onLoad);
}
else{
ria.utils.event.genericAddEvent(document,"readystatechange",rialto.onLoad);
}
}
else{
ria.utils.event.genericAddEvent(window,"load",rialto.onLoad);
}
ria.utils.event.genericAddEvent(window,"beforeunload",rialto.onUnLoad);
rialto.appearence={};
rialto.appearence.initSkin=function(){
if(!rialto.config.skinList)return;
rialto.appearence.currentSkin=rialtoConfig.skin||'standart';
var cssId=rialto.appearence.currentSkin
+'_'
+rialtoConfig.baseIdCssWithSkin;
var linkCss=document.getElementById(cssId);
if(linkCss)linkCss.disabled=false;
for(var i=0;i<rialtoConfig.skinList.length;i++){
var othCssId=rialtoConfig.skinList[i]
+'_'
+rialtoConfig.baseIdCssWithSkin;
linkCss=document.getElementById(othCssId);
if(linkCss)linkCss.disabled=(cssId!=othCssId);
}
}
rialto.appearence.setSkin=function(skin,isForcedUpdate){
if(!rialto.config.skinList)return;
traceExec('setSkin '+skin,73);
if(!isForcedUpdate
&&(skin==rialto.appearence.currentSkin))return;
var cssId=rialto.appearence.currentSkin
+'_'
+rialtoConfig.baseIdCssWithSkin;
document.getElementById(cssId).disabled=true;
rialto.appearence.currentSkin=skin;
cssId=rialto.appearence.currentSkin
+'_'
+rialtoConfig.baseIdCssWithSkin;
document.getElementById(cssId).disabled=false;
}
function __boot(){
widthGlobal=document.body.clientWidth;
heightGlobal=document.body.clientHeight;
document.onselectstart=function(){return false;};

document.onclick=function(){
if (objMenuCont.prototype.menuActif){objMenuCont.prototype.menuActif.masqueMenu();}
}
document.oncontextmenu=function(){
if (objMenuCont.prototype.menuActif){objMenuCont.prototype.menuActif.masqueMenu();}
return false;
}
document.body.style.overflow='hidden';
document.body.arrChild=new Array();
document.body.oRia=document.body;
document.body.id="body";
document.body.isContainer=true;
document.body.record=rialto.widget.AbstractContainer.prototype.record;
document.body.removeContents=rialto.widget.AbstractContainer.prototype.removeContents;
document.body.updateToContent=function(){};
document.body.resizeChilds=rialto.widget.AbstractContainer.prototype.resizeChilds;
document.body.remove=function(){
document.body.oRia=null;
document.onselectstart=null;
document.onclick=null;
document.oncontextmenu=null;
document.body.record=null;
document.body.removeContents=null;
document.body.updateToContent=null;
document.body.resizeChilds=null;
}
rialto.session.masque=document.createElement('DIV');
rialto.session.masque.style.display='none';
rialto.session.masque.style.width='100%';
rialto.session.masque.style.height='100%';
rialto.session.masque.style.zIndex=10000;
window.document.body.appendChild(rialto.session.masque);
rialto.session.masquePopupTop=document.createElement('DIV');
rialto.session.masquePopupTop.style.display='none';
rialto.session.masquePopupTop.style.width='100%';
rialto.session.masquePopupTop.style.height='100%';
rialto.session.masquePopupTop.style.zIndex=10000;
window.document.body.appendChild(rialto.session.masquePopupTop);
window.onresize=function(){
var over=document.body.style.overflow;
document.body.style.overflow='hidden';
document.body.resizeChilds();
document.body.style.overflow=over;
}
}

