function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_timelineGoto(tmLnName, fNew, numGotos) { //v2.0
  //Copyright 1997 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (numGotos != null)
    if (tmLn.gotoCount == null) tmLn.gotoCount = 1;
    else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}
  jmpFwd = (fNew > tmLn.curFrame);
  for (i = 0; i < tmLn.length; i++) {
    sprite = (jmpFwd)? tmLn[i] : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back
    if (sprite.charAt(0) == "s") {
      numKeyFr = sprite.keyFrames.length;
      firstKeyFr = sprite.keyFrames[0];
      lastKeyFr = sprite.keyFrames[numKeyFr - 1];
      if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd
      for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);
      for (j=0; j<sprite.values.length; j++) {
        props = sprite.values[j];
        if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only
        else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range
        if (sprite.obj != null) {
          if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];
          else        sprite.obj[props.prop2][props.prop] = props[propNum];
      } }
    } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
  }
  tmLn.curFrame = fNew;
  if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');
}
function MM_timelinePlay(tmLnName, myID) { //v1.2
  //Copyright 1997 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
  if (myID == tmLn.ID) { //if Im newest
    setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j]; 
              if (numKeyFr != props.length) {
              if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  } }
}

function MM_initTimelines() {
    //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
    var ns = navigator.appName == "Netscape";
    document.MM_Time = new Array(3);
    document.MM_Time[0] = new Array(1);
    document.MM_Time["Timeline2"] = document.MM_Time[0];
    document.MM_Time[0].MM_Name = "Timeline2";
    document.MM_Time[0].fps = 20;
    document.MM_Time[0][0] = new String("behavior");
    document.MM_Time[0][0].frame = 35;
    document.MM_Time[0][0].value = "MM_timelineGoto('Timeline2','1')";
    document.MM_Time[0].lastFrame = 35;
    document.MM_Time[1] = new Array(0);
    document.MM_Time["Timeline3"] = document.MM_Time[1];
    document.MM_Time[1].MM_Name = "Timeline3";
    document.MM_Time[1].fps = 15;
    document.MM_Time[1].lastFrame = 0;
    document.MM_Time[2] = new Array(0);
    document.MM_Time["Timeline4"] = document.MM_Time[2];
    document.MM_Time[2].MM_Name = "Timeline4";
    document.MM_Time[2].fps = 15;
    document.MM_Time[2].lastFrame = 0;
    for (i=0; i<document.MM_Time.length; i++) {
        document.MM_Time[i].ID = null;
        document.MM_Time[i].curFrame = 0;
        document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
    }
}

//////

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

/<!-- ////

/* BeOS window par E.D Prod 1998
   etiennedeb@ifrance.com
   
*/
var navigateur=navigator.appName;var abrege=navigateur.substring(0,2);
var ftx=450;var fty=380;
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() {
	Xpos = event.clientX+document.body.scrollLeft;
	Ypos = 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.all.fenetre.style.top=fpy;
 	  document.all.fenetre.style.left=fpx;
 	  return false;
  }	
}

document.onmousemove = Mouvement;

function cliquer(flag) {
	deplace=flag;
	return false;
}

function beWindow(fpx,fpy,ftx,fty,ftitre,fichier) {
var ftxb=130;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+'px;bgcolor:#0000ff;">'
+'<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:6px;height:6px;"><img src="/img/hg.gif" width="6" height="6"></div>'
+'<div id="hd" style="position:absolute;z-index:50;top:0px;left:'+(ftx-6)+'px;width:6px;height:6px;"><img src="/img/hd.gif" width="6" height="6"></div>'
+'<div id="bg" style="position:absolute;z-index:50;top:'+(fty-6)+'px;left:0px;width:6px;height:6px;"><img src="/img/bg.gif" width="6" height="6"></div>'
+'<div id="bd" style="position:absolute;z-index:50;top:'+(fty-6)+'px;left:'+(ftx-6)+'px;width:6px;height:6px;"><img src="/img/bd.gif" width="6" height="6"></div>'
+'<div id="h" style="position:absolute;z-index:50;top:0px;left:6px;width:1px;height:6px;"><img src="/img/h.gif" width="'+(ftx-10)+'" height="6"></div>'
+'<div id="b" style="position:absolute;z-index:50;top:'+(fty-6)+'px;left:6px;width:1px;height:6px;"><img src="/img/b.gif" width="'+(ftx-10)+'" height="6"></div>'
+'<div id="g" style="position:absolute;z-index:50;top:6px;left:0px;width:6px;height:1px;"><img src="/img/g.gif" width="6" height="'+(fty-10)+'"></div>'
+'<div id="d" style="position:absolute;z-index:50;top:6px;left:'+(ftx-6)+'px;width:6px;height:1px;"><img src="/img/d.gif" width="6" height="'+(fty-10)+'"></div>'
+'</div>'
+'<div id="titre" style="position:absolute;z-index:50;top:1px;left:0px;width:'+(ftx)+'px;height:21px;" onmousedown="return cliquer(1);" onmouseup="return cliquer(0);">'
+'<table CELLPADDING="0" CELLSPACING="0" border="0" width="'+(ftxb)+'" height="21"><tr><td background="/img/tm.gif"><FONT FACE="verdana" SIZE=1><B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+ftitre+'</B></FONT></td></tr></table>'
+'<div style="position:absolute;z-index:50;top:0px;left:0px;"><a href="#" onclick="javascript:return closebe();"><IMG src="/img/crc.gif" BORDER="0" WIDTH=21 HEIGHT=21></A></div>'
+'<div style="position:absolute;z-index:50;top:0px;left:'+(ftxb-4)+'px;"><IMG src="/img/td.gif" BORDER=0 WIDTH=4 HEIGHT=21></div>'
+'</div>'
+'<div id="interieur" style="position:absolute;z-index:50;top:27px;left:6px;width:'+(ftx-12)+'px;height:'+(fty-12)+'px;">'
+'<iframe name="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-20;}
    document.all.fenetre.style.left=fpx;
    if (fpx<-700) {
      fpxc=0;fpx=700;toclose=3;
      inbeos.location.href="attesa.htm";
      document.all.fenetre.style.visibility="hidden";
    }
  }
  tempobe=setTimeout('slidebe();',5);
}
function apercu(fichier) {
if (abrege=="Mi"){
self.clearTimeout();self.clearInterval();
fpy=document.body.scrollTop+(document.body.clientHeight/2)-200;
document.all.fenetre.style.top=fpy;
document.all.fenetre.style.left=-700;fpx=-700;fpxf=(document.body.clientWidth/2)-200;fpxc=100;toclose=0;
document.all.fenetre.style.visibility="visible";
inbeos.location.href=fichier;
// -->

larghezza=190;
altezza=190;
X=455;
Y=50;
MyWindow = eval
("window.open('/agent/merlino_news.html','85','scrollbars=no, resizable=no, width="+larghezza+",height="+altezza+",status=no,location=no,toolbars=no, top="+X+",left="+Y+"')"); 

}
else {myWindow=open(fichier, "newWindow", "width=450,height=380,menubar=no,resizable=no,scrollbars=YES,status=no,toolbar=no");}
return false;
}
function closebe() {
fpxc=80;toclose=1;
return false;
}
function CreerFenetreBe() {
  if (abrege=="Mi"){beWindow(0,0,450,380,"NEWS","attesa.htm");slidebe();}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////   aperture window
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var winMax='xx'
function apri(winURL,winMax)
{
window.open(winURL,winMax,'location=0,toolbar=0,status=0,scrollbars=1,resizable=1,width=760,height=350,top=20,left=30')
}

function apri2(winURL,winMax)
{
window.open(winURL,winMax,'location=0,toolbar=0,status=0,scrollbars=0,resizable=1,width=200,height=230,top=80,left=250')
}

function aprifree(winURL,winMax,winFeatures)
{
window.open(winURL,winMax,winFeatures)
}

function apri_sound(winURL,winMax)
{
window.open(winURL,winMax,'menubar=0,location=0,toolbar=0,status=0,scrollbars=1,resizable=1,width=240,height=170')
}
function apri_agent(Path)
{
larghezza=150;
altezza=100;
X=505;
Y=515;
MyWindow = eval
("window.open(Path,'1','scrollbars=no, resizable=no, width="+larghezza+",height="+altezza+",status=no,location=no,toolbars=no, top="+X+",left="+Y+"')"); 

}

function show(id) {
	document.getElementById(id).style.visibility = "visible";
}

function hide(id) {
	document.getElementById(id).style.visibility = "hidden";
}
//  per movimento layer con posizioni dinamiche chiamate con click
floatX=10;
floatY=10;
layerwidth=550;
layerheight=350;
halign="center";
valign="center";
delayspeed=3;

NS6=false;
IE4=(document.all);
if (!IE4) {NS6=(document.getElementById);}
NS4=(document.layers);

function adjust() {
if ((NS4) || (NS6)) {
if (lastX==-1 || delayspeed==0)
{
lastX=window.pageXOffset + floatX;
lastY=window.pageYOffset + floatY;
}
else
{
var dx=Math.abs(window.pageXOffset+floatX-lastX);
var dy=Math.abs(window.pageYOffset+floatY-lastY);
var d=Math.sqrt(dx*dx+dy*dy);
var c=Math.round(d/10);
if (window.pageXOffset+floatX>lastX) {lastX=lastX+delayspeed+c;}
if (window.pageXOffset+floatX<lastX) {lastX=lastX-delayspeed-c;}
if (window.pageYOffset+floatY>lastY) {lastY=lastY+delayspeed+c;}
if (window.pageYOffset+floatY<lastY) {lastY=lastY-delayspeed-c;}
}
if (NS4){
document.layers['floatlayer'].pageX = lastX;
document.layers['floatlayer'].pageY = lastY;
}
if (NS6){
document.getElementById('floatlayer').style.left=lastX;
document.getElementById('floatlayer').style.top=lastY;
}
}
else if (IE4){
if (lastX==-1 || delayspeed==0)
{
lastX=document.body.scrollLeft + floatX;
lastY=document.body.scrollTop + floatY;
}
else
{
var dx=Math.abs(document.body.scrollLeft+floatX-lastX);
var dy=Math.abs(document.body.scrollTop+floatY-lastY);
var d=Math.sqrt(dx*dx+dy*dy);
var c=Math.round(d/10);
if (document.body.scrollLeft+floatX>lastX) {lastX=lastX+delayspeed+c;}
if (document.body.scrollLeft+floatX<lastX) {lastX=lastX-delayspeed-c;}
if (document.body.scrollTop+floatY>lastY) {lastY=lastY+delayspeed+c;}
if (document.body.scrollTop+floatY<lastY) {lastY=lastY-delayspeed-c;}
}
document.all['floatlayer'].style.posLeft = lastX;
document.all['floatlayer'].style.posTop = lastY;
} 
setTimeout('adjust()',50);
}

function define()
{
if ((NS4) || (NS6)) 
{ 
if (halign=="left") {floatX=ifloatX};
if (halign=="right") {floatX=window.innerWidth-ifloatX-layerwidth-20};
if (halign=="center") {floatX=Math.round((window.innerWidth-20)/2)-Math.round(layerwidth/2)};
if (valign=="top") {floatY=ifloatY};
if (valign=="bottom") {floatY=window.innerHeight-ifloatY-layerheight};
if (valign=="center") {floatY=Math.round((window.innerHeight-20)/2)-Math.round(layerheight/2)};
}
if (IE4) 
{
if (halign=="left") {floatX=ifloatX};
if (halign=="right") {floatX=document.body.offsetWidth-ifloatX-layerwidth-20}
if (halign=="center") {floatX=Math.round((document.body.offsetWidth-20)/2)-Math.round(layerwidth/2)}
if (valign=="top") {floatY=ifloatY};
if (valign=="bottom") {floatY=document.body.offsetHeight-ifloatY-layerheight}
if (valign=="center") {floatY=Math.round((document.body.offsetHeight-20)/2)-Math.round(layerheight/2)}
}
}
//-->
