﻿function chkBrowser(){this.ver=navigator.appVersion;this.dom=document.getElementById?1:0;this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;this.ns4=(document.layers && !this.dom)?1:0;this.bVer=(this.ie5 || this.ie4 || this.ns4 || this.ns5);return this;}
bVer=new chkBrowser();ns4 = (document.layers)? true:false;ie4 = (document.all)? true:false;function AttB(f){if(bVer.ie4)f.style.display='block';}function AttN(f){if(bVer.ie4)f.style.display='none';}
 
function show(idLayer,idParent){
cLayer=bVer.dom?document.getElementById(idLayer).style:bVer.ie4?document.all[idLayer].style:bVer.ns4?idParent?document[idParent].document[idLayer]:document[idLayer]:0;
cLayer.display='block';divLinksForm=(ns4)?document.divLinks.document.divLinks:document.divLinks;}
 
function hide(idLayer,idParent){cLayer=bVer.dom?document.getElementById(idLayer).style:bVer.ie4?document.all[idLayer].style:bVer.ns4?idParent?document[idParent].document[idLayer]:document[idLayer]:0;
var d=document.Wiz;cLayer.display='none';}


function MM_openBrWindow(theURL,winName,features) {
var externalWin1 = null;
externalWin1 = window.open(theURL,winName,features);
}


function cambia(objeto,tipo){
   elobjeto=objeto;
   if (tipo == 0){
      if (window.paso2){clearInterval(paso2);}
      paso1=setInterval("baja_opacidad(elobjeto)",40);
   } else {
      if (window.paso1){clearInterval(paso1);}
      paso2=setInterval("sube_opacidad(elobjeto)",40);
   }
}
function baja_opacidad(objeto){
   if (objeto.filters.alpha.opacity >0 ) {
      objeto.filters.alpha.opacity -= 5;
   } else if (window.paso1) {
      clearInterval(paso1);
   }
}
function sube_opacidad(objeto){
   if (objeto.filters.alpha.opacity < 100 ) {
      objeto.filters.alpha.opacity += 5;
   } else if (window.paso2) {
      clearInterval(paso2);
   }
}
function popup(url, width, height) {
	
	var w = 480, h = 340;

	if (document.all) {
	   /* the following is only available after onLoad */
	   w = document.body.clientWidth;
	   h = document.body.clientHeight;
	}
	else if (document.layers) {
	   w = window.innerWidth;
	   h = window.innerHeight;
	}
	
	var leftPos = (w-width)/2, topPos = (h-height)/2;

	
	myFloater = window.open(url, getRandomName(10),'scrollbars=no,status=no,width=' + width + ',height=' + height + ',top=' + topPos + ',left=' + leftPos);
	
	
	if (!myFloater.opener) {
		myFloater.opener = self; 
	}
}


function selfClose() {
	window.close();
}

function openerRefresh() {
	opener.location.href = opener.location.href;
}

function getRandomName(chars) {
	var choice = "1234567890abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ";
	var choiceLength = choice.length;
	var result = '';
	for (var i = 0; i < chars; i++) {
		var rnd = Math.floor(Math.random() * choiceLength);
		result += choice.substring(rnd,rnd+1);
	}
	return result;
}
