Moved javascript to include tags at the bottom of layout. This should solve javascript document ready errors.