//theeditors.js

$(document).ready(function() {
   $('div[datasrc]').each(function(index) {
      var src = 'snippets/' + $(this).attr('datasrc');
      var target = $(this);
      load(src, target);
   });

   //dot highlighting
   $('#navcontainer ul li a').mouseover(function() {
      var dot = $(this).attr('dot');
      $('.dot').filter('.' + dot + ':not(.selected)').css('opacity', '0.5');
   });
   $('#navcontainer ul li a').mouseout(function() {
      var dot = $(this).attr('dot');
      $('.dot').filter('.' + dot + ':not(.selected)').css('opacity', '1.0');
   });
});

//loads html contained at src into DOM element target
function load(src, target) {
   $.get(src, function(data) {
      if (target.is('[datasel]')) data = $(data).filter('#' + target.attr('datasel'));
      target.html(data);  
   });
}





	      




