window.addEvent( 'load', function() {
    var options  = {
      'overlayOpacity' : 0.8,
      'topPosition'    : 50,
      'bgColor'        : '333333',
      'shadow'         : true,
      'outerCloser'    : true,
      'closer'         : true,
      'onClose'        : function( el ) { document.id( 'school-description-content' ).set('html', document.id( 'school-description-content-loader' ).get('html') ); }
    }
    URItoFIle = new URI(document.id( document.body ).getElements( 'script[src*=nxcschooldescriptionajax.js]' ).get('src'));
    jsonurltosystem = URItoFIle.get('data');
    jsonurltosystem = jsonurltosystem['url'];
    var lightbox = new NXC.LightBox( options );
    lightbox.setContent( 'school-description-content', false );
    schoolLinks = document.id( document.body ).getElements( 'a.lighxbox-school-description' );
    schoolLinks.addEvent( 'click', function( e ) {
        e.stop();
        schoolID = this.get('id').replace('school-', '');
        schoolDescBlock = document.id( 'school-description-content' );
          var req = new Request.HTML({url:jsonurltosystem + '/' + schoolID,
            onSuccess: function(html) {
              schoolDescBlock.set('text', '');
              schoolDescBlock.adopt(html);
            },
            onFailure: function() {
                schoolDescBlock.set('text','Server is not available');
            }
          }).send();
        lightbox.open();
    } );
} );