ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
var capa= (ns4)? document.layers : document.all 
document.onmousemove = mouseMove;
if(ns4){document.captureEvents(Event.MOUSEMOVE);}
var capita=0;var cX1, cX2, cY,cY2
function mouseMove(e) {
		 var x = (ns4)? e.pageX : event.x 
		 var y = (ns4)? e.pageY : event.y
	     Xpos = x ;
		 Ypos = y ;
		 if(capita!=0){
				if(y>cY || x<cX1 || x>cX2 || y<cY2){
					if (ns4){capa['m' + capita].visibility= "hidden"}
					else{capa["m" + capita].style.visibility= "hidden";}
				}  
		  } 
			return true
}
function mostrar(cual,x1,x2,y1,y2){
    capita=cual
	cX1=x1
	cX2=x2
	cY=y1
	cY2=y2
	if (ns4){ capa['m' + cual].visibility="visible";}
	else {capa["m" + cual].style.visibility= "visible";}
}


var hoy = new Date();
dia = hoy.getDate();
mes = hoy.getMonth();
ano = hoy.getFullYear();

if (mes == "0") nombremes = "Enero";
else if (mes == "1") nombremes = "Febrero";
else if (mes == "2") nombremes = "Marzo";
else if (mes == "3") nombremes = "Abril";
else if (mes == "4") nombremes = "Mayo";
else if (mes == "5") nombremes = "Junio";
else if (mes == "6") nombremes = "Julio";
else if (mes == "7") nombremes = "Agosto";
else if (mes == "8") nombremes = "Septiembre";
else if (mes == "9") nombremes = "Octubre";
else if (mes == "10") nombremes = "Noviembre";
else nombremes = "Diciembre";




function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ns6 = (this.b=="ns" && this.v==6)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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) { //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];}
}

//Función para manejar el menú de inicio superior
//de la página. Nos permite Restaurar, Cambiar imagen y Clickear
var selec,ima
function menuIMG(cual, imagen, accion){
	if(accion=="r"){
		var i,x,a=document.MM_sr; 
		for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
		if(selec!=null)MM_swapImage(selec,'',ima,1)
	}
	if(accion=="s"){MM_swapImage(cual,'',imagen,1)}
	if(accion=="c"){
		if(selec!=null){antId=selec;antImg=ima
		selec=cual;ima=imagen;MM_swapImage(antId,'',antImg,1);MM_swapImgRestore()}
else {antId=cual;antImg=ima;selec=cual;ima=imagen;MM_swapImage(antId,'',antImg,1);MM_swapImgRestore()}
	}
}

function enlace(donde,nivel){
if (donde=="home"){
if (nivel==2){nivel="../"}
window.location=nivel+"home.htm"
}
if (donde=="op1" || donde=="op2" || donde=="op3" || donde=="op4"){
if (donde=="op1"){window.open('#');}

if (donde=="op2"){window.open('#');}

if (donde=="op4"){window.open('#');}


if (donde=="op3"){window.open('#');}



}
else {
if (nivel==5){
window.location="../../"+donde+"/"+donde+".htm"
		}

if (nivel==4){
window.location="../"+donde+".htm"
		}
if (nivel==3){
window.location="../../"+donde+".htm"
		}
if (nivel==2){
window.location="../"+donde+"/"+donde+".htm"
		}
if (nivel==1){

window.location=donde+".htm"
}
if (nivel==0){

window.location=donde+"/"+donde+".htm"
}
}
}

function presenta(valor){
if (window.screen.width==800){var Sx=0;var Sy=0}
else {var Sx=((window.screen.width - 700)/2)-5;var Sy=((window.screen.height - 525)/2)-15;}
window.open('soporte'+valor+'.htm','confirmacion','resizable=no,scrollbars=no,toolbar=no,location=no,menu=no,Width=800,Height=600,left=' + Sx + ',top=' + Sy);
}
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function descargar(dir,pos,cual)
{
if(pos==2){window.location="../descargas/"+dir+"/"+cual+".zip"}
if(pos==1){window.location="descargas/"+dir+"/"+cual+".zip"}
}

// Funcion ramdon imagenes fondo 

function ImagenesObj() {
n=0;
this[n++]="../imgcomun/r1.jpg";
this[n++]="../imgcomun/r2.jpg";
this[n++]="../imgcomun/r3.jpg";
this[n++]="../imgcomun/r4.jpg";
this[n++]="../imgcomun/r5.jpg";
this[n++]="../imgcomun/r6.jpg";
this.N=n;



}
function ff(){
var Imagenes=new ImagenesObj();src= Imagenes[ Math.floor(Math.random() * Imagenes.N) ] ;
document.write("<img src="+src+" width='445' height='203' > ")
}

function noticia(desde){
	if (desde==1){window.location="#"}
	if (desde==2){window.location="#"}
	}
