var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all


function enlarge(which,e,i){
//Render image code for IE 4+ and NS6
if (ie||ns6){
imanota=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (imanota.style.visibility=="hidden"){
imanota.style.left=ns6? pageXOffset+e.clientX : document.body.scrollLeft+event.clientX
imanota.style.top=ns6? pageYOffset+e.clientY : document.body.scrollTop+event.clientY
imanota.innerHTML='<div class=caja align=center><table cellSpacing=2 cellPadding=2><tr><td class=cajon align=right id=drag><b>Llanera.com</b> <b style=cursor:hand onClick=closepreview()><IMG BORDER=0 SRC=images/btn_close_small.gif></b>&nbsp;&nbsp;</td></tr><tr><td align=center><img src="'+which+'"></td></tr><tr><td>'+fotonoti[i]+'</td></tr></table></div>'
imanota.style.visibility="visible"
imanota.className='tabla';

}
else
imanota.style.visibility="hidden"
return false
}
//Render image code for NS 4
else if (document.layers){
if (document.showimage.visibility=="hide"){
document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0></a>')
document.showimage.document.close()
document.showimage.left=e.x
document.showimage.top=e.y
document.showimage.visibility="show"
}
else
document.showimage.visibility="hide"
return false
}
//if NOT IE 4+ or NS 4, simply display image in full browser window
else
return true
}

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

//drag drop para NS 4////
/////////////////////////////////

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)
}

//drag drop function for IE 4+ and NS6////
/////////////////////////////////

function drag_drop(e){
if (ie&&dragapproved){
imanota.style.left=tempx+event.clientX-offsetx
imanota.style.top=tempy+event.clientY-offsety
}
else if (ns6&&dragapproved){
imanota.style.left=tempx+e.clientX-offsetx
imanota.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(imanota.style.left)
tempy=parseInt(imanota.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}

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