
var anchomargenlateral=0, altomargensuperior=0, anchocuadro=1000, altocuadro=600, altohead=144;;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    varwidth = window.innerWidth;
    varheight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    varwidth = document.documentElement.clientWidth;
    varheight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    varwidth = document.body.clientWidth;
    varheight = document.body.clientHeight;
  }
	anchomargenlateral = (varwidth - 1000)/2;      // ancho de campos laterales para el formato de página
	altomargensuperior = 0;
	//altomargensuperior = (varheight - 768)/2; // altura de la franja libre superior en la página
	if (varwidth < 1002) {
	anchomargenlateral = 1;
	}
	altocuadro = varheight - altomargensuperior - 2;
	anchocuadro = 960;
	// Define capas	
	document.getElementById('marco').style.top = altomargensuperior+"px";
	document.getElementById('marco').style.left = anchomargenlateral+"px";
	document.getElementById('marco').style.height = altocuadro+"px";
	
	var temp1 = altocuadro - altohead;
	document.getElementById('cuerpo').style.height = temp1+"px";
	
	document.getElementById('cuerpopop1').style.visibility="hidden";
	document.getElementById('cuerpopop2').style.visibility="hidden";
	document.getElementById('cuerpopop3').style.visibility="hidden";
	document.getElementById('cuerpopop4').style.visibility="hidden";		
	document.getElementById('label1').style.visibility="hidden";		
	document.getElementById('label2').style.visibility="hidden";	
	document.getElementById('label3').style.visibility="hidden";		
	
var idxTestimonios = Math.ceil(Math.random()*numTestimonios);
var idxCasos = Math.ceil(Math.random()*numCasos);

function abretestimonios() {
	
	if (idxTestimonios == 0) {
		idxTestimonios = numTestimonios;	
	} 
	if (idxTestimonios > numTestimonios) {
		idxTestimonios = 1;
	} 
	frames['testimonios'].location.href = "/info/testimonios/testimonio"+idxTestimonios+".html";
}

function abrecasos() {
	
	if (idxCasos == 0) {
		idxCasos = numCasos;	
	} 
	if (idxCasos > numCasos) {
		idxCasos = 1;	
	} 
	frames['casos'].location.href = "/info/casos/caso"+idxCasos+".html";	
}

abretestimonios();
abrecasos();

// Evita la selección de objetos para que no se oscurezcan los fondos
     // Internet Explorer
     document.onselectstart = function() { return false; } 
		// Firefox
     document.onmousedown = function() { return false; }
// /Evita la selección de objetos
