//****************
//* funciones de *
//* roll over    *
//****************

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) { //v4.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);
  if(!x && document.getElementById) x=document.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];}
}
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; }
}
// ********************************************************************
// *funcion que verifica el browser y asigna el estilo correspondiente*
// ********************************************************************
// se usa estilos() si está en la raiz, estilos2() si se está bajo UN directorio y así sucesivamente

var ns4 = (document.layers)? true:false
var ie4 = (document.all)? true:false

function estilos()
{
if (ie4)
	{
	document.write('<link rel=\"STYLESHEET\" type="TEXT/CSS" href=\"/estilos/ms.css\">');
	}
else
	{
	document.write('<link rel=\"stylesheet\" href=\"/estilos/ns.css\" type=\"text/css\">');		
	}
}

// **************************
// * Funcion que abre Popup *
// **************************

function popup(pagina,nombre,alto,ancho)
{
	window.open(pagina, nombre, "toolbar=no,location=no,directories=no,status=no,scrollbars=NO,menubar=no,resizable=no,top=146, left=160,width="+ancho+",height="+alto)
}
function popup2(pagina,nombre,alto,ancho)
{
	window.open(pagina, nombre, "toolbar=no,location=no,directories=no,status=no,scrollbars=NO,menubar=no,resizable=no,top=0, left=0,width="+ancho+",height="+alto)
}

function popup_scroll(pagina,nombre,alto,ancho)
{
	window.open(pagina, nombre, 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=no,top=0, left=0,width='+ancho+',height='+alto)
}

// *************************************
// * Funcion que abre Popup con scroll *
// *************************************

function popupscroll(pagina,nombre,alto,ancho)
{
/*	var winl = (screen.width - ancho) / 2;
	var wint = (screen.height - alto) / 2;
	window.open(pagina, nombre, "toolbar=no,location=no,directories=no,status=no,scrollbars=YES,menubar=no,resizable=no,width="+ancho+",height="+alto+",top="+wint+",left="+winl)*/
}

// ******************************
// * Funcion abre Popup centrado*
// ******************************

function popupcentrado(pagina,nombre,alto,ancho)
{
	//ABRE UN POPUP CENTRADO
	var winl = (screen.width - ancho) / 2;
	var wint = (screen.height - alto) / 2;
	window.open(pagina, nombre, "toolbar=no,location=no,directories=no,status=no,scrollbars=NO,menubar=no,resizable=no,width="+ancho+",height="+alto+",top="+wint+",left="+winl)
}

// *******************************
// * Funcion popupcentradoscroll *
// *******************************

function popupcentradoscroll(pagina,nombre,alto,ancho)
{
	//ABRE UN POPUP CENTRADO y con scroll
	var winl = (screen.width - ancho) / 2;
	var wint = (screen.height - alto) / 2;
	window.open(pagina, nombre, "toolbar=no,location=no,directories=no,status=no,scrollbars=YES,menubar=no,resizable=no,width="+ancho+",height="+alto+",top="+wint+",left="+winl)
}
// *******************************
// * Funcion fecha      	     *
// *******************************
function fecha()
{
        today = new Date();
        day = today.getDay();

        if ( day == 0 ) { document.write("Domingo "); }
        if ( day == 1 ) { document.write("Lunes "); }
        if ( day == 2 ) { document.write("Martes "); }
        if ( day == 3 ) { document.write("Mi&eacute;rcoles "); }
        if ( day == 4 ) { document.write("Jueves "); }
        if ( day == 5 ) { document.write("Viernes "); }
        if ( day == 6 ) { document.write("S&aacute;bado "); }

        today = new Date();
        year = today.getYear();
		if ( year <= 200) {year = year + 1900}
        if ( today.getMonth() == 0 ) { month = "Enero" }
        if ( today.getMonth() == 1 ) { month = "Febrero" }
        if ( today.getMonth() == 2 ) { month = "Marzo" }
        if ( today.getMonth() == 3 ) { month = "Abril" }
        if ( today.getMonth() == 4 ) { month = "Mayo" }
        if ( today.getMonth() == 5 ) { month = "Junio" }
        if ( today.getMonth() == 6 ) { month = "Julio" }
        if ( today.getMonth() == 7 ) { month = "Agosto" }
        if ( today.getMonth() == 8 ) { month = "Septiembre" }
        if ( today.getMonth() == 9 ) { month = "Octubre" }
        if ( today.getMonth() == 10 ) { month = "Noviembre" }
        if ( today.getMonth() == 11 ) { month = "Diciembre" }

       document.write( today.getDate(), " de ", month, " ", year);
}

ie=document.all?1:0;
n=document.layers?1:0;
timSpeed=50;
contHeight=100;

function makeScrollObj(obj,nest) {
	nest=(!nest) ? '':'document.'+nest+'.'										
	this.css=(n) ? eval(nest+'document.'+obj):eval('document.all.'+obj+'.style')							
	this.scrollHeight=n?this.css.document.height:eval('document.all.'+obj+'.offsetHeight')							
	this.top=b_gettop										
	return this
}

function b_gettop(){
	var gleft=(n) ? eval(this.css.top):eval(this.css.pixelTop);
	return gleft;
}

var scrollTim;
var active=0;
function scroll(speed){
	clearTimeout(scrollTim)
	way=speed>0?1:0
	if((!way && oScroll[active].top()>-oScroll[active].scrollHeight+contHeight) || (oScroll[active].top()<0 && way)){
		oScroll[active].css.top=oScroll[active].top()+speed
		scrollTim=setTimeout("scroll("+speed+")",timSpeed)
	}
}

function noScroll(){
	clearTimeout(scrollTim)
}

function scrollInit(){
	oScroll=new Array()
	oScroll[0]=new	makeScrollObj('divScroll','divCont')
	oScroll[0].css.visibility='visible'
}

// ********************************
// * Llamada a la Funcion estilos *
// * para que se ejecute          *
// ********************************

estilos();


