I find this line rather complex in terms of what it does:
var n=(/\d$/.test(divId))?divId.substr(divId.length-1):"";
I would like to say I understand how that works, but it's a bit beyond me, I can see how it's taking the divId.length - 1 and creating a variable 'n', but I do not get the...