Sorting Portlets

Sorting Portlets

Hi,

I'm really confused here..
I"m using this example to save the state of portlets.

http://jqueryui.com/demos/sortable/#portlets

How can i get the id of the portlet which i'm moving and how can i get the column id to which i'm dragging?

I gave the id attributes in div for column and for the portlet

like

<input type="text" id=txtselected />
<div class="column" id="Col1">
<div class="portlet" id="P1">
<div class="portlet-header">Feeds</div>
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
</div>
<div class="portlet" id="P2">
<div class="portlet-header">News</div>
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
</div>


<div class="column" id="Col2">
</div>


Can you please help me in saving the selected portlet id and the column id in txtselected ?

Thx,
Mujeeb.