/* BeOS window par E.D Prod 1998
   javascript-lab@nexen.net
   http://javascript-lab.nexen.net
   mise ŕ jour pour mozilla firefox : S.Leris 
   http://www.bluejayway.new.fr
Ajouts :
- compatibilité netscape.6+ mozilla/firefox.
- rollover sur bouton fermeture.
- titre personnalisable dans le lien.
*/
var ntsc =(document.getElementById && !document.all)
var ftx=800;var fty=500;
var fpx=0;var fpy=0;var fpxf=0;var fpxc=0;var tempobe=0;var toclose=0;var decax=0;var decay=0;var deplace=0;


function Mouvement(e) {
	Xpos = (ntsc)? e.pageX : event.clientX+document.body.scrollLeft;
	Ypos = (ntsc)? e.pageY : event.clientY+document.body.scrollTop;
  if (deplace!=0) {
  	if (deplace==1) 
	{
  		decax=Xpos-fpx;
  		decay=Ypos-fpy;
  		deplace=2;
  	}
 	  fpx=Xpos-decax;
 	  fpy=Ypos-decay;
 	  document.getElementById('fenetre').style.top=fpy;
 	  document.getElementById('fenetre').style.left=fpx;
 	  return false;
  }	
}
if(ntsc) 
document.captureEvents(Event.MOUSEMOVE); 
document.onmousemove = Mouvement;

function cliquer(flag) {
	deplace=flag;
	return false;
}
function beWindow(fpx,fpy,ftx,fty,z,fichier) {
var ftxb=210;var hide="hidden";

fchaine=''
+'<div id="fenetre" style="position:absolute;visibility:hidden;z-index:50;top:'+fpy+'px;left:'+fpx+'px;width:'+ftx+'px;height:'+(fty+21)+'px;bgcolor:#FFFFFF;border:0px solid red;">'
+'<div id="window" style="position:absolute;z-index:50;top:21px;left:0px;width:'+(ftx)+'px;height:'+(fty)+'px;">'
+'<div id="hg" style="position:absolute;z-index:50;top:0px;left:0px;width:10px;height:10px;"><img src="images/hg.gif" width="10" height="10"></div>'
+'<div id="hd" style="position:absolute;z-index:50;top:0px;left:'+(ftx-6)+'px;width:10px;height:10px;"><img src="images/hd.gif" width="10" height="10"></div>'
+'<div id="bg" style="position:absolute;z-index:50;top:'+(fty-6)+'px;left:0px;width:10px;height:10px;"><img src="images/bg.gif" width="10" height="10"></div>'
+'<div id="bd" style="position:absolute;z-index:50;top:'+(fty-6)+'px;left:'+(ftx-6)+'px;width:10px;height:10px;"><img src="images/bd.gif" width="10" height="10"></div>'
+'<div id="h" style="position:absolute;z-index:50;top:0px;left:6px;width:1px;height:10px;"><img src="images/h.gif" width="'+(ftx-12)+'" height="10"></div>'
+'<div id="b" style="position:absolute;z-index:50;top:'+(fty-6)+'px;left:6px;width:1px;height:10px;"><img src="images/b.gif" width="'+(ftx-12)+'" height="10"></div>'
+'<div id="g" style="position:absolute;z-index:50;top:6px;left:0px;width:10px;height:1px;"><img src="images/g.gif" width="10" height="'+(fty-12)+'"></div>'
+'<div id="d" style="position:absolute;z-index:50;top:6px;left:'+(ftx-6)+'px;width:10px;height:10px;"><img src="images/d.gif" width="10" height="'+(fty-12)+'"></div>'
+'</div>'
+'<div id="barre" style="position:absolute;z-index:50;top:0px;left:0px;width:'+(ftxb)+'px;height:21px;text-align:left;border:0px solid yellow;">'
+'<div id="titre" style="position:absolute;top:1px;border:0; width:'+(ftxb)+'; height:21px;padding-top:3px;background-image:url(images/tm.gif);gackground-repeat;repeat-x;font-size:12px;font-family:verdana, arial;color:#FFFF33;font-weight:normal;text-align:center;cursor:move;" onmousedown="return cliquer(1);" onmouseup="return cliquer(0);">'+z+'</div>'
+'<div style="position:absolute;z-index:50;top:1px;left:0px;"><IMG src="images/tl2.gif" style="border:0px; width:6px; height:21px;"></div>'
+'<div style="position:absolute;z-index:50;top:1px;left:0px;"><IMG src="images/tg.gif" style="border:0px; width:21px; height:21px;cursor:pointer;" onclick="closebe();" onMouseOver="this.src=\'images/tgs.gif\';" onMouseOut=this.src="images/tg.gif"></div>'
+'<div style="position:absolute;z-index:50;top:1px;left:'+(ftxb-6)+'px;"><IMG src="images/td.gif" style="border:0px; width:6px; height:21px;"></A></div>'
+'</div>'
+'<div id="interieur" style="position:absolute;z-index:50;top:27px;left:6px;width:'+(ftx-12)+'px;height:'+(fty-8)+'px;">'
+'<iframe name="inbeos" id="inbeos" TOP=0 LEFT=0 WIDTH='+(ftx-12)+' HEIGHT='+(fty-12)+' border=0 FRAMEBORDER=0 scrolling="auto" src="'+fichier+'"></iframe>'
+'</DIV>'
+'</div>'
+'</div>'
document.write(fchaine);
}
function slidebe() {
	if (toclose!=3) {
    fpx+=fpxc;
    if ((fpx>fpxf) && (toclose==0)) {fpx=fpxf;fpxc=0;toclose=3;}
    if (toclose==1) {fpxc=fpxc-5;}
    document.getElementById('fenetre').style.left=fpx;
    if (fpx<-800) {
      fpxc=0;fpx=800;toclose=0;
      inbeos.location.href="vide.htm";
      document.getElementById('fenetre').style.visibility="hidden";
    }
  }
  tempobe=setTimeout('slidebe();',5);
}
function apercu(fichier,titr) {
if (document.getElementById){
self.clearTimeout();self.clearInterval();
fpy= (document.all) ? document.body.scrollTop+(document.body.clientHeight/2)-205 : window.pageYOffset+(window.innerHeight/2)-250; // position haute fenetre
if(titr !=null)
document.getElementById('titre').innerHTML = titr;
document.getElementById('fenetre').style.top=fpy;
document.getElementById('fenetre').style.left=-200;
fpx=-200;
fpxf=(document.all) ? (document.body.clientWidth/2)-200 :(window.innerWidth/2)-200; ;
fpxc=50;
toclose=0;
document.getElementById('fenetre').style.visibility="visible";
inbeos.location.href=fichier;
}
else {myWindow=open(fichier, "newWindow", "width=800,height=500,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no");}
return false;
}

function closebe() {
fpxc=50;toclose=1;
return false;
}

if (document.getElementById){beWindow(0,0,800,500,"Bluejayway","vide.htm");slidebe();}


