////////////escribir
dinamico.prototype.escribe = function(html)
{
	if (document.layers)
	{
		this.css.document.open()
		this.css.document.write(html)
		this.css.document.close()
	}
	else
	{
		if (document.getElementById && !document.all)
			{
				this.pro.innerHTML = html;
			}
		if(document.all)
			{
				this.pro.innerHTML = html;
			}		
	}
}

///////////mueve la capa y asigna this.x y this.y
dinamico.prototype.moverA = function(x,y){
this.x=x;this.y=y;
this.css.left = this.x;this.css.top = this.y;
}

///////////mueve la capa de forma relativa
dinamico.prototype.moverDH = function(x,y){
this.x += x;
this.y += y;
this.css.left = this.x;this.css.top = this.y;
}

//////Enseņar y ocultar Div's///////////
dinamico.prototype.EnseOcul = function(vnv){
	if(vnv == 1){
			this.css.visibility = 'visible';}
	else{
			this.css.visibility = 'hidden';}
	return;	
}

////////Clipeado de Div's////////////
dinamico.prototype.clipea = function(t,r,b,l)
{
	this.t = t;this.r = r;this.b = b;this.l = l;
	if(document.layers){this.css.clip.top = this.t;this.css.clip.right = this.r;this.css.clip.bottom = this.b;this.css.clip.left = this.l}
	if(document.all || document.getElementById){this.css.clip = "rect("+this.t+"px "+this.r+"px "+this.b+"px "+this.l+"px)";}	
}
//////////Dar nuevas anchuras y alturas a los div's

dinamico.prototype.nueAncAlt = function(an,al)
{
	this.ancho=(an==null)?this.ancho:an;
	this.alto=(al==null)?this.alto:al;
	
	if(document.all || document.getElementById)
		{
			this.css.width = an;
			this.css.height = al;
			this.css.clip = 'rect(0px '+(this.ancho||0)+'px '+(this.alto||0)+'px 0px)';
		}
	else
		{
			this.css.clip.width = an;
			this.css.clip.height = al;
		}
}

//////////Nuevs alturas y anchuras de contenidos////////////////
dinamico.prototype.nuevaAltura = function()
{
	if(document.all){this.alCont = this.pro.offsetHeight;}
	if(document.layers){this.alCont = this.docu.height;}
	if(document.getElementById && !document.all)
		{
			var h = this.pE.lastChild.style.height;			this.pE.lastChild.style.height = "auto";			this.alCont = this.pE.lastChild.offsetHeight;
			this.pE.lastChild.style.height = h;
		}
}

dinamico.prototype.nuevaAnchura = function()
{
	if(document.all){this.alCont = this.pro.offsetWidth;}
	if(document.layers){this.alCont = this.docu.width;}
	if(document.getElementById && !document.all)
		{
			var w = this.pE.lastChild.style.width;			this.pE.lastChild.style.width = "auto";			this.alCont = this.pE.lastChild.offsetWidth;
			this.pE.lastChild.style.width = w;
		}
}

/////////////////////////////////////////////////////////////////

/////////////////Cambiar Color de fondo/////////////////////////dinamico.prototype.Color=function(color) {
	if(color==null)		{
			if(document.layers)color=null;
			else color='transparent';
		}
	this.bgColor=color;
	if(document.layers)this.docu.bgColor=color;
	else this.css.backgroundColor=color;
};
///////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////Eventos del mouse/////////////////////
var offsetX;
var offsetY;
var objSelecionado;

function md(e)
{
	if(document.layers || document.getElementById && !document.all){var x = e.pageX;var y = e.pageY;}
	if(document.all){var x = event.x+document.body.scrollTop;var y = event.y+document.body.scrollLeft;}
	dragables.coge(x,y);
	//return false solo si las capas dragables son imagenes
	//return false;
}

function mu(e)
{
	if(document.layers || document.getElementById && !document.all){var x = e.pageX;var y = e.pageY;}
	if(document.all){var x = event.x+document.body.scrollTop;var y = event.y+document.body.scrollLeft;}
	dragables.suelta(x,y);
	//return false solo si las capas dragables son imagenes
	//return false;
}
	
function mm(e)
{
	if(document.layers || document.getElementById && !document.all){var x = e.pageX;var y = e.pageY;}
	if(document.all){var x = event.x+document.body.scrollTop;var y = event.y+document.body.scrollLeft;}
	dragables.mueve(x,y);
	//return false solo si las capas dragables son imagenes
	//return false;
}
