prova con

temp1=parseInt(document.getElementById(id).offsetL eft, 10);
temp2=parseInt(document.getElementById(id).offsetT op, 10);