var sortorder = "obj,exp,qual,edu,int,ref,img".split(',');
$('div').sort(function(a, b){
return sortorder.indexOf(a.id) > sortorder.indexOf(b.id);
}).appendTo('body');
http://jsfiddle.net/JYnMd/
Older versions of IE do not support Array object's indexOf
method, for supporting those pseudo-browsers, you can use jQuery $.inArray()
utility function:
$('div').sort(function(a, b){
return $.inArray(a.id, sortorder) > $.inArray(b.id, sortorder);
}).appendTo('body');