function capa(capa) {
	if (ns4) {
		this.estilo = document.layers[capa];
		this.x = this.estilo.left;
		this.y = this.estilo.top;
	}
	else if (ie4) {
		this.estilo = document.all(capa).style ;
		this.x = this.estilo.pixelLeft;
		this.y = this.estilo.pixelTop;
	}
	else if (n6) {
		this.estilo = document.getElementById(capa).style;
		this.x = this.estilo.pixelLeft;
		this.y = this.estilo.pixelTop;
	}
	if (ns4) this.event = this.estilo;
	if (n6) this.event = document.getElementById(capa).style;
	if (ie4) this.event = document.all[capa];
	this.obj = capa + "capa";
	eval(this.obj + "=this");
	this.capa = capa;
	this.w = (ns4)? this.estilo.clip.width : this.estilo.pixelWidth;
	this.h = (ns4)? this.estilo.clip.height : this.event.scrollHeight;
	this.z = this.estilo.zIndex;
	this.scrollh = this.h;
	this.subeA = capaSubeA;
	this.ajustaA = capaAjustaA;
	this.mueveA = capaColocaEn;
	this.desplazaEn = capaDesplazaEn;
	this.muestra = capaMuestra;
	this.oculta = capaOculta;
	this.escribe = capaEscribe;
	this.setArrastraEn = capaArrastraEnInit;
	this.arrastraEn = capaArrastraEn;
	this.arrastra = capaArrastra;
	this.creaContenido = CreaContenido;
	this.cargaPagina = CargaPagina;
}
function CreaContenido () {
	this.contenido = this.capa + "Contenido";
	if (ns4) {
		//this.escribe("<layer id='"+this.capa+"Contenido"+"' WIDTH=175 HEIGHT=175 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING='NO' FRAMEBORDER='NO'></layer>");
		//eval(this.contenido+"=document."+this.capa+".document."+this.capa+"Contenido");
		eval(this.contenido+"=this.event");
	}
	if (ie4) {
		this.escribe("<iframe id='"+this.capa+"Contenido"+"' WIDTH="+this.w+" HEIGHT="+this.h+" MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING='NO' FRAMEBORDER='NO'></IFRAME>");
		eval(this.contenido+"=document.all."+this.capa+"Contenido");
	}
}
function CargaPagina (url) {
	eval(this.contenido).src=url;
}
function capaEscribe (texto_html) {
	if (ns4) {
		this.event.document.open();
		this.event.document.write(texto_html);
		this.event.document.close();
	}
	else if (ie4) {
		this.event.innerHTML = texto_html;
	}
}
function capaSubeA (z) {
	if (z!=null) {
		this.z = z;
		this.estilo.zIndex = z;
	}
}
function capaAjustaA (new_w, new_h) {
	if (new_w!=null) {
		this.w = new_w;
		if (ns4) this.estilo.clip.width = this.w;
		if (ie4) this.estilo.pixelWidth = this.w;
	}
	if (new_h!=null) {
		this.h = new_h;
		if (ns4) this.estilo.clip.height = this.h;
		if (ie4) this.estilo.pixelHeight = this.h;
	}
}
function capaColocaEn(x,y) {
	if (x!=null) {
		this.x = x;
		this.estilo.left = this.x;
	}
	if (y!=null) {
		this.y = y;
		this.estilo.top = this.y;
	}
}
function capaDesplazaEn(x,y) {
	if (x==null) x = 0;
	if (y==null) y = 0;
	this.mueveA(this.x+x,this.y+y);
}
function capaMuestra() {
	this.estilo.visibility = (ns4)? "show" : "visible";
if (n6){
	this.estilo.visibility =  "visible" ;}
}
function capaOculta() {
	this.estilo.visibility = (ns4)? "hide" : "hidden";
if (n6){
	this.estilo.visibility =  "hidden" ;}
}
function capaSubeA (z) {
	if (z!=null) {
		this.z = z;
		this.estilo.zIndex = z;
	}
}
function capaArrastraEnInit () {
	this.arrastraEn = capaArrastraEn;
	this.arrastra = capaArrastra;
}
function capaArrastraEn ( xdist, ydist, inc, velocidad, f_funcion) {
	if ( this.arrastrando ) return
	if (!inc) inc = 20;
	if (!velocidad) velocidad = 10;
	var xf = this.x + xdist;
	var yf = this.y + ydist;
	var num = Math.sqrt(Math.pow(xdist,2) + Math.pow(ydist,2))/inc;
	if (num==0) return;
	var dx = xdist/num;
	var dy = ydist/num;
	if (!f_funcion) f_funcion = null;
	this.arrastrando = true;
	this.arrastra( dx, dy, xf, yf, num, 1, velocidad, f_funcion );
}
function capaArrastra ( dx, dy, xf, yf, num, i, velocidad, f_funcion ) {
	if (i++ < num) {
		this.desplazaEn(dx,dy);
		setTimeout(this.obj+".arrastra("+dx+","+dy+","+xf+","+yf+","+num+","+i+","+velocidad+",\""+f_funcion+"\")",velocidad);
	}
	else {
		this.mueveA( xf, yf );
		this.arrastrando = false;
		eval( f_funcion );
	}
}

