ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
if (document.getElementById) {
	ns6 = true;
	ie4 = false;
} else {
	ns6 = false
}
//ns6 = (document.getElementById)? true:false

if (navigator.platform.indexOf('MacPPC') >= 0) {
	if (navigator.userAgent.indexOf('MSIE 5') >= 0) {
		document.writeln('<LINK rel="stylesheet" type="text/css" href="css/estilos.css">');
	} else {
		document.writeln('<LINK rel="stylesheet" type="text/css" href="css/estilosg.css">');
	}
}else { if((navigator.appName=="Microsoft Internet Explorer")&&(parseInt(navigator.appVersion)>=4)) document.writeln('<LINK rel="stylesheet" type="text/css" href="css/estilos.css">');
	else if((navigator.appName=="Netscape")&&(navigator.appVersion.indexOf("4.")>=0)) document.writeln('<LINK rel="stylesheet" type="text/css" href="css/estilosg.css">');
	else if((navigator.appName=="Netscape")&&(navigator.appVersion.indexOf("5.")>=0)) document.writeln('<LINK rel="stylesheet" type="text/css" href="css/estilos.css">');
	else document.writeln('<LINK rel="stylesheet" type="text/css" href="css/estilosg.css">');
}

txt1=null;
n_menus=6;
altoweb = 160;
var pararmostrar=null;
var pararocultar=null;

function precargar (botonObj, botonSrc) {
 eval (botonObj + ' = new Image()')
 eval (botonObj + '.src = "'+botonSrc+'"')
}

precargar ('icologoff','imagenes/icologo.gif');
precargar ('icologon','imagenes/icologob.gif');

function cambiarImg (layer, imgName, imgObj) {
  if (document.images) {
	if (ns4 && layer!=null) eval ('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src');
	else document.images[imgName].src = eval (imgObj+".src");
  }
}

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_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_findObj(n, d) { //v3.0
  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); 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];}
}

function init() {
 if (ns4) {
	fondoWeb = document.fondoWebDiv;
	fondoNoti = document.fondoNotiDiv;
	alto = document.altoDiv;
	noticias = document.noticiasDiv;
	lista = document.noticiasDiv.document.listaDiv;
	menu = document.menuDiv;
	carga = document.cargaDiv;
	web1 = document.web1Div;
	web2 = document.web2Div;
	web3 = document.web3Div;
	web4 = document.web4Div;
	web5 = document.web5Div;
	web6 = document.web6Div;
	}

if (ie4) {
	fondoWeb = fondoWebDiv.style;
	fondoNoti = fondoNotiDiv.style;
	alto = altoDiv.style;
	noticias = noticiasDiv.style;
	lista = listaDiv.style;
	menu = menuDiv.style;
	carga = cargaDiv.style;
	for(i=1;i<=n_menus;i++){
		eval("web"+i+" = web"+i+"Div.style;")
		eval("web"+i+".pixelHeight = 0")
		}
	}

if (ns6) {
	fondoWeb = document.getElementById("fondoWebDiv").style;
	fondoNoti = document.getElementById("fondoNotiDiv").style;
	alto = document.getElementById("altoDiv").style;
	noticias = document.getElementById("noticiasDiv").style;
	lista = document.getElementById("listaDiv").style;
	menu = document.getElementById("menuDiv").style;
	carga = document.getElementById("cargaDiv").style;
	for(i=1;i<=n_menus;i++){
		eval("web"+i+" = document.getElementById('web"+i+"Div').style");
		eval("web"+i+".height = 0")
		}
	}

	lista.ypos = parseInt(lista.top);
 
//	tope = (ie4) ? 169-parseInt(lista.height):169-lista.clip.bottom

	if (ie4) tope = 169-parseInt(lista.height);
	if (ns6) tope = 169-parseInt(lista.height);
	if (ns4) tope = 169-lista.clip.bottom;

	var pararbajar=null;
	var pararsubir=null;
	mostrarObjeto(fondoWeb)
	mostrarObjeto(fondoNoti)
	ocultarObjeto(carga)
	mostrarObjeto(alto)
	mostrarObjeto(noticias)
	mostrarObjeto(menu)
}

function mostrarMenu(n) {
	if (txt1!=null) {
		ocultarObjeto(txt1)
		if (ns4) eval("txt1.clip.height = "+altoweb+";");
		if (ie4) txt1.pixelHeight = 0;
		if (ns6) txt1.height = 0;
	}
	clearTimeout(pararmostrar)
	clearTimeout(pararocultar)
	txt1=eval("web"+n)
	mostrarObjeto(txt1)
	largo=0;
	activo=n;
	if (ie4) mostrarObjAniIE4();
	if (ns6) mostrarObjAniNS6();
	if (ns4) mostrarObjAniNS4(txt1,4,altoweb);
}

function mostrarObjAniIE4() {
	if (eval("txt1.pixelHeight < "+altoweb)) {
		txt1.pixelHeight +=16;
		pararmostrar = window.setTimeout("mostrarObjAniIE4();", 10);
	}
}

function mostrarObjAniNS6() {
	if (eval("parseInt(txt1.height) < "+altoweb)) {
		nuevoalt = parseInt(txt1.height) + 20;
		txt1.height = nuevoalt + "px";
		pararmostrar = window.setTimeout("mostrarObjAniNS6();", 10);
	}
}

function mostrarObjAniNS4(lyr,yinc,maximo) {
	largo=largo+4;
	lyr.clip.height = lyr.clip.top + largo;
	if ((largo < maximo)) {
		pararmostrar = setTimeout('mostrarObjAniNS4(txt1,4,altoweb)',10)
	}
}

function mostrarObjeto(obj) {
	if (ns4) obj.visibility = "show"
	else if ((ie4) || (ns6)) obj.visibility = "visible"
}

function ocultarObjeto(obj) {
	if (ns4) obj.visibility = "hide"
	else if ((ie4) || (ns6)) obj.visibility = "hidden"
}

function ocultarMenu(n) {
	largo=0;
	activo=n;
	clearTimeout(pararmostrar);
	clearTimeout(pararocultar);
	if (ie4) ocultarObjAniIE4();
	if (ns6) ocultarObjAniNS6();
	if (ns4) ocultarObjeto(txt1);
}

function ocultarObjAniIE4() {
	if (eval("txt1.pixelHeight > 0")) {
		txt1.pixelHeight -=16;
		pararocultar = window.setTimeout("ocultarObjAniIE4();", 10);
	} else {
		ocultarObjeto(txt1);
		txt1.pixelHeight = 0;
	}
}

function ocultarObjAniNS6() {
	if (eval("parseInt(txt1.height) > "+0)) {
		nuevoalt = parseInt(txt1.height) - 20;
		txt1.height = nuevoalt + "px";
		pararocultar = window.setTimeout("ocultarObjAniNS6();", 10);
	} else {
		ocultarObjeto(txt1);
		txt1.height = 0;
	}
}


function ocultarObjetoAniNS(lyr,yinc,minimo) {
	largo=largo+4;
	lyr.clip.height = altoweb - largo;
	if ((largo < 120)) {
		pararocultar = setTimeout('ocultarObjetoAniNS(txt1,4,0)',10)
	} else {
		ocultarObjeto(txt1);
		eval("txt1.clip.height = 120;");
	}
}

function parar_bajar()
{
	clearTimeout(pararbajar)
}

function bajar()
{
	if (lista.ypos < 1)
	{
		if ((ie4) || (ns4)) {
			lista.ypos += 2
		} else {
			lista.ypos += 6
		}
        	lista.top = lista.ypos
        	pararbajar=setTimeout("bajar()",20)
        }
}

function parar_subir()
{
	clearTimeout(pararsubir)
}

function subir()
{
	if (lista.ypos > tope){
		if ((ie4) || (ns4)) {
			lista.ypos -= 2
		} else {
			lista.ypos -= 6
		}
		lista.top = lista.ypos
		pararsubir=setTimeout("subir()",20)
        }
}
