/***********************************************************************************************/
/*    Nombre del archivo:  SitioJavaS.js                                                       */
/*    Descripcion: Archivo JavaScript que contiene solamente las validaciones correspondientes */
/*                 al Sitio Royal&SunAlliance, así como rutinas que eficienten los procesos    */
/*                 html estáticos.                                                             */
/*    Fecha de creación: 16/06/20003                                                           */
/*    Fecha de última actualización: 16/06/2003                                                */
/*    @author:   Edgar Mejia Almaguer                                                          */
/*                                                                                             */
/*    Fecha	   Referencia  Nombre de quien realiza el cambio  Cambio                       */
/*   -----------   ----------  ---------------------------------  ---------------------------- */
/*    23/06/2003   MEAE01      Edgar Mejia Almaguer               Creación del Archivo         */
/*                                                                                             */
/***********************************************************************************************/

var browser = navigator.appName;

  function refreshMenu( pMenuAsociado, pPaginaDesp ) {

    parent.sfmmnuxml.document.forms[0].menuDisplay.value = pMenuAsociado;
    parent.sfmmnuxml.document.forms[0].submit();
    location.href = pPaginaDesp;

  }

  function refreshMenu2( pMenuAsociado, pPaginaDesp ) {
    isIE = (browser == 'Microsoft Internet Explorer') ? 1 : 0;
    isNS = (browser == 'Netscape') ? 1 : 0;
    if (isIE) {
      parent.document.frames("sfmmnuxml").document.forms[0].menuDisplay.value = pMenuAsociado;
      parent.document.frames("sfmmnuxml").document.forms[0].submit();
    } else if (isNS) {
      parent.sfmmnuxml.document.forms[0].menuDisplay.value = pMenuAsociado;
      parent.sfmmnuxml.document.forms[0].submit();
      parent.sfmwork.location.href = pPaginaDesp;
    }
  }

  function resizeIframe(ban) {
	document.images['banner'].src=ban;
  }

  function mOut(objParam, campo, celda, liga) {
           objParam.className = campo;
           document.all[(celda+1)].className=liga;
  }

  function irTag(targ,selObj,restore) {
         if( document.all['ciudades'].value=='' ) return;
           eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
           if (restore) selObj.selectedIndex=0;
  }


  /////////////////////////////////////////////////
  // Coalesys WebMenu for ASP.NET IE5/IE6 DHTML script
  // Build 58 COPYRIGHT 2000-2002 Coalesys, Inc.
  /////////////////////////////////////////////////

  var cswmOM="document.all.";
  var cswmBgCo=".style.backgroundColor";
  var cswmCo=".style.color";
  var cswmDi=".style.display";
  var cswmTI="";
  var cswmClkd=-1;
  var cswmPI=new Array();
  var cswmPx=new Array();
  var cswmPy=new Array();
  var cswmPW=0;var cswmPH=0;
  var cswmSPnt="";
  var cswmDir="";
  var cswmMB=0;
  var cswmSI="";
  var cswmSE=new Object();
  var cswmSEL=0;
  var cswmSET=0;
  var cswmSEH=0;
  var cswmSEW=0;
  var cswmBW=0;
  var cswmBH=0;
  var cswmAR=0;
  var cswmAB=0;
  var cswmSLA=0;
  var cswmSTA=0;
  var cswmExIS="img/arrow-black.gif";
  var cswmExdIS="img/arrow-black.gif";
  var cswmCTH=0;
  var cswmXOff=0;
  var cswmYOff=0;
  var cswmFP=0;
  var cswmSH=false;
  var cswmSTI=0;
  var cswmSdw = new Array();

  var edValue = 0;

  function cswmT(ms)
   {if(ms!="off")
      {if(cswmCTH==0)
         {cswmTI=setTimeout("cswmHP(0);cswmClkd=-1;",ms);}
      }
    else
      {clearTimeout(cswmTI);}
  }

  function cswmST(l,g,i)
   {if(i)
      {cswmHP(l);cswmSP(g,i);}
    else if(l)
      {cswmHP(l);}
   }

  function cswmShow(id,srcid,relpos,offsetX,offsetY,fixedpos)
   {clearTimeout(cswmTI);
   if(cswmClkd!=id)
     {   if(!edValue) cswmHP(0);
         cswmSI=srcid;cswmSPnt=relpos;cswmClkd=id;cswmDir="right";
     if(document.all["cswmPopup"+id])
      {if(offsetX)
         cswmXOff=offsetX;
         if(offsetY)
            cswmYOff=offsetY;
            if(fixedpos)
               cswmFP=fixedpos;cswmSP(id);
      }
     }
  }
  function cswmHide()
   {cswmTI=setTimeout("if(!edValue) cswmHP(0); cswmClkd=-1;", 350);}

  function cswmHiI(id,bgco)
   {if(document.all["cswmIcoOn"+id])
      {document.all["cswmIco"+id].style.display="none";document.all["cswmIcoOn"+id].style.display="inline";
      }
    document.all["cswmItem"+id].style.color="#ffffff";document.all["cswmExpand"+id].style.color="#ffffff";
    if(bgco!=null)
       {document.all["cswmItem"+id].style.backgroundColor=bgco;document.all["cswmExpand"+id].style.backgroundColor=bgco;
       }
    else
       {document.all["cswmItem"+id].style.backgroundColor="#7e919e";document.all["cswmExpand"+id].style.backgroundColor="#7e919e";
       }
    if(document.all["cswmExpandIc"+id])
       {document.all["cswmExpandIc"+id].src=cswmExdIS;
       }
  }
  function cswmDiI(id,bgco)
   {if(document.all["cswmIcoOn"+id])
      {document.all["cswmIco"+id].style.display="inline";document.all["cswmIcoOn"+id].style.display="none";
      }
    document.all["cswmItem"+id].style.color="#000000";document.all["cswmExpand"+id].style.color="#000000";
    if(bgco!=null)
      {document.all["cswmItem"+id].style.backgroundColor=bgco;document.all["cswmExpand"+id].style.backgroundColor=bgco;
      }
    else
      {document.all["cswmItem"+id].style.backgroundColor="#d6dee4";document.all["cswmExpand"+id].style.backgroundColor="#d6dee4";
      }
    if(document.all["cswmExpandIc"+id])
      {document.all["cswmExpandIc"+id].src=cswmExIS;
      }
  }
  function cswmHideSelectBox(boolHide,arrSelectList)
   {if(navigator.platform!="MacPPC")
      {if(arrSelectList)
         {document.cswmSelects=new Array();var SelectID=new String();var iCount=0;for(iCount=0;iCount<arrSelectList.length;iCount++){SelectID=arrSelectList[iCount];document.cswmSelects[iCount]=document.all[SelectID];}}
       if(!document.cswmSelects)
         {document.cswmSelects=new Array();}
       if(boolHide==true && !cswmSH)
       {document.cswmSelects=new Array();var iCount=0;var iCount2=0;var Selects = document.getElementsByTagName("select");for(iCount=0;iCount<Selects.length;iCount++){if(Selects[iCount].style.visibility != "hidden"){document.cswmSelects[iCount2]=Selects[iCount];iCount2++;}}}
        var iCount=0;
        if(boolHide==true){for(iCount=0;iCount<document.cswmSelects.length;iCount++){document.cswmSelects[iCount].style.visibility="hidden";}cswmSH=true;}
        if(boolHide==false){for(iCount=0;iCount<document.cswmSelects.length;iCount++){document.cswmSelects[iCount].style.visibility="visible";}cswmSH=false;}
      }
  }
  function cswmSP(id,itemid){
     if(!itemid){
         if(cswmFP){
            cswmSEL=cswmXOff;
            cswmSET=cswmYOff;
            cswmSEH=1;
            cswmSEW=1;
            cswmFP=0;
         } else {
           if(!document.all[cswmSI]){return;}
           cswmSE=new Object(document.all[cswmSI]);
           var cswmPrO=cswmSE;var cswmPrT="";
           cswmSEL=cswmSE.offsetLeft+cswmXOff;
           cswmSET=cswmSE.offsetTop+cswmYOff;
           cswmSEH=cswmSE.offsetHeight;
           cswmSEW=cswmSE.offsetWidth;
           while(cswmPrT!="BODY"){
               cswmPrO=cswmPrO.offsetParent;cswmSEL+=cswmPrO.offsetLeft;cswmSET+=cswmPrO.offsetTop;cswmPrT=cswmPrO.tagName;
           }
           if(navigator.platform=="MacPPC"){
              cswmSEL+=Number(document.body.leftMargin);
              cswmSET+=Number(document.body.topMargin);}
           }
           document.all["cswmPopup"+id].style.display="block";
           cswmPW=document.all["cswmPopup"+id].clientWidth;
           cswmPH=document.all["cswmPopup"+id].clientHeight;
           cswmBW=document.body.clientWidth;
           cswmBH=document.body.clientHeight;
           cswmSLA=document.body.scrollLeft;
           cswmSTA=document.body.scrollTop;
              switch(cswmSPnt){
                case "above":cswmPx[cswmPx.length]=cswmSEL;cswmPy[cswmPy.length]=cswmSET-cswmPH;cswmCA();cswmCR();break;
                case "below":cswmPx[cswmPx.length]=cswmSEL;cswmPy[cswmPy.length]=cswmSET+cswmSEH;cswmCB();cswmCR();break;
                case "right":cswmPx[cswmPx.length]=cswmSEL+cswmSEW;cswmPy[cswmPy.length]=cswmSET;cswmCR();cswmCB();break;
                case "left":cswmPx[cswmPx.length]=cswmSEL-cswmPW;cswmPy[cswmPy.length]=cswmSET;cswmCL();cswmCB();cswmDir="left";break;
              }
              cswmXOff=0;cswmYOff=0;
              document.all["cswmPopup"+id].style.left=cswmPx[cswmPx.length-1];
              document.all["cswmPopup"+id].style.top=cswmPy[cswmPy.length-1];
              cswmPI[cswmPI.length]=id;}else{cswmPx[cswmPx.length]=document.all["cswmPopup"+cswmPI[cswmPI.length-1]].clientWidth+cswmPx[cswmPx.length-1]-4;var szPrE="";if(document.all["cswmItem"+itemid].parentElement.offsetTop==0){if(navigator.platform=="MacPPC"){var szPrE="parentElement.parentElement.";}else if(document.all["cswmItem"+itemid].parentElement.parentElement.parentElement.parentElement.className!="cswmPopupBox"){var szPrE="parentElement.parentElement.parentElement.";}}cswmPy[cswmPy.length]=eval(cswmOM+"cswmItem"+itemid+".parentElement."+szPrE+"offsetTop")+cswmPy[cswmPy.length-1];document.all["cswmPopup"+id].style.display="block";
              cswmPW=document.all["cswmPopup"+id].clientWidth;
              cswmPH=document.all["cswmPopup"+id].clientHeight;
              var cswmPrW=document.all["cswmPopup"+cswmPI[cswmPI.length-1]].clientWidth;
              cswmAR=cswmBW-cswmPx[cswmPx.length-1]+cswmSLA;cswmAB=cswmBH-cswmPy[cswmPy.length-1]+cswmSTA;if(cswmPx[cswmPx.length-2]==cswmSLA){cswmDir="right";}if((cswmAR<cswmPW)||(cswmDir=="left")){cswmMB=(cswmPx[cswmPx.length-1]-cswmPW-cswmPrW)+8;if((cswmMB>=0)&&(cswmMB>cswmSLA)){cswmDir="left";}else{cswmMB=cswmSLA;}cswmPx[cswmPx.length-1]=cswmMB;}if(cswmAB<cswmPH){cswmMB=cswmPy[cswmPy.length-1]-(cswmPH-cswmAB);if(cswmMB<0){cswmMB=cswmSTA;}cswmPy[cswmPy.length-1]=cswmMB;}document.all["cswmPopup"+id].style.left=cswmPx[cswmPx.length-1];document.all["cswmPopup"+id].style.top=cswmPy[cswmPy.length-1];cswmPI[cswmPI.length]=id;}if(navigator.platform!="MacPPC"){cswmMS(id);}}

  function cswmHP(level){
  if(level==0){}
  var count=level;
  for(count=level;count<cswmPI.length;count++){
     document.all["cswmPopup"+cswmPI[count]].style.display="none";
  }
  if(level==0&&cswmPI.length>0){}
  cswmPI.length=level;
  cswmPx.length=level;
  cswmPy.length=level;

  if(navigator.platform!="MacPPC"){cswmDS(level);}}

  function cswmCR(){cswmAR=(cswmBW+cswmSLA)-cswmPx[cswmPx.length-1];if(cswmAR<cswmPW+4){if(cswmSPnt=="below"||cswmSPnt=="above"){cswmMB=cswmPx[cswmPx.length-1]-(cswmPW-cswmAR)-4;if(cswmMB<0||cswmMB<cswmSLA){cswmMB=cswmSLA;}cswmPx[cswmPx.length-1]=cswmMB;}else{cswmMB=cswmSEL-cswmPW;if(cswmMB>=0){cswmPx[cswmPx.length-1]=cswmMB;}}}}
  function cswmCL(){if(cswmPx[cswmPx.length-1]<(cswmSLA)){cswmPx[cswmPx.length-1]=cswmSEL+cswmSEW;cswmCR();}}
  function cswmCB(){cswmAB=(cswmBH+cswmSTA)-cswmPy[cswmPy.length-1];if(cswmAB<cswmPH){if(cswmSPnt=="below"){cswmMB=cswmPy[cswmPy.length-1]-cswmPH-cswmSEH;if(cswmMB>=0){cswmPy[cswmPy.length-1]=cswmMB;}}else{cswmMB=cswmPy[cswmPy.length-1]-(cswmPH-cswmAB);if(cswmMB<0||cswmMB<cswmSTA){cswmMB=cswmSTA;}cswmPy[cswmPy.length-1]=cswmMB;}}}
  function cswmCA(){if(cswmPy[cswmPy.length-1]<(cswmSTA)){cswmPy[cswmPy.length-1]=cswmSET+cswmSEH;cswmCB();}}
  function cswmMS(id){var rt;var rs;var i;for (i=0;i<4;i++){rt=document.createElement("div");rs=rt.style;rs.position="absolute";rs.left=cswmPx[cswmPx.length-1]+(4)+i;rs.top=cswmPy[cswmPy.length-1]+(4)+i;if(cswmPW>8){rs.width=cswmPW-(i*2);}if(cswmPH>8){rs.height=cswmPH-(i*2);}rs.backgroundColor="#000000";rs.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=4)";document.all["cswmPopup"+cswmPI[cswmPI.length-1]].insertAdjacentElement("afterEnd",rt);cswmSdw[cswmSdw.length]=rt;}}
  function cswmDS(level){var i;var Keep=level*4;for(i=Keep;i<cswmSdw.length;i++){cswmSdw[i].removeNode(true);}cswmSdw.length=Keep;}
  function cswmShowInFrame(MenuID,x,y){x+=document.body.scrollLeft;y+=document.body.scrollTop;cswmShow(MenuID,'','below',x,y,1);}
  function cswmRefresh(){}



