(function( $, undefined ) {

function num(v) {
    return parseInt(v, 10) || 0;
}