/*

Drag n drop for layers

*/



//drag drop function for NS////
/////////////////////////////////

var dragswitch=0
var nsx
var nsy
var 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){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}

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


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

var dragapproved=false

function drag_dropie_1() {

	if (dragapproved==true){
		document.all.layer_1.style.pixelLeft=tempx+event.clientX-iex
		document.all.layer_1.style.pixelTop=tempy+event.clientY-iey
		return false
	}
	
}

function drag_dropie_2() {

	if (dragapproved==true){
		document.all.layer_2.style.pixelLeft=tempx+event.clientX-iex
		document.all.layer_2.style.pixelTop=tempy+event.clientY-iey
		return false
	}
}

function drag_dropie_3() {

	if (dragapproved==true){
		document.all.layer_3.style.pixelLeft=tempx+event.clientX-iex
		document.all.layer_3.style.pixelTop=tempy+event.clientY-iey
		return false
	}
}

function drag_dropie_4() {

	if (dragapproved==true){
		document.all.layer_4.style.pixelLeft=tempx+event.clientX-iex
		document.all.layer_4.style.pixelTop=tempy+event.clientY-iey
		return false
	}
}

function drag_dropie_5() {

	if (dragapproved==true){
		document.all.layer_5.style.pixelLeft=tempx+event.clientX-iex
		document.all.layer_5.style.pixelTop=tempy+event.clientY-iey
		return false
	}
}

function drag_dropie_6() {

	if (dragapproved==true){
		document.all.layer_6.style.pixelLeft=tempx+event.clientX-iex
		document.all.layer_6.style.pixelTop=tempy+event.clientY-iey
		return false
	}
}

function initializedragie(choice){
iex=event.clientX
iey=event.clientY
tempx=eval("layer_"+choice).style.pixelLeft
tempy=eval("layer_"+choice).style.pixelTop
dragapproved=true
document.onmousemove=eval("drag_dropie_"+choice)
}

if (document.all){
document.onmouseup=new Function("dragapproved=false")
}

////drag drop functions end here//////

function hidebox(choice) {

	if (document.all) {
		eval("layer_"+choice).style.visibility="hidden"
	} else if (document.layers) {
		document.eval("layer_"+choice).visibility="hide"
	}
}

function showbox(choice) {

	if (document.all) {
		eval("layer_"+choice).style.visibility="visible"
	} else if (document.layers) {
		document.eval("layer_"+choice).visibility="show"
	}
}