//funciones de los desplegables -- Basada en el Dynlayer Object de Dan Steinman, de http://www.dansteinman.com/dynduo/-- Gracias Dan
version=parseInt(navigator.appVersion);
var bro = navigator.appName
ns = (bro=="Netscape")? true:false;
var ns4 = false;
if(ns){ns4 = (version==4)? true:false};
ie = (bro=="Microsoft Internet Explorer")? true:false;
function DynLayer(id) {
    if (ns) {
	if (ns4==false) {
		this.event = document.getElementById(id)
		this.css = this.event.style
		this.doc = document
		this.x = this.css.left
		this.y = this.css.top
	}
	else{
      	  	this.css = document.layers[id]
        	this.event = this.css
        	this.x = this.css.left
		this.y = this.css.top
        }
    }
    else if (ie) {
        this.event = document.all[id]
        this.css = document.all[id].style
    }
    this.id = id
    this.obj = id + "DynLayer"
    eval(this.obj + "=this")
}
function DynLayerMoveTo(x,y) {
	if (x!=null) {
		this.x = this.css.left
		this.x = x
		if (ns) this.css.left = this.x
		else this.css.pixelLeft = this.x
	}
	if (y!=null) {
		this.y = y
		if (ns) this.css.top = this.y
		else this.css.pixelTop = this.y
	}
}

function DynLayerShow() {
    this.css.visibility = (ns4)? "show" : "visible"
}

function DynLayerHide() {
    this.css.visibility = (ns4)? "hide" : "hidden"
}

DynLayer.prototype.moveTo = DynLayerMoveTo
DynLayer.prototype.show = DynLayerShow
DynLayer.prototype.hide = DynLayerHide

function init() {
        menu1 = new DynLayer("menu1Div")
        menu2 = new DynLayer("menu2Div")
        menu3 = new DynLayer("menu3Div")
        menu4 = new DynLayer("menu4Div")
        menu5= new DynLayer("menu5Div")
        menu6 = new DynLayer("menu6Div")
        menu7 = new DynLayer("menu7Div")
        menu8 = new DynLayer("menu8Div")
        if (ns4){
             menu1.event.captureEvents(Event.MOUSEDOWN);
             menu3.event.captureEvents(Event.MOUSEDOWN);
        }
        menu1.event.onmouseout = new Function ("mouseOutHandler('menu1')");
        menu2.event.onmouseout = new Function ("mouseOutHandler('menu2')");
        menu3.event.onmouseout = new Function ("mouseOutHandler('menu3')");
        menu4.event.onmouseout = new Function ("mouseOutHandler('menu4')");
        menu5.event.onmouseout = new Function ("mouseOutHandler('menu5')");
        menu6.event.onmouseout = new Function ("mouseOutHandler('menu6')");
        menu7.event.onmouseout = new Function ("mouseOutHandler('menu7')");
        menu8.event.onmouseout = new Function ("mouseOutHandler('menu8')");

}

function mouseOutHandler(layer) {
    eval(layer+".hide()");

}
//funcion para el pop up de las fotos
    function verFoto (url,tam,pos) {
        var ancho;
        var alto;
        var altoClose=20;
        if (tam=='med'){
          if (pos=='H'){
           ancho=140;
           alto=105;
          } else {
           ancho=140;
           alto=187;
          }
        } else
          if (pos=='H'){
           ancho=400;
           alto=300;
           } else {
           ancho=300;
           alto=400;
          }
        path = "/viewPhoto.jsp?photo=" + url+"&ancho="+ancho+"&alto="+alto;
        xpos = screen.width/2 - ancho/2;
        ypos = screen.height/2 - alto/2;
        alto=alto+altoClose;
        eval ("v = window.open (path,'photo','top=' + ypos + ',left=' + xpos + ',width='+ancho+',height='+alto)");

        v.focus ();
    }
    
    //funcion generada por Dreamweaver para refresco para netscape 4
    
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);
