sono ignorante anche io e non ho ben capito che cosa significhi questa riga:
document.onmouseup = new Function("curElement=null")

però credo che proprio li dovresti chiamare una funzione per scrivere un cookie che salvi la posizione

Codice PHP:
var curElement;
function 
doMouseMove() {
var 
newleft=0newTop 0
if ((event.button==1) && (curElement!=null)) {

newleft=event.clientX-document.all.OuterDiv.offsetLeft-(curElement.offsetWidth/2)
if (
newleft<0newleft=0
curElement
.style.pixelLeftnewleft
newtop
=event.clientY -document.all.OuterDiv.offsetTop-(curElement.offsetHeight/2)
if (
newtop<0newtop=0
curElement
.style.pixelTopnewtop
event
.returnValue false
event
.cancelBubble true
}
}

function 
doDragStart() {
// Don't do default drag operation.
if ("IMG"==event.srcElement.tagName)
event.returnValue=false;
}

function 
doMouseDown() {
if ((
event.button==1) && (event.srcElement.tagName=="IMG"))
curElement event.srcElement
}

document.ondragstart doDragStart;
document.onmousedown doMouseDown;
document.onmousemove doMouseMove;
document.onmouseup salva(el_id);

function 
salva (id) {
  
SetCookie(id+"-pos-x",newleft,30);
  
SetCookie(id+"-pos-y",newtop,30);
  
curElement=null;  // non sono sicuro che questo sia corretto
  
}
function 
SetCookie(cookieName,cookieValue,nDays) {
    var 
today = new Date();
    var 
expire = new Date();
    if (
nDays==null || nDays==0nDays=1;
    
expire.setTime(today.getTime() + 3600000*24*nDays);
    
document.cookie cookieName +"="escape(cookieValue) +";expires="expire.toGMTString();
}
function 
ReadCookie(cookieName) {
    var 
theCookie=""+document.cookie;
    var 
ind=theCookie.indexOf(cookieName);
    if (
ind==-|| cookieName=="") return ""
    var 
ind1=theCookie.indexOf(';',ind);
    if (
ind1==-1ind1=theCookie.length
    return 
unescape(theCookie.substring(ind+cookieName.length+1,ind1));


hai anche bisogno di una funzione che ti legga i cookie