You have a problem of scope, I suggest you read a little about it because you can improve your javascript a ton, but you could solve it in two general ways:
var inv_count; //you declare your variable in a global scope, it's not very good practice
$(document).ready(function() {
inv_count = 3;
});
function blah(a,b) {
alert (inv_count);
}
or
$(document).ready(function() {
var inv_count = 3;
function blah(a,b) {
alert (inv_count);
}
//you declare everything inside the scope of jQuery, if you want to acess blah outside use:
//window.blah = blah;
});
Also I recommend you read about clousures if you don't know how they work.
inv_counta global variable; it is inside a function. write it outside thereadyfunction