function bannerHandler()
{
   this.hideStatic = function( contener )
   {
      document.getElementById( contener ).style.display = 'none';
   }

   this.showStatic = function( contener )
   {
      document.getElementById( contener ).style.display = 'block';
   }

   this.showFlash = function( flashRequired, flashContener, src, width, height )
   {
      this.detectFlash = new detectFlash();

      if( !flashRequired || 
		  !flashContener || 
		  !this.detectFlash.isFlash() || 
		  this.detectFlash.flashVersion < flashRequired ) return false;
      
      return this.generate( flashContener, src, width, height );
   }
   
   this.generate = function( flashContener, src, width, height )
   {
       if( !flashContener ) return false;
	   
	   HTMLcode = this.getHTML( src, width, height );
	   if( !HTMLcode ) return false;
	   
	   document.getElementById( flashContener ).innerHTML = HTMLcode;
	   
	   return true;
   }

   this.getHTML = function( src, width, height )
   {
      if( !src ) return false;
	  
	  HTMLText = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
	  HTMLText += 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" '; 
	  if( width ) HTMLText += 'width="' + width + '" ';
	  if( height ) HTMLText += 'height="' + height + '" ';
	  HTMLText += '>';
      HTMLText += '<param name="movie" value="' + src + '" />';
	  HTMLText += '<param name="menu" value="false" />';
	  HTMLText += '<param name="quality" value="high" />';
	  HTMLText += '<embed ';
	  HTMLText += 'src="' + src + '" '; 
	  HTMLText += 'menu="false" ';
	  HTMLText += 'quality="high" ';
	  if( width ) HTMLText += 'width="' + width + '" ';
	  if( height ) HTMLText += 'height="' + height + '" ';
	  HTMLText += 'type="application/x-shockwave-flash"'; 
	  HTMLText += 'pluginspage="http://www.macromedia.com/go/getflashplayer" '; 
	  HTMLText += '/>';
      HTMLText += '</object>';

      return HTMLText;
   }
}

bannerHandler = new bannerHandler();
