
var Fenetre=function(id,content,cheminimg,width,height,left,top,title){this.ID=id;this.Content=content;this.lechemindesimages=cheminimg;this.largeur=width;this.hauteur=height;this.positionY=top;this.positionX=left;this.title=title;this.madiv=null;this.contentdiv=null;this.isMinimize=false;this.sourisX=null;this.sourisY=null;this.droitdebouger=false;this.altminimize='minimize';this.altclose='close';}
Fenetre.prototype.retailler=function(w,h){this.largeur=w;this.hauteur=h;document.getElementById(this.ID).style.width=this.largeur+'px';document.getElementById('Content_'+this.ID).style.height=this.hauteur+'px';document.getElementById('TopBar_'+this.ID).style.width=this.largeur+'px';document.getElementById('iframe'+this.ID).style.width=this.largeur+2+'px';document.getElementById('iframe'+this.ID).style.height=this.hauteur+42+'px';}
Fenetre.prototype.deplacer=function(x,y){this.positionX=x;this.positionY=y;document.getElementById(this.ID).style.top=this.positionY+'px';document.getElementById(this.ID).style.left=this.positionX+'px';}
Fenetre.prototype.afficher=function(){var div=document.createElement('DIV');div.className='windows_jeff';div.style.top=this.positionY+'px';div.style.left=this.positionX+'px';div.style.width=this.largeur+'px';div.id=this.ID;var topDiv=document.createElement('DIV');topDiv.className='windows_jeff_top';topDiv.id='TopBar_'+this.ID;topDiv.target=this;document.documentElement.target=this;document.documentElement.onmouseup=function(){this.target.stopmove();}
topDiv.onmouseup=function(){this.target.stopmove();}
topDiv.onmousedown=function(){this.target.startmove();}
topDiv.style.width=this.largeur+'px';var buttonDiv=document.createElement('DIV');buttonDiv.className='top_buttons';var img=document.createElement('IMG');img.id='UnicityClosedButn'+this.ID;img.src=this.lechemindesimages+'close.gif';img.className='closeButton';img.target=this;img.alt=this.altclose;img.onclick=function(){this.target.detruire();};buttonDiv.appendChild(img);var img=document.createElement('IMG');img.src=this.lechemindesimages+'top_right2.gif';img.style.height='30px';img.style.width='5px';img.className='decoDroite';buttonDiv.appendChild(img);topDiv.appendChild(buttonDiv);var img=document.createElement('IMG');img.src=this.lechemindesimages+'top_left2.gif';img.align='left';topDiv.appendChild(img);var titlewindow=document.createTextNode(this.title);topDiv.appendChild(titlewindow);topDiv.onselectstart=function(){return false;};div.appendChild(topDiv);var middleDiv=document.createElement('DIV');middleDiv.className='windows_jeff_Middle';div.appendChild(middleDiv);var contentDiv=document.createElement('DIV');contentDiv.style.height=this.hauteur+'px';contentDiv.id='Content_'+this.ID;contentDiv.className='windows_jeff_Content';middleDiv.appendChild(contentDiv);var bottomDiv=document.createElement('DIV');bottomDiv.className='windows_jeff_bottom';div.appendChild(bottomDiv);this.madiv=div;patchiframe=document.createElement('IFRAME');patchiframe.className='windows_jeff';patchiframe.style.border='0px';patchiframe.style.top=this.positionY+'px';patchiframe.style.left=this.positionX-1+'px';patchiframe.style.width=this.largeur+2+'px';patchiframe.style.height=this.hauteur+42+'px';patchiframe.id='iframe'+this.ID;patchiframe.style.Zindex=185;document.body.appendChild(patchiframe);document.body.appendChild(div);};Fenetre.prototype.detruire=function(){try{this.madiv.parentNode.removeChild(this.madiv);document.body.removeChild(document.getElementById('iframe'+this.ID));}
catch(e){var mess_error=e.message;}};Fenetre.prototype.minimize=function(){if(this.isMinimize){this.isMinimize=false;document.getElementById('Content_'+this.ID).style.display='block';document.getElementById('minimize_'+this.ID).src=this.lechemindesimages+'minimize.gif';document.getElementById('iframe'+this.ID).style.height=document.getElementById(this.ID).offsetHeight+'px';}
else{this.isMinimize=true;document.getElementById('Content_'+this.ID).style.display='none';document.getElementById('iframe'+this.ID).style.height=document.getElementById(this.ID).offsetHeight+'px';}};Fenetre.prototype.cache=function(){document.getElementById(this.ID).style.display='none';document.getElementById('iframe'+this.ID).style.display='none';};Fenetre.prototype.startmove=function(){souX=x;souY=y;id=this.ID;posX=this.positionX;posY=this.positionY;droitdebouger=true;};Fenetre.prototype.stopmove=function(){if(droitdebouger){this.positionX=posX-souX+x;this.positionY=posY-souY+y;document.getElementById('iframe'+this.ID).style.height=document.getElementById(this.ID).offsetHeight+'px';if(this.positionY>0){document.getElementById(this.ID).style.top=this.positionY+'px';document.getElementById('iframe'+this.ID).style.top=this.positionY-1+'px';}
if(this.positionX>0){document.getElementById(this.ID).style.left=this.positionX+'px';document.getElementById('iframe'+this.ID).style.left=this.positionX-1+'px';}
droitdebouger=false;}};Fenetre.prototype.addContent=function(content){try{lediv=document.getElementById('Content_'+this.ID);lediv.appendChild(content);}
catch(e){var mess_error=e.message;}};Fenetre.prototype.delContent=function(content){try{lediv=document.getElementById('Content_'+this.ID);while(letr.firstChild){letr.removeChild(letr.firstChild);}}
catch(e){var mess_error=e.message;}};Fenetre.prototype.setTitle=function(title){this.title=title;};var y;var x;var droitdebouger=false;var id;var posX;var posY;var souX;var souY;var DocRef;function get_position(e){if(e&&e.target){x=e.pageX;y=e.pageY;}
else{x=event.clientX+DocRef.scrollLeft-2;y=event.clientY+DocRef.scrollTop-2;}
if(droitdebouger){document.getElementById('iframe'+id).style.left=posX-souX-1+x+'px';document.getElementById(id).style.left=posX-souX+x+'px';document.getElementById('iframe'+id).style.top=posY-souY-1+y+'px';document.getElementById(id).style.top=posY-souY+y+'px';document.getElementById('iframe'+id).style.height=document.getElementById(id).offsetHeight+'px';}}
function cancelEvent(){return!droitdebouger;}
function getLeft(l){if(l.offsetParent)return(l.offsetLeft+getLeft(l.offsetParent));else return(l.offsetLeft);}
function getTop(l){if(l.offsetParent)return(l.offsetTop+getTop(l.offsetParent));else return(l.offsetTop);}
var oldwindowonload=document.onload;window.onload=function(){if(document.documentElement&&document.documentElement.clientWidth){DocRef=document.documentElement;}
else{DocRef=document.body;}
DocRef.onmousemove=get_position;var oldondragstart=DocRef.ondragstart;if(typeof DocRef.ondragstart!='function'){DocRef.ondragstart=cancelEvent;}
else{DocRef.ondragstart=function(){oldondragstart();cancelEvent();}}
var oldonselectstart=DocRef.onselectstart;if(typeof DocRef.onselectstart!='function'){DocRef.onselectstart=cancelEvent;}
else{DocRef.onselectstart=function(){oldonselectstart();cancelEvent();}}
if(typeof oldwindowonload=='function'){oldwindowonload();}}