Thanks for the reply.
Actually, i took over the project from a previous developer who although created the TOC but was not able to sort out the scale dependency stuff. His scale dependecy code seemed to work sometimes but usually falls over with all checkbox greying out at all scales (on extent change or simple first loading or even on refresh)
At that point i added your code and was able to make it work perfectly but this also introduced the problem i outlined earlier.
Although the previous developer's code, didnt work properly with scales, it never had the problem i am experiencing now. His code does show all layers (map services) in the TOC even the really big ones which take time to load, initially the slow loading layers (map service) wouldnt have the + sign in front of them but after some wait it does appear.
Now my issue is that the code i used, actually never seem to show the + sign in front of the slow loading map services. I even removed the slow loading map service and strangely it shows same behaviour for very simple map services as well (i.e, it doesnt show the + sign in front of the map service, but as i mentioned, this doesnt happen always).
I have tried the standard TOC code as you advised and it functions fine. I have also simplified some complex map services and now all layers are loaded and rendered fine.
I am assuming the moment i will add the scale dependecy code, it will cause problems as before.
I