  // :: REQUIRES PROTOTYPE FRAMEWORK
  
  var Userenlighter = Class.create();
  
  Userenlighter.prototype = {
      
      // CONSTRUCTOR
    errorStatus:3,
    successStatus:3,
    noticeStatus:3,
    initialize: function() {
      // GENERATE BOX
      if($('userenlighter'))
      {


        var objUE = $('userenlighter');
        
        if(objUE.select('.Error')[0])
        {
          objUE.appendChild(Builder.node('div',{id:'ue-error'}, [
          
            Builder.node('div',{id:'ue-error-top-line'}, [
              Builder.node('div',{id:'ue-error-top-line-icon'}),
              Builder.node('div',{id:'ue-error-top-line-text'}),
              
              Builder.node('div',{id:'ue-error-top-line-resize'}, [
                
                Builder.node('div',{id:'ue-error-top-line-resize-toggle'}),
                Builder.node('div',{id:'ue-error-top-line-resize-close'}),
                Builder.node('div',{style:'clear:left;'})
                
              ]),
              Builder.node('div',{style:'clear:left;'})
            ]),
            
            Builder.node('div',{id:'ue-error-content'})
          
          ]));
          
          objUE.select('.Error')[0].select('h2')[0].remove();
          
          $('ue-error-top-line-icon').update('<img src="'+ GJ_WEBSITE_TEMPLATE_URL +'images/userenlighter/error-16x16.png" alt="Error" title="Error" />');
          $('ue-error-top-line-text').update(LANG_JS000071);
          $('ue-error-top-line-resize-toggle').update(LANG_JS000072 + ' |');
          $('ue-error-top-line-resize-close').update('&nbsp;&nbsp;' + LANG_JS000073);
          

          $('ue-error-content').update(objUE.select('.Error')[0].innerHTML)
          
          objUE.select('.Error')[0].remove();
          
          $('ue-error-top-line-resize-toggle').observe('click', function(event) { event.stop(); this.toggleError(); }.bindAsEventListener(this));
          $('ue-error-top-line-resize-close').observe('click', function(event) { event.stop(); this.closeError(event); }.bindAsEventListener(this));

        }
        
        if(objUE.select('.Success')[0])
        {
          objUE.appendChild(Builder.node('div',{id:'ue-success'}, [
          
            Builder.node('div',{id:'ue-success-top-line'}, [
              Builder.node('div',{id:'ue-success-top-line-icon'}),
              Builder.node('div',{id:'ue-success-top-line-text'}),
              
              Builder.node('div',{id:'ue-success-top-line-resize'}, [
                
                Builder.node('div',{id:'ue-success-top-line-resize-toggle'}),
                Builder.node('div',{id:'ue-success-top-line-resize-close'}),
                Builder.node('div',{style:'clear:left;'})
                
              ]),
              Builder.node('div',{style:'clear:left;'})
            ]),
            
            Builder.node('div',{id:'ue-success-content'})
          
          ]));
          
          objUE.select('.Success')[0].select('h2')[0].remove();
          
          $('ue-success-top-line-icon').update('<img src="' + GJ_WEBSITE_TEMPLATE_URL + 'images/userenlighter/success-16x16.png" alt="Success" title="Success" />');
          $('ue-success-top-line-text').update(LANG_JS000074);
          
          $('ue-success-top-line-resize-toggle').update(LANG_JS000072 + ' |');
          $('ue-success-top-line-resize-close').update('&nbsp;' + LANG_JS000073);
          

          $('ue-success-content').update(objUE.select('.Success')[0].innerHTML)
          
          objUE.select('.Success')[0].remove();
        
          $('ue-success-top-line-resize-toggle').observe('click', function(event) { event.stop(); this.toggleSuccess(); }.bindAsEventListener(this));
          $('ue-success-top-line-resize-close').observe('click', function(event) { event.stop(); this.closeSuccess(event); }.bindAsEventListener(this));
          
        }
        
        if(objUE.select('.Notice')[0])
        {
          objUE.appendChild(Builder.node('div',{id:'ue-notice'}, [
          
            Builder.node('div',{id:'ue-notice-top-line'}, [
              Builder.node('div',{id:'ue-notice-top-line-icon'}),
              Builder.node('div',{id:'ue-notice-top-line-text'}),
              
              Builder.node('div',{id:'ue-notice-top-line-resize'}, [
                
                Builder.node('div',{id:'ue-notice-top-line-resize-toggle'}),
                Builder.node('div',{id:'ue-notice-top-line-resize-close'}),
                Builder.node('div',{style:'clear:left;'})
                
              ]),
              Builder.node('div',{style:'clear:left;'})
            ]),
            
            Builder.node('div',{id:'ue-notice-content'})
          
          ]));
          
          objUE.select('.Notice')[0].select('h2')[0].remove();
          
          $('ue-notice-top-line-icon').update('<img src="' + GJ_WEBSITE_TEMPLATE_URL + 'images/userenlighter/notice-16x16.png" alt="Notice" title="Notice" />');
          $('ue-notice-top-line-text').update(LANG_JS000075);
          
          $('ue-notice-top-line-resize-toggle').update(LANG_JS000072 + ' |');
          $('ue-notice-top-line-resize-close').update('&nbsp;' + LANG_JS000073);
          
          $('ue-notice-content').update(objUE.select('.Notice')[0].innerHTML)
          
          objUE.select('.Notice')[0].remove();
        
          $('ue-notice-top-line-resize-toggle').observe('click', function(event) { event.stop(); this.toggleNotice(); }.bindAsEventListener(this));
          $('ue-notice-top-line-resize-close').observe('click', function(event) { event.stop(); this.closeNotice(event); }.bindAsEventListener(this));
        }
        
        
        
          new Effect.SlideDown($('userenlighter'), {  duration: 0.7, from: 0.0, to: 1.0 });
      }
        
        

    },
    
    toggleError: function() {
    
      if(this.errorStatus==3)
      {
        new Effect.SlideUp($('ue-error-content'), { duration: 0.7 });
        $('ue-error-top-line-resize-toggle').update(LANG_JS000076 + ' |');
        this.errorStatus=2;
      }
      else if(this.errorStatus==2)
      {
        new Effect.SlideDown($('ue-error-content'), { duration: 0.7 });
        $('ue-error-top-line-resize-toggle').update(LANG_JS000072 + ' |');
        this.errorStatus=3;
      }
    },
    
    closeError: function(event) {
      
      new Effect.Fade($('ue-error'), { duration: 1.0, afterFinish: (function(){ $('ue-error').remove(); }) });
    },

    toggleSuccess: function() {
    
      if(this.successStatus==3)
      {
        new Effect.SlideUp($('ue-success-content'), { duration: 0.7 });
        $('ue-success-top-line-resize-toggle').update(LANG_JS000076 + ' |');
        this.successStatus=2;
      }
      else if(this.successStatus==2)
      {
        new Effect.SlideDown($('ue-success-content'), { duration: 0.7 });
        $('ue-success-top-line-resize-toggle').update(LANG_JS000072 + ' |');
        this.successStatus=3;
      }
    },
    
    closeSuccess: function(event) {
      
      new Effect.Fade($('ue-success'), { duration: 1.0, afterFinish: (function(){ $('ue-success').remove(); }) });
    },
    
    toggleNotice: function() {
    
      if(this.noticeStatus==3)
      {
        new Effect.SlideUp($('ue-notice-content'), { duration: 0.7 });
        $('ue-notice-top-line-resize-toggle').update(LANG_JS000072 + ' |');
        this.noticeStatus=2;
      }
      else if(this.noticeStatus==2)
      {
        new Effect.SlideDown($('ue-notice-content'), { duration: 0.7 });
        $('ue-notice-top-line-resize-toggle').update(LANG_JS000076 + ' |');
        this.noticeStatus=3;
      }
    },
    
    closeNotice: function(event) {
      
      new Effect.Fade($('ue-notice'), { duration: 1.0, afterFinish: (function(){ $('ue-notice').remove(); }) });
    }    
  }
  
  document.observe('dom:loaded', function () { new Userenlighter(); });