comunque potresti lavorare sull' indirizzo in href
onclick="return check(this.href.substr(this.href.indexOf('id=')+3) )"

ciao