
// MARCA CON FLECHA MENU PRINCIPAL
var normal='';
var usado='';
function ponFlecha(objId,menuEstado){
var objItem=document.getElementById(objId);
if(menuEstado=='marcar' ){
	
	usado=objId;
	objItem.style.backgroundColor='#000000';
	objItem.style.color='#ffffff';
	objItem.style.paddingLeft='8px';
	objItem.style.cursor='pointer';
	objItem.innerHTML='&gt;&nbsp;'+objItem.innerHTML;
}
if(usado!=objId){
	if(menuEstado==true ){
		normal=objItem.innerHTML;
		objItem.innerHTML='&gt;&nbsp;'+objItem.innerHTML;}
	else{ objItem.innerHTML=normal;
		normal='';}
	}
}
//ENLAZAR DESDE CULQUIER OBJETO CON ONCLIK....
function enlazar(pag){if(pag!='' ){window.location=pag}}




//CALCULA EL ANCHO REAL DISPONIBLE DE LA VENTANA
function checkWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
return myWidth;
}

//CALCULA EL ALTO REAL DISPONIBLE DE LA VENTANA
function checkHeight() {
var myHeight = 0;
var compensar=0;
  if( typeof( window.innerHeight ) == 'number' ) {
  compensar=12;
    //Non-IEcompensar
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
	compensar=12;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
	compensar=5;
    myHeight = document.body.clientHeight-compensar;
  }
return  myHeight
}

// VER BOTONES VENTANA LEGAL DEPENDIENDO  DEL ENLACE

function verBotones(estado){
	if(estado==true){legal_index=true;}
	else{legal_index=false;}
	document.getElementById('iwin_legal').src='info_legal.cfm'; 
	}
//VER COPY
function verCopy(){
	document.getElementById('iwin_copy').src='copy.cfm';
	}



//CENTRA SEUDO VENTANAS REALIZADAS CON CAPAS. 
function reColoca(){
	var objCopy=document.getElementById('win_copy');
	var objLegal=document.getElementById('legal');
	if(objCopy){winColoca('win_copy')}
	if(objLegal){winColoca('legal')}
	}

function winColoca(ventana){
	var anch_campo=checkWidth();
	var alt_campo=checkHeight();
	var objWin=document.getElementById(ventana);
	var altWin=objWin.style.height.substring(0,objWin.style.height.length-2);
	var anchWin=objWin.style.width.substring(0,objWin.style.width.length-2);
	objWin.style.left=(anch_campo-anchWin)/2+"px";
	objWin.style.top=(alt_campo-altWin)/2+"px";
	}

//COLOCA EL ALTO IDEAL DE UNA CAPA SCROLL TENIENDO EN CUENTA EL DISPONIBLE 
var pag_index=false;
function mysCapas(id_cabecera,id_base,margen){
var altura_cabecera=document.getElementById(id_cabecera).style.height;
var altura_base=document.getElementById(id_base).style.height;
var h_cab=altura_cabecera.substring(0,altura_cabecera.length-2);
var h_bas=altura_base.substring(0,altura_base.length-2);
var h_final=50;
var h_final_px;
var altura=checkHeight();
var paraIndex=628-h_bas-h_cab-margen-10;

h_final=altura-h_bas-h_cab-10;// es elmargen que dejamos abajo para garantizar que no saque el scroll;
h_final_px=(h_final+'px');
		
	if( pag_index==true ){
		if (document.getElementById('contenido') ){
			document.getElementById('contenido').style.height=paraIndex+'px'}
		if (document.getElementById('sroll_pagina') ){
			document.getElementById('sroll_pagina').style.height=paraIndex+'px'
			document.getElementById('sroll_pagina').style.overflow='';}
			 centraIndex();
		}

	if(h_final>100 && altura<=628 && altura>450  ){
		if (document.getElementById('contenido') ){
			document.getElementById('contenido').style.height=h_final_px;}
		if (document.getElementById('sroll_pagina') ){
			document.getElementById('sroll_pagina').style.height=(h_final-margen)+'px'
			document.getElementById('sroll_pagina').style.overflow='';}
		}
	
	else{
			if (document.getElementById('sroll_pagina') ){
				document.getElementById('sroll_pagina').style.overflow='visible';}
			
		if ( pag_index!=true && altura>450 ){
			if (document.getElementById('contenido') ){
				document.getElementById('contenido').style.height=h_final_px;}
			if (document.getElementById('sroll_pagina') ){
				document.getElementById('sroll_pagina').style.overflow='';
				document.getElementById('sroll_pagina').style.height=(h_final-margen)+'px'}
			}
	}

}
//  CENTRAR INDEX EN PANTALLA
function centraIndex(){
var pantalla=checkHeight();
var margenTop=(pantalla-628)/2;
if(margenTop>1){
document.getElementById('margenArriba').style.display='block';	
document.getElementById('margenArriba').style.height=margenTop+'px';
}
else {document.getElementById('margenArriba').style.display='none';}
}
//MARCAN CUANDO SE ESTA EN LA PAGINA DE LA OBJETOS DEL MENU BASE
function marcaBase(itemBase, estado){
if(itemBase!='' && document.getElementById(itemBase)){
	if( estado==true){document.getElementById(itemBase).className='menu_base_ativ';}
	else{document.getElementById(itemBase).className='menu_base_ativ';}
	}
		
}



//ABRIR  UNA GALERIA DE FOTOS APARTE CON OPCIONES
function abrirGaleria(URL){
var elWidth=750;
var elHeight=550;
if(newWin){newWin.closed();} 
var newWin =window.open(URL,'newWin','top=4000, scrollbars=no,resize=no');
newWin.resizeTo(elWidth,elHeight);
newWin.moveTo((screen.width-elWidth)/2,(screen.height-elHeight)/2);
newWin.focus()

}
// CAMBIO DE COLORES PARA EL CAMPO DE TEXTO DEL BUSCADOR
function buscaCamp(estado,objId){
var obj=document.getElementById(objId);
if(estado==true){obj.style.backgroundColor='#ECEBEB';}
else{obj.style.backgroundColor='#CCC9C9';}
}
// CAMBIO DE COLORES PARA EL CAMPO DE TEXTO DEL BUSCADOR FAQs
function buscaFaqs(estado,objId){
var obj=document.getElementById(objId);
if(estado==true){
obj.style.backgroundColor='#EFF7FE';}
else{obj.style.backgroundColor='#FFFFFF';}
}




