function setuppage(){
var imagen = document.getElementById('imgid');//central image
imagen.style.height="350px";
imagen.style.width="636px";
var header=document.getElementById('top');
var headHeight = ContainerHeight(header.id);//height of header
var footHeight = ContainerHeight(document.getElementById('fixedfoot').id);//height of footer

var mid = document.getElementById('middle');

var fxleft = document.getElementById('fixedleft');
var leftWidth = ContainerWidth(fxleft.id);//left div width

var fxright = document.getElementById('fixedright');
var rightWidth = ContainerWidth(fxright.id);//right div width

var p_Height=f_clientHeight()-headHeight-footHeight-40;//max area height
var p_Width=f_clientWidth()-leftWidth-rightWidth-40;//max area height

var fxcenter = document.getElementById('fixedcenter');//outer div central image
var fxframe = document.getElementById('imgframe');//inner div central image

var imgHeight = ContainerHeight(imagen.id);//height of central image
var imgWidth = ContainerWidth(imagen.id);//width of central image

//calculate image proportions
var imgProp=(imgHeight>imgWidth)?p_Height/imgHeight:p_Width/imgWidth;
var newHeight=(imgHeight*imgProp)-40;
var newWidth=(imgWidth*imgProp);
	
var tarea=document.getElementById('contright');
tarea.style.fontSize=12+"px";
heading=tarea.getElementsByTagName('h1');
heading[0].style.fontSize=24+"px";
heading[0].style.marginBottom=12+"px";

var layer=document.getElementById('topImg');//top image div
var lemadiv=document.getElementById('lema');//lema div
var dlema=document.getElementById('innerlema');//lema inside div

var sec = document.getElementById('section');//section image
var secHeight = ContainerHeight(sec.id);//section image height
var secWidth = ContainerWidth(sec.id);//section image width

//calculate section image proportions
var secProp=(secHeight>secWidth)?newHeight/secHeight:newWidth/secWidth;
var newsecHeight=(secHeight*secProp);
var newsecWidth=(secWidth*secProp);
sec.height=newHeight/1.25;
sec.width=newsecWidth/1.25;

//set space from header
header.style.marginBottom=10+'px';

imagen.style.height=newHeight+"px";
imagen.style.width=newWidth+"px";

mid.style.height=newHeight+"px";
fxleft.style.height=newHeight+"px";
fxcenter.style.width=p_Width+"px";
fxcenter.style.height=newHeight+"px";
fxright.style.height=newHeight+"px";
	
	
	layer.style.height=newHeight+"px";
	layer.style.width=newWidth+"px";
	layer.style.top=headHeight+10+'px';
	layer.style.left=leftWidth+20+"px";

if(dlema){
dlema.style.fontSize=36+"px";
dlema.style.width="auto";
var dlemaWidth=(ContainerWidth(dlema.id));
	for(i=36; dlemaWidth>newWidth; i--){
	dlema.style.fontSize=(parseInt(Math.floor(i)))+"px";
	dlema.style.width="auto";
	var dlemaWidth=(ContainerWidth(dlema.id));
	}
}

	if(lemadiv){
	lemadiv.style.height=newHeight+"px";
	lemadiv.style.width=leftWidth+20+newWidth+"px";
	lemadiv.style.top=headHeight+sec.style.height+"px";
	lemadiv.style.left="0px";
	
	}
	tarea.style.height=newHeight-30+"px";
	tarea.pageYOffset=0;
	tarea.scrollTop=0;
	
	var cont = document.getElementById('innercont');

	if(cont.scrollHeight>newHeight-30)
	{
		document.getElementById('scrolldown').style.visibility="visible";
	}
	else
	{
		document.getElementById('scrolldown').style.visibility="hidden";	
	}
	if(lemadiv){
	lemadiv.style.visibility="visible";	
	}
//lemadiv.style.visibility="visible";
mid.style.visibility="visible";
layer.style.visibility="visible";
imagen.style.visibility="visible";
setupmenu();
}

function scrollup(){
cont=document.getElementById("contright");
	if(cont.scrollTop>0)
	{
		cont.scrollTop=cont.scrollTop-10;
		demora = setTimeout("scrollup()",60);
	}
	else
	{
		stopscroll()
	}	
}
function scrolldown(){
cont=document.getElementById("contright");
var conHeight=(ContainerHeight(cont.id));
var incont=document.getElementById("innercont");
	if(cont.scrollHeight>conHeight-30)
	{
		//document.getElementById('scrollup').style.visibility="visible";

		cont.scrollTop=cont.scrollTop+10;
		demora = setTimeout("scrolldown()",60);
	}
	else
	{
		stopscroll();
	}	
}
function getscroll(){
cont=document.getElementById("contright");
var conHeight=(ContainerHeight(cont.id));
var incont=document.getElementById("innercont");
	if(cont.scrollTop<(cont.scrollHeight-conHeight-30))
	{
	document.getElementById('scrolldown').style.visibility="visible";
	}
	else
	document.getElementById('scrolldown').style.visibility="hidden";
	
	if(cont.scrollTop>0)
	{
	document.getElementById('scrollup').style.visibility="visible";
	}
	else
	document.getElementById('scrollup').style.visibility="hidden";	
}
function stopscroll(){
	clearTimeout(demora);
	getscroll();
}
function changeOpac(opacity, num) {
    var object = document.getElementById(num).style;
	if( object.MozOpacity != undefined ) 
	{
    object.MozOpacity = (opacity / 100);
	}
	else if( object.Khtmlopacity != undefined ) 
	{
    object.KhtmlOpacity = (opacity / 100);
	}
	else if( object.filter != undefined ) 
	{ //IE	
	var obj = document.getElementById(num);
	object.setAttribute("filter", "alpha(opacity="+opacity+")");
	}
	else if( object.opacity != undefined ) 
	{ //Opera	
    object.opacity = (opacity / 100);
	}
}

function swopcontent(obj, element, id, dir, opac){
//aparecer();
var bground=document.getElementById('imgid');
bground.src = arrayImages[id].src;

var hijos = firstborn(obj, element);
opimg=document.getElementById(hijos[0]);
op=opimg.style;
if( op.MozOpacity != undefined ) 
{
grade=(dir=='bajar')?opac-10:opac+10;
}		
else if( op.opacity != undefined ) 
{ //Opera
grade=(dir=='bajar')?opac-20:opac+20;
}
else if( op.filter != undefined ) 
{ //IE	
grade=(dir=='bajar')?opac-20:opac+20;
}
else if( op.Khtmlopacity != undefined ) 
{
grade=(dir=='bajar')?opac-10:opac+10;
}
	changeOpac(grade, obj)

if(grade==0){
	
	opimg.src=arrayImages[id].src;
	grade=100;
	
	var secground=document.getElementById('section');
	secground.src = sectionImages[id].src
	var txt = document.getElementById('innercont');
	var newtxt = document.getElementById('txt'+id);
	txt.innerHTML=newtxt.innerHTML;
	var lema = document.getElementById('innerlema');
	var newlema = document.getElementById('lema'+id);
	lema.innerHTML=newlema.innerHTML;
}
	
	if(grade<100){fade=setTimeout("swopcontent('"+obj+"', '"+element+"', '"+id+"', '"+dir+"', '"+grade+"')",1);}
	else{
		
	var objstyle = document.getElementById(obj).style;
	try{ objstyle.removeAttribute("filter"); } catch(err) {};
	getscroll()
	clearTimeout(fade);
	
	changeOpac(grade, obj)
	//desvanecer()
	}
}