Dynamic horizontal menu

Dynamic horizontal menu

Hello guys. I am working on multilanguage project and I need help with top horizontal menu. Problem I must to solve is, that items (UL>LI) on top menu in every language is various long. In some language there is no problem in 1024px browser resolutions (no breaking line), in other there is not enough space in 1280px. 
So I search for script that convert horizontal menu dynamically to dropdown list according your browser resolution. I found http://css-tricks.com/examples/ConvertMenuToDropdown/ but this convert whole inline UL >LI menu do dropdown in exact browser size. And I look for script, that doesnt change whole UL to dropdown, but only partly. So in big browser resolution width you have all items inline, when smaller more LI change to dropdown - not all - but item by item. Something that checks and compare dynamically size of UL and browser resolution. Thanx.