/* JavaScript Library, Copyright © 2002, ECO Services International */
/* Respetando el credito a quienes hicieron este JavaScript */

/* Check & Set FrameContext */
function cfc(MyTyp) {
   if(top == self) {
      if(MyTyp == "a") {         /* Register */
         var MyLoc = "/register/";
         var MySel = "index/index.html"; }
      if(MyTyp == "b") {         /* Root */
         var MyLoc = "/";
         var MySel = "select.html"; }
      if(MyTyp == "c") {         /* Info */
         var MyLoc = "/info/";
         var MySel = "info/index.html"; }
      if(MyTyp == "d") {         /* Index Classification */
         var MyLoc = "/index/";
         var MySel = "index/index.html"; }
      if(MyTyp == "e") {         /* Index Countries */
         var MyLoc = "/index/country/";
         var MySel = "index/country/index.html"; }
      if(MyTyp == "f") {         /* In Focus */
         var MyLoc = "/focus/";
         var MySel = "info/index.html"; }
      if(MyTyp == "g") {         /* Editorial */
         var MyLoc = "/editorial/";
         var MySel = "editorial/index.html"; }
      if(MyTyp == "h") {         /* User Forum */
         var MyLoc = "/info/forum/";
         var MySel = "info/index.html"; }
      if(MyTyp == "i") {         /* Visitor Statistics */
         var MyLoc = "/info/stats/";
         var MySel = "info/index.html"; }
      var CurrentPage = unescape(window.location.pathname);
      if ((CurrentPage.indexOf(MyLoc) == 0) && (CurrentPage.indexOf('?') == -1)) {
         var CurrentPage = CurrentPage.substring(1);
         var SetContext = "/cgi-local/sfc?a=" + MySel + "&b=" + CurrentPage;
         var appVer = navigator.appVersion;
         var NS = (navigator.appName == 'Netscape') && ((appVer.indexOf('3') != -1) || (appVer.indexOf('4') != -1));
         var MSIE = (appVer.indexOf('MSIE 4') != -1);
         if (NS || MSIE)
            location.replace(SetContext);
         else
            location.href = SetContext;
      }
   }
}

var MyID = null;
var MyStr = null;
var MyAct = null;
var MyDis = null;
var MyFil = 0;
if (!document.layers&&!document.all&&!document.getElementById)
    event="Old";

function hla(MyEve,MyID,MyAct) {
   if(document.all) {
      MyStr = "document.all." + MyID + ".innerHTML";
      MyDis = eval(MyStr) + "<HR SIZE=1 COLOR=#F0E0C0>" + MyAct;
      MyStr = "document.all." + MyID + ".innerText";
      MyStr = eval(MyStr);
      MyPos = MyStr.indexOf("  ");
      MyStr = MyStr.substr(0,MyPos);
      MyStat = "Ver detalles " + MyStr;
      hlIE(MyDis,MyStat);
   }
   else if(document.getElementById) {
      MyDis = MyAct;
      MyStat = "Haz clic para ver detalles";
      hlMO(MyEve,MyDis,MyStat);
   }
   else if(document.layers) {
      MyDis = MyAct;
      MyStat = "Haz clic para ver detalles";
      hlNN(MyEve,MyDis,MyStat);
   }
   else if (event == "Old") {
      MyStat = MyAct;
      window.setTimeout("window.status = MyStat",150);
   }
}

function hlt(MyEve,MyStr) {
   MyStat = MyStr;
   if(document.all) {
      MyDis = MyStat;
      hlIE(MyDis,MyStat);
   }
   else if(document.getElementById) {
      MyDis = MyStat;
      hlMO(MyEve,MyDis,MyStat);
   }
   else if(document.layers) {
      MyDis = MyStat;
      hlNN(MyEve,MyDis,MyStat);
   }
   else if (event == "Old") {
      window.setTimeout("window.status = MyStat",150);
   }
}

function hli(MyEve,MyInd) {
   MyStat = eval(MyInd);
   if(document.all) {
      MyDis = MyStat;
      hlIE(MyDis,MyStat);
   }
   else if(document.getElementById) {
      MyDis = MyStat;
      hlMO(MyEve,MyDis,MyStat);
   }
   else if(document.layers) {
      MyDis = MyStat;
      hlNN(MyEve,MyDis,MyStat);
   }
   else if (event == "Old") {
      window.setTimeout("window.status = MyStat",150);
   }
}

function hlIE(MyDis,MyStat) {
   document.all.HLie.innerHTML = MyDis
   document.all.HLie.style.left = window.event.clientX + 32;
   if((document.body.clientWidth - window.event.clientX) < document.all.HLie.offsetWidth) {
      document.all.HLie.style.left = (document.body.clientWidth - (document.all.HLie.offsetWidth + 2));
   }
   document.all.HLie.style.top = document.body.scrollTop + window.event.clientY + 10;
   if((document.body.clientHeight - window.event.clientY) < document.all.HLie.offsetHeight) {
      if(((document.body.clientWidth - window.event.clientX) < (document.all.HLie.offsetWidth + 33)) && ((document.body.clientHeight - window.event.clientY) < document.all.HLie.offsetHeight)) {
         document.all.HLie.style.left = (document.body.clientWidth - (document.all.HLie.offsetWidth + 2));
         document.all.HLie.style.top = document.body.scrollTop + (window.event.clientY - (document.all.HLie.offsetHeight + 5));
      }
      else {
         document.all.HLie.style.top = document.body.scrollTop + (document.body.clientHeight - (document.all.HLie.offsetHeight + 5));
      }
   }
   document.all.HLie.filters.revealTrans.Transition = MyFil;
   document.all.HLie.filters.revealTrans.Apply();
   document.all.HLie.style.visibility = "visible";
   document.all.HLie.filters.revealTrans.Play();
   MyFil++
   window.setTimeout("window.status = MyStat",0);
}

function hlMO(MyEve,MyDis,MyStat) {
   MyEle=document.getElementById("HLnn");
   MyEle.innerHTML = MyDis
   X = MyEve.pageX + 20;
   MyEle.style.left = X;
   if((window.innerWidth - X) < MyEle.offsetWidth) {
      X = (window.innerWidth - (MyEle.offsetWidth + 24));
      MyEle.style.left = X;
   }
   MyEle.style.top = MyEve.pageY + 5;
   if((MyEve.pageY + MyEle.offsetHeight + 2) > (window.pageYOffset + window.innerHeight)) {
      if(((window.innerWidth - X) < (MyEle.offsetWidth + 24)) && ((MyEve.pageY + MyEle.offsetHeight + 2) > (window.pageYOffset + window.innerHeight))) {
         MyEle.style.left = (window.innerWidth - (MyEle.offsetWidth + 20));
         MyEle.style.top = MyEve.pageY - 20 - MyEle.offsetHeight;
         if ((MyEve.pageY - 20 - MyEle.offsetHeight) < window.pageYOffset) {
            MyEle.style.top = window.pageYOffset + 5;
            MyEle.style.left = 5;
         }
         else {
            MyEle.style.top = MyEve.pageY - (MyEle.offsetHeight + 20);
         }
      }
      else {
         MyEle.style.top = ((window.pageYOffset + window.innerHeight) - (MyEle.offsetHeight + 20));
      }
   }
   MyEle.style.visibility = "visible";
   window.setTimeout("window.status = MyStat",0);
}

function hlNN(MyEve,MyDis,MyStat) {
   document.HLnn.document.write('<LAYER width="256" bgColor="#006050" STYLE="padding:12px; border-style:solid; border-width:1px; border-color:#FFC040; width:128%"><DIV STYLE="color:#50F0B0";>'+MyDis+'</DIV></LAYER>')
   document.HLnn.document.close();
   document.HLnn.left = MyEve.pageX + 20;
   if((window.innerWidth - document.HLnn.left) < document.HLnn.clip.width) {
      document.HLnn.left = (window.innerWidth - (document.HLnn.clip.width + 24)); 
   }
   document.HLnn.pageY = MyEve.pageY + 5;
   if((MyEve.pageY + document.HLnn.clip.height + 2) > (window.pageYOffset + window.innerHeight)) {
      if(((window.innerWidth - document.HLnn.left) < (document.HLnn.clip.width + 25)) && ((MyEve.pageY + document.HLnn.clip.height + 2) > (window.pageYOffset + window.innerHeight))) {
         document.HLnn.left = (window.innerWidth - (document.HLnn.clip.width + 20));
         document.HLnn.pageY = MyEve.pageY - 20 - document.HLnn.clip.height;
         if (document.HLnn.pageY < window.pageYOffset) {
            document.HLnn.pageY = window.pageYOffset + 5;
            document.HLnn.pageX = 5;
         }
         else {
            document.HLnn.pageY = MyEve.pageY - (document.HLnn.clip.height + 20);
         }
      }
      else {
         document.HLnn.pageY = ((window.pageYOffset + window.innerHeight) - (document.HLnn.clip.height + 20));
      }
   }
   document.HLnn.visibility = "show";
   window.setTimeout("window.status = MyStat",0);
}

function hlOff() {
   if(document.all) {
      document.all.HLie.filters.revealTrans.Transition = MyFil;
      document.all.HLie.filters.revealTrans.Apply();
      document.all.HLie.style.visibility = "hidden";
      document.all.HLie.filters.revealTrans.Play();
      MyFil++
      if(MyFil == 24) MyFil = 0;
   }
    else if(document.getElementById) {
        MyEle=document.getElementById("HLnn");
        MyEle.style.visibility = "hidden";
   }
   else if(document.layers) {
      document.HLnn.visibility = "hide";
   }
   window.status = '';
}

function ImgOn(ImgName, WinText) {
   if (document.images) {
      document[ImgName].src = eval(ImgName + "_h.src");
   }
   window.status = WinText;
}

function ImgOff(ImgName) {
   if (document.images) {
      document[ImgName].src = eval(ImgName + ".src");
   }
   window.status = '';
}

function spw(MyURL) {
   if(document.all) {
      WinX = document.body.clientWidth + 120;
      WinY = document.body.clientHeight + 40;
   }
   else if((navigator.appName == "Netscape") && (parseFloat(navigator.appVersion) >= 4)) {
      WinX = window.innerWidth + 120;
      WinY = window.innerHeight + 40;
   }
   else {
      WinX = 640;
      WinY = 480;
   }
   var popwin = window.open(MyURL,'PopWin','width='+WinX+',height='+WinY+',toolbar,location,scrollbars,resizable');
   if (window.focus) popwin.focus();
}
