This is done with Javascript and Ajax, if I'm correct it's located in the file js/varien/configurable.js. If you want to change the behaviour of this you could use prototyping to extend the specific function. Im not to good with javascript but I think this Stackoverflow article explains the basics of extending http://stackoverflow.com/questions/2686258/javascript-inheritance-extend-functionhttps://stackoverflow.com/questions/2686258/javascript-inheritance-extend-function