//Web Otto Walter

// Funciones de menús

// Botones logos
function men_OVE_logo(OP) { 
  if (document.getElementById('L_1')!=null) {document.getElementById('L_1').className="opOUT_logo1"}
  if (document.getElementById('L_2')!=null) {document.getElementById('L_2').className="opOUT_logo2"}
  if (document.getElementById('LA1')!=null) {document.getElementById('LA1').className="opOUT_logo1"}
  if (document.getElementById('LA2')!=null) {document.getElementById('LA2').className="opOUT_logo2"}
  if (right(OP,1)==1 || right(OP,1)==2) {document.getElementById(OP).className="opOVE_logo"+right(OP,1) }
  }

function men_OUT_logo(OP) {
  if (right(OP,1)==1 || right(OP,1)==2) {document.getElementById(OP).className="opOUT_logo"+right(OP,1) }
  if (document.getElementById('LA1')!=null) {document.getElementById('LA1').className="opOVE_logo1"}
  if (document.getElementById('LA2')!=null) {document.getElementById('LA2').className="opOVE_logo2"}
  }


function men_ACT_logo(OP) {
  var op_C=right(OP,1)
  if (op_C==1 || op_C==2) {document.getElementById(OP).className="opACT_logo"+op_C }
  }


//Botones menú principal
function men_OVE(OP) { 
  var celOP = document.getElementsByTagName('TD') ; 
  var numOP = celOP.length;
  if(numOP>0){
    do{
      var nom = celOP[numOP-1].id
      if (nom.indexOf('_A')!=-1){document.getElementById(celOP[numOP-1].id).className="opOUT" } 
      document.getElementById(OP).className="opOVE"
    }
    while(--numOP);
    }
  }

function men_OUT() { 
  var celOP = document.getElementsByTagName('TD') ;
  var numOP = celOP.length;
  if(numOP>0){
    do{
      var nom = celOP[numOP-1].id
      if (nom.indexOf('O_')!=-1){document.getElementById(celOP[numOP-1].id).className="opOUT" } 
      if (nom.indexOf('_A')!=-1){document.getElementById(celOP[numOP-1].id).className="opOVE" } 
    }
    while(--numOP);
    } 
  }

function men_ACT(OP) {document.getElementById(OP).className="opACT";}

function asig_EVEN(cel_M, neo_E, neo_F) {if(cel_M.addEventListener){cel_M.addEventListener(neo_E, neo_F, false);} else {cel_M.attachEvent("on"+neo_E, neo_F);}}


/* FUNCIONES ESPECIALES PARA OTRAS FUNCIONES */
	function left(str, n){if(n<=0) return ""; else if (n> String(str).length)return str; else return String(str).substring(0,n);}
	function right(str,n){if(n<=0) return ""; else if (n> String(str).length)return str; else {var iLen = String(str).length; return String(str).substring(iLen, iLen - n);}}
/* FINAL FUNCIONES ESPECIALES */

// Boton logos

// Opciones menú secundario

function mensec_OVE(OP) { 
var celOP = document.getElementsByTagName('A') ; 
var numOP = celOP.length;
if(numOP>0){
  do{
	  var nom = celOP[numOP-1].id
	  if (nom.indexOf('M_')!=-1){document.getElementById(celOP[numOP-1].id).className="op2OUT" } 
	  document.getElementById(OP).className="op2OVE"
	}
  while(--numOP);
  } 
}

function mensec_OUT() { 
var celOP = document.getElementsByTagName('A') ;
var numOP = celOP.length;
if(numOP>0){
  do{
	  var nom = celOP[numOP-1].id
	  if (nom.indexOf('M_')!=-1){document.getElementById(celOP[numOP-1].id).className="op2OUT" } 
	  if (nom.indexOf('_B')!=-1){document.getElementById(celOP[numOP-1].id).className="op2OVE" } 
	}
  while(--numOP);
  } 
}


// Boton grande cursos

function camb_FND(CEL,FND) {CEL.className ="btOVE";
  CEL.onmouseout=function() {CEL.className ="btOUT";}
}

function acti_FND(CEL,FND) {CEL.className ="btACT";
  CEL.onmouseout=function() {CEL.className ="btOUT";}
}

//Funciones de rollovers y popups

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


var ventana=null;

function abre_ventana(direccion,ancho,alto)
{

var winl = (screen.width-700)/2;
var wint = (screen.height-800)/2;

if(navigator.displayWindow)
	{ventana.src=direccion;}
	//{ventana = window.close;}
else
	var dim = "toolbar=0,location=0,directories=0,status=no,menubar=0,scrollbars=1,resizable=1,copyhistory=0,top=" + wint+ ",left=" + winl + ",width=" + ancho + ",height=" + alto
	ventana = window.open(direccion,"displayWindow",dim);
}

function cambiaH() {
	var altura
	var fijo = 230
	if (window.innerHeight){ 
	   //navegadores basados en mozilla 
	   altura = window.innerHeight - fijo 
	}else{ 
	   if (document.body.clientHeight){ 
		  //Navegadores basados en IExplorer, es que no tengo innerheight 
		   altura = document.body.clientHeight - fijo 
	   }else{ 
		   //otros navegadores 
		   altura = 350 
	   } 
	} 
  document.getElementById("cuerpo_scroll").style.height = altura ;
}
