﻿var IsKidSelect=0;
var MySelectedObj=null;
var MyTypeObj="";
var MyArrParent= new Array();
var MyArrParentShow= new Array();
var ShowLen=-1;
var MyTop=0;
var MyLeft=0;
var isSelectObj=false;
var MyIMGInfos=null;
var IrInicio=false;
var MyOldCateAct="";
var MyNoBanner=0;

function ShowVideo(MyId) {
  //alert("asdsdf");
 
 
  var MyOldVideo=document.getElementById('TXTIdVideo').value;
  var MyVideo=document.getElementById(MyOldVideo);
  var MyHTML=MyVideo.innerHTML; //"http://www.youtube.com/v/FFLyhWuP51k&layer_token=9d9dd586483e2604&hl=es&fs=1";
  
  MyVideo.innerHTML=MyHTML //'<EMBED height=344 type=application/x-shockwave-flash align=center width=425 src='+MyHTML+' allowfullscreen="true" allowscriptaccess="always"></EMBED> ';
  //if (MyVideo) MyVideo.stop();
  //if (MyVideo) MyVideo.stopVideo(); 

  var MyOld=document.getElementById(MyOldVideo);
  if (MyOld) document.getElementById(MyOldVideo).style.display='none';
  document.getElementById(MyId).style.display='';
  document.getElementById('TXTIdVideo').value=MyId;
  
  //var ccc=document.getElementById('PhotoDescAct').innerText;
  //var cccC=document.getElementById('PhotoDesc_'+MyIdd).innerText;
  //document.getElementById('PhotoDescAct').innerText=document.getElementById('PhotoDesc_'+MyIdd).innerText;
}

function ShowLeftCate(MyId) {
 var MyOLd=document.getElementById(MyOldCateAct);
 if (MyOLd) {MyOLd.style.display='none';
             MyOldCateAct=MyOldCateAct.replace("RLeftProd_","CLeftProd_")
             MyOLd=document.getElementById(MyOldCateAct);
             MyOLd.style.display='none';}
 var MyIdProd=document.getElementById('TxtIdProd').value;
 var MyIdCate=document.getElementById('TxtIdCategory').value;
 if (MyIdProd>0) {document.getElementById('RLeftProd_'+MyIdCate).style.display='none';
                 document.getElementById('CLeftProd_'+MyIdCate).style.display='none';}           
 document.getElementById(MyId).style.display='';
 MyOldCateAct=MyId;
 MyId=MyId.replace("RLeftProd_","CLeftProd_")
 document.getElementById(MyId).style.display='';
 
}

function PlayMusica(MyIdPlay,MyIdStop,MyV) {
  document.getElementById(MyIdPlay).style.display='none';
  document.getElementById(MyIdStop).style.display='';
  Media.PlaySound.PlayNow('media/'+MyV+'.mp3');
}

function StopMusica(MyIdStop,MyIdPlay,MyV) {
  document.getElementById(MyIdPlay).style.display='';
  document.getElementById(MyIdStop).style.display='none';
  Media.PlaySound.PlayNow('no.mp3');
}


function ChangeIdioma(MyObj) {
   //alert(document.getElementById('TXTIdioma').value);
   if (document.getElementById('TXTIdioma').value=="English") var MyIdioma="Español";
   else var MyIdioma="English";
  // var MyIdioma=MyObj.innerText;
  //alert(MyIdioma);
   document.getElementById('IsChangeIdioma').checked=true;
   document.getElementById('TXTIdioma').value=MyIdioma; //MyObj.innerText;
   var btn =document.getElementById('ButtonExe');
   btn.click();
}

function IrADetalle(MyId) {
  var MyIdCata=document.getElementById('TxtIdCatalog').value;
  var MyIdCate=document.getElementById('TxtIdCategory').value;
  var MyIdProd=document.getElementById('TxtIdProd').value;
  var MyIdDeta=MyId;
  document.getElementById('TxtIdDeta').value=MyId;                     
     
  if (document.getElementById('IsCFG').checked==true) {var btn =document.getElementById('ButtonExe');
                                                       btn.click();}                                                 
  else { var MyIdioma=document.getElementById('TXTIdioma').value;
         var MyOP=MyIdCata+"|"+MyIdCate+"|"+MyIdProd+"|"+MyIdDeta+"|"+MyIdioma;
         window.location.href ="acsWebPage.aspx?ID="+MyOP;}      
}


function ShowEnlace(MyLink) {
if (MyLink.length>0)
   {
   if (MyLink.length)
   //alert(MyLink)
   var MyP=MyLink.indexOf('"http://');
   var MyPS=MyLink.indexOf('"https://'); 
   if ((MyP==-1&&MyPS==-1)) {var MyPos=MyLink.lastIndexOf('|');
                             var MyIdC=MyLink.substring(0,MyPos);
                             var MyNivel=MyLink.substring(MyPos+1,MyLink.length);
                             QTChangePage(MyIdC,MyNivel,'91',MyIdC,1);}
   else {window.open(MyLink);}
   }

}


function QTChangePhoto(MyId) {
   document.getElementById('MyPhoto').style.display="none";
    document.getElementById('MyPhoto').src="Images/imgtmpqt/"+MyId+".gif"
   var MyObj=document.getElementById('CProdIMGGrande');
   FindPosObj(MyObj,true) 
   //document.getElementById('MyPhoto').src=document.getElementById('MyPhotoLoad').src;
   document.getElementById('TblProdPhoto').style.display ="none";
   document.getElementById('TblProdPhoto').style.left=MyLeft+'px';
   document.getElementById('TblProdPhoto').style.top=MyTop+'px';
   document.getElementById('TblProdPhoto').style.width=MyObj.style.width;
   document.getElementById('TblProdPhoto').style.height='420px';
   //document.getElementById('MyPhotoLoad').src="Images/imgtmpqt/"+MyId+".gif"
   //Effect.Appear('TblProdPhoto', {duration: 1.0});
  
   Effect.Appear('MyPhoto', {duration: 1.5});
   var MyPos=MyId.lastIndexOf('_');
   var MyIdd=MyId.substring(MyPos+1,MyId.length);
   var ccc=document.getElementById('PhotoDescAct').innerText;
   var cccC=document.getElementById('PhotoDesc_'+MyIdd).innerText;
   document.getElementById('PhotoDescAct').innerText=document.getElementById('PhotoDesc_'+MyIdd).innerText;
}

function  ScrollPanelLeft(MyCtrl,MyV) {
 var MyPnl=document.getElementById(MyCtrl);
 var MyScrollL=MyPnl.scrollLeft+MyV;
 MyPnl.scrollLeft=MyScrollL;
}



function InsertClient() {
  document.getElementById("IsInsertClient").checked=true;  
  CrearCuentaCliente();
}

function EnviarMensage() {
  document.getElementById("IsEnviarMensage").checked=true;
  var btn =document.getElementById('ButtonExe');
  btn.click();
}


//--------------- VISIBLE ---------------------------------------

function SetInicio(MyId) {
  if (document.getElementById('TXTPageToShow').value=='Inicio') {SelectObj(MyId,'LABEL');}
  else {document.getElementById('TxtIdCatalog').value=0;
        document.getElementById('TxtIdCategory').value=0;
        document.getElementById('TxtIdProd').value=0; 
        document.getElementById('TxtIdDeta').value=0;
        if (document.getElementById('IsCFG').checked==true) {var btn =document.getElementById('ButtonExe');
                                                             btn.click();}                                                 
        else {var MyIdioma=document.getElementById('TXTIdioma').value;
              var MyOP=0+"|"+0+"|"+0+"|"+0+"|"+MyIdioma;
              window.location.href ="acsWebPage.aspx?ID="+MyOP;}      
       }
}


function QTChangePage(MyId,MyTipo,MyIdCatal,MyIdCateg,IsLink){
 //alert(MyId);
 
 if (IsLink) {var ii="";} 
 else {if (MyIdCatal) {document.getElementById('TxtIdCatalog').value=MyIdCatal;}
       if (MyIdCateg) {document.getElementById('TxtIdCategory').value=MyIdCateg;}}
             
 if (!MyId) {MyId=MySelectedObj.id;
             if (MyId.indexOf("Cata_")>0||MyId.indexOf("Menu_")>0) MyTipo="CATA";
             if (MyId.indexOf("Cate_")>0) MyTipo="CATE";
             if (MyId.indexOf("Prod_")>0) MyTipo="PROD";
             if (MyId.indexOf("Det_")>0) MyTipo="DETA";
             if (MyId.indexOf("DetRel")>0) MyTipo="DETA";}
 else {if (MyId.indexOf("Cata_")>0||MyId.indexOf("Menu_")>0) MyTipo="CATA";
       if (MyId.indexOf("Cate_")>0) MyTipo="CATE";
       if (MyId.indexOf("Prod_")>0) MyTipo="PROD";
       if (MyId.indexOf("Det_")>0) MyTipo="DETA";
       if (MyId.indexOf("DetRel")>0) MyTipo="DETA";}            
 if (MyId.indexOf("Idioma_")>0) {var MyObjIdio=document.getElementById(MyId);
                                 ChangeIdioma(MyObjIdio);}
 else {
 if (!MyId) {MyId=MySelectedObj.id;
             if (MyId.indexOf("Cata_")>0||MyId.indexOf("Menu_")>0) MyTipo="CATA";
             if (MyId.indexOf("Cate_")>0) MyTipo="CATE";
             if (MyId.indexOf("Prod_")>0) MyTipo="PROD";
             if (MyId.indexOf("Det_")>0) MyTipo="DETA";
             if (MyId.indexOf("DetRel")>0) MyTipo="DETA";}
 if (IrInicio==true) SetInicio(MyId);
 else {      
          
 var MyPos=MyId.lastIndexOf('_');
 if (MyTipo=="CATA") {var MyIdCate=0;
                      var MyIdProd=0; 
                      var MyIdDeta=0; 
                      var MyIdCata=MyId.substring(MyPos+1,MyId.length);}
 if (MyTipo=="CATE") {var MyIdProd=0;
                      var MyIdDeta=0;
                      var MyIdCata=document.getElementById('TxtIdCatalog').value;
                      var MyIdCate=MyId.substring(MyPos+1,MyId.length);}
 if (MyTipo=="PROD") {var MyIdDeta=0;
                      var MyIdCata=document.getElementById('TxtIdCatalog').value;
                      var MyIdCate=document.getElementById('TxtIdCategory').value;
                      var MyIdProd=MyId.substring(MyPos+1,MyId.length);}                     
 if (MyTipo=="DETA") {var MyIdCata=document.getElementById('TxtIdCatalog').value;
                      var MyIdCate=document.getElementById('TxtIdCategory').value;
                      var MyIdProd=document.getElementById('TxtIdProd').value;
                      var MyIdDeta=MyId.substring(MyPos+1,MyId.length);} 
                      
 if (MyIdCata==document.getElementById('TxtIdCatalog').value&&MyIdCate==document.getElementById('TxtIdCategory').value&&MyIdProd==document.getElementById('TxtIdProd').value&&MyIdDeta==document.getElementById('TxtIdDeta').value) {SelectObj(MyId,'LABEL');}
 else {if (MyTipo=="CATA") {document.getElementById('TxtIdCategory').value=0;
                            document.getElementById('TxtIdProd').value=0; 
                            document.getElementById('TxtIdDeta').value=0; 
                            document.getElementById('TxtIdCatalog').value=MyIdCata;}
       if (MyTipo=="CATE") {document.getElementById('TxtIdProd').value=0;
                            document.getElementById('TxtIdDeta').value=0; 
                            document.getElementById('TxtIdCatalog').value=MyIdCata;
                            document.getElementById('TxtIdCategory').value=MyId.substring(MyPos+1,MyId.length);;}                            
       if (MyTipo=="PROD") {document.getElementById('TxtIdProd').value=MyId.substring(MyPos+1,MyId.length);;
                            document.getElementById('TxtIdDeta').value=0; 
                            document.getElementById('TxtIdCatalog').value=MyIdCata;
                            document.getElementById('TxtIdCategory').value=MyIdCate;}                                                        
       if (MyTipo=="DETA") {document.getElementById('TxtIdDeta').value=MyId.substring(MyPos+1,MyId.length);;
                            document.getElementById('TxtIdCatalog').value=MyIdCata;
                            document.getElementById('TxtIdCategory').value=MyIdCate;
                            document.getElementById('TxtIdProd').value=MyIdProd;} 
      
      if (document.getElementById('IsCFG').checked==true) {var btn =document.getElementById('ButtonExe');
                                                           btn.click();}                                                 
      else { var MyIdioma=document.getElementById('TXTIdioma').value;
             var MyOP=MyIdCata+"|"+MyIdCate+"|"+MyIdProd+"|"+MyIdDeta+"|"+MyIdioma;
             window.location.href ="acsWebPage.aspx?ID="+MyOP;}      
       }
}}}





function SalvarPagina() {
  SalvarTexto();
   var btn =document.getElementById('ButtonExe');
   btn.click();   
}

function acsPageIni() {
  
    var MyIMG = document.getElementById('IMGTitle_91');
    if (MyIMG) Effect.Appear(MyIMG, { duration: 1.5 });
 var MyIdE=document.getElementById('TxtIdCategory').value
 if (document.getElementById('TxtIdCategory').value == 0) Media.PlaySound.PlayNow('QTOuverture.mp3');

 //if (document.getElementById('TxtIdCategory').value==32) Media.PlaySound.PlayNow('Cafetin de mi barrio.mp3');
   var myobj=document.getElementById('HeadVisible');
   if (myobj) {FindPosObj(myobj);                                
               var MyLeftV=curleft;
               var MyTb=document.getElementById('tb1');
               MyTb.style.top='46px';
               if (MyLeftV==0) {if (MyTb) MyTb.style.left='60px';}
               else {if (MyTb) MyTb.style.left=MyLeftV+60+'px';}
               if (document.getElementById('IsCFG').checked==true)  MyTb.style.display=''; 
               
               MyTb=document.getElementById('tb2');
               MyTb.style.top='46px';
               if (MyLeftV==0) {if (MyTb) MyTb.style.left=600+'px';}
               else {if (MyTb) MyTb.style.left=MyLeftV+600+'px';}
               if (document.getElementById('IsCFG').checked==true)  MyTb.style.display=''; 
               
               MyTb=document.getElementById('DivMoves');
               MyTb.style.top='46px';
               if (MyLeftV==0) {if (MyTb) MyTb.style.left=800+'px';}
               else {if (MyTb) MyTb.style.left=MyLeftV+800+'px';}
               if (document.getElementById('IsCFG').checked==true)  MyTb.style.display='none';                               
              }

          
   var MyAllObjs = new Array("C41","C42","C421","C43","C44","C45");
   if (document.getElementById('IsCFG').checked==true) {
       for (i = 0; i<=MyAllObjs.length-1; i++) {document.getElementById(MyAllObjs[i]).style.display='none';}                                                               
   }

   
   if (isSelectObj==false)   {var MyIdWeb=document.getElementById('TXTEmpresa').value;
                              MyTbl=document.getElementById('TblPage_'+MyIdWeb);
                              FindPosObj(MyTbl);
                              var MyL=curleft+610;
                              var MyHe=HVentana();
                              var MyWi=WVentana();
                              if (document.getElementById('IsCFG').checked==true) {document.getElementById('acsPanel').style.width=(MyWi*1)-4 + 'px';
                                                                                   document.getElementById('acsPanel').style.height=(MyHe*1)-95 + 'px';}
   }

   if (document.getElementById('IsCFG').checked==true) {
      document.getElementById('C40').style.display = "";
      document.getElementById(rteName).style.display = "none";
  }
  
  postcargaBanners();
  
   var MyEmpre=document.getElementById('TXTEmpresa').value;
   if (document.getElementById('CHKShowInfo').checked==true) {document.getElementById('DivConexcion').style.display='none';
                                                              ShowConexion('DivInscription');
                                                              document.getElementById('CHKShowInfo').checked=false;}
}

function postcargaBanners() {
  var rep=setInterval("ShowIMGBanners();",4000);
}

function ShowIMGBanners() {
    var MyIMG = document.getElementById('IMGFookLienMenu_114');
  MyIMG.style.display="none";
  var MyIdio=document.getElementById('TXTIdioma').value;
  if (MyIdio == '') MyIdio = 'Espanol';
  
  if (MyIdio == 'English') {
      if (MyNoBanner == 0) {
          MyIMG.src = "images/imgtmpqt/AlbunE.png"; 
          //MyIMG.attachEvent("onclick", SetNoLink); 
          }
      if (MyNoBanner == 1) {
          MyIMG.src = "images/imgtmpqt/FaceBookE.png";
          // MyIMG.attachEvent("onclick", FaceBookLink); 
         }
  }
  else {
      //alert(MyNoBanner);
      if (MyNoBanner == 0) {
          MyIMG.src = "images/imgtmpqt/Albun.png"; 
          //MyIMG.attachEvent("onclick", SetNoLink); 
     }
      if (MyNoBanner == 1) {
        MyIMG.src = "images/imgtmpqt/FaceBook.png"; 
        //MyIMG.attachEvent("onclick", FaceBookLink); 
     } 
  }

  if (MyNoBanner == 0) { MyNoBanner = 1; }
  else { MyNoBanner = 0; }
 
// MyIMG.style.display = "";
  
  Effect.Appear(MyIMG, { duration: 1.5});
}

function SetNoLink() {
   
}

function FaceBookLink() {
  if (MyNoBanner == 0) {window.location.href = "http://www.facebook.com/pages/Quartango/144562444730?ref=search&sid=100000014292619.3027895997..1";}
}

function acsResizeCFG(){
 if (isSelectObj==false)
  {var MyIdWeb=document.getElementById('TXTEmpresa').value;
  MyTbl=document.getElementById('TblPage_'+MyIdWeb);
  FindPosObj(MyTbl);
  var MyL=curleft+610;
  var MyHe=HVentana();
  var MyWi=WVentana();
  if (document.getElementById('IsCFG').checked==true) {
       if (document.getElementById('acsPanel').style.width!=(MyWi*1)-4 + 'px' || document.getElementById('acsPanel').style.height!=(MyHe*1)-95 + 'px')
             {document.getElementById('acsPanel').style.width=(MyWi*1)-4 + 'px';
              document.getElementById('acsPanel').style.height=(MyHe*1)-95 + 'px';}}
 // else {var MyTblH=MyTbl.offsetHeight;
          //if (MyHe*1<MyTblH) {document.getElementById('acsPanel').style.height=(MyTblH*1) + 'px';
          //                    document.getElementById('acsPanel').style.width=((MyWi*1)-20) + 'px';}
          //else               {document.getElementById('acsPanel').style.height=(MyHe*1) + 'px';
          //                    document.getElementById('acsPanel').style.width=((MyWi*1)) + 'px';}}
}
isSelectObj=true;
}


function ShowHideTextArea(MyOpc){
  document.getElementById(rteName).style.display = "none";
}

function ChangeFontColor(MyL,MyC,IsProd) {
   document.getElementById(MyL).style.color=MyC;
}

function InsertLink(MyId,MyT,MyTbl) {
   var MyParent=document.getElementById(MyTbl);
   var MyRow = AppendRow(MyParent);
   MyRow.id="RowLink_" + MyId;
   var MyCell = AppendCell(MyRow);
   MyCell.id="CellLink_" + MyId;
      
   var MyImage = new Image();
   MyImage.src   = "Images/acsPersonal.gif" ;
   MyImage.id="ImgLink_"+MyId;
   MyCell.appendChild(MyImage);
   
   var MyRow = AppendRow(MyParent);
   MyRow.id="RowLLink_" + MyId;
   var MyCell = AppendCell(MyRow);
   MyCell.id="CellLLink_" + MyId;      
   var MyLabel = document.createElement('Label');
   MyLabel.id="LinkLabel_" + MyId;
   MyLabel.innerText=MyT;
   
   MyLabel.width=170;
   MyLabel.style.height=20;
   MyLabel.style.color="Blue";
   MyLabel.style.fontFamily="Arial";
   MyLabel.style.fontSize="9pt";
   MyLabel.style.fontWeight="";
   MyLabel.style.textDecoration="underline";
   MyLabel.align ='center';
   MyLabel.verticalAlign='middle';
   MyLabel.style.textAlign ='center';
   
   MyCell.appendChild(MyLabel);
   
   var MyRow = AppendRow(MyParent);
   MyRow.id="RowLinkSep_" + MyId;
   var MyCell = AppendCell(MyRow);
   MyCell.id="CellLinkSep_" + MyId;      
   MyCell.style.backgroundColor="#CCCCCC";
   var MyLabel = document.createElement('Label');
   MyLabel.id="LinkSep_"+ MyId;
   //MyLabel.innerText=MyT;
   MyCell.appendChild(MyLabel);
   //MyDivlabel.attachEvent("onclick",SelectObjNew);
}

function ShowRelacionados(MyIdRel,MyRel){
  var MyArrId=MyIdRel;
  var MyArrName=MyRel;
  var MyPos=MyArrId.indexOf("|")
  var MyPosN=MyArrName.indexOf("|")
  
  //BorrarRelacionados('TBLLinks');
  
  if (MyPos>-1) {do    {var MyId=MyArrId.substring(0,MyPos);
                        var MyIdN=MyArrName.substring(0,MyPosN);
                        if (MyId.length>0) {InsertLink(MyId,MyIdN,'TBLLinks');}      
                        MyArrId=MyArrId.substring(MyPos+1,MyArrId.length);
                        MyArrName=MyArrName.substring(MyPosN+1,MyArrName.length);
                        MyPos=MyArrId.indexOf("|");
                        MyPosN=MyArrName.indexOf("|")}
                 while (MyPos>-1)}
}

function BorrarRelacionados(MyIdTbl) {
  var tabla=document.getElementById(MyIdTbl);
  if (tabla) {
  var cantFilas = tabla.rows.length;
  var cantCeldas = tabla.cells.length;
  var MyCell=document.getElementById("CellLLink_2"); 
  
  if (cantFilas>1) {
  do    {var MyIdCell = tabla.cells[1].id;
         var MyIdRow=MyIdCell.replace("Cell","Row"); ;                       
         var MyRow=document.getElementById(MyIdRow); 
         var MyCell=document.getElementById(MyIdCell); 
         MyRow.removeChild(MyCell);
         MyRow.parentNode.removeChild(MyRow); 
         cantFilas = tabla.rows.length;}
  while (cantFilas>1);
  }
}}


function ShowConexion(MyIdDiv, MyName, MyDes, MyDesT, MyDesImg, MyImg,MyIdRel,MyRel) {
  var arrayPageSize = getPageSize();
  var arrayPageScroll = getPageScroll();
  
  var MyFlash=document.getElementById('animationFlash_91');
  if (MyFlash) {
    MyFlash.style.display='none';
  }
    
  MyIMGInfos=document.getElementById('IMGInfos');
 // MyIMGInfos.id=MyImg;
  
  if (MyImg) {
  var MyPos=MyImg.indexOf("_");
  var MyId=MyImg.substr(MyPos+1,MyImg.length);
  document.getElementById('TxtIdDeta').value=MyId;}
  
  if (MyName) document.getElementById('LabelInfoName').innerText=MyName; 
  if (MyDes) document.getElementById('LabelInfoDesc').innerHTML=MyDes; 
  if (MyDesT) document.getElementById('LabelInfoDescT').innerHTML=MyDesT; 
  if (MyDesImg) document.getElementById('LabelInfoIMG').innerText=MyDesImg; 
  if (MyIdRel) ShowRelacionados(MyIdRel,MyRel);
  
  if (MyIdDiv) { //MyIMGInfos.src = "images/imgtmpqt/"+MyImg+".gif";
                var MyDiv=document.getElementById(MyIdDiv);
                var MyTop=((arrayPageScroll[1] + 200) + 'px');
                var MyLeft=(((arrayPageSize[0] - 20 - 460) / 2) + 'px');}
  else {var MyDiv=document.getElementById('DivConexcion');
        var MyTop=(arrayPageScroll[1] + ((arrayPageSize[3] - 35 - 136) / 2) + 'px');
        var MyLeft=(((arrayPageSize[0] - 20 - 376) / 2) + 'px');}

   var MyDivP=document.getElementById('DivOverLigthConex');
   if (document.getElementById('IsCFG').checked==true) {MyDivP.style.top='72px';}
   else {MyDivP.style.top='0px';} 

   MyDivP.style.display='';
   MyDivP.appendChild(MyDiv);
   MyDiv.style.top=MyTop;
   MyDiv.style.left=MyLeft;
   MyId=MyDiv.id;
   Effect.Appear(MyId, { duration: 1.5});
   //MyDiv.style.display='';
   	
}

function OpenConnexion() {
  document.getElementById('TXTPassWordHide').value=document.getElementById('TXTPassWord').value;
  document.getElementById('TXTEmailHide').value=document.getElementById('TXTEmail').value;
  document.getElementById('IsConnexion').checked=true;
  var btn =document.getElementById('ButtonExe');
  btn.click(); 
}

function CloseHideLightBox() {
  BorrarRelacionados('TBLLinks');
  var MyDivPC=document.getElementById('DivOverLigthConex');
  var MyDiv=document.getElementById('DivConexcion');
  var MyDivI=document.getElementById('DivInfos');
  
  document.getElementById('TxtIdDeta').value=0;
  if (MyIMGInfos) {MyIMGInfos.src = "";
                   MyIMGInfos.id="IMGInfos";}
  //document.getElementById('IMGInfos');
  //MyIMGInfos=null;
 // MyDivI.style.display='none';
  MyDiv.style.display='none';
  MyDivPC.style.display='none';
  
  MyDivI=document.getElementById('DivContact');
  //MyDivI.style.display='none';
  MyDivI=document.getElementById('DivInscription');
  MyDivI.style.display='none';
  var MyFlash=document.getElementById('animationFlash_91');
  if (MyFlash) {
    MyFlash.style.display='';
  }
}

function SetSelection() {
   IsKidSelect=0;
}

function SelectObj(MyId,IsIMG,IsInicio) {

}


// *************GENERAL FUNCTIONS**************




function showXPos(e) {
 MyPosY=e.clientY;
 MyPosX= e.clientX;
}
 
function showYPos(e) {
 MyPosY=e.clientY;
 MyPosX= e.clientX;
 
}  

function CI(MyC,MyI){
document.getElementById(MyC).style.backgroundImage = 'url('+MyI+')';
}

function AI() { //v3.0
    var i, j = 0, x, a = AI.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3)
        if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; }

}

function MM_findObj(n, d) { //v4.01
    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);
    if (!x && d.getElementById) x = d.getElementById(n); return x;
}


function WVentana() {
  var Tamanyo = [0, 0];
  if (typeof window.innerWidth != 'undefined') {Tamanyo = window.innerWidth;}
  else if (typeof document.documentElement != 'undefined'
        && typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0)
          { Tamanyo = document.documentElement.clientWidth;}
      else   {Tamanyo = document.getElementsByTagName('body')[0].clientWidth;}
  return Tamanyo;
}

function HVentana() {
  var Tamanyo = [0, 0];
  if (typeof window.innerWidth != 'undefined') {Tamanyo = window.innerHeight;}
  else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0)
          {Tamanyo =document.documentElement.clientHeight;}
  else   {Tamanyo = document.getElementsByTagName('body')[0].clientHeight;}
  return Tamanyo;
}

function FindPosObj(obj,ShowP) {
 var ii=-1
 var MyId='';
 var MyObj=obj;

 curleft = curtop = 0; 
 if (obj.offsetParent) {
      do {curleft += obj.offsetLeft;
          ii=ii+1;
          curtop += obj.offsetTop;
          MyId=obj.id;
          if (MyId.length>0) MyArrParent[ii]=obj.id;
          }
      while (obj = obj.offsetParent);}
 else {MyArrParent[i]=obj.id;}     
 
 MyLeft=curleft;
 MyTop=curtop;
 
 if (ShowP==true) {
    for (i = 0; i<=ShowLen; i++) {if (document.getElementById("Selection_"+MyArrParentShow[i])) {
                                       document.getElementById("Selection_"+MyArrParentShow[i]).style.display='none';
                                       document.getElementById("SelectionSep_"+MyArrParentShow[i]).style.display='none';}}     
    ShowLen=-1
    for (i = ii-1; i>=0; i--) {ShowLen=ShowLen+1;
                               MyArrParentShow[ShowLen]=MyArrParent[i];
                               //if (document.getElementById(MyArrParent[i])) {document.getElementById(MyArrParent[i]).style.borderWidth ='1px';
                               //                                              document.getElementById(MyArrParent[i]).style.borderStyle='solid';}
                               if (document.getElementById("Selection_"+MyArrParent[i])) {
                                   document.getElementById("Selection_"+MyArrParent[i]).style.display='';
                                   document.getElementById("SelectionSep_"+MyArrParent[i]).style.display='';}}     
 }
}

function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}

function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

function disableselect(e){
for (i = 0; i < omitformtags.length; i++)
if (omitformtags[i]==(e.target.tagName.toLowerCase()))
return;
return false
}

function reEnable(){
return true
}


function CrearCuentaCliente() {
   
   var MyStrError="";
   
   var MyV=document.getElementById('ClientName').value;
   if (MyV.length==0) MyStrError=MyStrError + "* Nombre";
   
   var MyV=document.getElementById('ClientAppe').value;
   if (MyV.length==0) MyStrError=MyStrError + "* Apellidos";
   
   //var MyV=document.getElementById('ClientDir').value;
   //if (MyV.length==0) MyStrError=MyStrError + "* Dirección";
   
   //var MyV=document.getElementById('ClienPais').value;
   //if (MyV.length==0) MyStrError=MyStrError + "* Pais";
   
   //var MyV=document.getElementById('ClientProv').value;
   //if (MyV.length==0) MyStrError=MyStrError + "* Provincia";
   
   //var MyV=document.getElementById('ClientCiudad').value;
   //if (MyV.length==0) MyStrError=MyStrError + "* Ciudad";
   
   //var MyV=document.getElementById('ClientCodigoPostal').value;
   //if (MyV.length==0) MyStrError=MyStrError + "* Código Postal";
   
   //var MyV=document.getElementById('ClientTel').value;
   //if (MyV.length==0) MyStrError=MyStrError + "* Télefono";
   
    var MyV=document.getElementById('ClientEmail').value;
   if (MyV.length==0) MyStrError=MyStrError + "* Email";
   
   var MyV=document.getElementById('ClientClave').value;
   if (MyV.length==0) MyStrError=MyStrError + "* Contraseña";
   
   var MyV=document.getElementById('ClientConfirm').value;
   if (MyV.length==0) MyStrError=MyStrError + "* Confirmación de la Contraseña";
   
   //var MyV=document.getElementById('BeneName').value;
   //if (MyV.length==0) MyStrError=MyStrError + "* Nombre del Destinatario";
   
    //var MyV=document.getElementById('BeneAppe').value;
   //if (MyV.length==0) MyStrError=MyStrError + "* Apellidos del destinatario";
   
   //var MyV=document.getElementById('BeneDir').value;
   //if (MyV.length==0) MyStrError=MyStrError + "* Direción del destinatario";
   
   //var MyV=document.getElementById('BenePais').value;
   //if (MyV.length==0) MyStrError=MyStrError + "* País del destinatario";
   
   //var MyV=document.getElementById('BeneProv').value;
   //if (MyV.length==0) MyStrError=MyStrError + "* Provincia del destinatario";
   
   // var MyV=document.getElementById('BeneCiudad').value;
   //if (MyV.length==0) MyStrError=MyStrError + "* Ciudad del destinatario";
      
   if (document.getElementById('ClientClave').value!=document.getElementById('ClientConfirm').value) {MyStrError=MyStrError + "* La contraseña y la confirmación deben ser iguales ";}
   
   if (MyStrError.length==0) {var btn=document.getElementById('ButtonExe');
                              btn.click();}
   else {MyStrError="Verificar : "+MyStrError ; alert(MyStrError);}                           
}


//------------------------- media -----------------------------------
function MM_findObj(n, d) { //v4.01
        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);
        if (!x && d.getElementById) x = d.getElementById(n); 
        return x;
    }
    
    /*Namespaces*/
    
    
var MySound="media/flourish.mid" 
var Media = document.Media || {};// funciones para cookies 
            Media.PlaySound = {	MSIE: navigator.userAgent.indexOf("MSIE"),	
            NETS: navigator.userAgent.indexOf("Netscape"),	
            OPER: navigator.userAgent.indexOf("Opera"),	
            cookieName:  "cookie_sound_active",	
            imgOn: "images/ico_on.gif",	
            imgOff: "images/ico_off.gif",	
            Sound: MySound,	
            WriteCookie: function( name, value ){		
                          var expdate=new Date();		
                          expdate.setTime(expdate.getTime()+10*365*24*60*60*1000);		
                          document.cookie = name + "=" + escape (value) + "; expires=" + expdate.toGMTString();	
            },	
            ReadCookie: function( name ){		
                         var namearg = name + "=";		
                         var nlen = namearg.length;		
                         var clen = document.cookie.length;		
                         var i = 0;		
                         while (i < clen) {			
                                var j = i + nlen;			
                                if (document.cookie.substring(i, j) == namearg) {				
                                    var endpos = document.cookie.indexOf (";", j);				
                                    if (endpos == -1) endpos = document.cookie.length;				
                                    return unescape(document.cookie.substring(j, endpos));			
                                }			
                                i = document.cookie.indexOf(" ", i) + 1;			
                                if (i == 0)  break;		
                         }		
                         return null;	
            },	
            OnOffSound: function( img ){	
                          newValue = Media.PlaySound.ReadCookie( Media.PlaySound.cookieName ) == 1 || Media.PlaySound.ReadCookie( Media.PlaySound.cookieName ) == null  ? 0 : 1;		
                          img.src = newValue == 1 ? Media.PlaySound.imgOn : Media.PlaySound.imgOff;		
                          Media.PlaySound.WriteCookie( Media.PlaySound.cookieName, newValue );	
            },	
            SetMediaIE: function(){		
                         if((Media.PlaySound.MSIE>-1) || (Media.PlaySoundOPER>-1)) { 
                               document.write('<bgsound loop="0" name="MediaMyMediaObj" id="MediaMyMediaObj" >');		
                         }	
            },	
            PlayNow: function(MyS,MyId) {	
           
                      //if( Media.PlaySound.ReadCookie( Media.PlaySound.cookieName ) == 1 || Media.PlaySound.ReadCookie( Media.PlaySound.cookieName ) == null ){		
                             if (MyId) {if (MyS.length==0) {document.getElementById('Play_'+MyId).style.display = "";
                                                            document.getElementById('Stop_'+MyId).style.display = "none"; }
                                        else {document.getElementById('Play_'+MyId).style.display = "none";
                                              document.getElementById('Stop_'+MyId).style.display = ""; }
                                        }         
                         
                             obj = MM_findObj("MediaMyMedia");			
                             if((Media.PlaySound.MSIE>-1) || (Media.PlaySoundOPER>-1)) {obj = MM_findObj("MediaMyMediaObj");
                                                                                        obj.src = MyS;} 
                             else {obj = MM_findObj("MediaMyMediaDiv");
                                   //MyS="QTOuverture.mp3";
                                   obj.innerHTML = '<embed src="' + MyS + '" autostart=true width=0 height=0 name="QT" enablejavascript="true">'
                                   //var thissound= eval("document.QT");
                                   //thissound.Play();
                                   //obj.innerHTML = '<embed  src="' + Media.PlaySound.Sound + '" hidden="true" volume="200" loop="0" type="audio/midi" >';
                                    
                                    //else  {document.write('<embed  src="' + Media.PlaySound.Sound + '" hidden="true" volume="200" loop="0" type="audio/midi" >');}
                                    }
                                          
                       //}                        } 
           }
           
Media.PlaySound.SetMediaIE();

//-------------------------------------------------------------------
