var array_exists_cont = [{col:1}, {col:2}, {col:1}, {col:2}, {col:1}, {col:3}, {col:3}, {col:3} ],
array_exists = [];
function resort() {
var tmp_hash = {};
for (var i=array_exists_cont.length; i--; ) {
tmp_hash[array_exists_cont[i].col] || (tmp_hash[array_exists_cont[i].col] = []);
tmp_hash[array_exists_cont[i].col].unshift(array_exists_cont[i]);
}
for (i in tmp_hash) {
array_exists.push(tmp_hash[i]);
}
}