Here is what I use:
$(window).bind('resize', function(event) {
//Whatever you want to run here
});
Just set a variable for you window width and height and check what they are at inside of this function.
As for changing your javascript file when the screen is resized with out reloading the whole page... I don't think that is possible. A work around might be to import all the javascript files into one file and just run different functions that overwrite any changes that the last javascript function made.
This obviously uses jQuery though.