/*
var dragswitch=0 
var nsx 
var nsy 
var nstemp 

function drag_dropns(name){ 
temp=eval(name); 
temp.captureEvents(Event.MOUSEDOWN); 
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 

var g_win_id = null;
var iex = null;
var iey = null;
var tempx = null;
var tempy = null;

function drag_dropie(win_id){ 
	if (dragapproved==true){ 
		document.getElementById(g_win_id).style.pixelLeft=tempx+event.clientX-iex; 
		document.getElementById(g_win_id).style.pixelTop=tempy+event.clientY-iey; 
		return false 
	} 
} 

function initializedragie(win_id){ 
	g_win_id = win_id;
	iex=event.clientX;
	iey=event.clientY;
	tempx=document.getElementById(win_id).style.pixelLeft; 
	tempy=document.getElementById(win_id).style.pixelTop; 
	dragapproved=true; 
	document.onmousemove=drag_dropie;
} 


if (document.all){ 
document.onmouseup=new Function("dragapproved=false") 
} 
*/
var dragObj = null;
var tempX, tempY = 0;
	document.onmouseup = function()
	{
		EndDrag(true);
	}


					
	document.onmousemove = function()
	{
		if (dragObj != null)
		{
			dragObj.style.top = (event.clientY - tempY);
			dragObj.style.left = (event.clientX - tempX);
						
		}
	}


	function StartDrag(srcObj)
	{
		//alert("START");
		//var srcObj = event.srcElement;
		srcObj.style.position = "absolute";
		//srcObj.style.filter = "alpha(opacity=80)";

		
		tempY = event.clientY - parseInt(srcObj.style.top);
		tempX = event.clientX - parseInt(srcObj.style.left);

		//document.getElementById("temp").innerText = srcObj.style.left+", "+srcObj.style.top+", "+event.clientX+", "+event.clientY+", "+event.x+", "+event.y+", "+tempY+", "+tempX;
		//srcObj.style.top = event.y;
		//srcObj.style.left = event.x;
		
		dragObj = srcObj;
	}
	
	function EndDrag(update)
	{

		dragObj = null;
		tempX = 0;
		tempY = 0;
	}
