function showPopUpServicio(sNombre,sFoto,sDescripcion)
{
  document.getElementById("imgFoto").src=document.getElementById("hPathImgServicios").value + "/" + sFoto;
  document.getElementById("tdDescripcion").innerHTML=sDescripcion;

  var sHTML=document.getElementById("divInfoServicio").innerHTML;
 
  floatPrestacion=new FloatingWindow("divPrestacion",5,200,600,500,"whiteSmoke",sHTML,true,sNombre);
  
  if(window.parent && window.parent.scrollTo)
  {
    var iOffset=posicionYPopUp();
    window.parent.scrollTo(0,iOffset+200);
  }
  if(window.parent && window.parent.checkFrameStateAndInit)
  {
    window.parent.checkFrameStateAndInit("divMain");
  }
  
}

function mostrarServicio(sNombre,sFoto,sDescripcion)
{
  showPopUpServicio(sNombre,sFoto,sDescripcion);  
  /*
  if(window.parent && window.parent.parent && window.parent.parent.showPopUpServicio)
  {
    window.parent.parent.showPopUpServicio(sNombre,sFoto,sDescripcion);
  }
  else
  {
    
  }
  */
}

function mostrarPopUpPrestacion()
{
  var iFrame=document.getElementById("ifrDetallePrestacion");
  if(iFrame && iFrame.contentWindow && iFrame.contentWindow.document && iFrame.contentWindow.document.body.innerHTML!="")
  {
    iFrame.style.display="";
    var sHtml=iFrame.contentWindow.document.body.innerHTML;
    if(window.parent)
    {
      var iOffset=posicionYPopUp();
      window.parent.scrollTo(0,iOffset + 200);
    }
    floatPrestacion=new FloatingWindow("divPrestacionInfo",5,200,600,500,"#D8E7E7",sHtml,true,"Prestación");
    iFrame=null;
  }
}

function posicionYPopUp()
{
  var iOffset=0;
  if(window.parent.document.getElementById("ifrDestinos"))
  {
    iOffset=getTotalTopOffset(window.parent.document.getElementById("ifrDestinos"));
  }
  else
  {
    if(window.parent.document.getElementById("ifrmContent"))
    {
      iOffset=getTotalTopOffset(window.parent.document.getElementById("ifrmContent"));
    } 
  }
  return(iOffset);
}

function mostrarPrestacion(iIndex)
{
  for(var x=1;x<2;x++)
  {
    if(x!=iIndex)
    {
      document.getElementById("divPrestacion" + x).style.display="none";
    }
  }
  if(document.getElementById("divPrestacion" + iIndex).style.display=="none")
  {
    document.getElementById("divPrestacion" + iIndex).style.display="";
  }
  else
  {
    document.getElementById("divPrestacion" + iIndex).style.display="none";
  }
  /*
  if(window.parent && window.parent.checkFrameStateAndInit)
  {
    window.parent.checkFrameStateAndInit("divMain");
  }
  */
}

function mostrarContenidoIframePrestacion(iIndex)
{
  document.getElementById("divPrestacion" + iIndex).appendChild(document.getElementById("ifrPrestacion" + iIndex).contentWindow.document.getElementById("tblPrestacion" + iIndex));
  if(!document.getElementById("divInfoServicio"))
  {
    document.getElementById("divMain").appendChild(document.getElementById("ifrPrestacion" + iIndex).contentWindow.document.getElementById("divInfoServicio"));
  }
}
