isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function InitFloat(e){
  FloatAd=isIE ? "BODY" : "HTML";
  FloadAdX=isIE ? document.all.theLayer : document.getElementById("theLayer");
  AdFloatNow=isIE ? event.srcElement : e.target;
  while (AdFloatNow.id!="titleBar"&&AdFloatNow.tagName!=FloatAd){
    AdFloatNow=isIE ? AdFloatNow.parentElement : AdFloatNow.parentNode;
  }
  if (AdFloatNow.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(FloadAdX.style.left);
    nowY=parseInt(FloadAdX.style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}

function dd(e){
  if (!ddEnabled) return;
  FloadAdX.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx;
  FloadAdX.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;
}

function ddN4(PopAd){
  if (!isN4) return;
  N4=eval(PopAd);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function hideMe(){
  if (isIE||isNN) FloadAdX.style.visibility="hidden";
  else if (isN4) document.theLayer.visibility="hide";
}

function showMe(){
  if (isIE||isNN) FloadAdX.style.visibility="visible";
  else if (isN4) document.theLayer.visibility="show";
}

//Initial routine
document.onmousedown=InitFloat;
document.onmouseup=Function("ddEnabled=false");

//Create PopAd
CreatePopAd();

//Show PopAd x seconds later
ShowPopAddelay();


function ShowPopAddelay() {
delay = 1;    // time in seconds before floating ad appears
timer = setTimeout("theLayer.style.visibility='visible'", delay*1000);
}

function CreatePopAd() {
document.writeln('<DIV id="theLayer" style="position:absolute;width:150;left:0px;top:0px;visibility:hidden;">');
document.writeln('<table border="0" width="100%" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" style="border: 1px solid #630909">');
document.writeln('<tr><td width="100%">');
document.writeln('<table border="0" width="100%" cellspacing="0" cellpadding="0" height="36">');
document.writeln('<tr><td id="titleBar" style="cursor:move;background-color:#630909" width="100%" align="center">');
document.writeln('<ilayer width="100%" onSelectStart="return false">');
document.writeln('<layer width="100%" onMouseover="isHot=true;if (isN4) ddN4(theLayer)" onMouseout="isHot=false">');
document.writeln('<font face="Arial" color="#FFFFFF" size="1em"><b>Fermeture provisoire</b></font>');
document.writeln('</layer></ilayer></td>');
document.writeln('<td style="cursor:hand;background-color:#630909" valign="middle">');
document.writeln('<a href="#" onClick="hideMe();return false"><img src="closew.gif" border="0" align="middle"></a>');
document.writeln('</td></tr><tr><td width="100%" bgcolor="#ffffff" style="padding:0px" colspan="2">');
document.writeln('<TABLE WIDTH=100% ALIGN=CENTER BORDER=0 CELLPADDING=10 ');
document.writeln('CELLSPACING=0 BGCOLOR="#FFFFFF">');
document.writeln('<TR>');
document.writeln('<TD align=left style="border: 0px solid #630909"><FONT FACE="Arial" COLOR="#630909" size="1em"><br>El Restaurante está cerrado temporalmente por la jubilación de los dueños. Proximamente nueva dirección.<br><br>Le restaurant est fermé provisoirement pour cause de départ à la retraite. Nouvelle direction bientôt.<br><br>The restaurant is temporarily closed due to retirement. New management soon.<br><br>');
document.writeln('</FONT>');
document.writeln('</TD>');
document.writeln('</TR>');
document.writeln('</TABLE>');
document.writeln('');
document.writeln('</td></tr></table></td></tr></table></div>');
}
