// Funcion usada en Agor003 para abrir nuevas ventanas
function abrirDialogAxenda(pag, param, ancho, alto)
{
    return window.open(pag, param,
        "width="+ ancho +"px,height="+ alto +"px,center=yes,status=no,resizeable=no,help=no,scroll=yes");
}

//Usase na paxina de busqueda de BOPG y DSPG
function calendarios()
{
	var lblD=document.getElementById('lblDataDesde');
	
	if (lblD)
	{
		var inptD=lblD.getElementsByTagName('input')[0];
		var spD=lblD.getElementsByTagName('span')[0];
		spD.onclick=function()
			{
				return __PopCalShowCalendar(inptD.id,spD);
			};
	}
	
	var lblH=document.getElementById('lblDataHasta');
	
	if (lblH)
	{
		var inptH=lblH.getElementsByTagName('input')[0];
		var spH=lblH.getElementsByTagName('span')[0];
		spH.onclick=function()
			{
				return __PopCalShowCalendar(inptH.id,spH);
			};
	}
	
	return true;
}
//Funcion para aumentar y disminuir el tamaņo de la fuente con los botones de ferramentas.
function zoomText(Accion,Elemento){ 
	obj=document.getElementById(Elemento);
	if (obj.style.fontSize=='') 
	{ 	
		obj.style.fontSize='100%'; 
	} 
	actual=parseInt(obj.style.fontSize); 
	incremento=10; 
	if(Accion=='aumentar' && actual < 120) 
	{	
		valor=actual+incremento;
		obj.style.fontSize=valor+'%';
	}
	if(Accion=='disminuir' && actual > 80)
	{
		valor=actual-incremento;
		obj.style.fontSize=valor+'%';
	}
	};
	
	
function hideDiv(idName){
		obj = document.getElementById(idName);
		obj.style.display="none";
	};
	
function changeVisibility(idName){
	obj = document.getElementById(idName);
	obj2 = document.getElementById('img' + idName);
	if (obj.style.display=='none')
	{
		obj.style.display="block";
		obj2.src='./_themes/pargal/imaxes/iconos/pdg.bulletFlechaazuldown.gif';
	}
	else
	{
		obj.style.display="none";
		obj2.src='./_themes/pargal/imaxes/iconos/pdg.bulletFlechaazul.gif';

	}
};

// This function gives the same height to 'primaria' and 'secundaria' divs
// It's intended to be executed when loading <body> contents
function layoutContentDivs() {

	var divPrimaria=document.getElementById("primaria");
	var divSecundaria=document.getElementById("secundaria");

	if(divPrimaria!=null && divSecundaria!=null) {
		var divPrimariaHeight = divPrimaria.offsetHeight;
		var divSecundariaHeight = divSecundaria.offsetHeight;

		if(divPrimariaHeight>divSecundariaHeight) {
			divSecundaria.style.height = divPrimariaHeight + "px";
		}
		
		if(divPrimariaHeight<divSecundariaHeight) {
			divPrimaria.style.height = divSecundariaHeight + "px";
		}
	}
};

// Function to be loaded when loading page. This code requires scriptLoader.js file to be loaded before scriptTools.js
addLoadEvent(layoutContentDivs);	// run layoutContentDvis onLoad
