
   var corx = (screen.availWidth  - 300) / 2 ;
   var cory = 300 ;
   var nIE  = 0;

   // show / hide system message
   function Message(number,header,text,btn2,url2,btn1,url1)
   {
      this.number = number;
      this.header = header;
      this.text   = text;
      this.btn2   = btn2;
      this.url2   = url2;
      this.btn1   = btn1;      
      this.url1   = url1;
   }

   function init() {
   with (this)
      document.write('<div id=\"msg'+this.number+'\" class=\"msg\">');
      document.write('<div id=\"msgbox'+this.number+'\" class=\"msgbox\">');

      document.write('<p class=\"msgtext1\">');
      document.write(this.header);
      document.write('</p>');
      document.write('<p class=\"msgtext2\">');
      document.write(this.text);
      document.write('</p>');

      document.write('<p align=\"center\">');

      if (this.btn2)
      {
         if (this.url2)
         {
            document.write('&nbsp;<input type=\"button\" class=\"msgbutton\" name=\"action\" value=\"'+this.btn2+'\" title=\"'+this.btn2+'\" onClick=\"go(\''+this.url2+'\');\"/>&nbsp;');
         }
         else
         {
            document.write('&nbsp;<input type=\"button\" class=\"msgbutton\" name=\"action\" value=\"'+this.btn2+'\" title=\"'+this.btn2+'\" onClick=\"hide('+this.number+');\"/>&nbsp;');
         }
      }

      if (this.btn1)
      {
         if (this.url1)
         {
            document.write('&nbsp;<input type=\"button\" class=\"msgbutton\" name=\"action\" value=\"'+this.btn1+'\" title=\"'+this.btn1+'\" onClick=\"go(\''+this.url1+'\');\"/>&nbsp;');
         }
         else
         {
            document.write('&nbsp;<input type=\"button\" class=\"msgbutton\" name=\"action\" value=\"'+this.btn1+'\" title=\"'+this.btn1+'\" onClick=\"hide('+this.number+');\"/>&nbsp;');
         }
      }

      document.write('</p>');

      document.write('</div>');
      document.write('</div>');

      // message position
      ExGetElementByID('msgbox'+this.number).style.left       = corx + 'px';
      ExGetElementByID('msgbox'+this.number).style.top        = cory + 'px';

      // height of message box
      if (screen.availHeight>(ExGetElementByID('footer').offsetTop + 50))
      {
         if (navigator.userAgent.indexOf("MSIE")!=-1) { nIE = 130; } else { nIE = 0; }
         ExGetElementByID('msg'+this.number).style.height = (screen.availHeight - nIE);
      }
      else
      {
         ExGetElementByID('msg'+this.number).style.height = (ExGetElementByID('footer').offsetTop + 50) + 'px';
      }
   }

   function show() {
   with (this)
      ExGetElementByID('msg'+this.number).style.display       = "" ;
      ExGetElementByID('msgbox'+this.number).style.display    = "" ;
      ExGetElementByID('msg'+this.number).style.visibility    = "visible" ;
      ExGetElementByID('msgbox'+this.number).style.visibility = "visible" ;
      scrollBy(0,0);
   }

   function hide(item) {
      ExGetElementByID('msg'+item).style.display              = "none" ;
      ExGetElementByID('msgbox'+item).style.display           = "none" ;
      ExGetElementByID('msg'+item).style.visibility           = "hidden" ;
      ExGetElementByID('msgbox'+item).style.visibility        = "hidden" ;
   }

   function go(sUrl) {
   with (this)
     location.href = sUrl;
   }

   // prototype
   Message.prototype.init = init;
   Message.prototype.show = show;
   Message.prototype.hide = hide;
   Message.prototype.go   = go;

   // scroll by Y px
	function Scroll(nPosY)
	{
		scrollBy(0,nPosY);
	}
