<!--
//Funciones revisadas

//Hace visible un Layer, opcionalmente con fade
function Show(name, fade, shadow)
{
	showobj = eval('document.all.' + name)
	if (showobj)
	{
		showobj.style.display='';
		if (showobj.style.visibility!='visible')
		{
			if (fade==1)
			{
				showobj.style.visibility = 'hidden';
				if (shadow==1)
				{
					showobj.style.filter = 'blendTrans(duration=2)progid:DXImageTransform.Microsoft.Shadow(color=022222,direction=135 strength=20)';
				} else {
					showobj.style.filter = 'blendTrans(duration=2)';
				}
				showobj.filters.blendTrans.stop();
				showobj.filters.blendTrans.apply();
			}
			showobj.style.visibility = 'visible';

			if (fade==1)
			{
				showobj.filters.blendTrans.play();
			}
		}
	}
}

//Oculta un Layer, opcionalmente con fade
function Hide(name, fade)
{
	showobj = eval('document.all.' + name)
	if (showobj)
	{
		if (showobj.style.visibility!='hidden')
		{
			if (fade==1)
			{
				showobj.style.visibility = 'visible';
				if (showobj.filters.blendTrans.status!=2)
				{
					showobj.filters.blendTrans.stop();
					showobj.filters.blendTrans.apply();
					showobj.style.visibility = 'hidden';
					showobj.filters.blendTrans.play();
				}
				else
				{
					showobj.filters.blendTrans.stop();
					showobj.style.visibility = 'hidden';
				}
			}
			else
			{
				showobj.style.visibility = 'hidden';
			}
		}
		showobj.style.display = 'none'
	}
}


//Función para cambiar el texto o todo el HTML de un Div
function changetext(divname, newtext) {
    if (document.layers) {
        document.layers[divname].document.write(newtext)
        document.layers[divname].document.close()
    }
    else if (document.all) document.all[divname].innerHTML = newtext
}

//Funciones para abrir una ventana centrada en la pantalla
//tipos:
//1.-no scroll, no status, no toolbar
//2.-si scroll, no status, no toolbar
//3.-no scroll, si status, no toolbar
//4.-no scroll, no status, si toolbar
//5.-si scroll, si status, no toolbar
//6.-si scroll, no status, si toolbar
//7.-no scroll, si status, si toolbar
//8.-si scroll, si status, si toolbar
function openwin(source,ancho,alto,tipo){
 var win_opt, xposition=0, yposition=0;
 if(parseInt(navigator.appVersion)>=4){xposition=(screen.width-ancho)/2;yposition=((screen.height-alto)/2)-25;}
 win_opt = "location=0,directories=0,menubar=0,copyhistory=0,resizable=0";
 if ((tipo==2)||(tipo==5)||(tipo==6)||(tipo==7)) win_opt += ",scrollbars=1"; else win_opt += ",scrollbars=0";
 if ((tipo==3)||(tipo==5)||(tipo==7)||(tipo==8)) win_opt += ",status=1"; else win_opt += ",status=0";
 if ((tipo==4)||(tipo==6)||(tipo==7)||(tipo==8)) win_opt += ",toolbar=1"; else win_opt += ",toolbar=0";
 win_opt += ",screenx=" + xposition + "," + "screeny=" + yposition + "," + "left=" + xposition + "," + "top=" + yposition + ",";
 win_opt += "width=" + ancho + ",height=" + alto;
 rand= "" + Math.floor(1000*Math.random())+1;
 nombre="newwin"+rand
 return window.open(source,nombre,win_opt);
}

function openwinresizable(source,ancho,alto,tipo){
 var win_opt, xposition=0, yposition=0;
 if(parseInt(navigator.appVersion)>=4){xposition=(screen.width-ancho)/2;yposition=((screen.height-alto)/2)-25;}
 win_opt = "location=0,directories=0,menubar=0,copyhistory=0,resizable=1";
 if ((tipo==2)||(tipo==5)||(tipo==6)||(tipo==7)) win_opt += ",scrollbars=1"; else win_opt += ",scrollbars=0";
 if ((tipo==3)||(tipo==5)||(tipo==7)||(tipo==8)) win_opt += ",status=1"; else win_opt += ",status=0";
 if ((tipo==4)||(tipo==6)||(tipo==7)||(tipo==8)) win_opt += ",toolbar=1"; else win_opt += ",toolbar=0";
 win_opt += ",screenx=" + xposition + "," + "screeny=" + yposition + "," + "left=" + xposition + "," + "top=" + yposition + ",";
 win_opt += "width=" + ancho + ",height=" + alto;
 rand= "" + Math.floor(1000*Math.random())+1;
 nombre="newwin"+rand
 return window.open(source,nombre,win_opt);
}

function showDiv(obj) {
	ns4 = (document.layers)? true:false
	ie4 = (document.all)? true:false

	if (ns4) block = eval("document." + obj)
	if (ie4) block = eval(obj + ".style")

	if (ns4) block.visibility = "show"
	else if (ie4) block.visibility = "visible"
}

//Control de los menus de la web de Idemas

//para efecto cambio de color sobre elementos del menu
function mOvr(src,clrOver,nItem) {
	if (!src.contains(event.fromElement)) {
	src.style.cursor = 'hand';
	src.bgColor = clrOver;
	}
	SetWindowStatus(nItem);
}

function SetWindowStatus(nStatus) {
	switch (nStatus) {
		case 1:
			Frase = "";
			break;
		case 2:
			Frase = "";
			break;
		case 3:
			Frase = "";
			break;
		case 4:
			Frase = "";
			break;
		case 5:
			Frase = "";
			break;
		case 6:
			Frase = "";
			break;
		default:
			Frase = window.defaultStatus
	}
	window.status = Frase;
}

function mOut(src,clrIn) {
	if (!src.contains(event.toElement)) {
	src.style.cursor = 'default';
	src.bgColor = clrIn;
	SetWindowStatus(0);
	}
}

function mClk(src) {
	if(event.srcElement.tagName=='TD'){
	src.children.tags('A')[0].click();
	}
}


//FUNCIONES NO REVISADAS / NO usadas

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function modelesswin(url,mwidth,mheight){
if (document.all&&window.print) //if ie5
eval('window.showModelessDialog(url,"","help:0;resizable:1;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")')
else
eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=1,scrollbars=1")')
}

//FUNCION PARA HACER EL PRELOAD DE LAS IMAGENES
function preload(imgObj,imgSrc) {
  eval(imgObj+' = new Image()')
  eval(imgObj+'.src = "'+imgSrc+'"')
}

//FUNCION PARA REALIZAR EL DESPLAZAMIENTO DE CUALQUIER OBJETO DIV EN LA DIRECCION QUE SE QUIRA
function slide(obj,initx,inity,finx,finy,dir,inc) {
  if (document.layers) {
    eval("document."+obj+".top =" + parseInt(inity));
    eval("document."+obj+".left =" + parseInt(initx));
  }
  else {
    if (document.all) {
      eval(obj+".style.pixelTop=" + parseInt(inity));
      eval(obj+".style.pixelLeft=" + parseInt(initx));
    }
 }
 if (dir=='directo') return true;
 if (dir=='arriba'){
  if (parseInt(inity)>parseInt(finy)){
    setTimeout("slide('"+obj+"',"+finx+","+(parseInt(inity)-parseInt(inc))+","+finx+","+finy+",'"+dir+"',"+inc+")",10)
  }
 }
 if (dir=='abajo'){
  if (parseInt(inity)<parseInt(finy)){
    setTimeout("slide('"+obj+"',"+finx+","+(parseInt(inity)+parseInt(inc))+","+finx+","+finy+",'"+dir+"',"+inc+")",10)
  }
 }
 if (dir=='izquierda'){
  if (parseInt(initx)>parseInt(finx)){
   setTimeout("slide('"+obj+"',"+(parseInt(initx)-parseInt(inc))+","+finy+","+finx+","+finy+",'"+dir+"',"+inc+")",10)
  }
 }
 if (dir=='derecha'){
  if (parseInt(initx)<parseInt(finx)){
   setTimeout("slide('"+obj+"',"+(parseInt(initx)+parseInt(inc))+","+finy+","+finx+","+finy+",'"+dir+"',"+inc+")",10)
  }
 }
 return true;
}

//FUNCION PARA DESPLAZAR DIVS EN LA DIRECCION QUE SE QUIERA A PARTIR DE DONDE ESTÁ
function sliderel(obj,incx,incy,inc) {
  if (document.layers) {
    if (incy!=0) {
      eval("document."+obj+".top = document."+obj+".top + " + parseInt(inc));
      incy=incy-(Math.abs(inc));
    }
    if (incx!=0){
      eval("document."+obj+".left = document."+obj+".left +" + parseInt(inc));
      incx=incx-(Math.abs(inc));
    }
    if ((incx==0)&&(incy==0)) salida=true;
     else {setTimeout("sliderel('"+obj+"',"+incx+","+incy+","+inc+")",10);}
  }
  else {
    if (document.all) {
     if (incy!=0) {
      eval(obj+".style.pixelTop=" + obj + ".style.pixelTop +" + parseInt(inc));
      incy=incy-(Math.abs(inc));
     }
     if (incx!=0) {
      eval(obj+".style.pixelLeft=" + obj + ".style.pixelLeft +" + parseInt(inc));
      incx=incx-(Math.abs(inc));
     }
    if ((incx==0)&&(incy==0)) salida=true;
     else {setTimeout("sliderel('"+obj+"',"+incx+","+incy+","+inc+")",10);}
   }
  }
}

//FUNCIONES PARA SABER CUAL ES LA POSICION DE UN LAYER
function divx(obj){
  if (document.layers) return eval("document."+obj+".left");
  else if (document.all) return eval(obj+".style.pixelLeft");
}

function divy(obj){
  if (document.layers) return eval("document."+obj+".top");
  else if (document.all) return eval(obj+".style.pixelTop");
}

//FUNCIONES PARA SABER LA POSICION DE UN ANCHOR
function anchorx(obj){
 if (document.layers) return eval("document.anchors['"+obj+"'].x");
 else {
  xPos = eval("document.anchors('"+obj+"').offsetLeft");
  tempEl = eval("document.anchors('"+obj+"').offsetParent");
  while (tempEl != null) {xPos += tempEl.offsetLeft;tempEl = tempEl.offsetParent;}
  return xPos;
 }
}

function anchory(obj){
 if (document.layers) return eval("document.anchors['"+obj+"'].y");
 else {
  yPos = eval("document.anchors('"+obj+"').offsetTop");
  tempEl = eval("document.anchors('"+obj+"').offsetParent");
  while (tempEl != null) {yPos += tempEl.offsetTop;tempEl = tempEl.offsetParent;}
  return yPos;
 }
}


//FUNCIO PER CAMBIAR IMATGES CUAN NO TE LAYER
function changeimg (img1,img2){
 eval("document.images['"+ img1 + "'].src="+ img2 +".src");
}

//FUNCIONS PER CAMBIAR IMATGES SI TE LAYER
function changedivimg (divname,img1,img2){
 if (document.all){
 eval("document.images['"+ img1 + "'].src="+ img2 +".src");
 }
 else if (document.layers){
  eval("document."+ eldiv +".document['"+ img1 + "'].src="+ img2 +".src");
 }
}

//FUNCIO PER CAMBIAR EL TEXTE I TOT L'HTML SI ES VOL DE UN ANCHOR
function changeanchor(aname, newtext) {
 if (document.layers) {
  var textmarca=newtext;
  document.write(textmarca.anchor(""));
  document.anchors[aname].text=newtext;
 }
 else if (document.all) document.anchors(aname).innerHTML = newtext
}

//FUNCION PARA REALIZAR UN FADEIN Y UN FADEOUT AL ENTRAR EN UNA PAGINA
//EJEMPLO:  onLoad="fade(100,0,0,255,255,255,64)" onUnload="fade(255,255,255,100,0,0,64)"
function fadebgcolor(sred, sgreen, sblue, ered, egreen, eblue, step) {
 var hexCharacters = "0123456789ABCDEF"
 for(var i = 0; i <= step; ++i) {
  red = Math.floor(sred * ((step - i) / step) + ered * (i / step))
  green = Math.floor(sgreen * ((step - i) / step) + egreen * (i / step))
  blue = Math.floor(sblue * ((step - i) / step) + eblue * (i / step))
  redhex= hexCharacters.charAt(Math.floor(red / 16)) + hexCharacters.charAt(red % 16)
  greenhex= hexCharacters.charAt(Math.floor(green / 16)) + hexCharacters.charAt(green % 16)
  bluehex= hexCharacters.charAt(Math.floor(blue / 16)) + hexCharacters.charAt(blue % 16)
  document.bgColor = "#" + redhex + greenhex + bluehex
 }
}

//FUNCIONES QUE OCULTAN O MUESTRAN UN LAYER SEGUN NOS INTERESE O NOS RETORNA SU VISIBILIDAD
//function show(obj) {
// if (document.layers) eval("document."+obj+".visibility = 'show'");
 //else if (document.all) eval(obj+".style.visibility = 'visible'");
//}
//function hide(obj) {
// if (document.layers) eval("document."+obj+".visibility = 'hide'");
// else if (document.all) eval(obj+".style.visibility = 'hidden'");
//}

function isvisible(obj){
 if (document.layers) {
  if (eval("document."+obj+".visibility == 'show'")) return true;
  else return false;
 }
 else if (document.all) {
  if (eval(obj+".style.visibility == 'visible'")) return true;
  else return false;
 }
}
//-->
