fix broken js code.
fix for each loop.
use new getLoggedIn() js function instead of jquery.cookie.
remove other cases of problematic for each ... and remove debugging info.
Merge branch 'master' into topic/refactor_breeders_home