
var indicate=false
var previousimage=''
if (!document.layers&&!document.all)
event="test"


function previewit(theimage,e){
if ((theimage!=previousimage)&&previousimage!="")
indicate=true
else
indicate=false
previousimage=theimage

if (document.all){
if (document.all.preview2.style.visibility=="hidden"||indicate){
document.all.preview2.src=theimage
document.all.preview2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.preview2.style.pixelTop=event.clientY+document.body.scrollTop
document.all.preview2.style.visibility="visible"
e.cancelBubble='true'
}
}

else if (document.layers){
if (document.preview.visibility=="hide"||indicate){
document.preview.document.write('<img src="'+theimage+'">')
document.preview.document.close()
document.preview.left=e.pageX+10
document.preview.top=e.pageY
document.preview.visibility="show"
}
else
document.preview.visibility="hide"
}
}

function hideimage(){
if (event.srcElement.id!="preview2"){
document.all.preview2.style.visibility='hidden'
document.all.preview2.src='spacer.gif'
}
}

if (document.all)
document.onclick=hideimage


var dragapproved=false
var z,x,y
function move(){
if (event.button==1&&dragapproved){
z.style.pixelLeft=temp1+event.clientX-x
z.style.pixelTop=temp2+event.clientY-y
return false
}
}
function drags(){
if (!document.all)
return
if (event.srcElement.id=="preview2"){
dragapproved=true
z=event.srcElement
temp1=z.style.pixelLeft
temp2=z.style.pixelTop
x=event.clientX
y=event.clientY
document.onmousemove=move
}
}
document.onmousedown=drags
document.onmouseup=new Function("dragapproved=false")


var nsx
var nsy
var nstemp

function drag_drop(name){
temp=eval("document."+name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=go
temp.onmousemove=drag
temp.onmouseup=stop
}

function go(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function drag(e){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}

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


