Just a note on style: you might consider wrapping the script contents in an immediate function in order to introduce a new variable scope. The reason for this is that all of the functions defined in this script are in the global scope, so there's a potential for clashes with either other iSites core functions/variables or mis-behaving scripts introduced by other iSites tools. If you wrap this code in an immediate function and localize all variables with the `var` keyword, then you can avoid that potential issue. Obviously, it has been working fine so far, so that's not a huge concern, but I think it's worth pointing out.