<script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> function doFunky(nav_name) { if(divStatus('mp3s_menu')=="block"){ nav_from = "mp3s"; } if(divStatus('videos_menu')=="block"){ nav_from = "videos"; } if(divStatus('files_menu')=="block"){ nav_from = "files"; } $("#" + nav_from + "_menu").fadeOut("slow",function() { $("#" + nav_name + "_menu").fadeIn("slow"); }); } function divStatus(the_thing){ if (document.getElementById){ return document.getElementById(the_thing).style.display; } else{ if (document.layers){ return document.the_thing.display; } else{ return document.all.the_thing.style.display; } } } </script> <small><a href="javascript:doFunky('videos')">1</a></small> <small><a href="javascript:doFunky('mp3s')">2</a></small> HTML: it is menna work.. but it doesnt.. the problem is this: it doesnt get the divStatus('files_menu') etc BUT it works if i do document.write(divStatus('files_menu')); so its the if() function that i have done wrong probs :S whats wrong with it lol