function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ns6 = (this.b=="ns" && this.v==6)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
}
is = new BrowserCheck()
// abajo izquierda
function movercursor1(e)
	{
		// IE5
		if (document.body && document.body.scrollTop)  {
			pointer.moveTo(event.clientX-220,event.clientY+12+document.body.scrollTop)
		}
		// IE6
		if (document.documentElement && document.documentElement.scrollTop) {
			pointer.moveTo(event.clientX-220,event.clientY+12+document.documentElement.scrollTop)
		}
		// NS	
		if (is.ns) {
			 pointer.moveTo(e.pageX-200,e.pageY+12);
		}
	}
// abajo derecha
function movercursor2(e)
	{
		if (document.body && document.body.scrollTop)  {
			pointer.moveTo(event.clientX+30,event.clientY+20+document.body.scrollTop)
		}
		if (document.documentElement && document.documentElement.scrollTop) {
		 	pointer.moveTo(event.clientX+30,event.clientY+20+document.documentElement.scrollTop)
		}
		if (is.ns) {
			 pointer.moveTo(e.pageX+30,e.pageY+12);
		}
	}
// arriba izquierda
function movercursor3(e)
	{
		if (document.body && document.body.scrollTop) {
			pointer.moveTo(event.clientX-200,event.clientY-80+document.body.scrollTop)
		}		
		if (document.documentElement && document.documentElement.scrollTop) {
			pointer.moveTo(event.clientX-200,event.clientY-80+document.documentElement.scrollTop)
		}					
		if (is.ns) {
			 pointer.moveTo(e.pageX-200,e.pageY-80);
		}
	}
// arriba derecha
function movercursor4(e)
	{
		if (document.body && document.body.scrollTop) {
			pointer.moveTo(event.clientX+30,event.clientY-80+document.body.scrollTop)
		}
		if (document.documentElement && document.documentElement.scrollTop) {
			pointer.moveTo(event.clientX+30,event.clientY-80+document.documentElement.scrollTop)
		}			
		if (is.ns) {
			 pointer.moveTo(e.pageX+30,e.pageY-80);
		}
	}
function movercursor5(e)
	{
		if (document.body && document.body.scrollTop) {
			pointer.moveTo(event.clientX+40,event.clientY-200+document.body.scrollTop)
		}
			
		if (is.ns) {
			 pointer.moveTo(e.pageX+40,e.pageY-200);
		}
	}

function detectamov(titulo,texto,posicion)
	{
		if (cargado)
			{
				if (is.ns)
				{
					switch (posicion)
					{
						case 1:	document.captureEvents(Event.MOUSEMOVE);
								document.onmousemove = movercursor1;
								break;
						case 2:	document.captureEvents(Event.MOUSEMOVE);
								document.onmousemove = movercursor2;
								break;
						case 3:	document.captureEvents(Event.MOUSEMOVE);
								document.onmousemove = movercursor3;
								break;
						case 4:	document.captureEvents(Event.MOUSEMOVE);
								document.onmousemove = movercursor4;
								break;
						case 5:	document.captureEvents(Event.MOUSEMOVE);
								document.onmousemove = movercursor5;
								break;
					}
				}
			
				else
				{ 
					switch (posicion)
					{
						case 1: document.onmousemove = movercursor1;
								break;
						case 2: document.onmousemove = movercursor2;
								break;
						case 3: document.onmousemove = movercursor3;
								break;
						case 4: document.onmousemove = movercursor4;
								break;
						case 5: document.onmousemove = movercursor5;
								break;
					}
				}
				var txt='<table cellpadding="0" cellspacing="0" border="0" width="186">';
				txt+='<tr>';
				txt+='<td width="2" background="./images/t_fondogris.gif"></td>';
				txt+='<td bgcolor="#52B2D6" width="184">';
				txt+='<table cellpadding="5" cellspacing="1" border="0">';
				txt+='<tr>';
				txt+='<td width="184" bgcolor="#BFEEFF"><table cellpadding="0" cellspacing="0" border="0"><tr><td width="17"><img src="./images/t_admiracion.gif" border="0"></td><td align="center" width="167" class="cuerpo1"><b>'+titulo+'</b></td></tr></table></td>';
				txt+='</tr>';
				txt+='<tr>';
				txt+='<td width="184" bgcolor="#FFFFFF" class="cuerpojustificado">'+texto+'</td>';
				txt+='</tr>';
				txt+='</table>';
				txt+='</td>';
				txt+='</tr>';
				txt+='<tr>';
				txt+='<td colspan="2"><img src="./images/t_fondogrishori1.gif"></td>';
				txt+='</tr>';
				txt+='</table>';
				pointer.write(txt);
				pointer.show();
			}
	}
function endMov()
{
	setInterval('',500);
}
function detectamovoff()
	{
		if (cargado)
			{
				pointer.hide();
				if (is.ns6) document.captureEvents(null)
				else 
				{
				document.onmousemove=endMov;
				}
			}
	}

function DynLayer(id,nestref,frame) {
	if (!DynLayer.set && !frame) DynLayerInit()
	this.frame = frame || self
	if (is.ns)
		{
			if (is.ns4)
				{
					if (!frame)
						{
							if (!nestref) var nestref = DynLayer.nestRefArray[id]
							if (!DynLayerTest(id,nestref)) return
							this.css = (nestref)? eval("document."+nestref+".document."+id) : document.layers[id]
						}
					else
						this.css = (nestref)? eval("frame.document."+nestref+".document."+id) : frame.document.layers[id]
					this.elm = this.event = this.css
					this.doc = this.css.document
					this.x = this.css.left
					this.y = this.css.top
					this.w = this.css.clip.width
					this.h = this.css.clip.height
				}
			else if (is.ns5)
				{
					this.elm = document.getElementById(id)
					this.css = this.elm.style
					this.doc = document
					var auxx=this.css.left;
					this.x = auxx.substring(0,auxx.indexOf('px'))
					var auxy=this.css.top;
					this.y = auxy.substring(0,auxy.indexOf('px'))
					this.w = this.elm.offsetWidth
					this.h = this.elm.offsetHeight
				}
		}
	else if (is.ie)
		{
			this.elm = this.event = this.frame.document.all[id]
			this.css = this.frame.document.all[id].style
			this.doc = document
			this.x = this.elm.offsetLeft
			this.y = this.elm.offsetTop
			this.w = (is.ie4)? this.css.pixelWidth : this.elm.offsetWidth
			this.h = (is.ie4)? this.css.pixelHeight : this.elm.offsetHeight
		}
	this.id = id
	this.nestref = nestref
	this.obj = id + "DynLayer"
	eval(this.obj + "=this")
}

function DynLayerShow() {
	this.css.visibility = (is.ns4)? "show" : "visible"
}

function DynLayerHide() {
	this.css.visibility = (is.ns4)? "hide" : "hidden"
}

function DynLayerMoveTo(x,y) {
	if (x!=null) {
		this.x = x
		if (is.ns) this.css.left = this.x
		else this.css.pixelLeft = this.x
	}
	if (y!=null) {
		this.y = y
		if (is.ns) this.css.top = this.y
		else this.css.pixelTop = this.y
	}
}

function DynLayerWrite(html)
	{
		if (is.ns4)
			{
				this.doc.open()
				this.doc.write(html)
				this.doc.close()
			}
		else if (is.ns5)
			{this.elm.innerHTML = html}
		else if (is.ie)
			{this.event.innerHTML = html}
	}

DynLayer.prototype.write = DynLayerWrite
DynLayer.prototype.show = DynLayerShow
DynLayer.prototype.hide = DynLayerHide
DynLayer.prototype.moveTo = DynLayerMoveTo
DynLayerTest = new Function('return true')

function DynLayerInit(nestref) {
	if (!DynLayer.set) DynLayer.set = true
	if ((is.ns)&&(!is.ns5))
		{
			if (nestref)
				ref = eval('document.'+nestref+'.document')
			else
				{nestref = ''; ref = document;}

			for (var i=0; i<ref.layers.length; i++)
				{
					var divname = ref.layers[i].name
					DynLayer.nestRefArray[divname] = nestref
					var index = divname.indexOf("Div")
					if (index > 0)
						{eval(divname.substr(0,index)+' = new DynLayer("'+divname+'","'+nestref+'")')}
					if (ref.layers[i].document.layers.length > 0)
						{DynLayer.refArray[DynLayer.refArray.length] = (nestref=='')? ref.layers[i].name : nestref+'.document.'+ref.layers[i].name}
				}
			if (DynLayer.refArray.i < DynLayer.refArray.length)
				{DynLayerInit(DynLayer.refArray[DynLayer.refArray.i++])}
		}
	else if (is.ie)
		{
			for (var i=0; i<document.all.tags("DIV").length; i++)
				{
					var divname = document.all.tags("DIV")[i].id
					var index = divname.indexOf("Div")
					if (index > 0)
						{eval(divname.substr(0,index)+' = new DynLayer("'+divname+'")')}
				}
		}
	else if (is.ns5)
		{
			for (var i=0; i<document.getElementsByTagName("DIV").length; i++)
				{
					var divname = document.getElementsByTagName("DIV")[i].id
					var index = divname.indexOf("Div")
					if (index > 0)
						{eval(divname.substr(0,index)+' = new DynLayer("'+divname+'")')}
				}
		}
	return true
}

DynLayer.nestRefArray = new Array()
DynLayer.refArray = new Array()
DynLayer.refArray.i = 0
DynLayer.set = false



