$("th").live("click",function(){
var str1="",str2="";
$(this).siblings().each(function(){
if(str1==""){
str1=$(this).attr("orderField");
}
else{
str1=str1+","+$(this).attr("orderField");
}
if(str2==""){
str2=$(this).attr("class");
}
else{
str2=str2+","+$(this).attr("class");
}
});
$("*[name='orderField']").val(str1);
$("*[name='orderDirection']").val(str2);
});
var str1="",str2="";
$(this).siblings().each(function(){
if(str1==""){
str1=$(this).attr("orderField");
}
else{
str1=str1+","+$(this).attr("orderField");
}
if(str2==""){
str2=$(this).attr("class");
}
else{
str2=str2+","+$(this).attr("class");
}
});
$("*[name='orderField']").val(str1);
$("*[name='orderDirection']").val(str2);
});