<!-- Comienza el Script. (c) Juan Pablo Tejero Martín '03
var ie=document.all;
var ns=document.layers;
var ns6=document.getElementById&&!document.all;

function enlarge(which,x,y){
	
	if (ie||ns6){
		crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
		if (crossobj.style.visibility){
			crossobj.style.left=ns6? pageXOffset+x : document.body.scrollLeft+x-20
			crossobj.style.top=ns6? pageYOffset+y : document.body.scrollTop+50
			crossobj.innerHTML='<div style=" width:600px;"><img style="cursor:hand; position:absolute; top:21px; left:588px;" align="right" onClick=closepreview() src="/images/cerrar.gif" /><br><table border="0" cellspacing="0" cellpadding="0"><tr><td colspan="2" align="right" style="padding:1px; background-color:#ffffff; border:1px solid #dddddd"><img style="border:1px solid #cccccc" src="'+which+'"></td></tr></table></div>'
			crossobj.style.visibility="visible"
		}

	}
	else if (document.layers){
		if (document.showimage.visibility){
			document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0></a>')
				document.showimage.document.close()
				document.showimage.left=x
				document.showimage.top=y
				document.showimage.visibility="show"
		}
		
	}
		else
		return true
}

function closepreview(){
	crossobj.style.visibility="hidden"
}


var nsx,nsy,nstemp;

function drag_dropns(name){
		temp=eval(name)
		temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
		temp.onmousedown=gons
		temp.onmousemove=dragns
		temp.onmouseup=stopns
}

function gons(e){
		temp.captureEvents(Event.MOUSEMOVE)
		nsx=e.x
		nsy=e.y
}

function dragns(e){
		temp.moveBy(e.x-nsx,e.y-nsy)
		return false
}

function stopns(){
	temp.releaseEvents(Event.MOUSEMOVE)
}

function drag_drop(e){
		if (ie&&dragapproved){
				crossobj.style.left=tempx+event.clientX-offsetx
				crossobj.style.top=tempy+event.clientY-offsety
		}
		else if (ns6&&dragapproved){
				crossobj.style.left=tempx+e.clientX-offsetx
				crossobj.style.top=tempy+e.clientY-offsety
		}
return false
}

function initializedrag(e){
	if (ie&&event.srcElement.id=="drag"||ns6&&e.target.id=="drag"){
		offsetx=ie? event.clientX : e.clientX
		offsety=ie? event.clientY : e.clientY
		tempx=parseInt(crossobj.style.left)
		tempy=parseInt(crossobj.style.top)
		dragapproved=true
		document.onmousemove=drag_drop
	}
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")

//-->
