function vermarco(dir){
  var wurl2="";
  var wurl1="";
  if (!dir){
    dir="";
  };
  if (!self.CtlDft){
    wurl1=self.location.href;
		} else {
		wurl1=self.CtlDft;
		wurl2="&url2=" + self.location.href;
	};
  try{
    if ((top.location.host!=self.location.host) || (top==self)){
      top.location.replace(dir + "index2.html?url1=" + wurl1 + wurl2);
    };
  }
  catch(exception){
    top.location.replace(dir + "index2.html?url1=" + wurl1 + wurl2);
  };
};
function setcabmenu(){
  try{
    opcion=top.control.cabmenu;
    for (var i=1; true; i++){
      menuid="menu"+i;
      if (i == opcion){
        top.document.getElementById(menuid).className="botonp";
      }
      else{
        top.document.getElementById(menuid).className="boton";
      };
    };
  }
  catch(exception){
  };
};
function setctlmenu(){
  try{
    opcion=top.control.principal.ctlmenu;
    for (var i=1; true; i++){
      menuid="menu"+i;
      if (i == opcion){
        top.control.document.getElementById(menuid).className="botonp";
      }
      else{
        top.control.document.getElementById(menuid).className="boton";
      };
    };
  }
  catch(exception){
  };
};
function setactmenu(){
  try{
    opcion="a" + top.control.principal.actaaaa;
    for (var i=1; i < top.control.document.links.length ; i++){
      if (top.control.document.links[i].name == opcion){
        top.control.document.links[i].className="botonp";
        top.control.actaaaa=top.control.principal.actaaaa;
      }
      else{
        top.control.document.links[i].className="boton";
      };
    };
  }
  catch(exception){
  };
};
function setclaseover(){
  if (this.className == "boton"){
    this.className = "botonh";
  };
};
function setclaseout(){
  if (this.className == "botonh"){
    this.className = "boton";
  };
};
function setblur(){
    this.blur(); 
};
function envcorr (direccion, contenido){
  mto="m~to:";
  mto=mto.replace(/~/,"ail");
  direccion= direccion.replace(/~~/,"@");
  direccion= direccion.replace(/~/g,".");
  document.write ('<a href="' + mto + direccion + '">');
  if (contenido){
    document.write (contenido);
  }
  else{
    document.write (direccion);
  };
  document.write ('<\/a>');
};
function setPralIframe(){
  divHeight=window.innerHeight?window.innerHeight:document.body.clientHeight;
  var winWidth=window.innerWidth?window.innerWidth:document.body.clientWidth;
  var ctlWidth=self.document.getElementById("control").offsetWidth;
  divWidth=winWidth - ctlWidth;
  self.document.getElementById("principal").style.width= divWidth + "px";
  self.document.getElementById("principal").style.height= divHeight + "px";
  window.onresize=setPralIframe;
};
function setCtlIframe(){
  var winHeight=window.innerHeight?window.innerHeight:document.body.clientHeight;
  var cabHeight=self.document.getElementById("cabecera").offsetHeight;
  divHeight=winHeight - cabHeight;
  self.document.getElementById("control").style.height= divHeight + "px";
  window.onresize=setCtlIframe;
};
function initLinks(){
	var arr = document.getElementsByTagName('*');
	for (var i=0; i < arr.length; i++){
		if (arr[i].onclick || arr[i].href) {
			arr[i].onmouseover=setclaseover;
			arr[i].onmouseout=setclaseout;
			arr[i].onfocus=setblur;
		};
	};
};
function setgalmarr() {
    top.galmarr = new Array();
    top.galmarr[0]=arguments[0].childNodes[0].nodeValue;
    for (var i=1; i < arguments.length; i++) {
	    top.galmarr[i]=arguments[i];
    };
};
function openextlnk(obj) {
	var w=window.open();
	w.document.write('<META HTTP-EQUIV="refresh" content="0; url=')
	if (arguments.length > 0) {
		w.document.write(obj.href);
	} else {
		w.document.write(this.href);
	};
	w.document.write('">');
	w.document.close();
	return false;
};
function setboton(obj) {
	var img = obj.childNodes[0]
	var a = img.src.split('/')
	var b = a[a.length - 1].split('.')
	b[0]= obj.id
	a[a.length - 1]=b.join('.')
	img.src = a.join('/')
	obj.className = "boton"
};
function setbotonn(obj) {
	var img = obj.childNodes[0]
	var a = img.src.split('/')
	var b = a[a.length - 1].split('.')
	b[0]= obj.id + 'n'
	a[a.length - 1]=b.join('.')
	img.src = a.join('/')
	obj.className = "botonn"
};




